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

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@don-vip
Copy link
Contributor

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)

@googlebot googlebot added the cla: yes label Sep 5, 2018

simon04 pushed a commit to openstreetmap/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

This comment has been minimized.

Copy link
Contributor

cushon commented Sep 6, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.