@Test @Parameters({"2 == 1, 2 == 1", "${body.prop} == 1, ${body[prop]} == 1", "${body.prop} == 1 OR ${body.fr_op.gl$op.ml0op[3]} == '2.4', ${body[prop]} == 1 OR ${body[fr_op][gl$op][ml0op][3]} == '2.4'"}) public void shouldConvertSimpleExpressionsToOgnl(final String simple, final String ognl) { assertThat(convertSimpleToOGNLForMaps(simple)).isEqualTo(ognl); }
@SuppressWarnings("JdkObsolete") static String convertSimpleToOGNLForMaps(final String simple) { final Matcher matcher = SIMPLE_EXPRESSION.matcher(simple); final StringBuffer ognl = new StringBuffer(simple.length() + 5); while (matcher.find()) { final String expression = toOgnl(matcher); matcher.appendReplacement(ognl, "\\$\\{" + expression + "\\}"); } matcher.appendTail(ognl); return ognl.toString(); }
JsonSimplePredicate implements Predicate { @SuppressWarnings("JdkObsolete") static String convertSimpleToOGNLForMaps(final String simple) { final Matcher matcher = SIMPLE_EXPRESSION.matcher(simple); final StringBuffer ognl = new StringBuffer(simple.length() + 5); while (matcher.find()) { final String expression = toOgnl(matcher); matcher.appendReplacement(ognl, "\\$\\{" + expression + "\\}"); } matcher.appendTail(ognl); return ognl.toString(); } }
JsonSimplePredicate implements Predicate { @SuppressWarnings("JdkObsolete") static String convertSimpleToOGNLForMaps(final String simple) { final Matcher matcher = SIMPLE_EXPRESSION.matcher(simple); final StringBuffer ognl = new StringBuffer(simple.length() + 5); while (matcher.find()) { final String expression = toOgnl(matcher); matcher.appendReplacement(ognl, "\\$\\{" + expression + "\\}"); } matcher.appendTail(ognl); return ognl.toString(); } JsonSimplePredicate(final String expression, final CamelContext context); }
JsonSimplePredicate implements Predicate { @SuppressWarnings("JdkObsolete") static String convertSimpleToOGNLForMaps(final String simple) { final Matcher matcher = SIMPLE_EXPRESSION.matcher(simple); final StringBuffer ognl = new StringBuffer(simple.length() + 5); while (matcher.find()) { final String expression = toOgnl(matcher); matcher.appendReplacement(ognl, "\\$\\{" + expression + "\\}"); } matcher.appendTail(ognl); return ognl.toString(); } JsonSimplePredicate(final String expression, final CamelContext context); @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) // https://github.com/spotbugs/spotbugs/issues/868 though this code is fishy (TODO) boolean matches(final Exchange exchange); }
JsonSimplePredicate implements Predicate { @SuppressWarnings("JdkObsolete") static String convertSimpleToOGNLForMaps(final String simple) { final Matcher matcher = SIMPLE_EXPRESSION.matcher(simple); final StringBuffer ognl = new StringBuffer(simple.length() + 5); while (matcher.find()) { final String expression = toOgnl(matcher); matcher.appendReplacement(ognl, "\\$\\{" + expression + "\\}"); } matcher.appendTail(ognl); return ognl.toString(); } JsonSimplePredicate(final String expression, final CamelContext context); @Override @SuppressFBWarnings({"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}) // https://github.com/spotbugs/spotbugs/issues/868 though this code is fishy (TODO) boolean matches(final Exchange exchange);  }