Code example for LoadingCache

Methods: getUnchecked

0
input = new InterruptibleCharSequence(input);
        final Map<String,Matcher> matchers = TL_MATCHER_MAP.get();
        Matcher m = (Matcher)matchers.get(pattern);
        if(m == null) {
            m = PATTERNS.getUnchecked(pattern).matcher(input);
        } else { 
            matchers.put(pattern,null);
            m.reset(input);
        } 
        return m;
    } 
 
    public static void recycleMatcher(Matcher m) {
        // while cached, eliminate reference to potentially-large prior 'input' 
        m.reset(""); 
        final Map<String,Matcher> matchers = TL_MATCHER_MAP.get();
        matchers.put(m.pattern().pattern(),m);
    } 
     
Stop searching for code, let great code find you!  Add Codota to your java IDE