Exemplo n.º 1
0
 private boolean hasExpectedException(TryTree tree) {
   for (CatchTree catchTree : tree.getCatches()) {
     if (catchTree.getParameter().getName().toString().equals("expected")) {
       return true;
     }
   }
   return false;
 }
Exemplo n.º 2
0
 private boolean anyCatchBlockMatches(TryTree tree, VisitorState state, Matcher<Tree> matcher) {
   for (CatchTree catchTree : tree.getCatches()) {
     if (matcher.matches(catchTree.getBlock(), state)) {
       return true;
     }
   }
   return false;
 }
Exemplo n.º 3
0
 private boolean isInapplicableExceptionType(TryTree tree, VisitorState state) {
   for (CatchTree catchTree : tree.getCatches()) {
     if (INAPPLICABLE_EXCEPTION.matches(catchTree.getParameter(), state)) {
       return true;
     }
   }
   return false;
 }