Skip to content

Commit 991f63a

Browse files
authored
Merge pull request jruby#9299 from headius/delete_deprecated
Delete methods deprecated prior to JRuby 9.4.0.0
2 parents c25d71e + 62a3dd6 commit 991f63a

201 files changed

Lines changed: 104 additions & 7179 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/src/main/java/org/jruby/IncludedModule.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ public RubyModule getOrigin() {
4545
return origin;
4646
}
4747

48-
@Deprecated(since = "9.3.0.0")
49-
@Override
50-
public RubyModule getNonIncludedClass() {
51-
return origin;
52-
}
53-
5448
@Deprecated(since = "10.0.3.0")
5549
@Override
5650
public IRubyObject id() {

core/src/main/java/org/jruby/IncludedModuleWrapper.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,6 @@ public IncludedModuleWrapper(Ruby runtime, RubyClass superClass, RubyModule orig
7373
methods = methodsHolder.getMethodsForWrite();
7474
}
7575

76-
/**
77-
* Overridden newIncludeClass implementation to allow attaching future includes to the correct module
78-
* (i.e. the one to which this is attached)
79-
*
80-
* @see org.jruby.RubyModule#newIncludeClass(RubyClass)
81-
*/
82-
@Override
83-
@Deprecated(since = "1.1.5")
84-
public IncludedModuleWrapper newIncludeClass(RubyClass superClass) {
85-
var context = getCurrentContext();
86-
IncludedModuleWrapper includedModule = new IncludedModuleWrapper(context.runtime, superClass, getOrigin());
87-
88-
// include its parent (and in turn that module's parents)
89-
if (getSuperClass() != null) includedModule.includeModule(context, getSuperClass());
90-
91-
return includedModule;
92-
}
93-
9476
public RubyModule getDelegate() {
9577
return origin;
9678
}

core/src/main/java/org/jruby/MetaClass.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@
4141

4242
public final class MetaClass extends RubyClass {
4343

44-
@Deprecated(since = "9.2.1.0")
45-
public MetaClass(Ruby runtime, RubyClass superClass, IRubyObject attached) {
46-
this(runtime, superClass, (RubyBasicObject) attached);
47-
}
48-
4944
/**
5045
* rb_class_boot for meta classes ({@link #makeMetaClass(ThreadContext, RubyClass)})
5146
*/

core/src/main/java/org/jruby/NativeException.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ public final IRubyObject cause() {
8282
return Java.getInstance(getRuntime(), getCause());
8383
}
8484

85-
@Deprecated(since = "9.1.0.0")
86-
public final IRubyObject cause(Block unusedBlock) {
87-
return cause();
88-
}
89-
9085
@Override
9186
public final IRubyObject backtrace() {
9287
IRubyObject rubyTrace = super.backtrace();
@@ -134,45 +129,6 @@ private static RubyArray joinedBacktrace(final Ruby runtime, final RubyArray rTr
134129
return RubyArray.newArrayMayCopy(runtime, trace);
135130
}
136131

137-
@Deprecated(since = "9.1.0.0") // not used
138-
public void trimStackTrace(Member target) {
139-
Throwable t = new Throwable();
140-
StackTraceElement[] origStackTrace = cause.getStackTrace();
141-
StackTraceElement[] currentStackTrace = t.getStackTrace();
142-
int skip = 0;
143-
for (int i = 1;
144-
i <= origStackTrace.length && i <= currentStackTrace.length;
145-
++i) {
146-
StackTraceElement a = origStackTrace[origStackTrace.length - i];
147-
StackTraceElement b = currentStackTrace[currentStackTrace.length - i];
148-
if (a.equals(b)) {
149-
skip += 1;
150-
} else {
151-
break;
152-
}
153-
}
154-
// If we know what method was being called, strip everything
155-
// before the call. This hides the JRuby and reflection internals.
156-
if (target != null) {
157-
String className = target.getDeclaringClass().getName();
158-
String methodName = target.getName();
159-
for (int i = origStackTrace.length - skip - 1; i >= 0; --i) {
160-
StackTraceElement frame = origStackTrace[i];
161-
if (frame.getClassName().equals(className) &&
162-
frame.getMethodName().equals(methodName)) {
163-
skip = origStackTrace.length - i - 1;
164-
break;
165-
}
166-
}
167-
}
168-
if (skip > 0) {
169-
final int len = origStackTrace.length - skip;
170-
StackTraceElement[] newStackTrace = new StackTraceElement[len];
171-
System.arraycopy(origStackTrace, 0, newStackTrace, 0, len);
172-
cause.setStackTrace(newStackTrace);
173-
}
174-
}
175-
176132
@Override
177133
public final IRubyObject getMessage() {
178134
if (message == null) {

core/src/main/java/org/jruby/PrependedModule.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ public RubyModule getDelegate() {
137137
return origin;
138138
}
139139

140-
@Deprecated(since = "9.3.0.0")
141-
@Override
142-
public RubyModule getNonIncludedClass() {
143-
return origin;
144-
}
145-
146140
@Deprecated(since = "10.0.3.0")
147141
@Override
148142
public IRubyObject id() {

core/src/main/java/org/jruby/Ruby.java

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,6 @@ private Ruby(RubyInstanceConfig config) {
498498
producerClass = null;
499499
}
500500

501-
continuationClass = initContinuation(context);
502-
503501
TracePoint.createTracePointClass(context, objectClass);
504502

505503
warningCategories = config.getWarningCategories();
@@ -1358,19 +1356,6 @@ public RubyClass getClass(String name) {
13581356
return Access.getClass(getCurrentContext(), name);
13591357
}
13601358

1361-
/**
1362-
* Retrieve the class with the given name from the Object namespace. The
1363-
* module name must be an interned string, but this method will be faster
1364-
* than the non-interned version.
1365-
*
1366-
* @param internedName the name of the class; <em>must</em> be an interned String!
1367-
* @return
1368-
*/
1369-
@Deprecated(since = "1.7.0")
1370-
public RubyClass fastGetClass(String internedName) {
1371-
return Access.getClass(getCurrentContext(), internedName);
1372-
}
1373-
13741359
/**
13751360
* A variation of defineClass that allows passing in an array of supplementary
13761361
* call sites for improving dynamic invocation performance.
@@ -1613,17 +1598,6 @@ private void initThreadStatuses(ThreadContext context) {
16131598
}
16141599
}
16151600

1616-
@SuppressWarnings("deprecation")
1617-
private RubyClass initContinuation(ThreadContext context) {
1618-
// Bare-bones class for backward compatibility
1619-
if (profile.allowClass("Continuation")) {
1620-
// Some third-party code (racc's cparse ext, at least) uses RubyContinuation directly, so we need this.
1621-
// Most functionality lives in continuation.rb now.
1622-
return RubyContinuation.createContinuation(context, objectClass);
1623-
}
1624-
return null;
1625-
}
1626-
16271601
public static final int NIL_PREFILLED_ARRAY_SIZE = RubyArrayNative.ARRAY_DEFAULT_SIZE * 8;
16281602
private final IRubyObject nilPrefilledArray[];
16291603

@@ -2193,10 +2167,6 @@ void setDefaultThreadGroup(RubyThreadGroup defaultThreadGroup) {
21932167
this.defaultThreadGroup = defaultThreadGroup;
21942168
}
21952169

2196-
public RubyClass getContinuation() {
2197-
return continuationClass;
2198-
}
2199-
22002170
public RubyClass getStructClass() {
22012171
return structClass;
22022172
}
@@ -4554,21 +4524,6 @@ public void setAbortOnException(final boolean abortOnException) {
45544524
this.abortOnException = abortOnException;
45554525
}
45564526

4557-
@Deprecated(since = "9.3.1.0")
4558-
public boolean isGlobalAbortOnExceptionEnabled() {
4559-
return abortOnException;
4560-
}
4561-
4562-
@Deprecated(since = "9.3.1.0")
4563-
public void setGlobalAbortOnExceptionEnabled(boolean enable) {
4564-
abortOnException = enable;
4565-
}
4566-
4567-
@Deprecated(since = "9.3.1.0")
4568-
public IRubyObject getReportOnException() {
4569-
return reportOnException ? getTrue() : getFalse();
4570-
}
4571-
45724527
public boolean isReportOnException() {
45734528
return reportOnException;
45744529
}
@@ -5314,7 +5269,6 @@ public interface RecursiveFunctionEx<T> extends ThreadContext.RecursiveFunctionE
53145269
private final RubyClass ioBufferClass;
53155270
private final RubyClass threadClass;
53165271
private final RubyClass threadGroupClass;
5317-
private final RubyClass continuationClass;
53185272
private final RubyClass structClass;
53195273
private final RubyClass exceptionClass;
53205274
private final RubyClass dummyClass;
@@ -5768,11 +5722,6 @@ protected TypePopulator computeValue(Class<?> type) {
57685722

57695723
ParserManager parserManager;
57705724

5771-
@Deprecated(since = "9.3.0.0")
5772-
public RaiseException newErrnoEADDRFromBindException(BindException be) {
5773-
return newErrnoEADDRFromBindException(be, null);
5774-
}
5775-
57765725
@Deprecated(since = "9.4.0.0")
57775726
public RaiseException newFrozenError(String objectType) {
57785727
return newFrozenError(objectType, null);

core/src/main/java/org/jruby/RubyArgsFile.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,6 @@ public ArgsFileData(Ruby runtime, RubyArray argv) {
160160
this.currentFile = runtime.getNil();
161161
}
162162

163-
@Deprecated(since = "9.1.8.0")
164-
public void setCurrentLineNumber(Ruby runtime, int linenumber) {
165-
runtime.setCurrentLine(linenumber);
166-
}
167-
168163
// ARGF.class.new
169164
void setArgs(RubyArray argv) {
170165
inited = false;
@@ -239,11 +234,6 @@ public static ArgsFileData getArgsFileData(Ruby runtime) {
239234
return (ArgsFileData) runtime.getArgsFile().dataGetStruct();
240235
}
241236

242-
@Deprecated(since = "9.1.8.0")
243-
public static ArgsFileData getDataFrom(IRubyObject recv) {
244-
return getArgsFileData(((RubyBasicObject) recv).getCurrentContext().runtime);
245-
}
246-
247237
private void createNewFile(File file) {
248238
try {
249239
file.createNewFile();
@@ -302,11 +292,6 @@ public boolean isCurrentFile(RubyIO io) {
302292
}
303293
}
304294

305-
@Deprecated(since = "9.1.8.0")
306-
public static void setCurrentLineNumber(IRubyObject recv, int newLineNumber) {
307-
((RubyBasicObject) recv).getCurrentContext().runtime.setCurrentLine(newLineNumber);
308-
}
309-
310295
@JRubyMethod
311296
public static IRubyObject inplace_mode(ThreadContext context, IRubyObject recv) {
312297
ArgsFileData data = ArgsFileData.getArgsFileData(context.runtime);

core/src/main/java/org/jruby/RubyArray.java

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,6 @@ public static RubyArray aryToAry(ThreadContext context, IRubyObject obj) {
419419
return tmp != context.nil ? (RubyArray) tmp : RubyArray.newArray(context.runtime, obj);
420420
}
421421

422-
@Deprecated(since = "9.2.5.0")
423-
public static RubyArray aryToAry(IRubyObject obj) {
424-
return aryToAry(obj.getRuntime().getCurrentContext(), obj);
425-
}
426-
427422
@Deprecated(since = "10.0.0.0")
428423
public IRubyObject insert(IRubyObject arg) {
429424
return insert(getCurrentContext(), arg);
@@ -493,7 +488,7 @@ public RubyArray<?> append(IRubyObject item) {
493488
@JRubyMethod(name = "<<")
494489
public abstract RubyArray append(ThreadContext context, IRubyObject item);
495490

496-
@Deprecated // not-used
491+
@Deprecated(since = "10.0.3.0") // not-used
497492
public RubyArray<?> push_m(IRubyObject[] items) {
498493
return push(items);
499494
}
@@ -572,11 +567,6 @@ public IRubyObject aref(IRubyObject[] args) {
572567
};
573568
}
574569

575-
@Deprecated(since = "9.4.0.0")
576-
public IRubyObject aref(IRubyObject arg0) {
577-
return aref(getCurrentContext(), arg0);
578-
}
579-
580570
@JRubyMethod(name = {"[]", "slice"})
581571
public abstract IRubyObject aref(ThreadContext context, IRubyObject arg0);
582572

@@ -757,11 +747,6 @@ public IRubyObject to_ary() {
757747
return this;
758748
}
759749

760-
@Deprecated(since = "9.3.0.0")
761-
public IRubyObject to_h(ThreadContext context) {
762-
return to_h(context, Block.NULL_BLOCK);
763-
}
764-
765750
@JRubyMethod(name = "to_ary")
766751
public final IRubyObject to_ary(ThreadContext context) {
767752
return this;
@@ -1431,59 +1416,6 @@ private static JavaSites.ArraySites sites(ThreadContext context) {
14311416
return context.sites.Array;
14321417
}
14331418

1434-
/**
1435-
* Increases the capacity of this <code>Array</code>, if necessary.
1436-
* @param minCapacity the desired minimum capacity of the internal array
1437-
*/
1438-
@Deprecated(since = "9.1.3.0")
1439-
public void ensureCapacity(int minCapacity) {
1440-
throw getRuntime().newNotImplementedError("RubyArray#ensure_capacity has been removed");
1441-
}
1442-
1443-
@Deprecated(since = "9.2.10.0")
1444-
@Override
1445-
public RubyArray to_a() {
1446-
throw getRuntime().newNotImplementedError("RubyArray#to_a has been removed");
1447-
}
1448-
1449-
@Deprecated(since = "9.2.15.0")
1450-
public IRubyObject shuffle(ThreadContext context, IRubyObject[] args) {
1451-
switch (args.length) {
1452-
case 0:
1453-
return shuffle(context);
1454-
case 1:
1455-
return shuffle(context, args[0]);
1456-
default:
1457-
throw argumentError(context, args.length, 0, 0);
1458-
}
1459-
}
1460-
1461-
@Deprecated(since = "9.2.15.0")
1462-
public IRubyObject shuffle_bang(ThreadContext context, IRubyObject[] args) {
1463-
switch (args.length) {
1464-
case 0:
1465-
return shuffle_bang(context, context.nil);
1466-
case 1:
1467-
return shuffle_bang(context, args[0]);
1468-
default:
1469-
throw argumentError(context, args.length, 0, 0);
1470-
}
1471-
}
1472-
1473-
@Deprecated(since = "9.2.15.0")
1474-
public IRubyObject sample(ThreadContext context, IRubyObject[] args) {
1475-
switch (args.length) {
1476-
case 0:
1477-
return sample(context);
1478-
case 1:
1479-
return sample(context, args[0]);
1480-
case 2:
1481-
return sample(context, args[0], args[1]);
1482-
default:
1483-
throw argumentError(context, args.length, 0, 1);
1484-
}
1485-
}
1486-
14871419
/**
14881420
* Returns a stream of each IRubyObject
14891421
* @return

0 commit comments

Comments
 (0)