View | Details | Raw Unified | Return to bug 331880 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/photran/internal/core/refactoring/IfConstructStatementConversionRefactoring.java (+235 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 Zeeshan Ansari, Mark Chen, Burim Isai, Waseem Sheikh, Mumtaz Vauhkonen. 
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    Zeeshan Ansari
10
 *    Mark Chen
11
 *    Mumtaz Vauhkonen
12
 *    Burim Isai
13
 *    Waseem Sheikh
14
 *******************************************************************************/
15
package org.eclipse.photran.internal.core.refactoring;
16
17
import java.util.ArrayList;
18
import org.eclipse.core.runtime.CoreException;
19
import org.eclipse.core.runtime.IProgressMonitor;
20
import org.eclipse.core.runtime.OperationCanceledException;
21
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
22
import org.eclipse.photran.internal.core.parser.ASTIfConstructNode;
23
import org.eclipse.photran.internal.core.parser.ASTIfStmtNode;
24
import org.eclipse.photran.internal.core.parser.ASTNode;
25
import org.eclipse.photran.internal.core.refactoring.infrastructure.FortranEditorRefactoring;
26
import org.eclipse.photran.internal.core.reindenter.Reindenter;
27
import org.eclipse.photran.internal.core.reindenter.Reindenter.Strategy;
28
29
/**
30
 * Converts an IF construct to an IF statement and vice versa. User must select the entire IF
31
 * statement or IF construct block, and select the refactoring option in the menu.
32
 * 
33
 * @author Zeeshan Ansari
34
 * @author Mark Chen
35
 * @author Mumtaz Vauhkonrn
36
 * @author Burim Isai
37
 * @author Waseem Sheikh
38
 */
39
public class IfConstructStatementConversionRefactoring extends FortranEditorRefactoring
40
{
41
    private ASTNode selectedNode = null;
42
    private ASTNode ifStmtNode, ifConstructNode;
43
    private boolean shouldAddEmptyElseBlock = false;
44
    private ArrayList<String> commentList = new ArrayList<String>();
45
46
    /**
47
     * Beyond the standard condition checks, this checks to ensure that a valid IF statement or IF
48
     * construct is selected and is refactorable.
49
     * 
50
     * @param ifConstructNode
51
     * @throws PreconditionFailure
52
     */
53
    @Override
54
    protected void doCheckInitialConditions(RefactoringStatus status, IProgressMonitor pm)
55
        throws PreconditionFailure
56
    {
57
        ensureProjectHasRefactoringEnabled(status);
58
59
        if (!fileInEditor.exists())
60
            fail(Messages.FortranEditorRefactoring_CantPerformRefactoringOnFileThatDoesNotExist);
61
62
        if (fileInEditor.isReadOnly())
63
            fail(Messages.FortranEditorRefactoring_CantPerformRefactoringOnReadOnlyFile);
64
65
        ifStmtNode = getNode(this.astOfFileInEditor, this.selectedRegionInEditor,
66
            ASTIfStmtNode.class);
67
        ifConstructNode = getNode(this.astOfFileInEditor, this.selectedRegionInEditor,
68
            ASTIfConstructNode.class);
69
70
        if (ifStmtNode != null)
71
            selectedNode = ifStmtNode;
72
        else if (ifConstructNode != null)
73
        {
74
            checkRefactorableConstruct(ifConstructNode);
75
            selectedNode = ifConstructNode;
76
        }
77
        else
78
            fail(Messages.IfConstructStatementConversionRefactoring_SelectAValidIfStatement);
79
    }
80
81
    /**
82
     * Checks various conditions to see if the user-selected IF construct is refactorable to an IF
83
     * statement. This includes making sure there is only one valid statement line in the construct
84
     * and that the construct is not named.
85
     * 
86
     * @param ifConstructNode
87
     * @throws PreconditionFailure
88
     */
89
    private void checkRefactorableConstruct(ASTNode ifConstructNode) throws PreconditionFailure
90
    {
91
        String constructParser = null;
92
        int validStatements = 0;
93
94
        // Checks for named construct
95
        if (!ifConstructNode.findFirstToken().getText().equals("if")) //$NON-NLS-1$
96
            fail(Messages.IfConstructStatementConversionRefactoring_InvalidNamedConstruct);
97
98
        // Check for multiple statements within construct and stores comment lines
99
        constructParser = this.selectedRegionInEditor.getText();
100
        constructParser = constructParser.substring(constructParser.indexOf("\n") + 1).trim(); //$NON-NLS-1$
101
        
102
        while (constructParser.contains("\n")) 
103
        { 
104
            //$NON-NLS-1$
105
            constructParser = constructParser.substring(constructParser.indexOf("\n") + 1).trim(); //$NON-NLS-1$
106
            if (!constructParser.startsWith("!") && !constructParser.startsWith("end if")) //$NON-NLS-1$ //$NON-NLS-2$
107
                ++validStatements;
108
            
109
            if (constructParser.startsWith("!")) //$NON-NLS-1$
110
                commentList.add(constructParser.substring(0, constructParser.indexOf("\n")).trim()); //$NON-NLS-1$
111
        }
112
        
113
        if (validStatements > 1)
114
            fail(Messages.IfConstructStatementConversionRefactoring_TooManyStatements);
115
    }
116
117
    public boolean isStmtNode()
118
    {
119
        return ifStmtNode != null;
120
    }
121
122
    public void AddEmptyElseBlock()
123
    {
124
        shouldAddEmptyElseBlock = true;
125
    }
126
127
    @Override
128
    protected void doCheckFinalConditions(RefactoringStatus status, IProgressMonitor pm)
129
        throws PreconditionFailure
130
    {
131
        // No final preconditions
132
    }
133
134
    /**
135
     * Determines whether an IF statement is selected or an IF construct is selected (done in
136
     * pre-condition). Depending on which, it will execute the appropriate refactoring (statement to
137
     * construct or vise versa). It will then reindent the entire section of refactored code based
138
     * on the formating context of the code around it.
139
     * 
140
     * @param pm
141
     * @throws CoreException, OperationCanceledException
142
     */
143
    @Override
144
    protected void doCreateChange(IProgressMonitor pm) throws CoreException,
145
        OperationCanceledException
146
    {
147
        if (selectedNode instanceof ASTIfStmtNode)
148
        {
149
            RefactorIfStmt();
150
        }
151
        else if (selectedNode instanceof ASTIfConstructNode)
152
        {
153
            RefactorIfConstruct();
154
        }
155
        else
156
            throw new IllegalStateException();
157
158
        Reindenter.reindent(selectedNode, this.astOfFileInEditor, Strategy.REINDENT_EACH_LINE);
159
        this.addChangeFromModifiedAST(this.fileInEditor, pm);
160
        vpg.releaseAST(this.fileInEditor);
161
162
    }
163
164
    protected void RefactorIfStmt()
165
    {
166
        ASTIfStmtNode ifStmtNode = (ASTIfStmtNode)selectedNode;
167
168
        ifStmtNode.replaceWith(createNewIfConstruct(ifStmtNode));
169
    }
170
171
    protected void RefactorIfConstruct()
172
    {
173
        ASTIfConstructNode ifConstructNode = (ASTIfConstructNode)selectedNode;
174
175
        ifConstructNode.replaceWith(createNewIfStmt(ifConstructNode));
176
    }
177
178
    /**
179
     * Creates a new IF statement from the selected IF construct
180
     * 
181
     * @param ifConstructNode
182
     */
183
    private ASTIfStmtNode createNewIfStmt(ASTIfConstructNode ifConstructNode)
184
    {
185
        StringBuilder sb = new StringBuilder();
186
187
        sb.append("    if ("); //$NON-NLS-1$
188
        sb.append(ifConstructNode.getIfThenStmt().getGuardingExpression().toString().trim());
189
        sb.append(") "); //$NON-NLS-1$
190
        sb.append(ifConstructNode.getConditionalBody().toString().trim());
191
        
192
        for (String comment : commentList)
193
            sb.append(" " + comment); //$NON-NLS-1$
194
        sb.append("\n"); //$NON-NLS-1$
195
196
        ASTIfStmtNode newIfStmtNode = (ASTIfStmtNode)parseLiteralStatement(sb.toString());
197
198
        return newIfStmtNode;
199
    }
200
201
    /**
202
     * Creates a new IF construct from the selected IF statement, with an option to add an empty
203
     * ELSE construct
204
     * 
205
     * @param ifConstructNode
206
     */
207
    private ASTIfConstructNode createNewIfConstruct(ASTIfStmtNode ifStmtNode)
208
    {
209
        StringBuilder sb = new StringBuilder();
210
211
        sb.append("    if ("); //$NON-NLS-1$
212
        sb.append(ifStmtNode.getGuardingExpression().toString());
213
        sb.append(") then"); //$NON-NLS-1$
214
        sb.append("\n        "); //$NON-NLS-1$
215
        sb.append(ifStmtNode.getActionStmt().toString().trim());
216
        sb.append("\n        !can add more statements here"); //$NON-NLS-1$
217
        if (shouldAddEmptyElseBlock)
218
        {
219
            sb.append("\n    else"); //$NON-NLS-1$
220
            sb.append("\n        !can add more statements here"); //$NON-NLS-1$
221
        }
222
        sb.append("\n    end if"); //$NON-NLS-1$
223
224
        ASTIfConstructNode newIfConstructNode = (ASTIfConstructNode)parseLiteralStatement(sb
225
            .toString());
226
227
        return newIfConstructNode;
228
    }
229
230
    @Override
231
    public String getName()
232
    {
233
        return Messages.IfConstructStatementConversionRefactoring_Name;
234
    }
235
}
(-)src/org/eclipse/photran/internal/core/refactoring/Messages.java (+12 lines)
Lines 267-272 Link Here
267
    public static String ExtractLocalVariableRefactoring_VarsOnlyExtractedFromStmtsIn;
267
    public static String ExtractLocalVariableRefactoring_VarsOnlyExtractedFromStmtsIn;
268
268
269
    public static String InterchangeLoopsRefactoring_Name;
269
    public static String InterchangeLoopsRefactoring_Name;
270
    
271
    public static String IfConstructStatementConversionRefactoring_Name;
272
    
273
    public static String IfConstructStatementConversionRefactoring_SelectAValidIfStatement;
274
275
    public static String IfConstructStatementConversionRefactoring_InvalidNamedConstruct;
276
    
277
    public static String IfConstructStatementConversionRefactoring_TooManyStatements;
278
    
279
    public static String FortranEditorRefactoring_CantPerformRefactoringOnReadOnlyFile;
280
    
281
    public static String FortranEditorRefactoring_CantPerformRefactoringOnFileThatDoesNotExist;
270
282
271
    public static String InterchangeLoopsRefactoring_SelectTwoPerfNextedLoops;
283
    public static String InterchangeLoopsRefactoring_SelectTwoPerfNextedLoops;
272
284
(-)src/org/eclipse/photran/internal/core/refactoring/messages.properties (+6 lines)
Lines 200-202 Link Here
200
SafeDeleteInternalSubprogramRefactoring_SubroutineMustHaveOnlyInternalReferences=Subroutine must only have internal references.
200
SafeDeleteInternalSubprogramRefactoring_SubroutineMustHaveOnlyInternalReferences=Subroutine must only have internal references.
201
StandardizeStatementsRefactoring_Name=Standardize Statements
201
StandardizeStatementsRefactoring_Name=Standardize Statements
202
StandardizeStatementsRefactoring_SelectedFileCannotBeParsed=One of the selected files ({0}) cannot be parsed.
202
StandardizeStatementsRefactoring_SelectedFileCannotBeParsed=One of the selected files ({0}) cannot be parsed.
203
IfConstructStatementConversionRefactoring_Name= Convert Between IF Statement and IF Construct
204
IfConstructStatementConversionRefactoring_SelectAValidIfStatement= Please select a valid IF statement or construct.
205
IfConstructStatementConversionRefactoring_InvalidNamedConstruct= Cannot refactor a named IF construct. Please select an unnamed IF construct.
206
IfConstructStatementConversionRefactoring_TooManyStatements= Selected IF construct contains too many statements and cannot be refactored to an IF statement.
207
FortranEditorRefactoring_CantPerformRefactoringOnReadOnlyFile= Can't perform refactoring on a read-only file.
208
FortranEditorRefactoring_CantPerformRefactoringOnFileThatDoesNotExist= Can't perform refactoring on a file that does not exist.
(-)src/org/eclipse/photran/internal/core/refactoring/infrastructure/FortranResourceRefactoring.java (+34 lines)
Lines 43-48 Link Here
43
import org.eclipse.photran.internal.core.parser.ASTCallStmtNode;
43
import org.eclipse.photran.internal.core.parser.ASTCallStmtNode;
44
import org.eclipse.photran.internal.core.parser.ASTContainsStmtNode;
44
import org.eclipse.photran.internal.core.parser.ASTContainsStmtNode;
45
import org.eclipse.photran.internal.core.parser.ASTFunctionSubprogramNode;
45
import org.eclipse.photran.internal.core.parser.ASTFunctionSubprogramNode;
46
import org.eclipse.photran.internal.core.parser.ASTIfConstructNode;
47
import org.eclipse.photran.internal.core.parser.ASTIfStmtNode;
46
import org.eclipse.photran.internal.core.parser.ASTImplicitStmtNode;
48
import org.eclipse.photran.internal.core.parser.ASTImplicitStmtNode;
47
import org.eclipse.photran.internal.core.parser.ASTMainProgramNode;
49
import org.eclipse.photran.internal.core.parser.ASTMainProgramNode;
48
import org.eclipse.photran.internal.core.parser.ASTModuleNode;
50
import org.eclipse.photran.internal.core.parser.ASTModuleNode;
Lines 281-286 Link Here
281
        LoopReplacer.replaceAllLoopsIn(prog);
283
        LoopReplacer.replaceAllLoopsIn(prog);
282
        return (ASTProperLoopConstructNode)prog.getBody().get(0);
284
        return (ASTProperLoopConstructNode)prog.getBody().get(0);
283
    }
