RFR: JDK-8228502: javac crashed on a broken classfile with ConstantValue attribute on a field of type Object
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.
How does this look?
More information about the compiler-dev