ReturnJump getting logged, possibly when passing through a Java interface 
implementation
----------------------------------------------------------------------------------------

                 Key: JRUBY-2581
                 URL: http://jira.codehaus.org/browse/JRUBY-2581
             Project: JRuby
          Issue Type: Bug
            Reporter: Charles Oliver Nutter
            Assignee: Charles Oliver Nutter
             Fix For: JRuby 1.1.3


I'm reverting a change to do a shared ReturnJump per thread, because it seemed 
to cause logging of ReturnJump in a user's deployed Rails app. This bug is to 
figure out why this is happening, or at least mark that it's a problem with 
shared ReturnJump.

The diff for the revert, if it's possible to go back (which would be nice) is 
here:

{noformat}
diff --git a/src/org/jruby/exceptions/JumpException.java 
b/src/org/jruby/exceptions/JumpException.java
index d0109c4..976de23 100644
--- a/src/org/jruby/exceptions/JumpException.java
+++ b/src/org/jruby/exceptions/JumpException.java
@@ -66,7 +66,7 @@ public class JumpException extends RuntimeException {
     public static final RedoJump REDO_JUMP = new RedoJump();
     public static class SpecialJump extends FlowControlException {}
     public static final SpecialJump SPECIAL_JUMP = new SpecialJump();
-    public static class ReturnJump extends FlowControlException { public 
ReturnJump() {}; public void update(JumpTarget t, Object v) { target = t; value 
= v; }}
+    public static class ReturnJump extends FlowControlException { public 
ReturnJump(JumpTarget t, Object v) { target = t; value = v; }}
     
     /**
      * Constructor for flow-control-only JumpExceptions.
diff --git a/src/org/jruby/runtime/ThreadContext.java 
b/src/org/jruby/runtime/ThreadContext.java
index b9f2307..6727fa5 100644
--- a/src/org/jruby/runtime/ThreadContext.java
+++ b/src/org/jruby/runtime/ThreadContext.java
@@ -107,8 +107,6 @@ public final class ThreadContext {
     // appropriate place.
     private int rubyFrameDelta = 0;
     
-    private final ReturnJump RETURN_JUMP = new ReturnJump();
-    
     /**
      * Constructor for Context.
      */
@@ -153,8 +151,7 @@ public final class ThreadContext {
     }
     
     public ReturnJump returnJump(IRubyObject value) {
-        RETURN_JUMP.update(getFrameJumpTarget(), value);
-        return RETURN_JUMP;
+        return new ReturnJump(getFrameJumpTarget(), value);
     }
     
     /**
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to