Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
6.7.0
-
None
-
None
Description
The org.apache.bcel.generic.LDC class does not support Const.CONSTANT_Dynamic (Condy, Dynamic class-file constant) in the following methods:
- public Type getType(final ConstantPoolGen cpg);
- public Object getValue(final ConstantPoolGen cpg);
JaCoCo >= 0.8.4 (see jacoco/pull/845) creates class files which have Constant_Dynamic. When visiting the instructions of a method and calling either of the mentioned method of LDC, an IllegalArgumentException occurs: "Unknown or invalid constant type at 32".
This error causes a problem, when someone tries to analyze a class file containing condy with spotbugs, which uses BCEL. The error was originally found in spotbugs (see spotbugs/issues/2503 and spotbugs/pull/2512).
Attached a class built by Java 17 and JaCoCo 0.8.9., the source of this file is spotbugs/issues/2503/comment.
The issue can be reproduced by calling the org.apache.bcel.generic.TypeTestCase.testLDC(String className) method with the attached class file as a parameter.
Attachments
Attachments
Issue Links
- links to