degraph icon indicating copy to clipboard operation
degraph copied to clipboard

Exception when analyzing class with type annotations

Open schauder opened this issue 9 years ago • 3 comments

When analyzing a class with type annotations an exception is thrown like shown below. This is due to problems that ASM has with the behavior of certain javac versions.

See the following for more details:

  • http://forge.ow2.org/tracker/index.php?func=detail&aid=317615&group_id=23&atid=100023
  • https://jira.spring.io/browse/SPR-14089
  • https://netbeans.org/bugzilla/show_bug.cgi?id=233011

If you encounter the problem, you have the following options:

  • Use an older JDK Version for compiling your classes. 1.8.0_31-b13 is the latest one known to work.
  • Don't analyze such files. Note: an exclusing filter will not work
at org.objectweb.asm.ClassReader.readLabel(Unknown Source)
    at org.objectweb.asm.ClassReader.a(Unknown Source)
    at org.objectweb.asm.ClassReader.a(Unknown Source)
    at org.objectweb.asm.ClassReader.b(Unknown Source)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at de.schauderhaft.degraph.analysis.asm.Analyzer$.readStream$1(Analyzer.scala:17)
    at de.schauderhaft.degraph.analysis.asm.Analyzer$.de$schauderhaft$degraph$analysis$asm$Analyzer$$analyze$1(Analyzer.scala:32)
    at de.schauderhaft.degraph.analysis.asm.Analyzer$$anonfun$analyze$1$$anonfun$apply$1.apply(Analyzer.scala:50)
    at de.schauderhaft.degraph.analysis.asm.Analyzer$$anonfun$analyze$1$$anonfun$apply$1.apply(Analyzer.scala:49)
    at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:322)
    at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:978)
    at de.schauderhaft.degraph.analysis.asm.Analyzer$$anonfun$analyze$1.apply(Analyzer.scala:49)
    at de.schauderhaft.degraph.analysis.asm.Analyzer$$anonfun$analyze$1.apply(Analyzer.scala:46)
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
    at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
    at de.schauderhaft.degraph.analysis.asm.Analyzer$.analyze(Analyzer.scala:46)

schauder avatar Aug 31 '16 18:08 schauder

I don't oversee the implications but did you notice that the spring folks seem to have made asm ignore illegal offsets and so that version should be usable on those files? (The spring issue link you provided.)

cal101 avatar Aug 31 '16 20:08 cal101

I noticed that, but they are actually forking ASM, and I am not interested in doing that.

schauder avatar Sep 01 '16 07:09 schauder

The ASM issues referes to https://bugs.openjdk.java.net/browse/JDK-8144185

Looks like the JDK guys agree that it is a JDK issue.

schauder avatar Oct 10 '16 11:10 schauder