Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoj Palat2018-12-17 05:45:05 +0000
committerManoj Palat2018-12-17 05:45:05 +0000
commit685834eac6cc0d1b7e0a292d497063dd2c363f12 (patch)
tree9d35253a753cfd8a55eb942d5e26c58ada60615d
parent7061085c6633eb8bf2ff3f40798ce79a9d492d09 (diff)
downloadeclipse.jdt.core-685834eac6cc0d1b7e0a292d497063dd2c363f12.tar.gz
eclipse.jdt.core-685834eac6cc0d1b7e0a292d497063dd2c363f12.tar.xz
eclipse.jdt.core-685834eac6cc0d1b7e0a292d497063dd2c363f12.zip
Bug 531714 Fixing compiler invocation tests
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java40
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java2
3 files changed, 42 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
index c59ead8ac2..94f6f7f256 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Benjamin Muskalla - Contribution for bug 239066
@@ -1187,6 +1191,30 @@ public void test011_problem_categories() {
expectedProblemAttributes.put("IllegalArrayOfUnionType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
expectedProblemAttributes.put("IllegalArrayTypeInIntersectionCast", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
expectedProblemAttributes.put("ProblemNotAnalysed", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE));
+ expectedProblemAttributes.put("SwitchExpressionsIncompatibleResultExpressionTypes",
+ new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+ expectedProblemAttributes.put("SwitchExpressionsEmptySwitchBlock",
+ new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+ expectedProblemAttributes.put("SwitchExpressionsNoResultExpression",
+ new ProblemAttributes(CategorizedProblem.CAT_TYPE));
+ expectedProblemAttributes.put("SwitchExpressionSwitchLabeledBlockCompletesNormally",
+ new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+ expectedProblemAttributes.put("SwitchExpressionLastStatementCompletesNormally",
+ new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+ expectedProblemAttributes.put("SwitchExpressionTrailingSwitchLabels",
+ new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+ expectedProblemAttributes.put("SwitchMixedCase",
+ new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
+ expectedProblemAttributes.put("SwitchExpressionMissingDefaultCase",
+ new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
+ expectedProblemAttributes.put("SwitchExpressionNotBelow12",
+ new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
+ expectedProblemAttributes.put("SwitchCaseLabelWithArrowNotBelow12",
+ new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
+ expectedProblemAttributes.put("SwitchExpressionPreviewDisabled",
+ new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
+ expectedProblemAttributes.put("SwitchCaseLabelWithArrowPreviewDisabled",
+ new ProblemAttributes(CategorizedProblem.CAT_SYNTAX));
StringBuffer failures = new StringBuffer();
StringBuffer correctResult = new StringBuffer(70000);
Field[] fields = (iProblemClass = IProblem.class).getFields();
@@ -2106,6 +2134,18 @@ public void test012_compiler_problems_tuning() {
expectedProblemAttributes.put("VarLocalReferencesItself", SKIP);
expectedProblemAttributes.put("VarLocalTooManyBrackets", SKIP);
expectedProblemAttributes.put("VarLocalWithoutInitizalier", SKIP);
+ expectedProblemAttributes.put("SwitchExpressionsIncompatibleResultExpressionTypes",SKIP);
+ expectedProblemAttributes.put("SwitchExpressionsEmptySwitchBlock",SKIP);
+ expectedProblemAttributes.put("SwitchExpressionsNoResultExpression",SKIP);
+ expectedProblemAttributes.put("SwitchExpressionSwitchLabeledBlockCompletesNormally",SKIP);
+ expectedProblemAttributes.put("SwitchExpressionLastStatementCompletesNormally",SKIP);
+ expectedProblemAttributes.put("SwitchExpressionTrailingSwitchLabels",SKIP);
+ expectedProblemAttributes.put("SwitchMixedCase", SKIP);
+ expectedProblemAttributes.put("SwitchExpressionMissingDefaultCase",SKIP);
+ expectedProblemAttributes.put("SwitchExpressionNotBelow12", SKIP);
+ expectedProblemAttributes.put("SwitchCaseLabelWithArrowNotBelow12", SKIP);
+ expectedProblemAttributes.put("SwitchExpressionPreviewDisabled", SKIP);
+ expectedProblemAttributes.put("SwitchCaseLabelWithArrowPreviewDisabled", SKIP);
Map constantNamesIndex = new HashMap();
Field[] fields = JavaCore.class.getFields();
for (int i = 0, length = fields.length; i < length; i++) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
index aa75d5bf73..1100f4161d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
@@ -2093,7 +2093,7 @@ void setSourceStart(int sourceStart);
/** @since 3.16 BETA_JAVA_12 */
int SwitchExpressionTrailingSwitchLabels = Internal + 1605;
/** @since 3.16 BETA_JAVA_12 */
- int MixedCase = Syntax + 1606;
+ int SwitchMixedCase = Syntax + 1606;
/** @since 3.16 BETA_JAVA_12 */
int SwitchExpressionMissingDefaultCase = Internal + 1607;
/** @since 3.16 BETA_JAVA_12 */
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index 366c8f146e..6e67fc14f1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -11044,7 +11044,7 @@ public void switchExpressionTrailingSwitchLabels(Statement stmt) {
}
public void switchExpressionMixedCase(ASTNode statement) {
this.handle(
- IProblem.MixedCase,
+ IProblem.SwitchMixedCase,
NoArgument,
NoArgument,
statement.sourceStart,

Back to the top