From: SourceForge.net <no...@so...> - 2012-12-18 21:18:53
|
Patches item #3431812, was opened at 2011-11-01 03:43 Message generated for change (Comment added) made by robmoore You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720017&aid=3431812&group_id=130558 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Bas de Bakker (basdebakker) Assigned to: Nobody/Anonymous (nobody) Summary: Generate stack map frames required in Java 7 Initial Comment: In Java 6, the StackMapTable attribute was introduced. At that time it was already announced that this would become required in Java 7. This patch makes ASM regenerate those attributes from the modified byte code, avoiding VerifyErrors in the instrumented class files. ---------------------------------------------------------------------- Comment By: Rob Moore (robmoore) Date: 2012-12-18 13:18 Message: Any chance that this fix will be included in a release soon? Thanks! ---------------------------------------------------------------------- Comment By: Bas de Bakker (basdebakker) Date: 2012-11-22 01:28 Message: The asm feature to compute the stack map tables may need to load the classes. Here's a quote from page 45 of the asm 4.0 manual: "Note also that, in order to compute frames automatically, it is sometimes necessary to compute the common super class of two given classes. By default the ClassWriter class computes this, in the getCommonSuperClass method, by loading the two classes into the JVM and by using the reflection API." What I did in our project was to add the uninstrumented class files to the classpath of the coberture-instrument task in the ant taskdef call. ---------------------------------------------------------------------- Comment By: John Lewis (lewijw) Date: 2012-11-21 07:58 Message: Thanks for the patch. Is there anything else required or left out of the patch? The net.sourceforge.cobertura.test.FunctionalTest.simpleFunctionalTest() fails when this patch is applied. Is a later version of ASM needed? Here is the error: [cobertura-instrument] Cobertura null - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [cobertura-instrument] Instrumenting 2 files to C:\Users\jwlewi\AppData\Local\Temp\cobertura_test1353512654190\instrument [cobertura-instrument] DEBUG - Instrumenting class C:\Users\jwlewi\AppData\Local\Temp\cobertura_test1353512654190\src\mypackage\Main.class [cobertura-instrument] WARN - Unable to instrument file C:\Users\jwlewi\AppData\Local\Temp\cobertura_test1353512654190\src\mypackage\Main.class [cobertura-instrument] java.lang.RuntimeException: java.lang.ClassNotFoundException: mypackage.Simple [cobertura-instrument] Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: mypackage.Simple [cobertura-instrument] at org.objectweb.asm.ClassWriter.getCommonSuperClass(Unknown Source) [cobertura-instrument] at org.objectweb.asm.ClassWriter.getCommonSuperClass(Unknown Source) [cobertura-instrument] at org.objectweb.asm.ClassWriter.a(Unknown Source) [cobertura-instrument] at org.objectweb.asm.ClassWriter.a(Unknown Source) [cobertura-instrument] at org.objectweb.asm.Frame.a(Unknown Source) [cobertura-instrument] at org.objectweb.asm.Frame.a(Unknown Source) [cobertura-instrument] at org.objectweb.asm.Frame.a(Unknown Source) [cobertura-instrument] at org.objectweb.asm.Frame.a(Unknown Source) [cobertura-instrument] at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source) [cobertura-instrument] at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source) [cobertura-instrument] at org.objectweb.asm.MethodAdapter.visitMaxs(Unknown Source) [cobertura-instrument] at org.objectweb.asm.MethodAdapter.visitMaxs(Unknown Source) [cobertura-instrument] at net.sourceforge.cobertura.instrument.SecondPassMethodInstrumenter.visitMaxs(SecondPassMethodInstrumenter.java:353) [cobertura-instrument] at org.objectweb.asm.tree.MethodNode.accept(Unknown Source) [cobertura-instrument] at net.sourceforge.cobertura.instrument.FirstPassMethodInstrumenter.visitEnd(FirstPassMethodInstrumenter.java:171) [cobertura-instrument] at org.objectweb.asm.ClassReader.accept(Unknown Source) [cobertura-instrument] at org.objectweb.asm.ClassReader.accept(Unknown Source) [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:367) [cobertura-instrument] at net.sourceforge.cobertura.instrument.SecondPassMethodInstrumenter.visitMaxs(SecondPassMethodInstrumenter.java:353) [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:425) [cobertura-instrument] at org.objectweb.asm.tree.MethodNode.accept(Unknown Source) [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:511) [cobertura-instrument] at net.sourceforge.cobertura.instrument.FirstPassMethodInstrumenter.visitEnd(FirstPassMethodInstrumenter.java:171) [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.main(Main.java:533) [cobertura-instrument] at org.objectweb.asm.ClassReader.accept(Unknown Source) [cobertura-instrument] Caused by: java.lang.ClassNotFoundException: mypackage.Simple [cobertura-instrument] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) [cobertura-instrument] at org.objectweb.asm.ClassReader.accept(Unknown Source) [cobertura-instrument] at java.security.AccessController.doPrivileged(Native Method) [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:367) [cobertura-instrument] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:425) [cobertura-instrument] at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:511) [cobertura-instrument] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.main(Main.java:533) [cobertura-instrument] at java.lang.ClassLoader.loadClass(ClassLoader.java:251) [cobertura-instrument] Caused by: java.lang.ClassNotFoundException: mypackage.Simple [cobertura-instrument] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) [cobertura-instrument] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) [cobertura-instrument] at java.lang.Class.forName0(Native Method) [cobertura-instrument] at java.security.AccessController.doPrivileged(Native Method) [cobertura-instrument] at java.lang.Class.forName(Class.java:164) [cobertura-instrument] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) [cobertura-instrument] ... 15 more [cobertura-instrument] at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [cobertura-instrument] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) [cobertura-instrument] at java.lang.ClassLoader.loadClass(ClassLoader.java:251) [cobertura-instrument] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) [cobertura-instrument] at java.lang.Class.forName0(Native Method) [cobertura-instrument] at java.lang.Class.forName(Class.java:164) [cobertura-instrument] ... 15 more ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720017&aid=3431812&group_id=130558 |