285
    }
286
    
287
    /**
288
     * Parses the given If-Construct as a {@link ASTIfConstructNode}.
289
     * <p>
290
     * @see parseLiteralStatement
291
     * @param string
292
     * @author Zeeshan Ansari
293
     * @author Mark Chen
294
     * @author Mumtaz Vauhkonen
295
     */
296
//    protected static ASTIfConstructNode parseLiteralIfConstructNode(String string)
297
//    {
298
//        string = "program p\n" + string + "\nend program"; //$NON-NLS-1$ //$NON-NLS-2$
299
//        ASTMainProgramNode prog = (ASTMainProgramNode)parseLiteralProgramUnit(string);
300
//        return (ASTIfConstructNode)prog.getBody().get(0);
301
//    }
302
    
303
    /**
304
     * Parses the given If-Statement as a {@link ASTIfStmtNode}.
305
     * <p>
306
     * @see parseLiteralStatement
307
     * @param string
308
     * @author Mark Chen
309
     * @author Burim Isai
310
     * @author Mumtaz Vauhkonen
311
     */
312
//    protected static ASTIfStmtNode parseLiteralIfStmtNode(String string)
313
//    {
314
//        string = "program p\n" + string + "\nend program"; //$NON-NLS-1$ //$NON-NLS-2$
315
//        ASTMainProgramNode prog = (ASTMainProgramNode)parseLiteralProgramUnit(string);
316
//        return (ASTIfStmtNode)prog.getBody().get(0);
317
//    }
284
318
285
    /** @return a CONTAINS statement */
