@Test public void fastMatches() { assert (TokenUtils.fastMatches("hi|yo", "hi")); assert (TokenUtils.fastMatches("hi|yo", "yo")); assert (TokenUtils.fastMatches("[a-z]*", "hi")); assert (TokenUtils.fastMatches("hey", "hey")); assert (TokenUtils.fastMatches("record|note|popup|namedPopup|td", "record")); }
public static boolean fastMatches(String regex, String name) { if (name == null || regex == null) return false; Integer pair = Integer.valueOf(name.hashCode() ^ ((regex.hashCode() ^ 0xf0f0f0f) >>> 32)); if (cached_matches == null) cached_matches = new HashSet<Integer>(8000); if (cached_failures == null) cached_failures = new HashSet<Integer>(40000); if (cached_failures.contains(pair)) return false; if (cached_matches.contains(pair)) return true; boolean result = fastMatchesNonCached(regex, name); if (result) cached_matches.add(pair); else cached_failures.add(pair); return result; }
TokenUtils { public static boolean fastMatches(String regex, String name) { if (name == null || regex == null) return false; Integer pair = Integer.valueOf(name.hashCode() ^ ((regex.hashCode() ^ 0xf0f0f0f) >>> 32)); if (cached_matches == null) cached_matches = new HashSet<Integer>(8000); if (cached_failures == null) cached_failures = new HashSet<Integer>(40000); if (cached_failures.contains(pair)) return false; if (cached_matches.contains(pair)) return true; boolean result = fastMatchesNonCached(regex, name); if (result) cached_matches.add(pair); else cached_failures.add(pair); return result; } }
TokenUtils { public static boolean fastMatches(String regex, String name) { if (name == null || regex == null) return false; Integer pair = Integer.valueOf(name.hashCode() ^ ((regex.hashCode() ^ 0xf0f0f0f) >>> 32)); if (cached_matches == null) cached_matches = new HashSet<Integer>(8000); if (cached_failures == null) cached_failures = new HashSet<Integer>(40000); if (cached_failures.contains(pair)) return false; if (cached_matches.contains(pair)) return true; boolean result = fastMatchesNonCached(regex, name); if (result) cached_matches.add(pair); else cached_failures.add(pair); return result; }  }
TokenUtils { public static boolean fastMatches(String regex, String name) { if (name == null || regex == null) return false; Integer pair = Integer.valueOf(name.hashCode() ^ ((regex.hashCode() ^ 0xf0f0f0f) >>> 32)); if (cached_matches == null) cached_matches = new HashSet<Integer>(8000); if (cached_failures == null) cached_failures = new HashSet<Integer>(40000); if (cached_failures.contains(pair)) return false; if (cached_matches.contains(pair)) return true; boolean result = fastMatchesNonCached(regex, name); if (result) cached_matches.add(pair); else cached_failures.add(pair); return result; }  static boolean isPlaintext(String s); static boolean isWhitespace(String s); static boolean fastMatches(String regex, String name); static boolean fastMatchesNonCached(String regex, String name); static boolean matchesCI(String regex, String s); static Pattern getPatternCachedCI(String regex); static String attributeDecode(String s); static String entityDecodeString(String s); static String attributeEncode(String s); static String entityEncode(String s); static String lightEntityEncode(String s); static String lightEntityEncodeAndConvertFolioBrackets(String s); }
TokenUtils { public static boolean fastMatches(String regex, String name) { if (name == null || regex == null) return false; Integer pair = Integer.valueOf(name.hashCode() ^ ((regex.hashCode() ^ 0xf0f0f0f) >>> 32)); if (cached_matches == null) cached_matches = new HashSet<Integer>(8000); if (cached_failures == null) cached_failures = new HashSet<Integer>(40000); if (cached_failures.contains(pair)) return false; if (cached_matches.contains(pair)) return true; boolean result = fastMatchesNonCached(regex, name); if (result) cached_matches.add(pair); else cached_failures.add(pair); return result; }  static boolean isPlaintext(String s); static boolean isWhitespace(String s); static boolean fastMatches(String regex, String name); static boolean fastMatchesNonCached(String regex, String name); static boolean matchesCI(String regex, String s); static Pattern getPatternCachedCI(String regex); static String attributeDecode(String s); static String entityDecodeString(String s); static String attributeEncode(String s); static String entityEncode(String s); static String lightEntityEncode(String s); static String lightEntityEncodeAndConvertFolioBrackets(String s);  }