Skip to content

Commit

Permalink
Fix: due proper RubyEvent#toJava handle Array directly
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed Jun 21, 2021
1 parent 81d6b71 commit fca920e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package org.logstash.config.ir.compiler;

import org.jruby.RubyArray;
import org.logstash.ext.JrubyEventExtLibrary;

import java.util.Collection;
Expand Down Expand Up @@ -52,4 +53,17 @@ public static void filterEvents(Collection<JrubyEventExtLibrary.RubyEvent> input
}
}

@SuppressWarnings({"unchecked", "rawtypes"})
public static void filterEvents(RubyArray<JrubyEventExtLibrary.RubyEvent> input, EventCondition filter,
List fulfilled, List unfulfilled) {
for (int i=0; i<input.size(); i++) {
JrubyEventExtLibrary.RubyEvent e = input.eltInternal(i);
if (filter.fulfilled(e)) {
fulfilled.add(e);
} else {
unfulfilled.add(e);
}
}
}

}

0 comments on commit fca920e

Please sign in to comment.