319
    /** @return a CONTAINS statement */
286
    protected static ASTContainsStmtNode createContainsStmt()
320
    protected static ASTContainsStmtNode createContainsStmt()
(-)refactoring-test-code/if-construct-statement-conversion/test01-fail-notAValidIfStatement/convertIfStatementToIfConstruct_InvalidIfStatement.f90 (+8 lines)
Added Link Here
1
program notAValidIf
2
    implicit none
3
    print *, "This is a test"
4
    print *, 3+4*5+6 !<<<<< 4, 5, 4, 22, fail-initial
5
    
6
    !!! This test shows the refactoring failing the initial precondition because the selected text is a print statement, and
7
    !!! not a valid IF statement or construct
8
end program
(-)refactoring-test-code/if-construct-statement-conversion/test02-convert_ifConstructToIfStmt/convert_ifConstruct.f90 (+10 lines)
Added Link Here
1
program convert_ifConstructToIfStmt
2
    implicit none
3
    print *, "This is a test"
4
    if(.true.) then
5
      a = 1
6
    end if
7
    !<<<<< 4, 5, 6, 11, pass
8
    
9
    !!! This test shows the refactoring successfully refactoring a simple valid IF construct into a valid IF statement.
10
end program
(-)refactoring-test-code/if-construct-statement-conversion/test02-convert_ifConstructToIfStmt/convert_ifConstruct.f90.result (+8 lines)
Added Link Here
1
program convert_ifConstructToIfStmt
2
    implicit none
3
    print *, "This is a test"
4
    if (.true.) a = 1
5
    !<<<<< 4, 5, 6, 11, pass
6
    
7
    !!! This test shows the refactoring successfully refactoring a simple valid IF construct into a valid IF statement.
8
end program
(-)refactoring-test-code/if-construct-statement-conversion/test03-fail-ifNamedVariable/convert_ifStatement_ifNamedVariable.f90 (+9 lines)
Added Link Here
1
program convert_ifStatementToIfConstruct_incorrectSelection
2
    implicit none
3
    print *, "This is a test"
4
    integer :: if
5
    if = 5 !<<<<< 5, 5, 5, 11, fail-initial
6
    
7
    !!! This test shows the refactoring failing the initial precondition because the selected text is not a valid
8
    !!! IF statement or construct, even though the first token is "if"
9
end program
(-)refactoring-test-code/if-construct-statement-conversion/test04-complexboolean/ifStmtComplexBoolean_1.f90 (+9 lines)
Added Link Here
1
program ifStmtComplexBoolean_1
2
    implicit none
3
    integer :: x, y, a
4
    print *, "This is a test"
5
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) a = 1 !<<<<< 5, 5, 5, 53, pass
6
    
7
    !!! This tests shows the refactoring successfully converting a valid IF statement to a valid IF construct, even
8
    !!! with a complex boolean guardian expression.
