Bug 567569 - Fix typo in cleanup constants: STATMENT -> STATEMENT
Deprecated existing constants.
Change-Id: Ib42114c68e1d69461229e02214a91cbd2ddd623f
Signed-off-by: Karsten Thoms <karsten.thoms@karakun.com>
diff --git a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstants.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstants.java
index 9798e1f..ba5b519 100644
--- a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstants.java
+++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstants.java
@@ -19,7 +19,6 @@
import org.eclipse.jdt.core.manipulation.CleanUpOptionsCore;
public class CleanUpConstants {
-
/**
* Constant for default options kind for clean up.
*/
@@ -410,8 +409,8 @@
/**
* Controls the usage of blocks around single control statement bodies. For detailed settings
- * use<br> {@link #CONTROL_STATMENTS_USE_BLOCKS_ALWAYS}<br> {@link #CONTROL_STATMENTS_USE_BLOCKS_NEVER}<br>
- * {@link #CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW} <br>
+ * use<br> {@link #CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS}<br> {@link #CONTROL_STATEMENTS_USE_BLOCKS_NEVER}<br>
+ * {@link #CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW} <br>
* <br>
* Possible values: {TRUE, FALSE}<br>
*
@@ -440,9 +439,55 @@
*
* @see CleanUpOptionsCore#TRUE
* @see CleanUpOptionsCore#FALSE
- * @since 3.3
+ * @since 4.18
*/
- public static final String CONTROL_STATMENTS_USE_BLOCKS_ALWAYS= "cleanup.always_use_blocks"; //$NON-NLS-1$
+ public static final String CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS= "cleanup.always_use_blocks"; //$NON-NLS-1$
+
+ /**
+ * Adds block to control statement body if the body is not a block.
+ * <p>
+ * Example:
+ *
+ * <pre>
+ * if (b) foo(); -> if (b) {foo();}
+ * </pre>
+ *
+ * Only has an effect if {@link #CONTROL_STATEMENTS_USE_BLOCKS} is TRUE <br>
+ * <br>
+ * Possible values: {TRUE, FALSE}<br>
+ *
+ * <br>
+ *
+ * @see CleanUpOptionsCore#TRUE
+ * @see CleanUpOptionsCore#FALSE
+ * @since 3.3
+ * @deprecated Use {@link #CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS} instead
+ */
+ @Deprecated
+ public static final String CONTROL_STATMENTS_USE_BLOCKS_ALWAYS= CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS;
+
+ /**
+ * Remove unnecessary blocks in control statement bodies if they contain a single return or
+ * throw statement.
+ * <p>
+ * Example:
+ *
+ * <pre>
+ * if (b) {return;} -> if (b) return;
+ * </pre>
+ *
+ * Only has an effect if {@link #CONTROL_STATEMENTS_USE_BLOCKS} is TRUE <br>
+ * <br>
+ * Possible values: {TRUE, FALSE}<br>
+ *
+ * <br>
+ *
+ * @see CleanUpOptionsCore#TRUE
+ * @see CleanUpOptionsCore#FALSE
+ * @since 4.18
+ */
+ public static final String CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW= "cleanup.use_blocks_only_for_return_and_throw"; //$NON-NLS-1$
+
/**
* Remove unnecessary blocks in control statement bodies if they contain a single return or
@@ -463,8 +508,31 @@
* @see CleanUpOptionsCore#TRUE
* @see CleanUpOptionsCore#FALSE
* @since 3.3
+ * @deprecated Use {@link #CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW} instead
*/
- public static final String CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW= "cleanup.use_blocks_only_for_return_and_throw"; //$NON-NLS-1$
+ @Deprecated
+ public static final String CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW= CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW;
+
+ /**
+ * Remove unnecessary blocks in control statement bodies.
+ * <p>
+ * Example:
+ *
+ * <pre>
+ * if (b) {foo();} -> if (b) foo();
+ * </pre>
+ *
+ * Only has an effect if {@link #CONTROL_STATEMENTS_USE_BLOCKS} is TRUE <br>
+ * <br>
+ * Possible values: {TRUE, FALSE}<br>
+ *
+ * <br>
+ *
+ * @see CleanUpOptionsCore#TRUE
+ * @see CleanUpOptionsCore#FALSE
+ * @since 4.18
+ */
+ public static final String CONTROL_STATEMENTS_USE_BLOCKS_NEVER= "cleanup.never_use_blocks"; //$NON-NLS-1$
/**
* Remove unnecessary blocks in control statement bodies.
@@ -484,12 +552,34 @@
* @see CleanUpOptionsCore#TRUE
* @see CleanUpOptionsCore#FALSE
* @since 3.3
+ * @deprecated Use {@link #CONTROL_STATEMENTS_USE_BLOCKS_NEVER} instead
*/
- public static final String CONTROL_STATMENTS_USE_BLOCKS_NEVER= "cleanup.never_use_blocks"; //$NON-NLS-1$
+ @Deprecated
+ public static final String CONTROL_STATMENTS_USE_BLOCKS_NEVER= CONTROL_STATEMENTS_USE_BLOCKS_NEVER;
/**
* Convert for loops to enhanced for loops. For detailed setting use<br>
- * {@link #CONTROL_STATMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED}<br>
+ * {@link #CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED}<br>
+ * <p>
+ * Example:
+ *
+ * <pre>
+ * for (int i = 0; i < array.length; i++) {} -> for (int element : array) {}
+ * </pre>
+ *
+ * Possible values: {TRUE, FALSE}<br>
+ *
+ * <br>
+ *
+ * @see CleanUpOptionsCore#TRUE
+ * @see CleanUpOptionsCore#FALSE
+ * @since 4.18
+ */
+ public static final String CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED= "cleanup.convert_to_enhanced_for_loop"; //$NON-NLS-1$
+
+ /**
+ * Convert for loops to enhanced for loops. For detailed setting use<br>
+ * {@link #CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED}<br>
* <p>
* Example:
*
@@ -504,8 +594,10 @@
* @see CleanUpOptionsCore#TRUE
* @see CleanUpOptionsCore#FALSE
* @since 3.3
+ * @deprecated Use {@link #CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED} instead
*/
- public static final String CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED= "cleanup.convert_to_enhanced_for_loop"; //$NON-NLS-1$
+ @Deprecated
+ public static final String CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED= CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED;
/**
* Convert a for loop to enhanced for loop only if the loop variable will be used.
@@ -516,7 +608,28 @@
* for (int i = 0; i < array.length; i++) {}; -> will not be converted
* </pre>
* <br>
- * Only has an effect if {@link #CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED} is TRUE <br>
+ * Only has an effect if {@link #CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED} is TRUE <br>
+ * <br>
+ * Possible values: {TRUE, FALSE}<br>
+ *
+ * <br>
+ *
+ * @see CleanUpOptionsCore#TRUE
+ * @see CleanUpOptionsCore#FALSE
+ * @since 4.18
+ */
+ public static String CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED= "cleanup.convert_to_enhanced_for_loop_if_loop_var_used"; //$NON-NLS-1$
+
+ /**
+ * Convert a for loop to enhanced for loop only if the loop variable will be used.
+ * <p>
+ * Example:
+ *
+ * <pre>
+ * for (int i = 0; i < array.length; i++) {}; -> will not be converted
+ * </pre>
+ * <br>
+ * Only has an effect if {@link #CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED} is TRUE <br>
* <br>
* Possible values: {TRUE, FALSE}<br>
*
@@ -525,8 +638,10 @@
* @see CleanUpOptionsCore#TRUE
* @see CleanUpOptionsCore#FALSE
* @since 4.16
+ * @deprecated Use {@link #CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED}
*/
- public static String CONTROL_STATMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED= "cleanup.convert_to_enhanced_for_loop_if_loop_var_used"; //$NON-NLS-1$
+ @Deprecated
+ public static String CONTROL_STATMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED= CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED;
/**
* Convert switch statements to switch expressions.IF_LOOP_VAR_USED}<br>
@@ -1108,7 +1223,6 @@
*/
public static final String REDUNDANT_IF_CONDITION= "cleanup.if_condition"; //$NON-NLS-1$
-
/**
* Use directly map method.<br>
* <br>
@@ -1536,6 +1650,4 @@
* @since 3.3
*/
public final static String DEFAULT_SAVE_PARTICIPANT_PROFILE= SAVE_PARTICIPANT_PROFILE;
-
-
}
diff --git a/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/views/CleanUpPerfTest.java b/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/views/CleanUpPerfTest.java
index a169e52..d9b972f 100644
--- a/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/views/CleanUpPerfTest.java
+++ b/org.eclipse.jdt.ui.tests/performance/org/eclipse/jdt/ui/tests/performance/views/CleanUpPerfTest.java
@@ -178,7 +178,7 @@
node.put(CleanUpConstants.MEMBER_ACCESSES_STATIC_QUALIFY_WITH_DECLARING_CLASS_SUBTYPE_ACCESS, CleanUpOptions.TRUE);
node.put(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS, CleanUpOptions.TRUE);
- node.put(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS, CleanUpOptions.TRUE);
+ node.put(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS, CleanUpOptions.TRUE);
node.put(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES, CleanUpOptions.TRUE);
node.put(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES_ALWAYS, CleanUpOptions.TRUE);
@@ -256,7 +256,7 @@
Map<String, String> node= getNullSettings();
node.put(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS, CleanUpOptions.TRUE);
- node.put(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS, CleanUpOptions.TRUE);
+ node.put(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS, CleanUpOptions.TRUE);
storeSettings(node);
@@ -273,7 +273,7 @@
Map<String, String> node= getNullSettings();
- node.put(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.TRUE);
+ node.put(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.TRUE);
storeSettings(node);
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java
index 4b3e3ca..dc7d3ff 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java
@@ -5255,8 +5255,8 @@
enable(CleanUpConstants.MEMBER_ACCESSES_STATIC_QUALIFY_WITH_DECLARING_CLASS_SUBTYPE_ACCESS);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES);
enable(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES_ALWAYS);
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java
index 8e6c0ed..defc01f 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java
@@ -2517,7 +2517,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -2575,7 +2575,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -2624,7 +2624,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -2679,7 +2679,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -2737,7 +2737,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -2815,7 +2815,7 @@
enable(CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS);
enable(CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS_ALWAYS);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
enable(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS);
buf= new StringBuffer();
@@ -2850,7 +2850,7 @@
enable(CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS);
enable(CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS_ALWAYS);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
enable(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS);
enable(CleanUpConstants.ADD_MISSING_NLS_TAGS);
@@ -3530,7 +3530,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -3937,7 +3937,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
enable(CleanUpConstants.ADD_MISSING_NLS_TAGS);
buf= new StringBuffer();
@@ -3980,7 +3980,7 @@
enable(CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS);
enable(CleanUpConstants.MEMBER_ACCESSES_NON_STATIC_FIELD_USE_THIS_ALWAYS);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
buf= new StringBuffer();
buf.append("package test1; \n");
@@ -4012,7 +4012,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -4043,8 +4043,8 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS);
enable(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_FELDS);
@@ -4082,7 +4082,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
enable(CleanUpConstants.ADD_MISSING_NLS_TAGS);
buf= new StringBuffer();
@@ -4161,7 +4161,7 @@
buf.append("}\n");
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL);
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_LOCAL_VARIABLES);
@@ -4196,7 +4196,7 @@
buf.append("}\n");
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL);
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_LOCAL_VARIABLES);
@@ -7724,7 +7724,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -7762,7 +7762,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -7808,9 +7808,9 @@
buf.append("}\n");
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -7857,9 +7857,9 @@
buf.append("}\n");
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -7898,9 +7898,9 @@
buf.append("}\n");
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -7939,9 +7939,9 @@
buf.append("}\n");
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -7976,9 +7976,9 @@
buf.append("}\n");
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -8022,7 +8022,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -8069,7 +8069,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
buf= new StringBuffer();
buf.append("package test;\n");
@@ -8106,8 +8106,8 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -8141,8 +8141,8 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -8236,7 +8236,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
enable(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES);
enable(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES_ALWAYS);
@@ -8279,7 +8279,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
enable(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES);
enable(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES_ALWAYS);
@@ -8323,7 +8323,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
enable(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES);
enable(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES_NEVER);
@@ -8366,7 +8366,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
enable(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES);
enable(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES_NEVER);
@@ -11246,7 +11246,7 @@
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL);
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_LOCAL_VARIABLES);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -11278,7 +11278,7 @@
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL);
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_LOCAL_VARIABLES);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -11311,7 +11311,7 @@
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL);
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_LOCAL_VARIABLES);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -11346,7 +11346,7 @@
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL);
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_LOCAL_VARIABLES);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
buf= new StringBuffer();
buf.append("package test1;\n");
@@ -11708,7 +11708,7 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW);
buf= new StringBuffer();
buf.append("package test;\n");
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest1d5.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest1d5.java
index 35d7724..08f4ff0 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest1d5.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest1d5.java
@@ -528,7 +528,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -572,7 +572,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -614,7 +614,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -656,7 +656,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -693,7 +693,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
assertRefactoringHasNoChange(new ICompilationUnit[] { cu1 });
}
@@ -711,7 +711,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
assertRefactoringHasNoChange(new ICompilationUnit[] { cu1 });
}
@@ -729,7 +729,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
assertRefactoringHasNoChange(new ICompilationUnit[] { cu1 });
}
@@ -748,7 +748,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
assertRefactoringHasNoChange(new ICompilationUnit[] { cu1 });
}
@@ -768,7 +768,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -799,7 +799,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
assertRefactoringHasNoChange(new ICompilationUnit[] { cu1 });
}
@@ -822,7 +822,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -857,7 +857,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -889,7 +889,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
assertRefactoringHasNoChange(new ICompilationUnit[] { cu1 });
}
@@ -932,7 +932,7 @@
+ "}\n";
pack2.createCompilationUnit("E3.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -969,7 +969,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -999,7 +999,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1030,7 +1030,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1066,7 +1066,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1105,8 +1105,8 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED);
assertRefactoringHasNoChange(new ICompilationUnit[] { cu1 });
}
@@ -1129,8 +1129,8 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED);
assertRefactoringHasNoChange(new ICompilationUnit[] { cu1 });
}
@@ -1153,7 +1153,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("A.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1189,7 +1189,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
assertRefactoringHasNoChange(new ICompilationUnit[] { cu1 });
}
@@ -1211,9 +1211,9 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
sample= "" //
+ "package test1;\n" //
@@ -1253,9 +1253,9 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
sample= "" //
+ "package test1;\n" //
@@ -1302,9 +1302,9 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER);
sample= "" //
+ "package test1;\n" //
@@ -1343,9 +1343,9 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
sample= "" //
+ "package test1;\n" //
@@ -1381,9 +1381,9 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
sample= "" //
+ "package test1;\n" //
@@ -1428,7 +1428,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1472,8 +1472,8 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1505,7 +1505,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1536,8 +1536,8 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1569,7 +1569,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1600,8 +1600,8 @@
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS);
- enable(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1641,7 +1641,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1678,7 +1678,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL);
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_LOCAL_VARIABLES);
enable(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_PARAMETERS);
@@ -1716,7 +1716,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1765,7 +1765,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1811,7 +1811,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1844,7 +1844,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
@@ -1884,7 +1884,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
assertRefactoringHasNoChange(new ICompilationUnit[] { cu1 });
}
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest1d7.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest1d7.java
index 59136c3..6e8bf1d 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest1d7.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest1d7.java
@@ -331,7 +331,7 @@
+ "}\n";
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", sample, false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
sample= "" //
+ "package test1;\n" //
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SaveParticipantTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SaveParticipantTest.java
index f5ffe16..f523fb5 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SaveParticipantTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SaveParticipantTest.java
@@ -1045,7 +1045,7 @@
buf.append("}");
ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
- enable(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
buf= new StringBuffer();
buf.append("package test;\r\n");
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstantsOptions.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstantsOptions.java
index 145257e..8ae5144 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstantsOptions.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpConstantsOptions.java
@@ -45,12 +45,12 @@
//Control Statements
options.setOption(CONTROL_STATEMENTS_USE_BLOCKS, CleanUpOptions.FALSE);
- options.setOption(CONTROL_STATMENTS_USE_BLOCKS_ALWAYS, CleanUpOptions.TRUE);
- options.setOption(CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW, CleanUpOptions.FALSE);
- options.setOption(CONTROL_STATMENTS_USE_BLOCKS_NEVER, CleanUpOptions.FALSE);
+ options.setOption(CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS, CleanUpOptions.TRUE);
+ options.setOption(CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW, CleanUpOptions.FALSE);
+ options.setOption(CONTROL_STATEMENTS_USE_BLOCKS_NEVER, CleanUpOptions.FALSE);
- options.setOption(CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.FALSE);
- options.setOption(CONTROL_STATMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED, CleanUpOptions.FALSE);
+ options.setOption(CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.FALSE);
+ options.setOption(CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED, CleanUpOptions.FALSE);
options.setOption(CONTROL_STATEMENTS_USE_ADD_REMOVE_ALL, CleanUpOptions.FALSE);
options.setOption(CONTROL_STATEMENTS_CONVERT_TO_SWITCH_EXPRESSIONS, CleanUpOptions.FALSE);
@@ -164,12 +164,12 @@
//Control Statements
options.setOption(CONTROL_STATEMENTS_USE_BLOCKS, CleanUpOptions.FALSE);
- options.setOption(CONTROL_STATMENTS_USE_BLOCKS_ALWAYS, CleanUpOptions.TRUE);
- options.setOption(CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW, CleanUpOptions.FALSE);
- options.setOption(CONTROL_STATMENTS_USE_BLOCKS_NEVER, CleanUpOptions.FALSE);
+ options.setOption(CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS, CleanUpOptions.TRUE);
+ options.setOption(CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW, CleanUpOptions.FALSE);
+ options.setOption(CONTROL_STATEMENTS_USE_BLOCKS_NEVER, CleanUpOptions.FALSE);
- options.setOption(CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.FALSE);
- options.setOption(CONTROL_STATMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED, CleanUpOptions.FALSE);
+ options.setOption(CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.FALSE);
+ options.setOption(CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED, CleanUpOptions.FALSE);
options.setOption(CONTROL_STATEMENTS_USE_ADD_REMOVE_ALL, CleanUpOptions.FALSE);
options.setOption(CONTROL_STATEMENTS_CONVERT_TO_SWITCH_EXPRESSIONS, CleanUpOptions.FALSE);
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/ControlStatementsCleanUp.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/ControlStatementsCleanUp.java
index 94ddec8..8bc9848 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/ControlStatementsCleanUp.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/ControlStatementsCleanUp.java
@@ -49,9 +49,9 @@
if (!useBlocks)
return false;
- return isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS) ||
- isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER) ||
- isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW);
+ return isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS) ||
+ isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER) ||
+ isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW);
}
@Override
@@ -65,19 +65,19 @@
return null;
return ControlStatementsFix.createCleanUp(compilationUnit,
- isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS),
- isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER),
- isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW));
+ isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS),
+ isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER),
+ isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW));
}
@Override
public String[] getStepDescriptions() {
List<String> result= new ArrayList<>();
- if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS))
+ if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS))
result.add(MultiFixMessages.CodeStyleMultiFix_ConvertSingleStatementInControlBodyToBlock_description);
- if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER))
+ if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER))
result.add(MultiFixMessages.ControlStatementsCleanUp_RemoveUnnecessaryBlocks_description);
- if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW))
+ if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW))
result.add(MultiFixMessages.ControlStatementsCleanUp_RemoveUnnecessaryBlocksWithReturnOrThrow_description);
return result.toArray(new String[result.size()]);
@@ -87,7 +87,7 @@
public String getPreview() {
StringBuilder buf= new StringBuilder();
- if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS)) {
+ if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS)) {
buf.append("if (obj == null) {\n"); //$NON-NLS-1$
buf.append(" throw new IllegalArgumentException();\n"); //$NON-NLS-1$
buf.append("}\n"); //$NON-NLS-1$
@@ -97,7 +97,7 @@
buf.append("} else {\n"); //$NON-NLS-1$
buf.append(" return;\n"); //$NON-NLS-1$
buf.append("}\n"); //$NON-NLS-1$
- } else if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER)){
+ } else if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER)){
buf.append("if (obj == null)\n"); //$NON-NLS-1$
buf.append(" throw new IllegalArgumentException();\n"); //$NON-NLS-1$
buf.append("\n"); //$NON-NLS-1$
@@ -107,7 +107,7 @@
buf.append("else\n"); //$NON-NLS-1$
buf.append(" return;\n"); //$NON-NLS-1$
buf.append("\n"); //$NON-NLS-1$
- } else if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW)) {
+ } else if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS) && isEnabled(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW)) {
buf.append("if (obj == null)\n"); //$NON-NLS-1$
buf.append(" throw new IllegalArgumentException();\n"); //$NON-NLS-1$
buf.append("\n"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/ConvertLoopCleanUp.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/ConvertLoopCleanUp.java
index 722e2f7..d011c31 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/ConvertLoopCleanUp.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/ConvertLoopCleanUp.java
@@ -40,7 +40,7 @@
@Override
public CleanUpRequirements getRequirements() {
- return new CleanUpRequirements(isEnabled(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED), false, false, null);
+ return new CleanUpRequirements(isEnabled(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED), false, false, null);
}
@Override
@@ -49,8 +49,8 @@
if (compilationUnit == null)
return null;
- boolean convertForLoops= isEnabled(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
- boolean checkIfLoopVarUsed= isEnabled(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED);
+ boolean convertForLoops= isEnabled(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
+ boolean checkIfLoopVarUsed= isEnabled(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED);
return ConvertLoopFix.createCleanUp(compilationUnit,
convertForLoops, convertForLoops,
@@ -62,9 +62,9 @@
public String[] getStepDescriptions() {
List<String> result= new ArrayList<>();
- if (isEnabled(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED)) {
+ if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED)) {
result.add(MultiFixMessages.Java50CleanUp_ConvertToEnhancedForLoop_description);
- if (isEnabled(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED)) {
+ if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED)) {
result.add(MultiFixMessages.Java50CleanUp_ConvertLoopOnlyIfLoopVarUsed_description);
}
}
@@ -75,7 +75,7 @@
public String getPreview() {
StringBuilder buf= new StringBuilder();
- if (isEnabled(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED)) {
+ if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED)) {
buf.append("for (int id : ids) {\n"); //$NON-NLS-1$
buf.append(" double value= id / 2; \n"); //$NON-NLS-1$
buf.append(" System.out.println(value);\n"); //$NON-NLS-1$
@@ -86,8 +86,8 @@
buf.append(" System.out.println(value);\n"); //$NON-NLS-1$
buf.append("}\n\n"); //$NON-NLS-1$
}
- if (isEnabled(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED) &&
- !isEnabled(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED)) {
+ if (isEnabled(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED) &&
+ !isEnabled(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED)) {
buf.append("for (int id : ids) {\n"); //$NON-NLS-1$
buf.append(" System.out.println(\"here\");\n"); //$NON-NLS-1$
buf.append("}\n"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CleanUpMessages.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CleanUpMessages.java
index 8cfbc7c..47c3c91 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CleanUpMessages.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CleanUpMessages.java
@@ -62,7 +62,7 @@
public static String CodeStyleTabPage_CheckboxName_UseVar;
public static String CodeStyleTabPage_CheckboxName_UseParentheses;
- public static String CodeStyleTabPage_GroupName_ControlStatments;
+ public static String CodeStyleTabPage_GroupName_ControlStatements;
public static String CodeStyleTabPage_GroupName_Expressions;
public static String CodeStyleTabPage_GroupName_NumberLiteral;
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CleanUpMessages.properties b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CleanUpMessages.properties
index 85ccc99..d144e52 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CleanUpMessages.properties
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CleanUpMessages.properties
@@ -54,7 +54,7 @@
CodeStyleTabPage_CheckboxName_ConvertForLoopToEnhanced=Conver&t 'for' loops to enhanced
CodeStyleTabPage_CheckboxName_ConvertLoopOnlyIfLoopVarUsed=Only if loop variable used
CodeStyleTabPage_CheckboxName_UseAddAllRemoveAll=Add or remove elements in collections without loop
-CodeStyleTabPage_GroupName_ControlStatments=Control statements
+CodeStyleTabPage_GroupName_ControlStatements=Control statements
CodeStyleTabPage_RadioName_UseBlocksSpecial=Always &except for single 'return' or 'throw' statements
CodeStyleTabPage_CheckboxName_UseParentheses=Use parent&heses in expressions
CodeStyleTabPage_GroupName_FunctionalInterfaces=Functional interface instances
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CodeStyleTabPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CodeStyleTabPage.java
index a271522..eaa5c2e 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CodeStyleTabPage.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/cleanup/CodeStyleTabPage.java
@@ -55,24 +55,24 @@
@Override
protected void doCreatePreferences(Composite composite, int numColumns) {
- Group controlGroup= createGroup(numColumns, composite, CleanUpMessages.CodeStyleTabPage_GroupName_ControlStatments);
+ Group controlGroup= createGroup(numColumns, composite, CleanUpMessages.CodeStyleTabPage_GroupName_ControlStatements);
final CheckboxPreference useBlockPref= createCheckboxPref(controlGroup, numColumns, CleanUpMessages.CodeStyleTabPage_CheckboxName_UseBlocks, CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS, CleanUpModifyDialog.FALSE_TRUE);
intent(controlGroup);
- final RadioPreference useBlockAlwaysPref= createRadioPref(controlGroup, numColumns - 1, CleanUpMessages.CodeStyleTabPage_RadioName_AlwaysUseBlocks, CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS, CleanUpModifyDialog.FALSE_TRUE);
+ final RadioPreference useBlockAlwaysPref= createRadioPref(controlGroup, numColumns - 1, CleanUpMessages.CodeStyleTabPage_RadioName_AlwaysUseBlocks, CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS, CleanUpModifyDialog.FALSE_TRUE);
intent(controlGroup);
- final RadioPreference useBlockJDTStylePref= createRadioPref(controlGroup, numColumns - 1, CleanUpMessages.CodeStyleTabPage_RadioName_UseBlocksSpecial, CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW, CleanUpModifyDialog.FALSE_TRUE);
+ final RadioPreference useBlockJDTStylePref= createRadioPref(controlGroup, numColumns - 1, CleanUpMessages.CodeStyleTabPage_RadioName_UseBlocksSpecial, CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW, CleanUpModifyDialog.FALSE_TRUE);
intent(controlGroup);
- final RadioPreference useBlockNeverPref= createRadioPref(controlGroup, numColumns - 1, CleanUpMessages.CodeStyleTabPage_RadioName_NeverUseBlocks, CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER, CleanUpModifyDialog.FALSE_TRUE);
+ final RadioPreference useBlockNeverPref= createRadioPref(controlGroup, numColumns - 1, CleanUpMessages.CodeStyleTabPage_RadioName_NeverUseBlocks, CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER, CleanUpModifyDialog.FALSE_TRUE);
registerSlavePreference(useBlockPref, new RadioPreference[] {useBlockAlwaysPref, useBlockJDTStylePref, useBlockNeverPref});
CheckboxPreference convertToSwitchExpressions= createCheckboxPref(controlGroup, numColumns, CleanUpMessages.CodeStyleTabPage_CheckboxName_ConvertToSwitchExpressions, CleanUpConstants.CONTROL_STATEMENTS_CONVERT_TO_SWITCH_EXPRESSIONS, CleanUpModifyDialog.FALSE_TRUE);
registerPreference(convertToSwitchExpressions);
- CheckboxPreference convertLoop= createCheckboxPref(controlGroup, numColumns, CleanUpMessages.CodeStyleTabPage_CheckboxName_ConvertForLoopToEnhanced, CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpModifyDialog.FALSE_TRUE);
+ CheckboxPreference convertLoop= createCheckboxPref(controlGroup, numColumns, CleanUpMessages.CodeStyleTabPage_CheckboxName_ConvertForLoopToEnhanced, CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpModifyDialog.FALSE_TRUE);
registerPreference(convertLoop);
intent(controlGroup);
- final CheckboxPreference convertLoopOnlyIfLoopVariableUsed= createCheckboxPref(controlGroup, 1, CleanUpMessages.CodeStyleTabPage_CheckboxName_ConvertLoopOnlyIfLoopVarUsed, CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED, CleanUpModifyDialog.FALSE_TRUE);
+ final CheckboxPreference convertLoopOnlyIfLoopVariableUsed= createCheckboxPref(controlGroup, 1, CleanUpMessages.CodeStyleTabPage_CheckboxName_ConvertLoopOnlyIfLoopVarUsed, CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_ONLY_IF_LOOP_VAR_USED, CleanUpModifyDialog.FALSE_TRUE);
registerSlavePreference(convertLoop, new CheckboxPreference[] {convertLoopOnlyIfLoopVariableUsed});
final CheckboxPreference addOrRemoveAllPref= createCheckboxPref(controlGroup, numColumns, CleanUpMessages.CodeStyleTabPage_CheckboxName_UseAddAllRemoveAll, CleanUpConstants.CONTROL_STATEMENTS_USE_ADD_REMOVE_ALL,
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java
index 629833c..d800905 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java
@@ -3277,7 +3277,7 @@
}
Map<String, String> options= new Hashtable<>();
options.put(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS, CleanUpOptions.TRUE);
- options.put(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER, CleanUpOptions.TRUE);
+ options.put(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NEVER, CleanUpOptions.TRUE);
ICleanUp cleanUp= new ControlStatementsCleanUp(options);
for (IProposableFix fix : fixes) {
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
@@ -4236,7 +4236,7 @@
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options= new HashMap<>();
- options.put(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.TRUE);
+ options.put(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.TRUE);
ICleanUp cleanUp= new ConvertLoopCleanUp(options);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, cleanUp, IProposalRelevance.CONVERT_FOR_LOOP_TO_ENHANCED, image, context);
proposal.setCommandId(CONVERT_FOR_LOOP_ID);
@@ -4259,7 +4259,7 @@
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
Map<String, String> options= new HashMap<>();
- options.put(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.TRUE);
+ options.put(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED, CleanUpOptions.TRUE);
ICleanUp cleanUp= new ConvertLoopCleanUp(options);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, cleanUp, IProposalRelevance.CONVERT_ITERABLE_LOOP_TO_ENHANCED, image, context);
proposal.setCommandId(CONVERT_FOR_LOOP_ID);
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateMethodAbstractAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateMethodAbstractAction.java
index c6b130f..e53c3a3 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateMethodAbstractAction.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateMethodAbstractAction.java
@@ -403,8 +403,8 @@
boolean useBlocks(IJavaProject project) {
if (CleanUpOptions.TRUE.equals(PreferenceConstants.getPreference(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS, project))) {
- return CleanUpOptions.TRUE.equals(PreferenceConstants.getPreference(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_ALWAYS, project))
- || CleanUpOptions.TRUE.equals(PreferenceConstants.getPreference(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW, project));
+ return CleanUpOptions.TRUE.equals(PreferenceConstants.getPreference(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_ALWAYS, project))
+ || CleanUpOptions.TRUE.equals(PreferenceConstants.getPreference(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS_NO_FOR_RETURN_AND_THROW, project));
}
return false;
}