Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GuardedByUtils: return empty set instead of null #1110

Closed
wants to merge 1 commit into from

Conversation

don-vip
Copy link
Contributor

@don-vip don-vip commented Sep 5, 2018

See #1106 (comment)

This fixes an NPE seen with JDK12 (when #1107 is merged):

[javac]     public final WaySegment getNearestWaySegment(Point p, Predicate<OsmPrimitive> predicate,
    [javac]                             ^
    [javac]      Please report this at https://github.com/google/error-prone/issues/new and include the following:
    [javac]   
    [javac]      error-prone version: 2.3.2-SNAPSHOT
    [javac]      BugPattern: GuardedBy
    [javac]      Stack Trace:
    [javac]      java.lang.NullPointerException
    [javac]   	at com.google.errorprone.bugpatterns.threadsafety.HeldLockAnalyzer$LockScanner.checkMatch(HeldLockAnalyzer.java:227)
    [javac]   	at com.google.errorprone.bugpatterns.threadsafety.HeldLockAnalyzer$LockScanner.visitIdentifier(HeldLockAnalyzer.java:196)
    [javac]   	at com.google.errorprone.bugpatterns.threadsafety.HeldLockAnalyzer$LockScanner.visitIdentifier(HeldLockAnalyzer.java:116)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2324)

simon04 pushed a commit to JOSM/josm that referenced this pull request Sep 5, 2018
floscher pushed a commit to floscher/josm that referenced this pull request Sep 5, 2018
This was referenced Sep 5, 2018
@cushon
Copy link
Collaborator

cushon commented Sep 6, 2018

Can you add a unit test? It is it covered by existing tests when running in JDK 12?

TimvdLippe added a commit to TimvdLippe/error-prone that referenced this pull request Apr 15, 2020
This allows us to check that ErrorProne works on Java 12. It is part of
issue google#1106 to make ErrorProne work on newer versions of Java.

It will allow us to verify that google#1110 indeed fixes the problem with Java
12.
@cushon
Copy link
Collaborator

cushon commented May 14, 2020

I have tests passing on JDK 12 and am still not observing the problem this solves, do you have a repro?

kluever pushed a commit that referenced this pull request May 17, 2020
Fixes #1110

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=311825676
@kluever kluever mentioned this pull request May 17, 2020
kluever pushed a commit that referenced this pull request May 17, 2020
Fixes #1110

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=311825676
@don-vip don-vip deleted the jdk12_pr2 branch June 1, 2020 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants