Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Widmer2005-03-16 10:48:32 +0000
committerTobias Widmer2005-03-16 10:48:32 +0000
commit5c1e8e0d20abb5adffddf3ad0466024dff3c5bbb (patch)
treebc7a2a82281220f187f2609277deb8951e6ecdc9 /org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java
parentd66b6f75d2b530f5282bd58c97d6beba0144486b (diff)
downloadeclipse.jdt.ui-5c1e8e0d20abb5adffddf3ad0466024dff3c5bbb.tar.gz
eclipse.jdt.ui-5c1e8e0d20abb5adffddf3ad0466024dff3c5bbb.tar.xz
eclipse.jdt.ui-5c1e8e0d20abb5adffddf3ad0466024dff3c5bbb.zip
Removed deprecated compliance level
Optimized processing of affected compilation units
Diffstat (limited to 'org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java')
-rw-r--r--org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java
index d08756da85..077c976de4 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java
@@ -613,7 +613,7 @@ public abstract class SuperTypeRefactoringProcessor extends RefactoringProcessor
* @throws JavaModelException if an error occurs
*/
protected final void solveSuperTypeConstraints(final ICompilationUnit subUnit, final CompilationUnit subNode, final IType type, final ITypeBinding subType, final ITypeBinding superType, final IProgressMonitor monitor, final RefactoringStatus status) throws JavaModelException {
- int level= AST.JLS3;
+ int level= 3;
final SuperTypeConstraintsModel model= new SuperTypeConstraintsModel(fEnvironment, fEnvironment.create(subType), fEnvironment.create(superType));
final SuperTypeConstraintsCreator creator= new SuperTypeConstraintsCreator(model, fInstanceOf);
fSuperType= model.getSuperType();
@@ -630,8 +630,8 @@ public abstract class SuperTypeRefactoringProcessor extends RefactoringProcessor
final Map groups= new HashMap();
for (final Iterator outer= firstPass.keySet().iterator(); outer.hasNext();) {
project= (IJavaProject) outer.next();
- if (level == AST.JLS3 && !JavaCore.VERSION_1_5.equals(project.getOption(JavaCore.COMPILER_COMPLIANCE, true)))
- level= AST.JLS2;
+ if (level == 3 && !JavaCore.VERSION_1_5.equals(project.getOption(JavaCore.COMPILER_COMPLIANCE, true)))
+ level= 2;
collection= (Collection) firstPass.get(project);
if (collection != null) {
for (final Iterator inner= collection.iterator(); inner.hasNext();) {
@@ -640,17 +640,23 @@ public abstract class SuperTypeRefactoringProcessor extends RefactoringProcessor
}
}
}
+ Set units= null;
final Set processed= new HashSet();
processed.add(subUnit);
- for (final Iterator iterator= firstPass.keySet().iterator(); iterator.hasNext();) {
- project= (IJavaProject) iterator.next();
+ for (final Iterator outer= firstPass.keySet().iterator(); outer.hasNext();) {
+ project= (IJavaProject) outer.next();
collection= (Collection) firstPass.get(project);
- if (collection != null && !collection.isEmpty()) {
+ if (collection != null) {
+ units= new HashSet(collection.size());
+ for (final Iterator inner= collection.iterator(); inner.hasNext();) {
+ group= (SearchResultGroup) inner.next();
+ units.add(group.getCompilationUnit());
+ }
parser.setWorkingCopyOwner(fOwner);
parser.setResolveBindings(true);
parser.setCompilerOptions(RefactoringASTParser.getCompilerOptions(project));
parser.setProject(project);
- parser.createASTs((ICompilationUnit[]) groups.keySet().toArray(new ICompilationUnit[groups.keySet().size()]), new String[0], new ASTRequestor() {
+ parser.createASTs((ICompilationUnit[]) units.toArray(new ICompilationUnit[units.size()]), new String[0], new ASTRequestor() {
public final void acceptAST(final ICompilationUnit unit, final CompilationUnit node) {
monitor.subTask(unit.getElementName());
@@ -669,10 +675,10 @@ public abstract class SuperTypeRefactoringProcessor extends RefactoringProcessor
performFirstPass(creator, secondPass, groups, subUnit, subNode);
for (final Iterator iterator= secondPass.keySet().iterator(); iterator.hasNext();) {
project= (IJavaProject) iterator.next();
- if (level == AST.JLS3 && !JavaCore.VERSION_1_5.equals(project.getOption(JavaCore.COMPILER_COMPLIANCE, true)))
- level= AST.JLS2;
+ if (level == 3 && !JavaCore.VERSION_1_5.equals(project.getOption(JavaCore.COMPILER_COMPLIANCE, true)))
+ level= 2;
collection= (Collection) secondPass.get(project);
- if (collection != null && !collection.isEmpty()) {
+ if (collection != null) {
parser.setWorkingCopyOwner(fOwner);
parser.setResolveBindings(true);
parser.setCompilerOptions(RefactoringASTParser.getCompilerOptions(project));

Back to the top