Renamed and disabled some new refactorings
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
similarity index 98%
rename from org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/NestedIfThenElseToSelectCaseRefactoring.java
rename to org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/ConvertIfThenElseToSelectCaseRefactoring.java
index 4aaf130..32aaacb 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 @@
* @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 @@
@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 916c12c..ec7132c 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 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 1435480..cde4242 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.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 @@
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
similarity index 93%
rename from org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/RemoveUnusedCommonBlocksRefactoring.java
rename to org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/RemoveUnusedCommonBlockVariablesRefactoring.java
index 9295ce2..e256b73 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 @@
* @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 @@
@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 @@
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 @@
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 05f39d8..b810015 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_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 9d593d8..9a1d391 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"