Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Overbey2012-06-12 20:31:31 +0000
committerJeffrey Overbey2012-06-12 20:31:31 +0000
commitbf9e479d82e93d26ca0f77535a3de2d093f13db9 (patch)
tree76f62409ab2f9915b2d5fd7df6e550d466165a93
parent4b8649216b0e3160d5e6a8c66d0997a65fba848c (diff)
downloadorg.eclipse.photran-bf9e479d82e93d26ca0f77535a3de2d093f13db9.tar.gz
org.eclipse.photran-bf9e479d82e93d26ca0f77535a3de2d093f13db9.tar.xz
org.eclipse.photran-bf9e479d82e93d26ca0f77535a3de2d093f13db9.zip
Renamed and disabled some new refactorings
-rw-r--r--org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/ConvertIfThenElseToSelectCaseRefactoring.java (renamed from org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/NestedIfThenElseToSelectCaseRefactoring.java)4
-rw-r--r--org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/Messages.java8
-rw-r--r--org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/MoveSubprogramToModuleRefactoring.java3
-rw-r--r--org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/RemoveUnusedCommonBlockVariablesRefactoring.java (renamed from org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/RemoveUnusedCommonBlocksRefactoring.java)10
-rw-r--r--org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/messages.properties8
-rw-r--r--org.eclipse.photran.ui.vpg/plugin.xml14
6 files changed, 24 insertions, 23 deletions
diff --git a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/NestedIfThenElseToSelectCaseRefactoring.java b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/ConvertIfThenElseToSelectCaseRefactoring.java
index 4aaf1304..32aaacb9 100644
--- a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/NestedIfThenElseToSelectCaseRefactoring.java
+++ b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/ConvertIfThenElseToSelectCaseRefactoring.java
@@ -32,7 +32,7 @@ import org.eclipse.photran.internal.core.refactoring.infrastructure.FortranResou
* @author Gustavo Risetti
*/
@SuppressWarnings("nls") // TODO: Externalize strings
-public class NestedIfThenElseToSelectCaseRefactoring extends FortranResourceRefactoring{
+public class ConvertIfThenElseToSelectCaseRefactoring extends FortranResourceRefactoring{
List<ASTIfConstructNode> ifNodes = new LinkedList<ASTIfConstructNode>();
List<ASTIfConstructNode> removeIfNodes = new LinkedList<ASTIfConstructNode>();
@@ -42,7 +42,7 @@ public class NestedIfThenElseToSelectCaseRefactoring extends FortranResourceRefa
@Override
public String getName() {
- return "Nested If-Then-Else To Select Case";
+ return "Convert If-Then-Else To Select Case";
}
@Override
diff --git a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/Messages.java b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/Messages.java
index 916c12cc..ec7132ce 100644
--- a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/Messages.java
+++ b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/Messages.java
@@ -488,13 +488,13 @@ public class Messages extends NLS
public static String RemoveAssignedGoToRefactoring_SelectedFileCannotBeParsed;
- public static String RemoveUnusedCommonBlocksRefactoring_Name;
+ public static String RemoveUnusedCommonBlockVariablesRefactoring_Name;
- public static String RemoveUnusedCommonBlocksRefactoring_SelectedFilesMustBeImplicitNone;
+ public static String RemoveUnusedCommonBlockVariablesRefactoring_SelectedFilesMustBeImplicitNone;
- public static String RemoveUnusedCommonBlocksRefactoring_NoDeclarationFoundFor;
+ public static String RemoveUnusedCommonBlockVariablesRefactoring_NoDeclarationFoundFor;
- public static String RemoveUnusedCommonBlocksRefactoring_MultipleDeclarationsFoundFor;
+ public static String RemoveUnusedCommonBlockVariablesRefactoring_MultipleDeclarationsFoundFor;
public static String VariableCaseRefactoring_Name;
diff --git a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/MoveSubprogramToModuleRefactoring.java b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/MoveSubprogramToModuleRefactoring.java
index 14354807..cde42424 100644
--- a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/MoveSubprogramToModuleRefactoring.java
+++ b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/MoveSubprogramToModuleRefactoring.java
@@ -35,6 +35,7 @@ import org.eclipse.photran.internal.core.parser.ASTVarOrFnRefNode;
import org.eclipse.photran.internal.core.parser.IASTListNode;
import org.eclipse.photran.internal.core.parser.IASTNode;
import org.eclipse.photran.internal.core.parser.IInternalSubprogram;
+import org.eclipse.photran.internal.core.parser.IProgramUnit;
import org.eclipse.photran.internal.core.refactoring.infrastructure.FortranEditorRefactoring;
/**
@@ -65,7 +66,7 @@ public class MoveSubprogramToModuleRefactoring extends FortranEditorRefactoring
protected void doCheckInitialConditions(RefactoringStatus status, IProgressMonitor pm) throws PreconditionFailure {
ensureProjectHasRefactoringEnabled(status);
// Finds the selected node and checks if it is a subroutine or a function.
- IASTNode selectedNode = findEnclosingNode(astOfFileInEditor, selectedRegionInEditor);
+ IASTNode selectedNode = findEnclosingNode(astOfFileInEditor, selectedRegionInEditor, IProgramUnit.class);
if(selectedNode instanceof ASTSubroutineSubprogramNode || selectedNode instanceof ASTFunctionSubprogramNode){
selectedFunctionOrSubroutine = selectedNode;
}else{
diff --git a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/RemoveUnusedCommonBlocksRefactoring.java b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/RemoveUnusedCommonBlockVariablesRefactoring.java
index 9295ce26..e256b730 100644
--- a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/RemoveUnusedCommonBlocksRefactoring.java
+++ b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/RemoveUnusedCommonBlockVariablesRefactoring.java
@@ -33,7 +33,7 @@ import org.eclipse.photran.internal.core.refactoring.infrastructure.FortranResou
* @author Federico Tombazzi
* @author German Aquino
*/
-public class RemoveUnusedCommonBlocksRefactoring extends FortranResourceRefactoring
+public class RemoveUnusedCommonBlockVariablesRefactoring extends FortranResourceRefactoring
{
@Override
protected void doCheckInitialConditions(RefactoringStatus status, IProgressMonitor pm)
@@ -89,7 +89,7 @@ public class RemoveUnusedCommonBlocksRefactoring extends FortranResourceRefactor
@Override
public String getName()
{
- return Messages.RemoveUnusedCommonBlocksRefactoring_Name;
+ return Messages.RemoveUnusedCommonBlockVariablesRefactoring_Name;
}
private void esureAllCommonVariablesAreDeclared(IFile file, IFortranAST ast) throws PreconditionFailure
@@ -109,11 +109,11 @@ public class RemoveUnusedCommonBlocksRefactoring extends FortranResourceRefactor
if (definition.size() == 0)
{
- fail(Messages.bind(Messages.RemoveUnusedCommonBlocksRefactoring_NoDeclarationFoundFor, commonBlockObject.getVariableName()));
+ fail(Messages.bind(Messages.RemoveUnusedCommonBlockVariablesRefactoring_NoDeclarationFoundFor, commonBlockObject.getVariableName()));
}
else if (definition.size() > 1)
{
- fail(Messages.bind(Messages.RemoveUnusedCommonBlocksRefactoring_MultipleDeclarationsFoundFor, commonBlockObject.getVariableName()));
+ fail(Messages.bind(Messages.RemoveUnusedCommonBlockVariablesRefactoring_MultipleDeclarationsFoundFor, commonBlockObject.getVariableName()));
}
}
}
@@ -128,7 +128,7 @@ public class RemoveUnusedCommonBlocksRefactoring extends FortranResourceRefactor
for (ScopingNode scope : ast.getRoot().getAllContainedScopes())
if (!(scope instanceof ASTExecutableProgramNode))
if (!scope.isImplicitNone())
- fail(Messages.bind(Messages.RemoveUnusedCommonBlocksRefactoring_SelectedFilesMustBeImplicitNone, file.getName()));
+ fail(Messages.bind(Messages.RemoveUnusedCommonBlockVariablesRefactoring_SelectedFilesMustBeImplicitNone, file.getName()));
}
private void processCommon(ASTCommonStmtNode node) throws PreconditionFailure
diff --git a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/messages.properties b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/messages.properties
index 05f39d8c..b8100156 100644
--- a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/messages.properties
+++ b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/messages.properties
@@ -236,7 +236,7 @@ FortranEditorRefactoring_CantPerformRefactoringOnReadOnlyFile= Can't perform ref
FortranEditorRefactoring_CantPerformRefactoringOnFileThatDoesNotExist= Can't perform refactoring on a file that does not exist.
VariableCaseRefactoring_Name= Change Variable Case
VariableCaseRefactoring_SelectedFileCannotBeParsed=One of the selected files ({0}) cannot be parsed.
-RemoveUnusedCommonBlocksRefactoring_Name= Remove Unused Common Blocks
-RemoveUnusedCommonBlocksRefactoring_SelectedFilesMustBeImplicitNone=All of the selected files must be IMPLICIT NONE. Please use the Introduce Implict None refactoring first to introduce IMPLICIT NONE statements in the file {0}.
-RemoveUnusedCommonBlocksRefactoring_NoDeclarationFoundFor=No declaration was found for {0}.
-RemoveUnusedCommonBlocksRefactoring_MultipleDeclarationsFoundFor=Multiple declarations were found for {0}. \ No newline at end of file
+RemoveUnusedCommonBlockVariablesRefactoring_Name= Remove Unused Common Block Variables
+RemoveUnusedCommonBlockVariablesRefactoring_SelectedFilesMustBeImplicitNone=All of the selected files must be IMPLICIT NONE. Please use the Introduce Implict None refactoring first to introduce IMPLICIT NONE statements in the file {0}.
+RemoveUnusedCommonBlockVariablesRefactoring_NoDeclarationFoundFor=No declaration was found for {0}.
+RemoveUnusedCommonBlockVariablesRefactoring_MultipleDeclarationsFoundFor=Multiple declarations were found for {0}. \ No newline at end of file
diff --git a/org.eclipse.photran.ui.vpg/plugin.xml b/org.eclipse.photran.ui.vpg/plugin.xml
index 9d593d80..9a1d3911 100644
--- a/org.eclipse.photran.ui.vpg/plugin.xml
+++ b/org.eclipse.photran.ui.vpg/plugin.xml
@@ -36,9 +36,9 @@
<editorRefactoring
command="org.eclipse.photran.ui.ExtractSubprogramToModuleRefactoringCommand"
/>
- <editorRefactoring
+ <!--editorRefactoring Temporarily disabled - see Bug 382437
command="org.eclipse.photran.ui.MoveSubprogramToModuleRefactoringCommand"
- />
+ /-->
<resourceRefactoring
class="org.eclipse.photran.internal.core.refactoring.IntroduceCallTreeRefactoring"
/>
@@ -72,9 +72,9 @@
<editorRefactoring
class="org.eclipse.photran.internal.core.refactoring.MoveSavedToCommonBlockRefactoring"
/>
- <resourceRefactoring
- class="org.eclipse.photran.internal.core.refactoring.RemoveUnusedCommonBlocksRefactoring"
- />
+ <!--resourceRefactoring Temporarily disabled - see Bug 382436
+ class="org.eclipse.photran.internal.core.refactoring.RemoveUnusedCommonBlockVariablesRefactoring"
+ /-->
<!--editorRefactoring
class="org.eclipse.photran.internal.core.refactoring.MoveCommonToModuleRefactoring"
/-->
@@ -164,10 +164,10 @@
command="org.eclipse.photran.ui.IfConstructStatementConversionRefactoringCommand"
/>
<resourceRefactoring
- class="org.eclipse.photran.internal.core.refactoring.NestedIfThenElseToSelectCaseRefactoring"
+ class="org.eclipse.photran.internal.core.refactoring.DataToParameterRefactoring"
/>
<resourceRefactoring
- class="org.eclipse.photran.internal.core.refactoring.DataToParameterRefactoring"
+ class="org.eclipse.photran.internal.core.refactoring.ConvertIfThenElseToSelectCaseRefactoring"
/>
<resourceRefactoring
class="org.eclipse.photran.internal.core.refactoring.IntroImplicitNoneRefactoring"

Back to the top