RFR: 8232765: NullPointerException at Types.eraseNotNeeded() when compiling a class

Guoxiong Li github.com+13688759+lgxbslgx at openjdk.java.net
Fri Jan 15 12:22:19 UTC 2021


Hi all,

The method `types::asSuper` may return `null` so that `types.erasure(types.asSuper(iterator.type.getReturnType(), syms.iteratorType.tsym))` throws `NPE`.

This patch sets the return type and outputs the corresponding error message if `types::asSuper` returns `null`.

Thank you for taking the time to review.

Best Regards.

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

Commit messages:
 - 8232765: NullPointerException at Types.eraseNotNeeded() when compiling a class

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

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


More information about the compiler-dev mailing list