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:
Pier-Hugues Pellerin 2017-06-12 17:24:50 -04:00
parent d87071edc9
commit a01842cd33
2 changed files with 3 additions and 3 deletions

View file

@ -36,13 +36,13 @@ public class ConvertedMap<K, V> implements Map<K, V> {
public static ConvertedMap<String, Object> newFromRubyHash(RubyHash o) { public static ConvertedMap<String, Object> newFromRubyHash(RubyHash o) {
final ConvertedMap<String, Object> result = new ConvertedMap<>(); final ConvertedMap<String, Object> result = new ConvertedMap<>();
o.visitAll(new RubyHash.Visitor() { o.visitAll(o.getRuntime().getCurrentContext(), new RubyHash.Visitor() {
@Override @Override
public void visit(IRubyObject key, IRubyObject value) { public void visit(IRubyObject key, IRubyObject value) {
String k = String.valueOf(BiValues.newBiValue(key).javaValue()) ; String k = String.valueOf(BiValues.newBiValue(key).javaValue()) ;
result.put(k, Valuefier.convert(value)); result.put(k, Valuefier.convert(value));
} }
}); }, null);
return result; return result;
} }

View file

@ -59,7 +59,7 @@ public class JrubyAckedBatchExtLibrary implements Library {
context.runtime.newArgumentError("expected queue AckedQueue"); 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; return context.nil;
} }