diff options
author | Tobias Widmer | 2005-03-09 13:51:49 +0000 |
---|---|---|
committer | Tobias Widmer | 2005-03-09 13:51:49 +0000 |
commit | a2199fb047b33a07761f869ab6fff9aab3a27021 (patch) | |
tree | f608345653ab460f778864f3328da55f726b5ce5 /org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java | |
parent | ab7c07290f96a12b7c25a8b3098c80720ab3c3f5 (diff) | |
download | eclipse.jdt.ui-a2199fb047b33a07761f869ab6fff9aab3a27021.tar.gz eclipse.jdt.ui-a2199fb047b33a07761f869ab6fff9aab3a27021.tar.xz eclipse.jdt.ui-a2199fb047b33a07761f869ab6fff9aab3a27021.zip |
Moved instanceof flag to SuperTypeRefactoringProcessor
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.java | 23 |
1 files changed, 22 insertions, 1 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 dc39b1ab85..6e7e5ca476 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 @@ -101,6 +101,9 @@ public abstract class SuperTypeRefactoringProcessor extends RefactoringProcessor /** The type environment */ protected final TypeEnvironment fEnvironment= new TypeEnvironment(); + /** Should type occurrences on instanceof's also be rewritten? */ + protected boolean fInstanceOf= false; + /** The obsolete casts (element type: <code><ICompilationUnit, Collection<CastVariable2>></code>) */ protected Map fObsoleteCasts= null; @@ -267,6 +270,15 @@ public abstract class SuperTypeRefactoringProcessor extends RefactoringProcessor } /** + * Returns whether type occurrences in instanceof's should be rewritten. + * + * @return <code>true</code> if they are rewritten, <code>false</code> otherwise + */ + public final boolean isInstanceOf() { + return fInstanceOf; + } + + /** * Performs the first pass of processing the affected compilation units. * * @param creator the constraints creator to use @@ -580,6 +592,15 @@ public abstract class SuperTypeRefactoringProcessor extends RefactoringProcessor } /** + * Determines whether type occurrences in instanceof's should be rewritten. + * + * @param rewrite <code>true</code> to rewrite them, <code>false</code> otherwise + */ + public final void setInstanceOf(final boolean rewrite) { + fInstanceOf= rewrite; + } + + /** * Solves the supertype constraints to replace subtype by a supertype. * * @param subUnit the compilation unit of the subtype @@ -595,7 +616,7 @@ public abstract class SuperTypeRefactoringProcessor extends RefactoringProcessor boolean covariance= true; final SuperTypeConstraintsModel model= new SuperTypeConstraintsModel(fEnvironment, fEnvironment.create(subType), fEnvironment.create(superType)); model.setUseCovariance(true); - final SuperTypeConstraintsCreator creator= new SuperTypeConstraintsCreator(model); + final SuperTypeConstraintsCreator creator= new SuperTypeConstraintsCreator(model, fInstanceOf); fSuperType= model.getSuperType(); try { monitor.beginTask("", 3); //$NON-NLS-1$ |