From 5d81b71a606cf6704be325c073c59e6d14566c11 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Mon, 17 Jun 2024 12:07:28 -0500 Subject: [PATCH] Use cat19 for 1.1 branch that will fade away soon This fixes #247 without introducing a dependency on the new catWithCodeRange in JRuby 9.4. It does depend on a now-deprecated method cat19 that will go away in the next year or so. --- src/main/java/org/jruby/rack/RackInput.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jruby/rack/RackInput.java b/src/main/java/org/jruby/rack/RackInput.java index 06675a23..3aeb9fd0 100644 --- a/src/main/java/org/jruby/rack/RackInput.java +++ b/src/main/java/org/jruby/rack/RackInput.java @@ -27,6 +27,7 @@ import org.jruby.runtime.ThreadContext; import org.jruby.runtime.builtin.IRubyObject; import org.jruby.util.ByteList; +import org.jruby.util.StringSupport; /** * Native (Java) implementation of a Rack input. @@ -147,7 +148,7 @@ public IRubyObject read(ThreadContext context, IRubyObject[] args) { if (bytes != null) { if (string != null) { string.clear(); - string.cat(bytes); + string.cat19(new ByteList(bytes, false), StringSupport.CR_UNKNOWN); return string; } return getRuntime().newString(new ByteList(bytes));