mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Update our JRuby Wrapper
`RubyHash#visitAll` and `RubyArray#getList` are now deprecated. - RubyArray now implements List, so we don't need to convert it. - We need to be a bit more explicit with the visitAll and pass the ruby context. Fixes: #7427 Fixes #7425
This commit is contained in:
parent
d87071edc9
commit
a01842cd33
2 changed files with 3 additions and 3 deletions
|
@ -36,13 +36,13 @@ public class ConvertedMap<K, V> implements Map<K, V> {
|
|||
public static ConvertedMap<String, Object> newFromRubyHash(RubyHash o) {
|
||||
final ConvertedMap<String, Object> result = new ConvertedMap<>();
|
||||
|
||||
o.visitAll(new RubyHash.Visitor() {
|
||||
o.visitAll(o.getRuntime().getCurrentContext(), new RubyHash.Visitor() {
|
||||
@Override
|
||||
public void visit(IRubyObject key, IRubyObject value) {
|
||||
String k = String.valueOf(BiValues.newBiValue(key).javaValue()) ;
|
||||
result.put(k, Valuefier.convert(value));
|
||||
}
|
||||
});
|
||||
}, null);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class JrubyAckedBatchExtLibrary implements Library {
|
|||
context.runtime.newArgumentError("expected queue AckedQueue");
|
||||
}
|
||||
|
||||
this.batch = new Batch(((RubyArray)events).getList(), ((RubyArray)seqNums).getList(), ((JrubyAckedQueueExtLibrary.RubyAckedQueue)queue).getQueue());
|
||||
this.batch = new Batch(((RubyArray)events), ((RubyArray)seqNums), ((JrubyAckedQueueExtLibrary.RubyAckedQueue)queue).getQueue());
|
||||
|
||||
return context.nil;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue