1 11 package org.eclipse.jdt.internal.corext.refactoring.util; 12 13 import org.eclipse.jdt.core.ICompilationUnit; 14 import org.eclipse.jdt.core.JavaModelException; 15 import org.eclipse.jdt.core.dom.ASTNode; 16 import org.eclipse.jdt.core.dom.ArrayInitializer; 17 18 import org.eclipse.jdt.internal.corext.dom.Selection; 19 import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; 20 import org.eclipse.jdt.internal.corext.refactoring.base.JavaStatusContext; 21 import org.eclipse.ltk.core.refactoring.RefactoringStatus; 22 23 public class CodeAnalyzer extends StatementAnalyzer { 24 25 public CodeAnalyzer(ICompilationUnit cunit, Selection selection, boolean traverseSelectedNode) throws JavaModelException { 26 super(cunit, selection, traverseSelectedNode); 27 } 28 29 protected final void checkSelectedNodes() { 30 super.checkSelectedNodes(); 31 RefactoringStatus status= getStatus(); 32 if (status.hasFatalError()) 33 return; 34 ASTNode node= getFirstSelectedNode(); 35 if (node instanceof ArrayInitializer) { 36 status.addFatalError(RefactoringCoreMessages.CodeAnalyzer_array_initializer, JavaStatusContext.create(fCUnit, node)); 37 } 38 } 39 } 40 | Popular Tags |