9
end program
(-)refactoring-test-code/if-construct-statement-conversion/test04-complexboolean/ifStmtComplexBoolean_1.f90.result (+12 lines)
Added Link Here
1
program ifStmtComplexBoolean_1
2
    implicit none
3
    integer :: x, y, a
4
    print *, "This is a test"
5
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) then
6
        a = 1 !<<<<< 5, 5, 5, 53, pass
7
        !can add more statements here
8
    end if
9
    
10
    !!! This tests shows the refactoring successfully converting a valid IF statement to a valid IF construct, even
11
    !!! with a complex boolean guardian expression.
12
end program
(-)refactoring-test-code/if-construct-statement-conversion/test05-complexboolean/ifStmtComplexBoolean_2.f90 (+9 lines)
Added Link Here
1
program ifStmtComplexBoolean_2
2
    implicit none
3
    integer :: x, y, z, a
4
    print *, "This is a test"
5
    if ((x*2+3)/z .GE. y) a = 1 !<<<<< 5, 5, 5, 32, pass
6
    
7
    !!! This tests shows the refactoring successfully converting a valid IF statement to a valid IF construct, even
8
    !!! with a complex boolean guardian expression.
9
end program
(-)refactoring-test-code/if-construct-statement-conversion/test05-complexboolean/ifStmtComplexBoolean_2.f90.result (+12 lines)
Added Link Here
1
program ifStmtComplexBoolean_2
2
    implicit none
3
    integer :: x, y, z, a
4
    print *, "This is a test"
5
    if ((x*2+3)/z .GE. y) then
6
        a = 1 !<<<<< 5, 5, 5, 32, pass
7
        !can add more statements here
8
    end if
9
    
10
    !!! This tests shows the refactoring successfully converting a valid IF statement to a valid IF construct, even
11
    !!! with a complex boolean guardian expression.
12
end program
(-)refactoring-test-code/if-construct-statement-conversion/test06-convertifStmt/convertIfStatementToIfConstruct.f90 (+10 lines)
Added Link Here
1
program convertIfStatementToIfConstruct
2
    implicit none
3
    integer :: var1, var2
4
    print *, "This is an if construct example."
5
    var1 = 4
6
    var2 = 5
7
    if (var1 < var2) print *, var1, " is less than ", var2, " using if-stmt." !<<<<< 7, 5, 7, 78, pass
8
    
9
    !!! This tests shows the refactoring successfully converting a valid IF statement to a valid IF construct.
10
end program
(-)refactoring-test-code/if-construct-statement-conversion/test06-convertifStmt/convertIfStatementToIfConstruct.f90.result (+13 lines)
Added Link Here
1
program convertIfStatementToIfConstruct
2
    implicit none
3
    integer :: var1, var2
4
    print *, "This is an if construct example."
5
    var1 = 4
6
    var2 = 5
7
    if (var1 < var2) then
8
        print *, var1, " is less than ", var2, " using if-stmt." !<<<<< 7, 5, 7, 78, pass
9
        !can add more statements here
10
    end if
11
    
12
    !!! This tests shows the refactoring successfully converting a valid IF statement to a valid IF construct.
13
end program
(-)refactoring-test-code/if-construct-statement-conversion/test07-ifConstructToStmtBasic/ifConstructToStmtBasic_1.f90 (+8 lines)
Added Link Here
1
program ifConstructToStmtBasic_1
2
    if (.true.) then
3
	    a = 2
4
    end if
5
    !<<<<< 2, 5, 4, 11, pass
6
    
7
    !!! This tests shows the refactoring successfully converting a valid IF construct to a valid IF statement.
8
end program
(-)refactoring-test-code/if-construct-statement-conversion/test07-ifConstructToStmtBasic/ifConstructToStmtBasic_1.f90.result (+6 lines)
Added Link Here
1
program ifConstructToStmtBasic_1
2
    if (.true.) a = 2
3
    !<<<<< 2, 5, 4, 11, pass
4
    
5
    !!! This tests shows the refactoring successfully converting a valid IF construct to a valid IF statement.
6
end program
(-)refactoring-test-code/if-construct-statement-conversion/test08-nonIfToken/nonIfToken_fail.f90 (+14 lines)
Added Link Here
1
program nonIfToken_1
2
	integer :: i, j
3
	integer :: k, z
4
	do j = 1, 10 !<<<<< 4, 5, 10, 11, fail-initial
5
		print *, i                   
6
   		if (i .gt. j) then
7
     		print *, i * 10
8
   		end if                      
9
   		print *, i
10
	end do
11
    
12
    !!! This tests shows the refactoring failing the initial precondition because the selected text is not a valid
13
    !!! IF statement or construct, since the first token is "do"
14
end program
(-)refactoring-test-code/if-construct-statement-conversion/test09-ifConstructComplexBoolean/ifConstructComplexBoolean_1.f90 (+12 lines)
Added Link Here
1
program ifConstructComplexBoolean_1
2
    implicit none
3
    integer :: x, y, a
4
    print *, "This is a test"
5
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) then
6
        a = 1
7
    end if
8
    !<<<<< 5, 5, 7, 11, pass
9
    
10
    !!! This tests shows the refactoring successfully converting a valid IF construct to a valid IF statement, even
11
    !!! with a complex boolean guardian expression.
12
end program
(-)refactoring-test-code/if-construct-statement-conversion/test09-ifConstructComplexBoolean/ifConstructComplexBoolean_1.f90.result (+10 lines)
Added Link Here
1
program ifConstructComplexBoolean_1
2
    implicit none
3
    integer :: x, y, a
4
    print *, "This is a test"
5
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) a = 1
6
    !<<<<< 5, 5, 7, 11, pass
7
    
8
    !!! This tests shows the refactoring successfully converting a valid IF construct to a valid IF statement, even
9
    !!! with a complex boolean guardian expression.
10
end program
(-)refactoring-test-code/if-construct-statement-conversion/test10-namedIfConstruct/namedIfConstruct_fail.f90 (+9 lines)
Added Link Here
1
program namedIfConstruct_fail
2
    myifconstruct: if (.true.) then
3
        a = 3
4
    end if myifconstruct
5
    print *, "This test tries to convert a named if construct to if statement" !<<<<< 2, 5, 4, 11, fail-initial
6
    
7
    !!! This test shows the refactoring failing the initial precondition because while the selected text is a
