From c60310f0c4b8c59e241b8b2b13b55efb9161944e Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Tue, 26 Mar 2024 11:39:05 -0500 Subject: [PATCH] Restore some 19 methods still in use by json See https://github.com/flori/json/pull/576 --- core/src/main/java/org/jruby/RubyString.java | 6 ++++++ core/src/main/java/org/jruby/util/ConvertBytes.java | 6 ++++++ core/src/main/java/org/jruby/util/ConvertDouble.java | 1 + 3 files changed, 13 insertions(+) diff --git a/core/src/main/java/org/jruby/RubyString.java b/core/src/main/java/org/jruby/RubyString.java index b2a81b38583..988c05b3cd4 100644 --- a/core/src/main/java/org/jruby/RubyString.java +++ b/core/src/main/java/org/jruby/RubyString.java @@ -6430,6 +6430,12 @@ public RubySymbol intern() { return symbol; } + // Must remain in place until json has migrated to the new method for some time (https://github.com/flori/json/pull/576) + @Deprecated + public RubySymbol intern19() { + return intern(); + } + @JRubyMethod public IRubyObject ord(ThreadContext context) { final Ruby runtime = context.runtime; diff --git a/core/src/main/java/org/jruby/util/ConvertBytes.java b/core/src/main/java/org/jruby/util/ConvertBytes.java index 9f62362fe65..fd813b04342 100644 --- a/core/src/main/java/org/jruby/util/ConvertBytes.java +++ b/core/src/main/java/org/jruby/util/ConvertBytes.java @@ -332,6 +332,12 @@ public static RubyInteger byteListToInum(Ruby runtime, ByteList str, int off, in return (RubyInteger) new ConvertBytes(runtime, str, off, end, base, badcheck).byteListToInum(true); } + // Must remain in place until json has migrated to the new method for some time (https://github.com/flori/json/pull/576) + @Deprecated + public static RubyInteger byteListToInum19(Ruby runtime, ByteList str, int base, boolean badcheck) { + return byteListToInum(runtime, str, base, badcheck); + } + private final static byte[] conv_digit = new byte[128]; private final static boolean[] digit = new boolean[128]; private final static boolean[] space = new boolean[128]; diff --git a/core/src/main/java/org/jruby/util/ConvertDouble.java b/core/src/main/java/org/jruby/util/ConvertDouble.java index cf4756100fb..7be01d8d91b 100644 --- a/core/src/main/java/org/jruby/util/ConvertDouble.java +++ b/core/src/main/java/org/jruby/util/ConvertDouble.java @@ -29,6 +29,7 @@ package org.jruby.util; public class ConvertDouble { + // Must remain in place until json has migrated to the new method for some time (https://github.com/flori/json/pull/576) @Deprecated public static double byteListToDouble19(ByteList bytes, boolean strict) { return byteListToDouble(bytes, strict);