Skip to content

GuardedByUtils: return empty set instead of null#1110

Closed
don-vip wants to merge 1 commit into
google:masterfrom
don-vip:jdk12_pr2
Closed

GuardedByUtils: return empty set instead of null#1110
don-vip wants to merge 1 commit into
google:masterfrom
don-vip:jdk12_pr2

Conversation

@don-vip

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

Copy link
Copy Markdown
Contributor

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

cushon commented Sep 6, 2018

Copy link
Copy Markdown
Collaborator

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

cushon commented May 14, 2020

Copy link
Copy Markdown
Collaborator

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