JDK-8192893 : Release Note: New Class AST Node With enclosing Instance
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 10
  • Priority: P3
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2017-12-01
  • Updated: 2021-03-25
  • Resolved: 2017-12-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10Resolved
Description
New Class AST nodes with an enclosing instance that incorrectly return a null have been fixed. In some cases, the `getEnclosingExpression()` method of the NewClassTree AST node was returning null for code like:

```
<enclosing>.new <Class>(...) { ... }
```

This has been fixed, and getEnclosingExpression() now returns the enclosing expression.