8
    !!! valid IF construct, it is a named IF construct, and therefore is not refactorable to an IF statement
9
end program
(-)refactoring-test-code/if-construct-statement-conversion/test11-multiLineIfConstructToIfStatement-failure/multiLineIfConstructToIfStmt.f90 (+12 lines)
Added Link Here
1
program convert_multiLineIfConstructToIfStatement
2
    if (.true.) then
3
        a = 2
4
        print *, 'hello'
5
        print *, 'world'
6
    end if
7
    print *, 3+4*5+6 !<<<<< 2, 5, 6, 11, fail-initial
8
    
9
    !!! This test shows the refactoring failing the initial precondition because while the selected text is a valid
10
    !!! IF construct, the body contains multiple lines of valid statements, and therefore, is not refactorable to
11
    !!! an IF statement.
12
end program
(-)refactoring-test-code/if-construct-statement-conversion/test12-generalIfConstToIfStmt-failure/generalIfConstToIfStmt.f90 (+13 lines)
Added Link Here
1
program convert_blockIfConstructToIfStatement
2
    if (x .LT. 1) then
3
        a = 2
4
    else if (x .GE. 1) then
5
        a = 4
6
    else
7
        a = 6
8
    end if !<<<<< 2, 5, 8, 11, fail-initial
9
    
10
    !!! This test shows the refactoring failing the initial precondition because while the selected text is a valid
11
    !!! IF construct, the body contains multiple lines of valid statements, and therefore, is not refactorable to
12
    !!! an IF statement.
13
end program
(-)refactoring-test-code/if-construct-statement-conversion/test13-fail-multipleIfSelections1/multipleIfSelections1.f90 (+10 lines)
Added Link Here
1
program multipleIfSelections1
2
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) a = 1
3
    if (.true.) then
4
	    a = 2
5
    end if 
6
    !<<<<< 2, 5, 5, 11, fail-initial
7
    
8
    !!! This test shows the refactoring failing the initial precondition because multiple IF statements and IF
9
    !!! constructs are selected, while the refactoring can only handle one at a time.
10
end program
(-)refactoring-test-code/if-construct-statement-conversion/test14-fail-multipleIfSelections2/multipleIfSelections2.f90 (+10 lines)
Added Link Here
1
program multipleIfSelections2
2
    if (.true.) then
3
	    a = 2
4
    end if 
5
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) a = 1
6
    !<<<<< 2, 5, 5, 53, fail-initial
7
    
8
    !!! This test shows the refactoring failing the initial precondition because multiple IF statements and IF
9
    !!! constructs are selected, while the refactoring can only handle one at a time.
10
end program
(-)refactoring-test-code/if-construct-statement-conversion/test15-commentInIfConstructToIfStmt/commentIfConstructToIfStmt.f90 (+11 lines)
Added Link Here
1
program commentIfConstructToIfStmt
2
    implicit none
3
    integer :: x, y, a
4
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) then
5
        a = 1 !This is an if statement
6
    end if
7
    print *, "This is a test" !<<<<< 4, 5, 6, 11, pass
8
    
9
    !!! This test shows the refactoring successfully converting a valid IF construct to a valid IF statement, while
10
    !!! also preserving the included comment.
11
end program
(-)refactoring-test-code/if-construct-statement-conversion/test15-commentInIfConstructToIfStmt/commentIfConstructToIfStmt.f90.result (+9 lines)
Added Link Here
1
program commentIfConstructToIfStmt
2
    implicit none
3
    integer :: x, y, a
4
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) a = 1 !This is an if statement
5
    print *, "This is a test" !<<<<< 4, 5, 6, 11, pass
6
    
7
    !!! This test shows the refactoring successfully converting a valid IF construct to a valid IF statement, while
8
    !!! also preserving the included comment.
9
end program
(-)refactoring-test-code/if-construct-statement-conversion/test16-commentInIfStmtToIfConstruct/commentInIfStmtToIfConst.f90 (+9 lines)
Added Link Here
1
program commentIfStmtToIfConstruct
2
    implicit none
3
    integer :: x, y, a
4
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) a = 1 !This is an if statement
5
    print *, "This is a test" !<<<<< 4, 5, 4, 78, pass
6
    
7
    !!! This test shows the refactoring successfully converting a valid IF statement to a valid IF construct, while
8
    !!! also preserving the included comment.
9
end program
(-)refactoring-test-code/if-construct-statement-conversion/test16-commentInIfStmtToIfConstruct/commentInIfStmtToIfConst.f90.result (+12 lines)
Added Link Here
1
program commentIfStmtToIfConstruct
2
    implicit none
3
    integer :: x, y, a
4
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) then
5
        a = 1 !This is an if statement
6
        !can add more statements here
7
    end if
8
    print *, "This is a test" !<<<<< 4, 5, 4, 78, pass
9
    
10
    !!! This test shows the refactoring successfully converting a valid IF statement to a valid IF construct, while
11
    !!! also preserving the included comment.
12
end program
(-)refactoring-test-code/if-construct-statement-conversion/test17-reindentIfConstruct/reindentIfConstruct.f90 (+9 lines)
Added Link Here
1
program reindentIfConstruct
2
                                     if (1 .GE. 1) then
3
                                     	a = 1
4
                                     end if
5
    !<<<<< 2, 38, 4, 44, pass
6
    
7
    !!! This test shows the refactoring successfully converting a valid IF construct to a valid IF statement, and 
8
    !!! then reindenting the section of code to the correct location, based on code context.
9
end program
(-)refactoring-test-code/if-construct-statement-conversion/test17-reindentIfConstruct/reindentIfConstruct.f90.result (+7 lines)
Added Link Here
1
program reindentIfConstruct
2
    if (1 .GE. 1) a = 1
3
    !<<<<< 2, 38, 4, 44, pass
4
    
5
    !!! This test shows the refactoring successfully converting a valid IF construct to a valid IF statement, and 
6
    !!! then reindenting the section of code to the correct location, based on code context.
7
end program
(-)refactoring-test-code/if-construct-statement-conversion/test18-commentHandling/commentHandling.f90 (+15 lines)
Added Link Here
1
program commentHandling
2
    implicit none
3
    integer :: x, y, a
