0

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?

Adjuzi
  • 1
  • 3

1 Answers1

-1

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

JohnB
  • 1
  • 1
    Building it how? With which setup? It is great that you try to answer the question, but without more details, this is just a "mediocre" comment, but in no way enough to be a real answer. – GhostCat Aug 31 '21 at 08:05
  • need to address the byte-code issue to answer this question – Nigel Savage Aug 31 '21 at 08:49
  • Please add further details to expand on your answer, such as working code or documentation citations. – Community Aug 31 '21 at 08:49
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). – RrR- Aug 31 '21 at 10:28