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: c848f280e4b6
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a4945b654d15
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Sep 30, 2016

  1. Copy the full SHA
    bd527af View commit details
  2. Copy the full SHA
    a4945b6 View commit details
7 changes: 2 additions & 5 deletions core/src/main/java/org/jruby/NativeException.java
Original file line number Diff line number Diff line change
@@ -167,22 +167,19 @@ public void trimStackTrace(Member target) {
}

@Override
@SuppressWarnings("deprecation")
public final IRubyObject getMessage() {
IRubyObject message = super.getMessage();

if (message == null) {
if (messageAsJavaString == null) {
message = getRuntime().getNil();
} else {
message = getRuntime().newString(messageAsJavaString);
}

setMessage(message);

return message;
}

return super.getMessage();
return message;
}

@Override
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/RubyException.java
Original file line number Diff line number Diff line change
@@ -134,6 +134,7 @@ public RubyException exception(IRubyObject[] args) {
}

@JRubyMethod(name = "to_s")
@SuppressWarnings("deprecation")
public IRubyObject to_s(ThreadContext context) {
final IRubyObject msg = getMessage();
if ( ! msg.isNil() ) return msg.asString();
@@ -277,7 +278,7 @@ public void copySpecialInstanceVariables(IRubyObject clone) {
RubyException exception = (RubyException)clone;
exception.backtraceData = backtraceData;
exception.backtrace = backtrace;
exception.setMessage(getMessage());
exception.message = message;
}

/**
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/RubySystemCallError.java
Original file line number Diff line number Diff line change
@@ -139,14 +139,15 @@ public IRubyObject allocate(Ruby runtime, RubyClass klass) {

private static final ObjectMarshal SYSTEM_CALL_ERROR_MARSHAL = new ObjectMarshal() {
@Override
@SuppressWarnings("deprecation")
public void marshalTo(Ruby runtime, Object obj, RubyClass type,
MarshalStream marshalStream) throws IOException {
RubySystemCallError exc = (RubySystemCallError) obj;
marshalStream.registerLinkTarget(exc);

List<Variable<Object>> attrs = exc.getVariableList();
attrs.add(new VariableEntry<Object>(
"mesg", exc.getMessage() == null ? runtime.getNil() : exc.getMessage()));
"mesg", exc.message == null ? runtime.getNil() : exc.message));
attrs.add(new VariableEntry<Object>("errno", exc.errno));
attrs.add(new VariableEntry<Object>("bt", exc.getBacktrace()));
marshalStream.dumpVariables(attrs);
7 changes: 6 additions & 1 deletion core/src/main/java/org/jruby/ext/socket/RubyTCPServer.java
Original file line number Diff line number Diff line change
@@ -214,7 +214,12 @@ public IRubyObject accept_nonblock(ThreadContext context, Ruby runtime, boolean

if (!ready) {
// no connection immediately accepted, let them try again
throw runtime.newErrnoEAGAINReadableError("Resource temporarily unavailable");

if (ex) {
throw runtime.newErrnoEAGAINReadableError("Resource temporarily unavailable");
}

return runtime.newSymbol("wait_readable");

} else {
// otherwise one key has been selected (ours) so we get the channel and hand it off