RFR: 8256809: Annotation processing causes NPE during flow analysis

Elliott Baron ebaron at openjdk.java.net
Fri Nov 20 22:27:15 UTC 2020


If an error is found in JavacProcessingEnvironment.newRound, the erroneous ClassSymbols are meant to have their types replaced with new ClassTypes. There is a bug here where the check for whether a ClassSymbol is erroneous happens after the ClassSymbol is reset, replacing its kind with `TYP`. This means the check always fails, and the `kind == ERR` branch is never taken.

This can lead to a NullPointerException later on during flow analysis, which I've captured with the included test.

-------------

Commit messages:
 - Remove debug output from test
 - 8256809: Annotation processing causes NPE during flow analysis

Changes: https://git.openjdk.java.net/jdk/pull/1359/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1359&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8256809
  Stats: 160 lines in 2 files changed: 159 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1359.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1359/head:pull/1359

PR: https://git.openjdk.java.net/jdk/pull/1359


More information about the compiler-dev mailing list