public static SearchResultGroup[] getConstructorReferences(IType type, WorkingCopyOwner owner, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException{ return new ConstructorReferenceFinder(type).getConstructorReferences(pm, owner, IJavaSearchConstants.REFERENCES, status); }
public static SearchResultGroup[] getConstructorReferences(IType type, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException{ return new ConstructorReferenceFinder(type).getConstructorReferences(pm, null, IJavaSearchConstants.REFERENCES, status); }
public static SearchResultGroup[] getConstructorReferences(IType type, WorkingCopyOwner owner, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException{ return new ConstructorReferenceFinder(type).getConstructorReferences(pm, owner, IJavaSearchConstants.REFERENCES, status); }
public static SearchResultGroup[] getConstructorReferences(IType type, WorkingCopyOwner owner, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException{ return new ConstructorReferenceFinder(type).getConstructorReferences(pm, owner, IJavaSearchConstants.REFERENCES, status); }
public static SearchResultGroup[] getConstructorReferences(IType type, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException{ return new ConstructorReferenceFinder(type).getConstructorReferences(pm, null, IJavaSearchConstants.REFERENCES, status); }
public static SearchResultGroup[] getConstructorReferences(IType type, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException{ return new ConstructorReferenceFinder(type).getConstructorReferences(pm, null, IJavaSearchConstants.REFERENCES, status); }
private Map<ICompilationUnit, SearchMatch[]> createConstructorReferencesMapping(IProgressMonitor pm, RefactoringStatus status) throws JavaModelException { SearchResultGroup[] groups= ConstructorReferenceFinder.getConstructorReferences(fType, pm, status); Map<ICompilationUnit, SearchMatch[]> result= new HashMap<>(); for (int i= 0; i < groups.length; i++) { SearchResultGroup group= groups[i]; ICompilationUnit cu= group.getCompilationUnit(); if (cu == null) continue; result.put(cu, group.getSearchResults()); } return result; }
private Map createConstructorReferencesMapping(IProgressMonitor pm, RefactoringStatus status) throws JavaModelException { SearchResultGroup[] groups= ConstructorReferenceFinder.getConstructorReferences(fType, pm, status); Map result= new HashMap(); for (int i= 0; i < groups.length; i++) { SearchResultGroup group= groups[i]; ICompilationUnit cu= group.getCompilationUnit(); if (cu == null) continue; result.put(cu, group.getSearchResults()); } return result; }
private Map<ICompilationUnit, SearchMatch[]> createConstructorReferencesMapping(IProgressMonitor pm, RefactoringStatus status) throws JavaModelException { SearchResultGroup[] groups= ConstructorReferenceFinder.getConstructorReferences(fType, pm, status); Map<ICompilationUnit, SearchMatch[]> result= new HashMap<>(); for (int i= 0; i < groups.length; i++) { SearchResultGroup group= groups[i]; ICompilationUnit cu= group.getCompilationUnit(); if (cu == null) continue; result.put(cu, group.getSearchResults()); } return result; }
public static SearchResultGroup[] getConstructorOccurrences(IMethod constructor, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException{ Assert.isTrue(constructor.isConstructor()); return new ConstructorReferenceFinder(constructor).getConstructorReferences(pm, null, IJavaSearchConstants.ALL_OCCURRENCES, status); }
public static SearchResultGroup[] getConstructorOccurrences(IMethod constructor, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException{ Assert.isTrue(constructor.isConstructor()); return new ConstructorReferenceFinder(constructor).getConstructorReferences(pm, null, IJavaSearchConstants.ALL_OCCURRENCES, status); }
public static SearchResultGroup[] getConstructorOccurrences(IMethod constructor, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException{ Assert.isTrue(constructor.isConstructor()); return new ConstructorReferenceFinder(constructor).getConstructorReferences(pm, null, IJavaSearchConstants.ALL_OCCURRENCES, status); }
protected RefactoringStatus checkConstructorCalls(final IType type, final IProgressMonitor monitor) throws JavaModelException { try { monitor.beginTask(RefactoringCoreMessages.PullUpRefactoring_checking, 2); final RefactoringStatus result= new RefactoringStatus(); final SearchResultGroup[] groups= ConstructorReferenceFinder.getConstructorReferences(type, fOwner, new SubProgressMonitor(monitor, 1), result); final String message= Messages.format(RefactoringCoreMessages.HierarchyRefactoring_gets_instantiated, new Object[] { JavaElementLabels.getTextLabel(type, JavaElementLabels.ALL_FULLY_QUALIFIED)}); ICompilationUnit unit= null; for (int index= 0; index < groups.length; index++) { unit= groups[index].getCompilationUnit(); if (unit != null) { final CompilationUnit cuNode= RefactoringASTParser.parseWithASTProvider(unit, false, new SubProgressMonitor(monitor, 1)); final ASTNode[] references= ASTNodeSearchUtil.getAstNodes(groups[index].getSearchResults(), cuNode); ASTNode node= null; for (int offset= 0; offset < references.length; offset++) { node= references[offset]; if ((node instanceof ClassInstanceCreation) || ConstructorReferenceFinder.isImplicitConstructorReferenceNodeInClassCreations(node)) { final RefactoringStatusContext context= JavaStatusContext.create(unit, node); result.addError(message, context); } } } } return result; } finally { monitor.done(); } }
protected RefactoringStatus checkConstructorCalls(final IType type, final IProgressMonitor monitor) throws JavaModelException { try { monitor.beginTask(RefactoringCoreMessages.PullUpRefactoring_checking, 2); final RefactoringStatus result= new RefactoringStatus(); final SearchResultGroup[] groups= ConstructorReferenceFinder.getConstructorReferences(type, fOwner, new SubProgressMonitor(monitor, 1), result); final String message= Messages.format(RefactoringCoreMessages.HierarchyRefactoring_gets_instantiated, new Object[] { JavaElementLabels.getTextLabel(type, JavaElementLabels.ALL_FULLY_QUALIFIED)}); ICompilationUnit unit= null; for (int index= 0; index < groups.length; index++) { unit= groups[index].getCompilationUnit(); if (unit != null) { final CompilationUnit cuNode= RefactoringASTParser.parseWithASTProvider(unit, false, new SubProgressMonitor(monitor, 1)); final ASTNode[] references= ASTNodeSearchUtil.getAstNodes(groups[index].getSearchResults(), cuNode); ASTNode node= null; for (int offset= 0; offset < references.length; offset++) { node= references[offset]; if ((node instanceof ClassInstanceCreation) || ConstructorReferenceFinder.isImplicitConstructorReferenceNodeInClassCreations(node)) { final RefactoringStatusContext context= JavaStatusContext.create(unit, node); result.addError(message, context); } } } } return result; } finally { monitor.done(); } }
protected RefactoringStatus checkConstructorCalls(final IType type, final IProgressMonitor monitor) throws JavaModelException { try { monitor.beginTask(RefactoringCoreMessages.PullUpRefactoring_checking, 2); final RefactoringStatus result= new RefactoringStatus(); final SearchResultGroup[] groups= ConstructorReferenceFinder.getConstructorReferences(type, fOwner, new SubProgressMonitor(monitor, 1), result); final String message= Messages.format(RefactoringCoreMessages.HierarchyRefactoring_gets_instantiated, new Object[] { JavaElementLabels.getTextLabel(type, JavaElementLabels.ALL_FULLY_QUALIFIED)}); ICompilationUnit unit= null; for (int index= 0; index < groups.length; index++) { unit= groups[index].getCompilationUnit(); if (unit != null) { final CompilationUnit cuNode= RefactoringASTParser.parseWithASTProvider(unit, false, new SubProgressMonitor(monitor, 1)); final ASTNode[] references= ASTNodeSearchUtil.getAstNodes(groups[index].getSearchResults(), cuNode); ASTNode node= null; for (int offset= 0; offset < references.length; offset++) { node= references[offset]; if ((node instanceof ClassInstanceCreation) || ConstructorReferenceFinder.isImplicitConstructorReferenceNodeInClassCreations(node)) { final RefactoringStatusContext context= JavaStatusContext.create(unit, node); result.addError(message, context); } } } } return result; } finally { monitor.done(); } }