summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Orenstein2013-04-29 17:24:58 (EDT)
committerJeffrey Overbey2013-04-29 17:24:58 (EDT)
commit8ee1bc96b1bc119e585c75b672da5f1fa7057066 (patch)
treef83b1034936d57d18ad644d3d740ac6189c2fe4a
parent8001d7c3e486a2b9655daa7ae5d0d73a8c7df5a6 (diff)
downloadorg.eclipse.photran-8ee1bc96b1bc119e585c75b672da5f1fa7057066.zip
org.eclipse.photran-8ee1bc96b1bc119e585c75b672da5f1fa7057066.tar.gz
org.eclipse.photran-8ee1bc96b1bc119e585c75b672da5f1fa7057066.tar.bz2
Bug 400647 - Ensuring Index is up to date takes too long when Previewing
a refactoring a 2nd time
-rw-r--r--org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/infrastructure/FortranEditorRefactoring.java4
-rw-r--r--org.eclipse.rephraserengine.core/src/org/eclipse/rephraserengine/core/vpg/refactoring/VPGRefactoring.java14
2 files changed, 15 insertions, 3 deletions
diff --git a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/infrastructure/FortranEditorRefactoring.java b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/infrastructure/FortranEditorRefactoring.java
index 428828a..b4ae4f0 100644
--- a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/infrastructure/FortranEditorRefactoring.java
+++ b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/infrastructure/FortranEditorRefactoring.java
@@ -7,6 +7,7 @@
*
* Contributors:
* UIUC - Initial API and implementation
+ * Louis Orenstein (Tech-X Corporation) - fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=400647
*******************************************************************************/
package org.eclipse.photran.internal.core.refactoring.infrastructure;
@@ -27,6 +28,7 @@ import org.eclipse.rephraserengine.core.refactorings.IEditorRefactoring;
* This is a base class for all Photran refactorings that apply to a single file
* and possibly require user input/selection
* @author Jeff Overbey, Timofey Yuvashev
+ * @author Louis Orenstein (Tech-X Corporation) - fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=400647
*/
public abstract class FortranEditorRefactoring
extends FortranResourceRefactoring
@@ -112,7 +114,7 @@ public abstract class FortranEditorRefactoring
if (astOfFileInEditor == null)
{
// Re-acquire the AST, and re-analyze the selection
- checkInitialConditions(pm);
+ checkInitialConditions(pm, true);
}
}
}
diff --git a/org.eclipse.rephraserengine.core/src/org/eclipse/rephraserengine/core/vpg/refactoring/VPGRefactoring.java b/org.eclipse.rephraserengine.core/src/org/eclipse/rephraserengine/core/vpg/refactoring/VPGRefactoring.java
index c05e2ba..56b6ec2 100644
--- a/org.eclipse.rephraserengine.core/src/org/eclipse/rephraserengine/core/vpg/refactoring/VPGRefactoring.java
+++ b/org.eclipse.rephraserengine.core/src/org/eclipse/rephraserengine/core/vpg/refactoring/VPGRefactoring.java
@@ -10,6 +10,7 @@ import java.util.Collections;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jface.text.Region;
import org.eclipse.ltk.core.refactoring.Change;
@@ -29,6 +30,7 @@ import org.eclipse.text.edits.ReplaceEdit;
* A refactoring which accesses a VPG.
*
* @author Jeff Overbey
+ * @author Louis Orenstein (Tech-X Corporation) - fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=400647
*
* @param <A> AST type
* @param <T> node/token type (i.e., the type returned by {@link IVPGNode#getASTNode()})
@@ -59,14 +61,22 @@ public abstract class VPGRefactoring<A, T, V extends EclipseVPG<A, T, ? extends
///////////////////////////////////////////////////////////////////////////
@Override
- public final RefactoringStatus checkInitialConditions(IProgressMonitor pm)
+ public final RefactoringStatus checkInitialConditions(IProgressMonitor pm) {
+ return checkInitialConditions(pm, false);
+ }
+
+ public final RefactoringStatus checkInitialConditions(IProgressMonitor pm, boolean maskVPGFromPM)
{
this.vpg = getVPG();
RefactoringStatus status = new RefactoringStatus();
pm.beginTask(Messages.VPGRefactoring_EnsuringIndexIsUpToDate, IProgressMonitor.UNKNOWN);
- vpg.ensureVPGIsUpToDate(pm);
+ if (maskVPGFromPM) {
+ vpg.ensureVPGIsUpToDate(new NullProgressMonitor());
+ } else {
+ vpg.ensureVPGIsUpToDate(pm);
+ }
pm.done();
try