コード例 #1
0
  public RefactoringStatus checkActivationBasics(CompilationUnit rootNode) throws CoreException {
    RefactoringStatus result = new RefactoringStatus();
    fRootNode = rootNode;

    fAnalyzer = new SurroundWithTryCatchAnalyzer(fCUnit, fSelection);
    fRootNode.accept(fAnalyzer);
    result.merge(fAnalyzer.getStatus());
    ITypeBinding[] exceptions = fAnalyzer.getExceptions();
    if (fIsMultiCatch && (exceptions == null || exceptions.length <= 1)) {
      result.merge(
          RefactoringStatus.createWarningStatus(
              RefactoringCoreMessages.SurroundWithTryCatchRefactoring_notMultipleexceptions));
    }
    return result;
  }