Skip to content

Commit 6a0bb07

Browse files
committedFeb 27, 2018
Clean up some deprecation in exception logic.
1 parent 91278e7 commit 6a0bb07

File tree

2 files changed

+21
-25
lines changed

2 files changed

+21
-25
lines changed
 

‎core/src/main/java/org/jruby/RubyException.java

-3
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ public void initBacktrace() {
269269
}
270270

271271
@Override
272-
@SuppressWarnings("deprecated")
273272
public void copySpecialInstanceVariables(IRubyObject clone) {
274273
RubyException exception = (RubyException)clone;
275274
exception.backtraceData = backtraceData;
@@ -389,7 +388,6 @@ public static IRubyObject newException(ThreadContext context, RubyClass exceptio
389388
/**
390389
* @return error message if provided or nil
391390
*/
392-
@SuppressWarnings("deprecated")
393391
public IRubyObject getMessage() {
394392
return message == null ? getRuntime().getNil() : message;
395393
}
@@ -398,7 +396,6 @@ public IRubyObject getMessage() {
398396
* Set the message for this NameError.
399397
* @param message the message
400398
*/
401-
@SuppressWarnings("deprecated")
402399
public void setMessage(IRubyObject message) {
403400
this.message = message;
404401
}

‎core/src/main/java/org/jruby/exceptions/RaiseException.java

+21-22
Original file line numberDiff line numberDiff line change
@@ -128,28 +128,6 @@ public RaiseException(RubyException exception, boolean nativeException) {
128128
preRaise(exception.getRuntime().getCurrentContext());
129129
}
130130

131-
public RaiseException(Throwable cause, NativeException nativeException) {
132-
super(nativeException.getMessageAsJavaString(), cause);
133-
providedMessage = super.getMessage(); // cause.getClass().getName() + ": " + message
134-
setException(nativeException, true);
135-
preRaise(nativeException.getRuntime().getCurrentContext(), nativeException.getCause().getStackTrace());
136-
setStackTrace(RaiseException.javaTraceFromRubyTrace(exception.getBacktraceElements()));
137-
}
138-
139-
@Deprecated
140-
public static RaiseException createNativeRaiseException(Ruby runtime, Throwable cause) {
141-
return createNativeRaiseException(runtime, cause, null);
142-
}
143-
144-
@Deprecated
145-
public static RaiseException createNativeRaiseException(Ruby runtime, Throwable cause, Member target) {
146-
NativeException nativeException = new NativeException(runtime, runtime.getNativeException(), cause);
147-
148-
// FIXME: someday, add back filtering of reflection/handle methods between JRuby and target
149-
150-
return new RaiseException(cause, nativeException);
151-
}
152-
153131
@Override
154132
public String getMessage() {
155133
if (providedMessage == null) {
@@ -243,4 +221,25 @@ public static StackTraceElement[] javaTraceFromRubyTrace(RubyStackTraceElement[]
243221
}
244222
return newTrace;
245223
}
224+
225+
@Deprecated
226+
public static RaiseException createNativeRaiseException(Ruby runtime, Throwable cause) {
227+
return createNativeRaiseException(runtime, cause, null);
228+
}
229+
230+
@Deprecated
231+
public static RaiseException createNativeRaiseException(Ruby runtime, Throwable cause, Member target) {
232+
NativeException nativeException = new NativeException(runtime, runtime.getNativeException(), cause);
233+
234+
return new RaiseException(cause, nativeException);
235+
}
236+
237+
@Deprecated
238+
public RaiseException(Throwable cause, NativeException nativeException) {
239+
super(nativeException.getMessageAsJavaString(), cause);
240+
providedMessage = super.getMessage(); // cause.getClass().getName() + ": " + message
241+
setException(nativeException, true);
242+
preRaise(nativeException.getRuntime().getCurrentContext(), nativeException.getCause().getStackTrace());
243+
setStackTrace(RaiseException.javaTraceFromRubyTrace(exception.getBacktraceElements()));
244+
}
246245
}

0 commit comments

Comments
 (0)
Please sign in to comment.