commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Ball (JIRA)" <j...@apache.org>
Subject [jira] Closed: (SANDBOX-319) Cannot pop operand off an empty stack
Date Tue, 22 Dec 2009 18:56:29 GMT

     [ https://issues.apache.org/jira/browse/SANDBOX-319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Joshua Ball closed SANDBOX-319.
-------------------------------

    Resolution: Invalid

I re-tested with svn r893171, and the code works as it should. I don't know why I had such
an old version. My apologies.

> Cannot pop operand off an empty stack
> -------------------------------------
>
>                 Key: SANDBOX-319
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-319
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Javaflow
>         Environment: Java 6
> javaflow svn revision 892381 (http://svn.apache.org/repos/asf/commons/sandbox/javaflow/trunk)
> Debian (mix of testing and unstable)
>            Reporter: Joshua Ball
>
> Steps to reproduce:
> Create the file Example.java:
> --------------
> import java.util.concurrent.*;
> public class Example {
>     private Executor executor = Executors.newFixedThreadPool(8);
>     private ScheduledThreadPoolExecutor stpe = new ScheduledThreadPoolExecutor(1);
>     public ScheduledFuture<?> schedule(final Runnable command, long delay, TimeUnit
unit) {
>         return stpe.schedule(new Runnable() {
>             public void run() {
>                 executor.execute(command);
>             }
>         }, delay, unit);
>     }
> }
> --------------
> and the file Rewriter.java:
> ---------------
> import org.apache.commons.javaflow.utils.RewritingUtils;
> import org.apache.commons.javaflow.bytecode.transformation.ResourceTransformer;
> import org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer;
> import java.io.File;
> public class Rewriter {
>     public static void main(String[] args) throws Exception {
>         ResourceTransformer transformer = new AsmClassTransformer();
>         RewritingUtils.rewriteClassFile(new File("Example.class"), transformer, new File("ExampleRewritten.class"));
>     }
> }
> ----------------
> Compile:
> javac -cp $JAVAFLOW *.java
> Run:
> java -cp $JAVAFLOW Rewriter
> It produces the following error:
> org.objectweb.asm.tree.analysis.AnalyzerException: Error at instruction 6: Method owner:
expected LExample$1;, but found Ljava/util/concurrent/ScheduledThreadPoolExecutor;
> 	at org.objectweb.asm.tree.analysis.Analyzer.analyze(Unknown Source)
> 	at org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer$2.analyze(ContinuationMethodAnalyzer.java:124)
> 	at org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:135)
> 	at org.objectweb.asm.ClassReader.accept(Unknown Source)
> 	at org.objectweb.asm.ClassReader.accept(Unknown Source)
> 	at org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:53)
> 	at org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:40)
> 	at org.apache.commons.javaflow.utils.RewritingUtils.rewriteClassFile(RewritingUtils.java:60)
> 	at Rewriter.main(Rewriter.java:10)
> Caused by: org.objectweb.asm.tree.analysis.AnalyzerException: Method owner: expected
LExample$1;, but found Ljava/util/concurrent/ScheduledThreadPoolExecutor;
> 	at org.objectweb.asm.tree.analysis.BasicVerifier.naryOperation(Unknown Source)
> 	at org.objectweb.asm.tree.analysis.Frame.execute(Unknown Source)
> 	at org.apache.commons.javaflow.bytecode.transformation.asm.MonitoringFrame.execute(MonitoringFrame.java:70)
> 	... 9 more
> org.objectweb.asm.tree.analysis.AnalyzerException: Error at instruction 9: Cannot pop
operand off an empty stack.
> 	at org.objectweb.asm.tree.analysis.Analyzer.analyze(Unknown Source)
> 	at org.objectweb.asm.util.CheckMethodAdapter$1.visitEnd(Unknown Source)
> 	at org.objectweb.asm.util.CheckMethodAdapter.visitEnd(Unknown Source)
> 	at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
> 	at org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:141)
> 	at org.objectweb.asm.ClassReader.accept(Unknown Source)
> 	at org.objectweb.asm.ClassReader.accept(Unknown Source)
> 	at org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:53)
> 	at org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:40)
> 	at org.apache.commons.javaflow.utils.RewritingUtils.rewriteClassFile(RewritingUtils.java:60)
> 	at Rewriter.main(Rewriter.java:10)
> Caused by: java.lang.IndexOutOfBoundsException: Cannot pop operand off an empty stack.
> 	at org.objectweb.asm.tree.analysis.Frame.pop(Unknown Source)
> 	at org.objectweb.asm.tree.analysis.Frame.execute(Unknown Source)
> 	... 11 more
> Exception in thread "main" java.lang.RuntimeException: Error at instruction 9: Cannot
pop operand off an empty stack. schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
> 00000 R R J . R  :  :    L0
> 00001 R R J . R  :  :     LINENUMBER 7 L0
> 00002 R R J . R  :  :     ALOAD 0
> 00003 R R J . R  : R  :     GETFIELD Example.stpe : Ljava/util/concurrent/ScheduledThreadPoolExecutor;
> 00004 R R J . R  : R  :     ALOAD 0
> 00005 R R J . R  : R R  :     ALOAD 1
> 00006 R R J . R  : R R R  :     INVOKESPECIAL Example$1.<init> (LExample;Ljava/lang/Runnable;)V
> 00007 R R J . R  :  :     NEW Example$1
> 00008 R R J . R  : R  :     DUP
> 00009 R R J . R  : R R  :     DUP2_X2
> 00010 ?             :     POP2
> 00011 ?             :     LLOAD 2
> 00012 ?             :     ALOAD 4
> 00013 ?             :    L1
> 00014 ?             :     INVOKEVIRTUAL java/util/concurrent/ScheduledThreadPoolExecutor.schedule
(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
> 00015 ?             :     ARETURN
> 	at org.objectweb.asm.util.CheckMethodAdapter$1.visitEnd(Unknown Source)
> 	at org.objectweb.asm.util.CheckMethodAdapter.visitEnd(Unknown Source)
> 	at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
> 	at org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:141)
> 	at org.objectweb.asm.ClassReader.accept(Unknown Source)
> 	at org.objectweb.asm.ClassReader.accept(Unknown Source)
> 	at org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:53)
> 	at org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:40)
> 	at org.apache.commons.javaflow.utils.RewritingUtils.rewriteClassFile(RewritingUtils.java:60)
> 	at Rewriter.main(Rewriter.java:10)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message