Adjuzi
Adjuzi

Reputation: 1

Error trying to calculate CKJM in Java classes

I am trying to calculate the Chidamber and Kemerer object-oriented metrics in java with ckjm 1.9 but I encounter this error for some of the classes.

java -jar freecol/ckjm-1.9/build/ckjm-1.9.jar 
freecol/out/production/freecol/net/sf/freecol/common/resources/ImageResource.class
Exception in thread "main" org.apache.bcel.classfile.ClassFormatException: Invalid byte tag in 
constant pool: 18
    at org.apache.bcel.classfile.Constant.readConstant(Constant.java:146)
    at org.apache.bcel.classfile.ConstantPool.<init>(ConstantPool.java:67)
    at org.apache.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:222)
    at org.apache.bcel.classfile.ClassParser.parse(ClassParser.java:136)
    at gr.spinellis.ckjm.MetricsFilter.processClass(Unknown Source)
    at gr.spinellis.ckjm.MetricsFilter.main(Unknown Source)

It is the FreeCol codebase I'm analyzing:

https://github.com/FreeCol/freecol

and I am using the terminal in IntelliJ IDEA Community 2020.2. Does anyone know how to fix this error?

Upvotes: 0

Views: 165

Answers (1)

JohnB
JohnB

Reputation: 1

I had the same problem. I solved it by building the project successfully and the error disappeared.

Upvotes: -1

Related Questions