XQQ8765 / jarjar

Automatically exported from code.google.com/p/jarjar
0 stars 0 forks source link

Processing JAR fails with java.lang.IllegalStateException: Unknown local variable 3 #43

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If I try to run jarjar on the attached JAR file (the file jarjar.rules is empty)

<java jar="D:\Java\Libraries\JarJar\jarjar-1.0.jar" fork="true" >
<arg value="process"/>
<arg value="jarjar.rules"/>
<arg value="bug.jar"/>
<arg value="bug2.jar"/>
</java>

I get the following error:

     [java] Exception in thread "main" java.lang.IllegalStateException: Unknown local variable 3
     [java]     at com.tonicsystems.jarjar.asm.commons.LocalVariablesSorter.remap(Unknown Source)
     [java]     at com.tonicsystems.jarjar.asm.commons.LocalVariablesSorter.visitFrame(Unknown Source)
     [java]     at com.tonicsystems.jarjar.asm.commons.RemappingMethodAdapter.visitFrame(Unknown Source)
     [java]     at com.tonicsystems.jarjar.asm.ClassReader.accept(Unknown Source)
     [java]     at com.tonicsystems.jarjar.asm.ClassReader.accept(Unknown Source)
     [java]     at com.tonicsystems.jarjar.ext_util.JarTransformer.process(JarTransformer.java:35)
     [java]     at com.tonicsystems.jarjar.ext_util.JarProcessorChain.process(JarProcessorChain.java:31)
     [java]     at com.tonicsystems.jarjar.MainProcessor.process(MainProcessor.java:80)
     [java]     at com.tonicsystems.jarjar.ext_util.StandaloneJarProcessor.run(StandaloneJarProcessor.java:50)
     [java]     at com.tonicsystems.jarjar.Main.process(Main.java:93)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
     [java]     at com.tonicsystems.jarjar.MainUtil.runMain(MainUtil.java:37)
     [java]     at com.tonicsystems.jarjar.Main.main(Main.java:50)
     [java] Java Result: 1

I also upload the source code of single Java file contained in the JAR.
The method testErrorWithJDT causes the error, if the source code is slightly 
changed like in testOk the file is processed fine.

I also noticed that the error only shows up if the class file in the JAR has 
been produced by the built-in Eclipe JDT compiler (I'm using Helios, Build id: 
20100617-1415).

If I compile the java file with Sun JDK 1.6.0_18, no error shows up.

Original issue reported on code.google.com by magicw...@gmail.com on 24 Sep 2010 at 10:38

Attachments:

GoogleCodeExporter commented 9 years ago
the same happens to me

Original comment by yoavram@gmail.com on 4 Oct 2010 at 4:18