Пример #1
0
 private StackFrame mask(StackFrame stackFrame) {
   for (MaskRule rule : masking) {
     if (stackFrame.getClassName().startsWith(rule.match)) {
       String cn = stackFrame.getClassName();
       String nn = rule.replace + cn.substring(rule.match.length());
       StackFrame ff =
           new StackFrame(
               "",
               nn,
               stackFrame.getMethodName(),
               stackFrame.getSourceFile(),
               stackFrame.getLineNumber());
       return ff;
     }
   }
   return stackFrame;
 }
Пример #2
0
 private boolean match(StackFrame e) {
   Boolean cached = elementCache.get(e);
   if (cached == null) {
     if (elementCache.size() > 4 << 10) {
       elementCache.clear();
     }
     boolean matched = false;
     for (Matcher m : matchers) {
       m.reset(e.toString());
       if (m.lookingAt()) {
         matched = true;
         break;
       }
     }
     elementCache.put(e, matched);
     return matched;
   }
   return cached;
 }