Skip to content

Commit e7eda5b

Browse files
authored
Merge pull request #355 from headius/no_string_constructors
Avoid direct constructors from JRuby
2 parents aae2576 + 654046f commit e7eda5b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Mavenfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ plugin :clean do
8282
'failOnError' => 'false' )
8383
end
8484

85-
jar 'org.jruby:jruby-core', '9.2.0.0', :scope => :provided
85+
jar 'org.jruby:jruby-core', '9.2.1.0', :scope => :provided
8686
# for invoker generated classes we need to add javax.annotation when on Java > 8
8787
jar 'javax.annotation:javax.annotation-api', '1.3.1', :scope => :compile
8888
jar 'org.junit.jupiter:junit-jupiter', '5.11.4', :scope => :test

src/main/java/org/jruby/ext/openssl/StringHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static RubyString newString(final Ruby runtime, final byte[] bytes, final int co
6363
}
6464

6565
static RubyString newString(final Ruby runtime, final CharSequence chars) {
66-
return new RubyString(runtime, runtime.getString(), chars, ASCIIEncoding.INSTANCE);
66+
return RubyString.newString(runtime, chars, ASCIIEncoding.INSTANCE);
6767
}
6868

6969
static ByteList setByteListShared(final RubyString str) {
@@ -73,12 +73,12 @@ static ByteList setByteListShared(final RubyString str) {
7373

7474
static RubyString newUTF8String(final Ruby runtime, final ByteList bytes) {
7575
ByteList byteList = new ByteList(RubyEncoding.encodeUTF8(bytes), UTF8Encoding.INSTANCE, false);
76-
return new RubyString(runtime, runtime.getString(), byteList);
76+
return RubyString.newString(runtime, byteList);
7777
}
7878

7979
static RubyString newUTF8String(final Ruby runtime, final CharSequence chars) {
8080
ByteList byteList = new ByteList(RubyEncoding.encodeUTF8(chars), UTF8Encoding.INSTANCE, false);
81-
return new RubyString(runtime, runtime.getString(), byteList);
81+
return RubyString.newString(runtime, byteList);
8282
}
8383

8484
static RubyString newStringFrozen(final Ruby runtime, final ByteList bytes) {

0 commit comments

Comments
 (0)