private static boolean soundslike(final String value1, final String value2) { final String soundex1; final String soundex2; if (value1 == null || value2 == null) { return false; } soundex1 = Soundex.soundex(value1); soundex2 = Soundex.soundex(value2); if (soundex1 == null) { return false; } return soundex1.equals(soundex2); }
public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) { String str1 = String.valueOf(soundslike.getReducedValueAccelerated(ctx, thisValue, factory)); String str2 = (String) stmt.getReducedValueAccelerated(ctx, thisValue, factory); return str1 == null ? str2 == null : ( str2 == null ? false : soundex(str1).equals(soundex(str2)) ); }
public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) { String str1 = String.valueOf(soundslike.getReducedValueAccelerated(ctx, thisValue, factory)); String str2 = (String) stmt.getReducedValueAccelerated(ctx, thisValue, factory); return str1 == null ? str2 == null : ( str2 == null ? false : soundex(str1).equals(soundex(str2)) ); }
public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) { try { String i = String.valueOf(soundslike.getReducedValue(ctx, thisValue, factory)); if (i == null) throw new ClassCastException(); String x = (String) stmt.getReducedValue(ctx, thisValue, factory); if (x == null) throw new CompileException("not a string: " + stmt.getName()); return soundex(i).equals(soundex(x)); } catch (ClassCastException e) { throw new CompileException("not a string: " + soundslike.getName()); } }
public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) { try { String i = String.valueOf(soundslike.getReducedValue(ctx, thisValue, factory)); if (i == null) throw new ClassCastException(); String x = (String) stmt.getReducedValue(ctx, thisValue, factory); if (x == null) throw new CompileException("not a string: " + stmt.getName(), stmt.getExpr(), stmt.getStart()); return soundex(i).equals(soundex(x)); } catch (ClassCastException e) { throw new CompileException("not a string: " + soundslike.getName(), soundslike.getExpr(), soundslike.getStart()); } }
public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) { try { String i = String.valueOf(soundslike.getReducedValue(ctx, thisValue, factory)); if (i == null) throw new ClassCastException(); String x = (String) stmt.getReducedValue(ctx, thisValue, factory); if (x == null) throw new CompileException("not a string: " + stmt.getName(), stmt.getExpr(), stmt.getStart()); return soundex(i).equals(soundex(x)); } catch (ClassCastException e) { throw new CompileException("not a string: " + soundslike.getName(), soundslike.getExpr(), soundslike.getStart()); } }