Skip to content

Commit 5d9ebfb

Browse files
committed
Restore StringSupport methods deprecated recently
Not intended to be removed. memchr at least is still used by StringIO.
1 parent d13daa5 commit 5d9ebfb

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

core/src/main/java/org/jruby/util/StringSupport.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,18 @@ public static int bytesToFixBrokenTrailingCharacter(byte[] bytes, int begin, int
898898
return 0;
899899
}
900900

901+
// Deprecated but still used by StringIO
902+
@Deprecated(since = "10.0.0.0")
903+
public static int memchr(byte[] ptr, int start, final int find, int len) {
904+
return Helpers.memchr(ptr, start, find, len);
905+
}
906+
907+
// MRI: StringValueCStr, rb_string_value_cstr without trailing null addition
908+
@Deprecated(since = "10.0.0.0")
909+
public static RubyString checkEmbeddedNulls(Ruby runtime, IRubyObject ptr) {
910+
return Check.checkEmbeddedNulls(runtime.getCurrentContext(), ptr);
911+
}
912+
901913
// MRI: str_null_check without trailing null check (JVM arrays do not null terminate)
902914
// This function returns Java Object Array, with index0 is RubyString and index1 is Boolean.
903915
// Boolean corresponds to int *w arg of str_null_check.

0 commit comments

Comments
 (0)