ClassReader throws an exception while parsing Java 9 module_info.class
I ran into an issue compiling one of my Java 9 modules, with Maven failing during testCompile phase with the following exception:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 29
at org.objectweb.asm.ClassReader.readUTF8(ClassReader.java:2591)
at org.objectweb.asm.ClassReader.readStringish(ClassReader.java:2659)
at org.objectweb.asm.ClassReader.readModule(ClassReader.java:2693)
at org.objectweb.asm.ClassReader.readModule(ClassReader.java:726)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:632)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at org.codehaus.plexus.languages.java.jpms.AsmModuleInfoParser.parse(AsmModuleInfoParser.java:81)
at org.codehaus.plexus.languages.java.jpms.AsmModuleInfoParser.getModuleDescriptor(AsmModuleInfoParser.java:65)
at org.codehaus.plexus.languages.java.jpms.LocationManager.resolvePaths(LocationManager.java:113)
at org.apache.maven.plugin.compiler.TestCompilerMojo.preparePaths(TestCompilerMojo.java:281)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:762)
at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:176)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
There is more, and you can see the full stack trace in MCOMPILER-309, but I believe the above is most relevant.
On suggestion from the Maven team I've upgraded ASM version used by maven-compiler-plugin
to 6.0, but that didn't help and I'm still seeing the exact same exception as before.
Attached is module-info.class file that ASM seems to be having problem with. Thanks in advance for looking into this.