public boolean evaluateCondition(EvaluationContextImpl context, LocatableEvent event)
     throws EvaluateException {
   if (CLASS_FILTERS_ENABLED) {
     String className = null;
     final ObjectReference thisObject = (ObjectReference) context.getThisObject();
     if (thisObject != null) {
       className = thisObject.referenceType().name();
     } else {
       final StackFrameProxyImpl frame = context.getFrameProxy();
       if (frame != null) {
         className = frame.location().declaringType().name();
       }
     }
     if (className != null) {
       boolean matches = false;
       for (ClassFilter classFilter : getClassFilters()) {
         if (classFilter.isEnabled() && classFilter.matches(className)) {
           matches = true;
           break;
         }
       }
       if (!matches) {
         return false;
       }
       for (ClassFilter classFilter : getClassExclusionFilters()) {
         if (classFilter.isEnabled() && classFilter.matches(className)) {
           return false;
         }
       }
     }
   }
   return super.evaluateCondition(context, event);
 }
Exemple #2
0
 private static boolean isFiltered(ClassFilter classFilter, String qName) {
   if (!classFilter.isEnabled()) {
     return false;
   }
   try {
     if (classFilter.matches(qName)) {
       return true;
     }
   } catch (PatternSyntaxException e) {
     LOG.debug(e);
   }
   return false;
 }