4
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) then
5
        a = 1 !This is an if statement
6
        !can add more statements here
7
        !more comments here
8
    end if
9
    print *, "This is a test" !<<<<< 4, 5, 8, 11, pass
10
    
11
    !!! This test shows the refactoring successfully converting a valid IF construct to a valid IF statement. Even though the IF
12
    !!! construct has multiple lines of code, only one of which is a valid statement, so it is therefore still refactorable. The
13
    !!! refactoring will then take the lines of comments and append them to the end of the IF statement in order to preserve them.
14
    !!! The user can then reformat the comments as they feel fit.
15
end program
(-)refactoring-test-code/if-construct-statement-conversion/test18-commentHandling/commentHandling.f90.result (+11 lines)
Added Link Here
1
program commentHandling
2
    implicit none
3
    integer :: x, y, a
4
    if (x .LT. y .OR. y .GT. 5 .AND. 6 .GE. 6) a = 1 !This is an if statement !can add more statements here !more comments here
5
    print *, "This is a test" !<<<<< 4, 5, 8, 11, pass
6
    
7
    !!! This test shows the refactoring successfully converting a valid IF construct to a valid IF statement. Even though the IF
8
    !!! construct has multiple lines of code, only one of which is a valid statement, so it is therefore still refactorable. The
9
    !!! refactoring will then take the lines of comments and append them to the end of the IF statement in order to preserve them.
10
    !!! The user can then reformat the comments as they feel fit.
11
end program
(-)refactoring-test-code/if-construct-statement-conversion/test19-optionalElse/optionalElse.f90 (+11 lines)
Added Link Here
1
program convertIfStatementToIfConstructWithOptionalElseBlock
2
    implicit none
3
    integer :: var1, var2
4
    print *, "This is an if construct example."
5
    var1 = 4
6
    var2 = 5
7
    if (var1 < var2) print *, var1, " is less than ", var2, " using if-stmt." !<<<<< 7, 5, 7, 78, IfStmtToIfConstruct, TRUE, pass
8
    
9
    !!! This test shows the refactoring successfully converting a valid IF statement to a valid IF construct, and then based
10
    !!! on the user's affirmative selection of the option, will add on an else construct block to the end of it.
11
end program
(-)refactoring-test-code/if-construct-statement-conversion/test19-optionalElse/optionalElse.f90.result (+16 lines)
Added Link Here
1
program convertIfStatementToIfConstructWithOptionalElseBlock
2
    implicit none
3
    integer :: var1, var2
4
    print *, "This is an if construct example."
5
    var1 = 4
6
    var2 = 5
7
    if (var1 < var2) then
8
        print *, var1, " is less than ", var2, " using if-stmt." !<<<<< 7, 5, 7, 78, IfStmtToIfConstruct, TRUE, pass
9
        !can add more statements here
10
    else
11
        !can add more statements here
12
    end if
13
    
14
    !!! This test shows the refactoring successfully converting a valid IF statement to a valid IF construct, and then based
15
    !!! on the user's affirmative selection of the option, will add on an else construct block to the end of it.
16
end program
(-)refactoring-test-code/if-construct-statement-conversion/test20-optionalElseNotAdded/optionalElseNotAdded.f90 (+11 lines)
Added Link Here
1
program convertIfStatementToIfConstructWithOutOptionalElseBlock
2
    implicit none
3
    integer :: var1, var2
4
    print *, "This is an if construct example."
5
    var1 = 4
6
    var2 = 5
7
    if (var1 < var2) print *, var1, " is less than ", var2, " using if-stmt." !<<<<< 7, 5, 7, 78, IfStmtToIfConstruct, FALSE, pass
8
    
9
    !!! This test shows the refactoring successfully converting a valid IF statement to a valid IF construct, and then based
10
    !!! on the user's negative selection of the option, will now add on an else construct block to the end of it.
11
end program
(-)refactoring-test-code/if-construct-statement-conversion/test20-optionalElseNotAdded/optionalElseNotAdded.f90.result (+14 lines)
Added Link Here
1
program convertIfStatementToIfConstructWithOutOptionalElseBlock
2
    implicit none
3
    integer :: var1, var2
4
    print *, "This is an if construct example."
5
    var1 = 4
6
    var2 = 5
7
    if (var1 < var2) then
8
        print *, var1, " is less than ", var2, " using if-stmt." !<<<<< 7, 5, 7, 78, IfStmtToIfConstruct, FALSE, pass
9
        !can add more statements here
10
    end if
11
    
12
    !!! This test shows the refactoring successfully converting a valid IF statement to a valid IF construct, and then based
13
    !!! on the user's negative selection of the option, will now add on an else construct block to the end of it.
