Skip to content

CanBeStatic: Fix NPE#1111

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

CanBeStatic: Fix NPE#1111
don-vip wants to merge 1 commit into
google:masterfrom
don-vip:jdk12_pr3

Conversation

@don-vip

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

Copy link
Copy Markdown
Contributor

See #1106 (comment)

Solves NPE (after #1107 and #1110 are merged) with Java 12:

[javac]      error-prone version: 2.3.2-SNAPSHOT
    [javac]      BugPattern: ClassCanBeStatic
    [javac]      Stack Trace:
    [javac]      java.lang.NullPointerException
    [javac]   	at com.google.errorprone.bugpatterns.CanBeStaticAnalyzer.visitIdent(CanBeStaticAnalyzer.java:60)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2316)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitBreak(TreeScanner.java:222)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBreak.accept(JCTree.java:1559)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitBlock(TreeScanner.java:143)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1026)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitIf(TreeScanner.java:213)
    [javac]   	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1486)

simon04 pushed a commit to JOSM/josm that referenced this pull request Sep 5, 2018
@don-vip don-vip mentioned this pull request Sep 5, 2018
@cushon

cushon commented Sep 6, 2018

Copy link
Copy Markdown
Collaborator

Can you add a test?

floscher pushed a commit to floscher/josm that referenced this pull request Sep 6, 2018
@kluever kluever mentioned this pull request May 17, 2020
kluever pushed a commit that referenced this pull request May 17, 2020
JDK 12 changes the representation of labelled breaks to use an identifier for
the label (instead of just a name), and the identifier doesn't have a symbol.

Fixes #1111

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=311832221
kluever pushed a commit that referenced this pull request May 17, 2020
JDK 12 changes the representation of labelled breaks to use an identifier for
the label (instead of just a name), and the identifier doesn't have a symbol.

Fixes #1111

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=311832221
@don-vip don-vip deleted the jdk12_pr3 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