RFR: JDK-8231826: Implement javac changes for pattern matching for instanceof

Jan Lahoda jan.lahoda at oracle.com
Thu Oct 10 12:12:59 UTC 2019


Hi,

As part of the effort to prepare JEP 305: Pattern Matching for 
instanceof (Preview) for Propose to Target, I would like to ask for a 
code review for the corresponding javac changes.

The webrev is here:
http://cr.openjdk.java.net/~jlahoda/8231826/webrev.00/

The patch applies on top of:
https://mail.openjdk.java.net/pipermail/compiler-dev/2019-October/013727.html

The current spec the patch is striving to implements is here:
http://cr.openjdk.java.net/~gbierman/jep305/jep305-20190918/specs/patterns-instanceof-jls.html

As far as I know, there is one (significant) open issue in the spec, and 
that is whether non-reifiable types should be allowed in "instanceof 
<type-test-pattern>". Currently (AFAIK), the spec does not allow 
non-reifiable types in the type test pattern in instanceof, and the 
javac implementation should be consistent with the spec. Should the spec 
change, the corresponding update to the javac code should have a very 
limited impact.

I'll be preparing a CSR for this change in the coming days.

The JBS issue for this code change is:
https://bugs.openjdk.java.net/browse/JDK-8231826

Any feedback is welcome!

Thanks!
     Jan


More information about the compiler-dev mailing list