Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c588a1892596
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7817bedd6898
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Sep 6, 2017

  1. Copy the full SHA
    7989fd3 View commit details
  2. Remove automatic Java initCause.

    Fixes #4699.
    See #4781.
    headius committed Sep 6, 2017
    Copy the full SHA
    7817bed View commit details
Showing with 5 additions and 15 deletions.
  1. +5 −15 core/src/main/java/org/jruby/RubyKernel.java
20 changes: 5 additions & 15 deletions core/src/main/java/org/jruby/RubyKernel.java
Original file line number Diff line number Diff line change
@@ -912,22 +912,12 @@ private static void maybeRaiseJavaException(final Ruby runtime,
// looks like someone's trying to raise a Java exception. Let them.
Object maybeThrowable = exception.getObject();

if (maybeThrowable instanceof Throwable) {
final Throwable ex = (Throwable) maybeThrowable;
if (cause instanceof ConcreteJavaProxy) {
maybeThrowable = ((ConcreteJavaProxy) cause).getObject();
if (maybeThrowable instanceof Throwable && ex != maybeThrowable) {
// we have a Throwable we can set for cause, do it under lock
synchronized (ex) {
if (ex.getCause() == null) {
ex.initCause((Throwable) maybeThrowable);
}
}
}
}
Helpers.throwException(ex); return; // not reached
if (!(maybeThrowable instanceof Throwable)) {
throw runtime.newTypeError("can't raise a non-Throwable Java object");
}
throw runtime.newTypeError("can't raise a non-Throwable Java object");

final Throwable ex = (Throwable) maybeThrowable;
Helpers.throwException(ex); return; // not reached
}
}