RFR: JDK-8228502: javac crashed on a broken classfile with ConstantValue attribute on a field of type Object

Jan Lahoda jan.lahoda at oracle.com
Mon Jul 29 15:23:53 UTC 2019


Consider a classfile that has a field with the ConstantValue attribute 
(pointing to a constant value of type String), but the type of the field 
is j.l.Object. This crashes javac (see the JBS entry to a stacktrace). 
The proposed solution is to throw a BadClassFile exception when this 
situation is detected, which is then handled using the existing mechanisms.

JBS: https://bugs.openjdk.java.net/browse/JDK-8228502
Webrev: http://cr.openjdk.java.net/~jlahoda/8228502/webrev.00/

How does this look?


More information about the compiler-dev mailing list