]> git.uio.no Git - ifi-stolz-refaktor.git/commitdiff
Prune imports & tidy
authorVolker Stolz <stolz@ifi.uio.no>
Sun, 13 Mar 2016 14:32:56 +0000 (15:32 +0100)
committerVolker Stolz <stolz@ifi.uio.no>
Sun, 13 Mar 2016 19:15:17 +0000 (20:15 +0100)
software/no.uio.ifi.refaktor/src/no/uio/ifi/refaktor/analyze/analyzers/ExtractAndMoveMethodSelectionAnalyzer.java
software/no.uio.ifi.refaktor/src/no/uio/ifi/refaktor/change/executors/RefactoringExecutor.java
software/no.uio.ifi.refaktor/src/no/uio/ifi/refaktor/handlers/SearchBasedExtractLocalVariableWithAssertsHandler.java

index 63e0c10e04a5857bbd2ea77c4fd4207276643e9c..db42d55adba98574256c3e4f85f44d577906480d 100644 (file)
@@ -7,9 +7,6 @@ import no.uio.ifi.refaktor.prefix.Prefix;
 import no.uio.ifi.refaktor.prefix.PrefixSet;
 import no.uio.ifi.refaktor.textselection.CompilationUnitTextSelection;
 
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jdt.core.dom.Modifier;
-
 //TODO: rewrite docs
 /**
  * A property extractor that collects all the expression prefixes within a selection
index 486508d597929e3849bee0b6cc01b65dca9318be..94a231f5b4c609cc8408c21b0b8caced29113acf 100644 (file)
@@ -2,10 +2,7 @@ package no.uio.ifi.refaktor.change.executors;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import no.uio.ifi.refaktor.analyze.candidates.ExtractLocalVariableCandidate;
 import no.uio.ifi.refaktor.analyze.candidates.RefactorCandidate;
-import no.uio.ifi.refaktor.change.changers.ExtractLocalVariableWithAssertsChanger;
 import no.uio.ifi.refaktor.change.changers.RefaktorChanger;
 import no.uio.ifi.refaktor.factories.RefactoringFactory;
 import no.uio.ifi.refaktor.textselection.CompilationUnitTextSelection;
@@ -25,9 +22,9 @@ public class RefactoringExecutor<Candidate extends RefactorCandidate> implements
        /**
         * Text selection containing the expression we want to refactor, and only that
         */
-       private CompilationUnitTextSelection textSelection;
-       private String newName;
-       private RefactoringFactory<Candidate> factory;
+       final private CompilationUnitTextSelection textSelection;
+       final private String newName;
+       final private RefactoringFactory<Candidate> factory;
 
        public RefactoringExecutor(Candidate analysisResult, RefactoringFactory<Candidate> factory) {
                this.factory = factory;
@@ -40,11 +37,7 @@ public class RefactoringExecutor<Candidate extends RefactorCandidate> implements
                //TODO should be generic
                RefaktorChanger changer = factory.getChanger(textSelection, newName);
                changer.checkPreconditions();
-               try {
-                       changer.execute(new NullProgressMonitor());
-               } catch (CoreException e) {
-                       e.printStackTrace();
-               }
+               changer.execute(monitor);
        }
 
 }
index 50c71322b960e1b5a2f28a25f3b69b9def80213d..ba2fe8f17f5804b766272b6173741b519bda7fcd 100644 (file)
@@ -3,26 +3,10 @@ package no.uio.ifi.refaktor.handlers;
 import no.uio.ifi.refaktor.analyze.candidates.ExtractLocalVariableCandidate;
 import no.uio.ifi.refaktor.change.SearchBasedRefactorChanger;
 import no.uio.ifi.refaktor.change.changers.ProjectWideRefactorChanger;
-import no.uio.ifi.refaktor.change.changers.RefaktorChanger;
-import no.uio.ifi.refaktor.change.changers.SearchBasedExtractAndMoveMethodChanger;
-import no.uio.ifi.refaktor.change.exceptions.RefaktorChangerException;
-import no.uio.ifi.refaktor.debugging.RefaktorDebug;
 import no.uio.ifi.refaktor.factories.ExtractLocalVariableFactory;
 import no.uio.ifi.refaktor.forTests.Refactorer;
 
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.internal.core.JavaProject;
-import org.eclipse.jdt.internal.core.PackageFragment;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
 
 import org.eclipse.core.resources.IProject;