Skip to content

Commit

Permalink
Restore these methods for StringIO
Browse files Browse the repository at this point in the history
StringIO currently still calls one or both of these cat19 methods,
and will need time to migrate away from them. We may not be able
to safely remove these after one major release cycle, so I am
reverting this deletion with extra notes for future evaluation.

The migration of StringIO will be tracked in ruby/stringio#83
and we will be backporting the new names to try to fast-track the
migration in the next year.
  • Loading branch information
headius committed Mar 12, 2024
1 parent 4553e9c commit 46cef2e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,13 @@ public final RubyString cat(byte[] str, int beg, int len) {
return this;
}

// Needs to remain in place until StringIO has migrated to the new methods
// See https://github.com/ruby/stringio/issues/83
@Deprecated
public final RubyString cat19(RubyString str2) {
return catWithCodeRange(str2);
}

// // rb_str_buf_append against VALUE
public final RubyString catWithCodeRange(RubyString str2) {
ByteList other = str2.getByteList();
Expand All @@ -1389,6 +1396,13 @@ public final RubyString cat(ByteList other, int codeRange) {
return this;
}

// Needs to remain in place until StringIO has migrated to the new methods
// See https://github.com/ruby/stringio/issues/83
@Deprecated
public final int cat19(ByteList other, int codeRange) {
return catWithCodeRange(other, codeRange);
}

// rb_str_buf_append against ptr
public final int catWithCodeRange(ByteList other, int codeRange) {
return EncodingUtils.encCrStrBufCat(metaClass.runtime, this, other, other.getEncoding(), codeRange);
Expand Down

0 comments on commit 46cef2e

Please sign in to comment.