Skip to content

Commit 8d10f1a

Browse files
committed
restore last deprecated methods
1 parent 3a71117 commit 8d10f1a

5 files changed

Lines changed: 35 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,6 +2542,11 @@ public void setDefaultRandom(RubyRandom random) {
25422542
this.defaultRand = random.getRandomType();
25432543
}
25442544

2545+
@Deprecated(since = "9.4-")
2546+
public RubyRandom.RandomType getDefaultRand() {
2547+
return getDefaultRandom().getRandomType();
2548+
}
2549+
25452550
/**
25462551
* @deprecated the modified field is now unused and deprecated and the set is ignored
25472552
*/

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
import static org.jruby.api.Create.newString;
7878
import static org.jruby.api.Define.defineClass;
7979
import static org.jruby.api.Error.argumentError;
80+
import static org.jruby.api.Warn.warn;
8081
import static org.jruby.runtime.ThreadContext.CALL_KEYWORD;
8182
import static org.jruby.runtime.ThreadContext.resetCallInfo;
8283
import static org.jruby.runtime.Visibility.PRIVATE;
@@ -559,6 +560,16 @@ public static IRubyObject each_codepoint(ThreadContext context, IRubyObject recv
559560
return recv;
560561
}
561562

563+
@Deprecated(since = "9.4-")
564+
public static IRubyObject codepoints(ThreadContext context, IRubyObject recv, Block block) {
565+
warn(context, "ARGF#codepoints is deprecated; use #each_codepoint instead");
566+
567+
if (!block.isGiven()) return RubyEnumerator.enumeratorize(context.runtime, recv, "each_line");
568+
569+
return each_codepoint(context, recv, block);
570+
}
571+
572+
562573
/** Invoke a block for each line.
563574
*
564575
*/
@@ -587,6 +598,12 @@ public static IRubyObject each_line(ThreadContext context, IRubyObject recv, IRu
587598
return recv;
588599
}
589600

601+
@Deprecated(since = "10.0")
602+
public static IRubyObject lines(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) {
603+
if (!block.isGiven()) return RubyEnumerator.enumeratorize(context.runtime, recv, "each_line");
604+
return each_line(context, recv, args, block);
605+
}
606+
590607
@JRubyMethod(name = "each", optional = 1, checkArity = false)
591608
public static IRubyObject each(final ThreadContext context, IRubyObject recv, IRubyObject[] args, final Block block) {
592609
return block.isGiven() ? each_line(context, recv, args, block) : enumeratorize(context.runtime, recv, "each", args);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,7 @@ private void concat(ThreadContext context, RubyArray<?> obj) {
18891889
}
18901890

18911891
@Deprecated(since = "10.0")
1892-
public RubyArray aryAppend(RubyArray<?> y) {
1892+
public RubyArray aryAppend(RubyArray y) {
18931893
return aryAppend(getCurrentContext(), y);
18941894
}
18951895

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,11 @@ public RubyFixnum hash(ThreadContext context) {
897897
return asFixnum(context, hashCode());
898898
}
899899

900+
@Deprecated(since = "10.0")
901+
public RubyHash named_captures(ThreadContext context) {
902+
return named_captures(context, NULL_ARRAY);
903+
}
904+
900905
@JRubyMethod(keywords = true, optional = 1)
901906
public RubyHash named_captures(ThreadContext context, IRubyObject[] args) {
902907
check(context);

tool/acceptable_errors.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,4 +934,11 @@
934934
'method org.jruby.RubyArray<?> org.jruby.RubyArray<T extends org.jruby.runtime.builtin.IRubyObject>::newArray(org.jruby.runtime.ThreadContext, int)|java.method.numberOfParametersChanged' => '10.0',
935935
'method org.jruby.RubyArray<?> org.jruby.RubyArray<T extends org.jruby.runtime.builtin.IRubyObject>::newArrayLight(org.jruby.RubyClass, org.jruby.runtime.builtin.IRubyObject)|java.method.numberOfParametersChanged' => '10.0',
936936
'method void org.jruby.RubyArray<T extends org.jruby.runtime.builtin.IRubyObject>::storeInternal(org.jruby.runtime.ThreadContext, int, org.jruby.runtime.builtin.IRubyObject)|java.method.numberOfParametersChanged' => '10.0',
937+
'method org.jruby.runtime.builtin.IRubyObject org.jruby.RubyClass::subclasses(org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject)|java.method.removed' => '10.0',
938+
'method org.jruby.RubyFixnum org.jruby.RubyComplex::hash(org.jruby.runtime.ThreadContext)|java.method.returnTypeChangedCovariantly' => '10.0',
939+
'method org.jruby.RubyFixnum org.jruby.RubyRational::hash(org.jruby.runtime.ThreadContext)|java.method.returnTypeChangedCovariantly' => '10.0',
940+
'method void org.jruby.RubyArray<T extends org.jruby.runtime.builtin.IRubyObject>::finishRawArray(org.jruby.runtime.ThreadContext)|java.method.removed' => '10.0',
941+
'method org.jruby.runtime.builtin.IRubyObject org.jruby.RubyArray<T extends org.jruby.runtime.builtin.IRubyObject>::choice(org.jruby.runtime.ThreadContext)|java.method.removed' => '10.0',
942+
'method void org.jruby.RubyArray<T extends org.jruby.runtime.builtin.IRubyObject>::modifyCheck(org.jruby.runtime.ThreadContext)|java.method.finalMethodAddedToNonFinalClass' => '10.0',
943+
'method java.lang.Boolean org.jruby.RubyInstanceConfig::isFrozenStringLiteral()|java.method.returnTypeChanged' => '10.0',
937944
}

0 commit comments

Comments
 (0)