title: Java - How to throw exception outside an anonymous class
body: <pre><code>try
  {
      if(ruleName.equalsIgnoreCase("RuleName"))
      {
          cu.accept(new ASTVisitor()
          {
              public boolean visit(MethodInvocation e)
              {
                  if(rule.getConditions().verify(e, env, parentKeys, astParser, file, cu)) // throws ParseException
                      matches.add(getLinesPosition(cu, e));
                  return true;
              }
          });
      }
      // ...
  }
  catch(ParseException e)
  {
      throw AnotherException();
  }
  // ...
  </code></pre>
  
  <p>I need to catch thrown exception in the bottom catch, but I cannot overload method via throws construction. How to do with that, please advice? Thanks</p>