Skip to content

Incorrect nullness inference for array constructors #433

@GoogleCodeExporter

Description

@GoogleCodeExporter
Is this a known issue? I couldn't find documentation for it.

=== Test.java ===
class Test {
  public static void main(String[] args) {
    String array[] = new String[3];
    array[0].length(); // NPE here
  }
}
===

$ ~/jsr308/checker-framework-1.9.1/checker/bin/javac -version -processor 
org.checkerframework.checker.nullness.NullnessChecker Test.java 
javac 1.8.0-jsr308-1.9.1

# compiles cleanly

$ java Test
Exception in thread "main" java.lang.NullPointerException
    at Test.main(Test.java:4)

Original issue reported on code.google.com by cus...@google.com on 14 May 2015 at 6:59

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions