Updated: JRuby to 9.2.11.0

- fix: deprecation warnings due JRuby 9.2.11
- fix: compat for upgraded RubyGems 3.0

Fixes #11647
This commit is contained in:
Karol Bucek 2020-03-03 09:44:15 +01:00
parent d3d765a455
commit b7a5f76859
5 changed files with 10 additions and 15 deletions

View file

@ -1 +1 @@
jruby-9.1.12.0 jruby-9.2.11.0

View file

@ -54,8 +54,8 @@ public final class OutputStrategyExt {
} }
@JRubyMethod @JRubyMethod
public IRubyObject classes() { public IRubyObject classes(final ThreadContext context) {
return map.rb_values(); return map.values(context);
} }
@JRubyMethod @JRubyMethod
@ -78,7 +78,7 @@ public final class OutputStrategyExt {
String.format( String.format(
"Could not find output delegator strategy of type '%s'. Value strategies: %s", "Could not find output delegator strategy of type '%s'. Value strategies: %s",
type.asJavaString(), type.asJavaString(),
map.rb_values().stream().map(v -> ((IRubyObject) v).asJavaString()) map.values(context).stream().map(v -> ((IRubyObject) v).asJavaString())
.collect(Collectors.joining(", ")) .collect(Collectors.joining(", "))
) )
); );

View file

@ -1,20 +1,15 @@
package org.logstash.log; package org.logstash.log;
import co.elastic.logstash.api.DeprecationLogger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jruby.RubyClass; import org.jruby.RubyClass;
import org.jruby.RubyModule; import org.jruby.RubyModule;
import org.jruby.RubyString; import org.jruby.RubyString;
import org.jruby.anno.JRubyMethod; import org.jruby.anno.JRubyMethod;
import org.jruby.anno.JRubyModule; import org.jruby.anno.JRubyModule;
import org.jruby.javasupport.JavaUtil;
import org.jruby.runtime.Block; import org.jruby.runtime.Block;
import org.jruby.runtime.ThreadContext; import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject; import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.runtime.builtin.InstanceVariables; import org.jruby.runtime.builtin.InstanceVariables;
import org.logstash.RubyUtil; import org.logstash.RubyUtil;
import org.logstash.common.SourceWithMetadata;
import static org.logstash.RubyUtil.RUBY; import static org.logstash.RubyUtil.RUBY;
@ -50,7 +45,7 @@ public final class LoggableExt {
} }
private static RubyString log4jName(final ThreadContext context, final RubyModule self) { private static RubyString log4jName(final ThreadContext context, final RubyModule self) {
IRubyObject name = self.name19(); IRubyObject name = self.name(context);
if (name.isNil()) { if (name.isNil()) {
final RubyClass clazz; final RubyClass clazz;
if (self instanceof RubyClass) { if (self instanceof RubyClass) {
@ -58,7 +53,7 @@ public final class LoggableExt {
} else { } else {
clazz = self.getMetaClass(); clazz = self.getMetaClass();
} }
name = clazz.name19(); name = clazz.name(context);
if (name.isNil()) { if (name.isNil()) {
name = clazz.to_s(); name = clazz.to_s();
} }

View file

@ -6,7 +6,7 @@ buildscript {
dependencies { dependencies {
classpath 'org.yaml:snakeyaml:1.23' classpath 'org.yaml:snakeyaml:1.23'
classpath "de.undercouch:gradle-download-task:3.2.0" classpath "de.undercouch:gradle-download-task:3.2.0"
classpath "org.jruby:jruby-complete:9.2.9.0" classpath "org.jruby:jruby-complete:9.2.11.0"
} }
} }
@ -81,7 +81,7 @@ void gem(File projectDir, File buildDir, String gem, String version, String path
jruby.runScriptlet(""" jruby.runScriptlet("""
require 'rubygems/commands/install_command' require 'rubygems/commands/install_command'
cmd = Gem::Commands::InstallCommand.new cmd = Gem::Commands::InstallCommand.new
cmd.handle_options ['--no-ri', '--no-rdoc', '${gem}', '-v', '${version}', '-i', '${path}'] cmd.handle_options ['--no-document', '${gem}', '-v', '${version}', '-i', '${path}']
begin begin
cmd.execute cmd.execute
rescue Gem::SystemExitException => e rescue Gem::SystemExitException => e

View file

@ -7,8 +7,8 @@ logstash-core-plugin-api: 2.1.16
# jruby must reference a *released* version of jruby which can be downloaded from the official download url # jruby must reference a *released* version of jruby which can be downloaded from the official download url
# *and* for which jars artifacts are published for compile-time # *and* for which jars artifacts are published for compile-time
jruby: jruby:
version: 9.2.9.0 version: 9.2.11.0
sha1: 39ef88eb5e7319402b15c048f638f26e2b9c4f4c sha1: c92bf2e52132b4d6d120f8dfbae15b36ab20d9d4
# jruby-runtime-override, if specified, will override the jruby version installed in vendor/jruby for logstash runtime only, # jruby-runtime-override, if specified, will override the jruby version installed in vendor/jruby for logstash runtime only,
# not for the compile-time jars # not for the compile-time jars