14
end program
(-)src/org/eclipse/photran/internal/tests/refactoring/IfConstructStatementConversionRefactoringTestSuite.java (+70 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 Zeeshan Ansari, Mark Chen, Burim Isai, Waseem Sheikh, Mumtaz Vauhkonen.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Zeeshan Ansari
10
 *     Mark Chen
11
 *     Burim Isai
12
 *     Waseem Sheihk
13
 *     Mumtaz Vauhkonen
14
 *******************************************************************************/
15
package org.eclipse.photran.internal.tests.refactoring;
16
17
import junit.framework.Test;
18
import junit.framework.TestFailure;
19
20
import org.eclipse.core.resources.IFile;
21
import org.eclipse.jface.text.TextSelection;
22
import org.eclipse.photran.internal.core.refactoring.ExtractLocalVariableRefactoring;
23
import org.eclipse.photran.internal.core.refactoring.IfConstructStatementConversionRefactoring;
24
import org.eclipse.photran.internal.tests.Activator;
25
import org.eclipse.photran.internal.tests.PhotranRefactoringTestSuiteFromMarkers;
26
27
/**
28
 * Unit tests for the IF Statement/Construct refactoring.
29
 * 
30
 * @author Zeeshan Ansari
31
 * @author Mark Chen
32
 * @author Mumtaz Vauhkonrn
33
 * @author Burim Isai
34
 * @author Waseem Sheikh
35
 */
36
public class IfConstructStatementConversionRefactoringTestSuite extends
37
    PhotranRefactoringTestSuiteFromMarkers<IfConstructStatementConversionRefactoring>
38
{
39
    private static final String DIR = "refactoring-test-code/if-construct-statement-conversion";
40
41
    public static Test suite() throws Exception
42
    {
43
        return new IfConstructStatementConversionRefactoringTestSuite();
44
    }
45
46
    public IfConstructStatementConversionRefactoringTestSuite() throws Exception
47
    {
48
        super(Activator.getDefault(), "Running If Construct Statement Conversion refactoring in",
49
            DIR, IfConstructStatementConversionRefactoring.class);
50
    }
51
52
    @Override
53
    protected boolean configureRefactoring(IfConstructStatementConversionRefactoring refactoring,
54
        IFile file, TextSelection selection, String[] markerText)
55
    {
56
        boolean shouldSucceed = super
57
            .configureRefactoring(refactoring, file, selection, markerText);
58
        String includeOptionalElse;
59
        String testType;
60
        testType = markerText[4];
61
62
        if (testType.equals("IfStmtToIfConstruct"))
63
        {
64
            includeOptionalElse = markerText[5];
65
            if (includeOptionalElse.equals("TRUE")) refactoring.AddEmptyElseBlock();
66
        }
67
        
68
        return shouldSucceed;
69
    }
70
}
(-)plugin.xml (-1 / +18 lines)
Lines 102-107 Link Here
102
         />
102
         />
103
      </group>
103
      </group>
104
      <group><!-- Refactorings that reformat code -->
104
      <group><!-- Refactorings that reformat code -->
105
         <editorRefactoring  command="org.eclipse.photran.ui.IfConstructStatementConversionRefactoringCommand" />   
105
         <editorRefactoring
106
         <editorRefactoring
106
             class="org.eclipse.photran.internal.core.refactoring.RemoveUnreferencedLabelsRefactoring"
107
             class="org.eclipse.photran.internal.core.refactoring.RemoveUnreferencedLabelsRefactoring"
107
         />         
108
         />         
Lines 151-156 Link Here
151
            categoryId="org.eclipse.photran.ui.RefactoringCategory"
152
            categoryId="org.eclipse.photran.ui.RefactoringCategory"
152
            id="org.eclipse.photran.ui.ExtractLocalVariableRefactoringCommand">
153
            id="org.eclipse.photran.ui.ExtractLocalVariableRefactoringCommand">
153
      </command>
154
      </command>
155
      <command
156
            name="%command.name.IfConstructStatementConversion"
157
            categoryId="org.eclipse.photran.ui.RefactoringCategory"
158
            id="org.eclipse.photran.ui.IfConstructStatementConversionRefactoringCommand">
159
      </command>
154
   </extension>
160
   </extension>
155
161
156
   <!-- 2. Optionally associate the command with an accelerator key -->
162
   <!-- 2. Optionally associate the command with an accelerator key -->
Lines 174-179 Link Here
174
            contextId="org.eclipse.photran.ui.FortranEditorContext"
180
            contextId="org.eclipse.photran.ui.FortranEditorContext"
175
            commandId="org.eclipse.photran.ui.ExtractLocalVariableRefactoringCommand"
181
            commandId="org.eclipse.photran.ui.ExtractLocalVariableRefactoringCommand"
176
     />
182
     />
183
     <key
184
            sequence="M3+M2+I"
185
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
186
            contextId="org.eclipse.photran.ui.FortranEditorContext"
187
            commandId="org.eclipse.photran.ui.IfConstructStatementConversionRefactoringCommand"
188
     />
177
   </extension>
189
   </extension>
178
190
179
   <!-- 3. Add the command to Photran's Refactoring action set -->
191
   <!-- 3. Add the command to Photran's Refactoring action set -->
Lines 199-204 Link Here
199
               definitionId="org.eclipse.photran.ui.ExtractLocalVariableRefactoringCommand"
211
               definitionId="org.eclipse.photran.ui.ExtractLocalVariableRefactoringCommand"
200
               class="org.eclipse.photran.internal.ui.refactoring.ExtractLocalVariableAction"
212
               class="org.eclipse.photran.internal.ui.refactoring.ExtractLocalVariableAction"
201
               id="org.eclipse.photran.ui.ExtractLocalVariableRefactoringAction"/>
213
               id="org.eclipse.photran.ui.ExtractLocalVariableRefactoringAction"/>
214
         <action
215
               label="%action.label.IfConstructStatementConversion"
216
               definitionId="org.eclipse.photran.ui.IfConstructStatementConversionRefactoringCommand"
217
               class="org.eclipse.photran.internal.ui.refactoring.IfConstructStatementConversionAction"
218
               id="org.eclipse.photran.ui.IfConstructStatementConversionRefactoringAction"/>
202
      </actionSet>
219
      </actionSet>
203
   </extension>
220
   </extension>
204
221
Lines 353-359 Link Here
353
            id="org.eclipse.photran.ui.Reindenter">
370
            id="org.eclipse.photran.ui.Reindenter">
354
	     <action 
371
	     <action 
355
	           label="%action.label.reindent.0" 
372
	           label="%action.label.reindent.0" 
356
               menubarPath="org.eclipse.photran.ui.source.menu/indentationActions"
373
               menubarPath="edit/additions"
357
               definitionId="org.eclipse.photran.ui.ReindenterCommand"
374
               definitionId="org.eclipse.photran.ui.ReindenterCommand"
358
	           class="org.eclipse.photran.internal.ui.actions.ReindentAction"
375
	           class="org.eclipse.photran.internal.ui.actions.ReindentAction"
359
	           id="org.eclipse.photran.ui.ReindenterAction">
376
	           id="org.eclipse.photran.ui.ReindenterAction">
(-)src/org/eclipse/photran/internal/ui/refactoring/IfConstructStatementConversionAction.java (+137 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 Zeeshan Ansari, Mark Chen, Burim Isai, Waseem Sheikh, Mumtaz Vauhkonen. 
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Zeeshan Ansari
10
 *     Mark Chen
11
 *     Burim Isai
12
 *     Waseem Sheihk
13
 *     Mumtaz Vauhkonen
14
 *******************************************************************************/
15
package org.eclipse.photran.internal.ui.refactoring;
16
17
import java.util.List;
18
19
import org.eclipse.core.resources.IFile;
20
import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
21
import org.eclipse.photran.core.IFortranAST;
22
import org.eclipse.photran.internal.core.lexer.Token;
23
import org.eclipse.photran.internal.core.refactoring.IfConstructStatementConversionRefactoring;
24
import org.eclipse.photran.internal.core.vpg.PhotranVPG;
25
import org.eclipse.rephraserengine.core.vpg.refactoring.VPGRefactoring;
26
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.events.SelectionEvent;
28
import org.eclipse.swt.events.SelectionListener;
29
import org.eclipse.swt.layout.GridLayout;
30
import org.eclipse.swt.widgets.Button;
31
import org.eclipse.swt.widgets.Composite;
32
import org.eclipse.swt.widgets.Label;
33
import org.eclipse.ui.IEditorActionDelegate;
34
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
35
36
/**
37
 * Handles the If Statement/Construct action in the Fortran editor's Refactoring popup menu and in
38
 * the Refactor menu in the workbench menu bar.
39
 * 
40
 * @author Zeeshan Ansari
41
 * @author Mark Chen
42
 * @author Mumtaz Vauhkonrn
43
 * @author Burim Isai
44
 * @author Waseem Sheikh
45
 */
46
public class IfConstructStatementConversionAction extends AbstractFortranRefactoringActionDelegate
47
    implements IWorkbenchWindowActionDelegate, IEditorActionDelegate
48
{
49
    public IfConstructStatementConversionAction()
50
    {
51
        super(IfConstructStatementConversionRefactoring.class,
52
            FortranIfConstructStatementConversionWizard.class);
53
    }
54
55
    @Override
56
    protected VPGRefactoring<IFortranAST, Token, PhotranVPG> getRefactoring(List<IFile> files)
57
    {
58
        IfConstructStatementConversionRefactoring r = new IfConstructStatementConversionRefactoring();
59
        r.initialize(getFortranEditor().getIFile(), getFortranEditor().getSelection());
60
        return r;
61
    }
62
63
    public static class FortranIfConstructStatementConversionWizard extends
64
        AbstractFortranRefactoringWizard
65
    {
66
        protected IfConstructStatementConversionRefactoring ifConstructStatementConversionRefactoring;
67
68
        public FortranIfConstructStatementConversionWizard(
69
            IfConstructStatementConversionRefactoring r)
70
        {
71
            super(r);
72
            this.ifConstructStatementConversionRefactoring = r;
73
        }
74
75
        @Override
76
        protected void doAddUserInputPages()
77
        {
78
            if (ifConstructStatementConversionRefactoring.isStmtNode())
79
            {
80
                addPage(new UserInputWizardPage(ifConstructStatementConversionRefactoring.getName())
81
                {
82
                    protected Button shouldAddEmptyElseBlock;
83
84
                    public void createControl(Composite parent)
85
                    {
86
                        Composite top = new Composite(parent, SWT.NONE);
87
                        initializeDialogUnits(top);
88
                        setControl(top);
89
                        top.setLayout(new GridLayout(2, false));
90
                        Composite group = top;
91
                        new Label(group, SWT.NONE).setText(""); //$NON-NLS-1$
92
93
                        shouldAddEmptyElseBlock = new Button(group, SWT.CHECK);
94
                        shouldAddEmptyElseBlock
95
                            .setText(Messages.IfConstructStatementConversionAction_AddEmptyElseBlock);
96
                        shouldAddEmptyElseBlock.setSelection(false);
97
                        shouldAddEmptyElseBlock.addSelectionListener(new SelectionListener()
98
                        {
99
                            public void widgetDefaultSelected(SelectionEvent e)
100
                            {
101
                                widgetSelected(e);
102
                            }
103
104
                            public void widgetSelected(SelectionEvent e)
105
                            {
106
                                if (shouldAddEmptyElseBlock.getSelection())
107
                                    ifConstructStatementConversionRefactoring.AddEmptyElseBlock();
108
                            }
109
110
                        });
111
                    }
112
                });
113
            }
114
            else
115
            {
116
                addPage(new UserInputWizardPage(ifConstructStatementConversionRefactoring.getName())
117
                {
118
                    public void createControl(Composite parent)
119
                    {
120
                        Composite top = new Composite(parent, SWT.NONE);
121
                        initializeDialogUnits(top);
122
                        setControl(top);
123
124
                        top.setLayout(new GridLayout(1, false));
125
126
                        Label lbl = new Label(top, SWT.NONE);
127
                        lbl.setText(Messages.bind(
128
                            Messages.RefactoringAction_ClickOKToRunTheRefactoring,
129
                            ifConstructStatementConversionRefactoring.getName()));
130
                    }
131
132
                });
133
            }
134
135
        }
136
    }
137
}
(-)src/org/eclipse/photran/internal/ui/refactoring/Messages.java (+4 lines)
Lines 82-87 Link Here
82
    public static String MoveFromModuleInputPage_selectDataMessage;
82
    public static String MoveFromModuleInputPage_selectDataMessage;
83
83
84
    public static String RenameAction_MatchExternalSubprograms;
84
    public static String RenameAction_MatchExternalSubprograms;
85
    
86
    public static String IfConstructStatementConversionAction_AddEmptyElseBlock;
87
    
88
    public static String RefactoringAction_ClickOKToRunTheRefactoring;
85
89
86
    public static String RenameAction_RenameAtoB;
90
    public static String RenameAction_RenameAtoB;
87
    static
91
    static
(-)src/org/eclipse/photran/internal/ui/refactoring/messages.properties (+2 lines)
Lines 31-33 Link Here
31
MoveFromModuleInputPage_selectDataMessage=Please select member data to move from module 
31
MoveFromModuleInputPage_selectDataMessage=Please select member data to move from module 
32
RenameAction_MatchExternalSubprograms=Match external subprograms with interfaces and external declarations
32
RenameAction_MatchExternalSubprograms=Match external subprograms with interfaces and external declarations
33
RenameAction_RenameAtoB=Rename {0} to
33
RenameAction_RenameAtoB=Rename {0} to
34
IfConstructStatementConversionAction_AddEmptyElseBlock=Add an empty else block
35
RefactoringAction_ClickOKToRunTheRefactoring=Click OK to run the {0} refactoring.\nTo see what changes will be made, click Preview.

Return to bug 331880