diff options
author | Manoj Palat | 2019-01-25 16:08:22 +0000 |
---|---|---|
committer | Manoj Palat | 2019-01-25 16:08:22 +0000 |
commit | e2c0af9a4f7c8c426838c5b2719daa2ef6f900be (patch) | |
tree | 57a815e76c7ee4e5792f7b77b9ff27bb4a40b0b5 | |
parent | bf1f831ccfe73711e3249e279ab200256aa22edf (diff) | |
download | eclipse.jdt.core-e2c0af9a4f7c8c426838c5b2719daa2ef6f900be.tar.gz eclipse.jdt.core-e2c0af9a4f7c8c426838c5b2719daa2ef6f900be.tar.xz eclipse.jdt.core-e2c0af9a4f7c8c426838c5b2719daa2ef6f900be.zip |
--enable-preview
3 files changed, 16 insertions, 6 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 80c22dd9f6..654852c594 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2018 IBM Corporation and others. + * Copyright (c) 2006, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -303,7 +303,7 @@ public class CompilerInvocationTests extends AbstractRegressionTest { // templates, which can occur downstream in the localization process (assuming // that we always release the English version right) public void test009_missing_message_templates() { - assertEquals("Unable to retrieve the error message for problem id: 8388607. Check compiler resources.", + assertEquals("Unable to retrieve the error message for problem id: 4194303. Check compiler resources.", new DefaultProblemFactory().getLocalizedMessage(Integer.MAX_VALUE, new String[] {})); } @@ -1174,9 +1174,9 @@ public void test011_problem_categories() { expectedProblemAttributes.put("SwitchCaseLabelWithArrowNotBelow12", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); expectedProblemAttributes.put("SwitchExpressionPreviewDisabled", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); expectedProblemAttributes.put("SwitchCaseLabelWithArrowPreviewDisabled", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("PreviewFeatureDisabled", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("PreviewFeatureUsed", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("PreviewFeatureNotSupported", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("PreviewFeatureDisabled", new ProblemAttributes(CategorizedProblem.CAT_COMPLIANCE)); + expectedProblemAttributes.put("PreviewFeatureUsed", new ProblemAttributes(CategorizedProblem.CAT_COMPLIANCE)); + expectedProblemAttributes.put("PreviewFeatureNotSupported", new ProblemAttributes(CategorizedProblem.CAT_COMPLIANCE)); StringBuffer failures = new StringBuffer(); StringBuffer correctResult = new StringBuffer(70000); Field[] fields = (iProblemClass = IProblem.class).getFields(); diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CategorizedProblem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CategorizedProblem.java index 6b13fee0dc..55cb6c5b99 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CategorizedProblem.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CategorizedProblem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -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 *******************************************************************************/ @@ -103,6 +107,10 @@ public abstract class CategorizedProblem implements IProblem { * @since 3.14 */ public static final int CAT_MODULE = 160; + /** + * @since 3.17 BETA_JAVA_12 + */ + public static final int CAT_COMPLIANCE = 170; /** * Returns an integer identifying the category of this problem. Categories, like problem IDs are 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 89d3b15cd0..6e0d33a16f 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 @@ -813,6 +813,8 @@ public static int getProblemCategory(int severity, int problemID) { return CategorizedProblem.CAT_MEMBER; if ((problemID & IProblem.ModuleRelated) != 0) return CategorizedProblem.CAT_MODULE; + if ((problemID & IProblem.Compliance) != 0) + return CategorizedProblem.CAT_COMPLIANCE; } return CategorizedProblem.CAT_INTERNAL; } |