title: JDK 11.0.2 compilation fails with javac NPE on anonymous parameterized class type inference
body: <p><strong>Code</strong> (spring-web 5.1.2)</p>
  
  <pre><code>public static void main(String[] args) {
      RestTemplate restTemplate = new RestTemplate();
  
      HttpHeaders headers = new HttpHeaders();
      headers.set(HttpHeaders.AUTHORIZATION, "token");
      HttpEntity&lt;Object&gt; requestEntity = new HttpEntity&lt;&gt;(headers);
  
      ResponseEntity&lt;Object&gt; test = restTemplate.exchange(
              "https://example.com",
              HttpMethod.GET,
              new HttpEntity&lt;&gt;(headers),
              new ParameterizedTypeReference&lt;&gt;() { // fails here
              });
  }
  </code></pre>
  
  <p><strong>OracleJDK 1.8</strong> (expected output)</p>
  
  <blockquote>
    <p>cannot infer type arguments for
    org.springframework.core.ParameterizedTypeReference </p>
    
    <p>reason: cannot use '&lt;>' with anonymous inner classes</p>
  </blockquote>
  
  <p><strong>OracleJDK 11.0.2</strong> (not expected output)</p>
  
  <blockquote>
    <p>compiler message file broken: key=compiler.misc.msg.bug
    arguments=11.0.2, {1}, {2}, {3}, {4}, {5}, {6}, {7}
    java.lang.NullPointerException    at
    jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply(Flow.java:1235)
      at
    jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1634)
      at
    jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at
    jdk.compiler/com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:398)
      at
    jdk.compiler/com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitVarDef(Flow.java:989) <br/>
    ...</p>
  </blockquote>
  
  <p>If I change diamond operator to explicit type</p>
  
  <p><code>new ParameterizedTypeReference&lt;&gt;(){}</code> to <code>new ParameterizedTypeReference&lt;Object&gt;(){}</code></p>
  
  <p>then the code compiles successfully on both JDKs.</p>
  
  <p>Is it a known compiler bug?</p>