LocalVariableSorter

Nikolas Nehmer <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Organization FB Informatik, TU Kaiserslautern, GERMANY
Message-ID <23032071.1287685505047.OPEN-XCHANGE.WebMail.tomcat@groupmail.informatik.uni-kl.de>
Hi,

I'm currently facing an issue with the LocalVariableSorter. The
following exception is raised:

java.lang.IllegalStateException: ClassReader.accept() should be called
with EXPAND_FRAMES flag
   at org.objectweb.asm.commons.LocalVariablesSorter.visitFrame(Unknown
Source)
   at org.objectweb.asm.tree.FrameNode.accept(Unknown Source)
   at org.objectweb.asm.tree.InsnList.accept(Unknown Source)
   at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
   at
de.kl.uni.cs.nehmer.setup.bci.FullLogBCIMethodAdapter.visitEnd(FullLogBCIMethodAdapter.java:73)
   at org.objectweb.asm.ClassReader.accept(Unknown Source)
   at org.objectweb.asm.ClassReader.accept(Unknown Source)
   at de.kl.uni.cs.nehmer.setup.bci.BCIAgent.transform(BCIAgent.java:44)
   at sun.instrument.TransformerManager.transform(Unknown Source)
   at sun.instrument.InstrumentationImpl.transform(Unknown Source)
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(Unknown Source)
   at java.lang.ClassLoader.defineClass(Unknown Source)
   at java.security.SecureClassLoader.defineClass(Unknown Source)
   at java.net.URLClassLoader.defineClass(Unknown Source)
   at java.net.URLClassLoader.access$000(Unknown Source)
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)

although the expand frames flag is set:

ClassReader classReader = new ClassReader(bytes);
ClassWriter classWriter = new ClassWriter(classReader,
ClassWriter.COMPUTE_FRAMES);
PrintWriter printWriter = new PrintWriter(new
FileOutputStream("classOutput.txt", true));
TraceClassVisitor traceClassVisitor = new TraceClassVisitor(classWriter,
printWriter);
BCIClassAdapter classAdapter = new BCIClassAdapter(traceClassVisitor);
classReader.accept(classAdapter, ClassReader.EXPAND_FRAMES);

Within the BCIClassAdapter a MethodAdapter is instantiated and visits
each method doing some transformations. In the visitEndMethod of the
MethodAdapter I call the accept(localVariableSorter) to chain the
visitor call just after my transformations are done. Any ideas or
suggestions?

Best regards
Nikolas
message-footer.txt (text/plain, 238 B)
-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.