JEXL update

-- Update to 2.1.1 from 2.0
-- VariantFiltrationWalker now allows you to run with type unsafe selects, which all default to false when matching.  So "AF < 0.5" works even in the presence of multi-allelics now.
--
This commit is contained in:
Mark DePristo 2012-06-21 09:54:36 -04:00
parent 24dd8ee51b
commit 31ee8aa01a
3 changed files with 7 additions and 4 deletions

View File

@ -59,7 +59,7 @@
<!-- Commons Dependencies -->
<dependency org="org.apache.commons" name="commons-email" rev="1.2"/>
<dependency org="org.apache.commons" name="commons-jexl" rev="2.0"/>
<dependency org="org.apache.commons" name="commons-jexl" rev="2.1.1"/>
<dependency org="commons-lang" name="commons-lang" rev="2.5"/>
<dependency org="commons-logging" name="commons-logging" rev="1.1.1"/>
<dependency org="commons-io" name="commons-io" rev="2.1"/>

View File

@ -52,8 +52,9 @@ public class VariantContextUtils {
private final static boolean ASSUME_MISSING_FIELDS_ARE_STRINGS = false;
static {
engine.setSilent(false); // will throw errors now for selects that don't evaluate properly
engine.setLenient(false);
engine.setSilent(true); // will throw errors now for selects that don't evaluate properly
engine.setLenient(true);
engine.setDebug(false);
}
/**

View File

@ -264,7 +264,9 @@ class JEXLMap implements Map<VariantContextUtils.JexlVCMatchExp, Boolean> {
// if the context is null, we need to create it to evaluate the JEXL expression
if (this.jContext == null) createContext();
try {
jexl.put (exp, (Boolean) exp.exp.evaluate(jContext));
final Boolean value = (Boolean) exp.exp.evaluate(jContext);
// treat errors as no match
jexl.put(exp, value == null ? false : value);
} catch (Exception e) {
throw new UserException.CommandLineException(String.format("Invalid JEXL expression detected for %s with message %s", exp.name, e.getMessage()));
}