Skip to content

Instantly share code, notes, and snippets.

@headius
Created February 18, 2012 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/1857349 to your computer and use it in GitHub Desktop.
Save headius/1857349 to your computer and use it in GitHub Desktop.
diff --git a/src/org/jruby/javasupport/JavaCallable.java b/src/org/jruby/javasupport/JavaCallable.java
index bdb732b..35fe08c 100644
--- a/src/org/jruby/javasupport/JavaCallable.java
+++ b/src/org/jruby/javasupport/JavaCallable.java
@@ -44,6 +44,7 @@ import org.jruby.RubyFixnum;
import org.jruby.RubyString;
import org.jruby.anno.JRubyMethod;
import org.jruby.runtime.builtin.IRubyObject;
+import org.jruby.util.unsafe.UnsafeFactory;
public abstract class JavaCallable extends JavaAccessibleObject implements ParameterTypes {
protected final Class<?>[] parameterTypes;
@@ -161,14 +162,14 @@ public abstract class JavaCallable extends JavaAccessibleObject implements Param
}
protected IRubyObject handleThrowable(Throwable t, Member target) {
- getRuntime().getJavaSupport().handleNativeException(t, target);
- // This point is only reached if there was an exception handler installed.
+ UnsafeFactory.getUnsafe().throwException(t);
+ // not reached
return getRuntime().getNil();
}
protected IRubyObject handleInvocationTargetEx(InvocationTargetException ite, Member target) {
- getRuntime().getJavaSupport().handleNativeException(ite.getTargetException(), target);
- // This point is only reached if there was an exception handler installed.
+ UnsafeFactory.getUnsafe().throwException(ite.getTargetException());
+ // not reached
return getRuntime().getNil();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment