Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2018-02-10 15:03:11 +0000
committerStephan Herrmann2018-02-10 15:03:11 +0000
commit04a7a2f16598e6dfc11b5fd19394352b774285db (patch)
tree0837c3c0f8e3be37df7e2611b6c770dcb4eb0f32
parent1c6bbd7f9c4622e0f10b7704394751e77980e279 (diff)
downloadorg.eclipse.objectteams-04a7a2f16598e6dfc11b5fd19394352b774285db.tar.gz
org.eclipse.objectteams-04a7a2f16598e6dfc11b5fd19394352b774285db.tar.xz
org.eclipse.objectteams-04a7a2f16598e6dfc11b5fd19394352b774285db.zip
update jdt.core to S4_7_3_RC1 (M-4.7.3RC1-201802071700)
-rw-r--r--org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.core.tests.compiler/pom.xml4
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java123
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutomaticModuleNamingTest.java5
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java22
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java337
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java91
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java13
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java48
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java48
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java104
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java72
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java134
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java4
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java218
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java5064
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java24
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java7
-rw-r--r--org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.core.tests.model/pom.xml4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava9Tests.java4
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java20
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java3
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java353
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java12
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Java9ElementTests.java84
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java28
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java99
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleOptionsTests.java706
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java21
-rw-r--r--org.eclipse.jdt.core/.settings/.api_filters6
-rw-r--r--org.eclipse.jdt.core/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java44
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java26
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java15
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java9
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java18
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/AnnotationInfo.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfo.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java15
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java19
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java27
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithAnnotations.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java7
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/AutomaticModuleNaming.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryAnnotation.java9
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java85
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java66
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java7
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java20
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java25
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java5
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java7
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java9
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java198
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties14
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java7
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java8
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java54
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java7
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleUpdater.java9
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java5
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java5
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java67
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java32
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java91
-rw-r--r--org.eclipse.jdt.core/pom.xml4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java1
85 files changed, 5826 insertions, 2888 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
index 2726bf24f..cb05ce3d3 100644
--- a/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.core.tests.compiler;singleton:=true
-Bundle-Version: 3.12.360.qualifier
+Bundle-Version: 3.12.361.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.jdt.core.tests.compiler,
diff --git a/org.eclipse.jdt.core.tests.compiler/pom.xml b/org.eclipse.jdt.core.tests.compiler/pom.xml
index e8ec718fe..7e8a8ca95 100644
--- a/org.eclipse.jdt.core.tests.compiler/pom.xml
+++ b/org.eclipse.jdt.core.tests.compiler/pom.xml
@@ -15,12 +15,12 @@
<parent>
<artifactId>tests-pom</artifactId>
<groupId>eclipse.jdt.core</groupId>
- <version>4.7.2-SNAPSHOT</version>
+ <version>4.7.3-SNAPSHOT</version>
<relativePath>../tests-pom/</relativePath>
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.core.tests.compiler</artifactId>
- <version>3.12.360-SNAPSHOT</version>
+ <version>3.12.361-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
index cab79d206..92e0ceb06 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -98,6 +98,111 @@ import org.osgi.framework.Bundle;
@SuppressWarnings({ "unchecked", "rawtypes" })
public abstract class AbstractRegressionTest extends AbstractCompilerTest implements StopableTestCase {
+ static final String[] env = System.getenv().entrySet().stream()
+ .filter(e -> !"JAVA_TOOL_OPTIONS".equals(e.getKey()))
+ .map(e -> e.getKey() + "=" + e.getValue())
+ .toArray(String[]::new);
+
+ protected class Runner {
+ boolean shouldFlushOutputDirectory = true;
+ // input:
+ String[] testFiles;
+ String[] dependantFiles;
+ String[] classLibraries;
+ // control compilation:
+ Map<String,String> customOptions;
+ boolean performStatementsRecovery;
+ boolean generateOutput;
+ ICompilerRequestor customRequestor;
+ // compiler result:
+ String expectedCompilerLog;
+ String[] alternateCompilerLogs;
+ boolean showCategory;
+ boolean showWarningToken;
+ // javac:
+ boolean skipJavac;
+ JavacTestOptions javacTestOptions;
+ // execution:
+ boolean forceExecution;
+ String[] vmArguments;
+ String expectedOutputString;
+ String expectedErrorString;
+
+ ASTVisitor visitor;
+
+ @SuppressWarnings("synthetic-access")
+ protected void runConformTest() {
+ runTest(this.shouldFlushOutputDirectory,
+ this.testFiles,
+ this.dependantFiles != null ? this.dependantFiles : new String[] {},
+ this.classLibraries,
+ this.customOptions,
+ this.performStatementsRecovery,
+ new Requestor(
+ this.generateOutput,
+ this.customRequestor,
+ this.showCategory,
+ this.showWarningToken),
+ false,
+ this.expectedCompilerLog,
+ this.alternateCompilerLogs,
+ this.forceExecution,
+ this.vmArguments,
+ this.expectedOutputString,
+ this.expectedErrorString,
+ this.visitor,
+ this.skipJavac ? JavacTestOptions.SKIP : this.javacTestOptions);
+ }
+
+ @SuppressWarnings("synthetic-access")
+ protected void runNegativeTest() {
+ runTest(this.shouldFlushOutputDirectory,
+ this.testFiles,
+ this.dependantFiles != null ? this.dependantFiles : new String[] {},
+ this.classLibraries,
+ this.customOptions,
+ this.performStatementsRecovery,
+ new Requestor(
+ this.generateOutput,
+ this.customRequestor,
+ this.showCategory,
+ this.showWarningToken),
+ true,
+ this.expectedCompilerLog,
+ this.alternateCompilerLogs,
+ this.forceExecution,
+ this.vmArguments,
+ this.expectedOutputString,
+ this.expectedErrorString,
+ this.visitor,
+ this.skipJavac ? JavacTestOptions.SKIP : this.javacTestOptions);
+ }
+
+ @SuppressWarnings("synthetic-access")
+ protected void runWarningTest() {
+ runTest(this.shouldFlushOutputDirectory,
+ this.testFiles,
+ this.dependantFiles != null ? this.dependantFiles : new String[] {},
+ this.classLibraries,
+ this.customOptions,
+ this.performStatementsRecovery,
+ new Requestor(
+ this.generateOutput,
+ this.customRequestor,
+ this.showCategory,
+ this.showWarningToken),
+ false,
+ this.expectedCompilerLog,
+ this.alternateCompilerLogs,
+ this.forceExecution,
+ this.vmArguments,
+ this.expectedOutputString,
+ this.expectedErrorString,
+ this.visitor,
+ this.skipJavac ? JavacTestOptions.SKIP : this.javacTestOptions);
+ }
+ }
+
// javac comparison related types, fields and methods - see runJavac for
// details
static class JavacCompiler {
@@ -148,7 +253,7 @@ static class JavacCompiler {
static String getVersion(String javacPathName) throws IOException, InterruptedException {
Process fetchVersionProcess = null;
try {
- fetchVersionProcess = Runtime.getRuntime().exec(javacPathName + " -version", null, null);
+ fetchVersionProcess = Runtime.getRuntime().exec(javacPathName + " -version", env, null);
Logger versionStdErrLogger = new Logger(fetchVersionProcess.getErrorStream(), ""); // for javac <= 1.8
Logger versionStdOutLogger = new Logger(fetchVersionProcess.getInputStream(), ""); // for javac >= 9
versionStdErrLogger.start();
@@ -256,7 +361,7 @@ static class JavacCompiler {
} else {
cmdLineAsString = cmdLine.toString();
}
- compileProcess = Runtime.getRuntime().exec(cmdLineAsString, null, directory);
+ compileProcess = Runtime.getRuntime().exec(cmdLineAsString, env, directory);
Logger errorLogger = new Logger(compileProcess.getErrorStream(),
"ERROR", log == null ? new StringBuffer() : log);
errorLogger.start();
@@ -308,7 +413,7 @@ static class JavaRuntime {
cmdLine.append(options);
cmdLine.append(' ');
cmdLine.append(className);
- executionProcess = Runtime.getRuntime().exec(cmdLine.toString(), null, directory);
+ executionProcess = Runtime.getRuntime().exec(cmdLine.toString(), env, directory);
Logger outputLogger = new Logger(executionProcess.getInputStream(),
"RUNTIME OUTPUT", stdout == null ? new StringBuffer() : stdout);
outputLogger.start();
@@ -1653,7 +1758,7 @@ protected static class JavacTestOptions {
// Launch process
compileProcess = Runtime.getRuntime().exec(
- cmdLine.toString(), null, this.outputTestDirectory);
+ cmdLine.toString(), env, this.outputTestDirectory);
// Log errors
Logger errorLogger = new Logger(compileProcess.getErrorStream(), "ERROR");
@@ -1718,7 +1823,7 @@ protected static class JavacTestOptions {
javaCmdLine.append(cp);
javaCmdLine.append(' ').append(testFiles[0].substring(0, testFiles[0].indexOf('.')));
// assume executable class is name of first test file - PREMATURE check if this is also the case in other test fwk classes
- execProcess = Runtime.getRuntime().exec(javaCmdLine.toString(), null, this.outputTestDirectory);
+ execProcess = Runtime.getRuntime().exec(javaCmdLine.toString(), env, this.outputTestDirectory);
Logger logger = new Logger(execProcess.getInputStream(), "");
// PREMATURE implement consistent error policy
logger.start();
@@ -1807,7 +1912,7 @@ protected static class JavacTestOptions {
// Launch process
File currentDirectory = new File(currentDirectoryPath);
compileProcess = Runtime.getRuntime().exec(
- cmdLine.toString(), null, currentDirectory);
+ cmdLine.toString(), env, currentDirectory);
// Log errors
Logger errorLogger = new Logger(compileProcess.getErrorStream(), "ERROR");
@@ -3315,6 +3420,10 @@ protected void runNegativeTest(
if (outputDir.exists()) {
Util.flushDirectoryContent(outputDir);
}
+ File libDir = new File(LIB_DIR);
+ if (libDir.exists()) {
+ Util.flushDirectoryContent(libDir);
+ }
super.tearDown();
if (RUN_JAVAC) {
if (JAVAC_OUTPUT_DIR.exists()) {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutomaticModuleNamingTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutomaticModuleNamingTest.java
index 4f7bf13b4..4693025d9 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutomaticModuleNamingTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutomaticModuleNamingTest.java
@@ -114,4 +114,9 @@ public class AutomaticModuleNamingTest extends AbstractRegressionTest {
new String(determineAutomaticModuleNameFromFileName("CLASSES12.ZIP", true, true)));
}
+ public void testBug529680() throws Exception {
+ assertEquals("hibernate.jpa", new String(
+ determineAutomaticModuleNameFromFileName("hibernate-jpa-2.1-api-1.0.0.Final.jar", true, true)));
+ }
+
}
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 00f694acb..04a91cc01 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, 2017 IBM Corporation and others.
+ * Copyright (c) 2006, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -913,7 +913,9 @@ public void _test011_problem_categories() {
expectedProblemAttributes.put("OuterLocalMustBeEffectivelyFinal", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
expectedProblemAttributes.put("OuterLocalMustBeFinal", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
expectedProblemAttributes.put("OverridingDeprecatedMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
+ expectedProblemAttributes.put("OverridingDeprecatedSinceVersionMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
expectedProblemAttributes.put("OverridingTerminallyDeprecatedMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
+ expectedProblemAttributes.put("OverridingTerminallyDeprecatedSinceVersionMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
expectedProblemAttributes.put("OverridingMethodWithoutSuperInvocation", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM));
expectedProblemAttributes.put("OverridingNonVisibleMethod", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT));
expectedProblemAttributes.put("PackageCollidesWithType", new ProblemAttributes(CategorizedProblem.CAT_TYPE));
@@ -1130,10 +1132,18 @@ public void _test011_problem_categories() {
expectedProblemAttributes.put("UsingDeprecatedField", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
expectedProblemAttributes.put("UsingDeprecatedMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
expectedProblemAttributes.put("UsingDeprecatedType", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
+ expectedProblemAttributes.put("UsingDeprecatedSinceVersionConstructor", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
+ expectedProblemAttributes.put("UsingDeprecatedSinceVersionField", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
+ expectedProblemAttributes.put("UsingDeprecatedSinceVersionMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
+ expectedProblemAttributes.put("UsingDeprecatedSinceVersionType", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
expectedProblemAttributes.put("UsingTerminallyDeprecatedConstructor", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
expectedProblemAttributes.put("UsingTerminallyDeprecatedField", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
expectedProblemAttributes.put("UsingTerminallyDeprecatedMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
expectedProblemAttributes.put("UsingTerminallyDeprecatedType", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
+ expectedProblemAttributes.put("UsingTerminallyDeprecatedSinceVersionConstructor", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
+ expectedProblemAttributes.put("UsingTerminallyDeprecatedSinceVersionField", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
+ expectedProblemAttributes.put("UsingTerminallyDeprecatedSinceVersionMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
+ expectedProblemAttributes.put("UsingTerminallyDeprecatedSinceVersionType", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION));
expectedProblemAttributes.put("VarargsElementTypeNotVisible", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
expectedProblemAttributes.put("VarargsElementTypeNotVisibleForConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
expectedProblemAttributes.put("VarargsConflict", new ProblemAttributes(CategorizedProblem.CAT_MEMBER));
@@ -1882,7 +1892,9 @@ public void test012_compiler_problems_tuning() {
expectedProblemAttributes.put("OuterLocalMustBeEffectivelyFinal", SKIP);
expectedProblemAttributes.put("OuterLocalMustBeFinal", SKIP);
expectedProblemAttributes.put("OverridingDeprecatedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION));
+ expectedProblemAttributes.put("OverridingDeprecatedSinceVersionMethod", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION));
expectedProblemAttributes.put("OverridingTerminallyDeprecatedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION));
+ expectedProblemAttributes.put("OverridingTerminallyDeprecatedSinceVersionMethod", new ProblemAttributes(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION));
expectedProblemAttributes.put("OverridingMethodWithoutSuperInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_OVERRIDING_METHOD_WITHOUT_SUPER_INVOCATION));
expectedProblemAttributes.put("OverridingNonVisibleMethod", new ProblemAttributes(JavaCore.COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD));
expectedProblemAttributes.put("PackageCollidesWithType", SKIP);
@@ -2099,10 +2111,18 @@ public void test012_compiler_problems_tuning() {
expectedProblemAttributes.put("UsingDeprecatedField", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION));
expectedProblemAttributes.put("UsingDeprecatedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION));
expectedProblemAttributes.put("UsingDeprecatedType", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION));
+ expectedProblemAttributes.put("UsingDeprecatedSinceVersionConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION));
+ expectedProblemAttributes.put("UsingDeprecatedSinceVersionField", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION));
+ expectedProblemAttributes.put("UsingDeprecatedSinceVersionMethod", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION));
+ expectedProblemAttributes.put("UsingDeprecatedSinceVersionType", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION));
expectedProblemAttributes.put("UsingTerminallyDeprecatedConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION));
expectedProblemAttributes.put("UsingTerminallyDeprecatedField", new ProblemAttributes(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION));
expectedProblemAttributes.put("UsingTerminallyDeprecatedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION));
expectedProblemAttributes.put("UsingTerminallyDeprecatedType", new ProblemAttributes(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION));
+ expectedProblemAttributes.put("UsingTerminallyDeprecatedSinceVersionConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION));
+ expectedProblemAttributes.put("UsingTerminallyDeprecatedSinceVersionField", new ProblemAttributes(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION));
+ expectedProblemAttributes.put("UsingTerminallyDeprecatedSinceVersionMethod", new ProblemAttributes(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION));
+ expectedProblemAttributes.put("UsingTerminallyDeprecatedSinceVersionType", new ProblemAttributes(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION));
expectedProblemAttributes.put("VarargsConflict", SKIP);
expectedProblemAttributes.put("VarargsElementTypeNotVisible", SKIP);
expectedProblemAttributes.put("VarargsElementTypeNotVisibleForConstructor", SKIP);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
index 027b98ee1..0b10539f4 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
@@ -64,7 +64,7 @@ public class Deprecated9Test extends AbstractRegressionTest {
"1. ERROR in p\\M1.java (at line 4)\n" +
" a.N1.N2.N3 m = null;\n" +
" ^^\n" +
- "The type N1.N2 has been deprecated and marked for removal\n" +
+ "The type N1.N2 has been deprecated since version 1.2 and marked for removal\n" +
"----------\n" +
"2. ERROR in p\\M1.java (at line 4)\n" +
" a.N1.N2.N3 m = null;\n" +
@@ -78,6 +78,61 @@ public class Deprecated9Test extends AbstractRegressionTest {
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
+ public void test002binary() {
+ Runner runner = new Runner();
+ runner.customOptions = new HashMap<>();
+ runner.customOptions.put(JavaCore.COMPILER_PB_DEPRECATION, CompilerOptions.WARNING);
+ runner.customOptions.put(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION, CompilerOptions.ERROR);
+ runner.customOptions.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.IGNORE);
+ runner.testFiles =
+ new String[] {
+ "a/N1.java",
+ "package a;\n" +
+ "public class N1 {\n" +
+ " @Deprecated(since=\"1.2\",forRemoval=true)\n" +
+ " public class N2 {" +
+ " public void foo() {}" +
+ " public class N3 {" +
+ " public void foo() {}" +
+ " }" +
+ " }" +
+ "}\n"
+ };
+ runner.runConformTest();
+
+ runner.shouldFlushOutputDirectory = false;
+ runner.testFiles =
+ new String[] {
+ "p/M1.java",
+ "package p;\n" +
+ "public class M1 {\n" +
+ " void bar() {\n" +
+ " a.N1.N2.N3 m = null;\n" +
+ " m.foo();\n" +
+ " }\n" +
+ "}\n"
+ };
+ runner.expectedCompilerLog =
+ "----------\n" +
+ "1. ERROR in p\\M1.java (at line 4)\n" +
+ " a.N1.N2.N3 m = null;\n" +
+ " ^^\n" +
+ "The type N1.N2 has been deprecated since version 1.2 and marked for removal\n" +
+ "----------\n" +
+ "2. ERROR in p\\M1.java (at line 4)\n" +
+ " a.N1.N2.N3 m = null;\n" +
+ " ^^\n" +
+ "The type N1.N2.N3 has been deprecated and marked for removal\n" +
+ "----------\n" +
+ "3. ERROR in p\\M1.java (at line 5)\n" +
+ " m.foo();\n" +
+ " ^^^^^\n" +
+ "The method foo() from the type N1.N2.N3 has been deprecated and marked for removal\n" +
+ "----------\n";
+ runner.javacTestOptions =
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+ runner.runNegativeTest();
+ }
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=191909
public void test004() {
Map<String, String> customOptions = new HashMap<>();
@@ -106,12 +161,12 @@ public class Deprecated9Test extends AbstractRegressionTest {
"1. ERROR in test1\\E02.java (at line 4)\n" +
" System.out.println(E01.x);\n" +
" ^\n" +
- "The field E01.x has been deprecated and marked for removal\n" +
+ "The field E01.x has been deprecated since version 3 and marked for removal\n" +
"----------\n" +
"2. ERROR in test1\\E02.java (at line 5)\n" +
" System.out.println(E01.y);\n" +
" ^\n" +
- "The field E01.y has been deprecated and marked for removal\n" +
+ "The field E01.y has been deprecated since version 3 and marked for removal\n" +
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
@@ -160,8 +215,6 @@ public class Deprecated9Test extends AbstractRegressionTest {
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
- // Bug 354536 - compiling package-info.java still depends on the order of compilation units
- // - option is disabled
public void test005b() {
Map<String, String> customOptions = new HashMap<>();
customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING);
@@ -188,14 +241,12 @@ public class Deprecated9Test extends AbstractRegressionTest {
},
customOptions);
}
- // Bug 354536 - compiling package-info.java still depends on the order of compilation units
- // some warnings suppressed
public void test005c() {
- Map<String, String> customOptions = new HashMap<>();
- customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING);
- customOptions.put(CompilerOptions.OPTION_ReportTerminalDeprecation, CompilerOptions.WARNING);
- this.runNegativeTest(
- true,
+ Runner runner = new Runner();
+ runner.customOptions = new HashMap<>();
+ runner.customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING);
+ runner.customOptions.put(CompilerOptions.OPTION_ReportTerminalDeprecation, CompilerOptions.WARNING);
+ runner.testFiles =
new String[] {
"p1/X.java",
"package p1;\n" +
@@ -216,24 +267,22 @@ public class Deprecated9Test extends AbstractRegressionTest {
" a.foo();\n" +
" }\n" +
"}\n",
- },
- null, customOptions,
+ };
+ runner.expectedCompilerLog =
"----------\n" +
"1. WARNING in p2\\C.java (at line 5)\n" +
" a.foo();\n" +
" ^^^^^\n" +
"The method foo() from the type X.Inner has been deprecated and marked for removal\n" +
- "----------\n",
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
+ "----------\n";
+ runner.runWarningTest();
}
- // https://bugs.eclipse.org/384870 - [compiler] @Deprecated annotation not detected if preceded by other annotation
- // old-style deprecation
public void test006() {
- Map<String, String> customOptions = new HashMap<>();
- customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING);
- customOptions.put(CompilerOptions.OPTION_ReportTerminalDeprecation, CompilerOptions.ERROR);
- this.runNegativeTest(
- true,
+ Runner runner = new Runner();
+ runner.customOptions = new HashMap<>();
+ runner.customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING);
+ runner.customOptions.put(CompilerOptions.OPTION_ReportTerminalDeprecation, CompilerOptions.ERROR);
+ runner.testFiles =
new String[] {
"test1/E02.java",
"package test1;\n" +
@@ -248,15 +297,15 @@ public class Deprecated9Test extends AbstractRegressionTest {
"public class E01 {\n" +
" public static int x = 5;\n" +
"}"
- },
- null, customOptions,
+ };
+ runner.expectedCompilerLog =
"----------\n" +
"1. WARNING in test1\\E02.java (at line 3)\n" +
" public void foo(E01 arg) {\n" +
" ^^^\n" +
- "The type E01 is deprecated\n" +
- "----------\n",
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
+ "The type E01 is deprecated since version 4\n" +
+ "----------\n";
+ runner.runWarningTest();
}
// method overriding
public void test007() {
@@ -297,7 +346,239 @@ public class Deprecated9Test extends AbstractRegressionTest {
"----------\n",
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
}
+ public void testSinceSource() {
+ Runner runner = new Runner();
+ runner.customOptions = new HashMap<>();
+ runner.customOptions.put(JavaCore.COMPILER_PB_DEPRECATION, CompilerOptions.WARNING);
+ runner.customOptions.put(JavaCore.COMPILER_PB_DEPRECATION_WHEN_OVERRIDING_DEPRECATED_METHOD, CompilerOptions.ENABLED);
+ runner.customOptions.put(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION, CompilerOptions.ERROR);
+ runner.testFiles =
+ new String[] {
+ "test1/E01.java",
+ "package test1;\n" +
+ "public class E01 {\n" +
+ " @Deprecated(since=\"1.0\") protected static class Old {}\n" +
+ " @Deprecated(since=\"2\") public static int x = 5, y= 10;\n" +
+ " @Deprecated(since=\"3.0.0\") public E01() {}\n" +
+ " @Deprecated(since=\"4-SNAPSHOT\") protected void old() {}\n" +
+ "}",
+ "test1/E02.java",
+ "package test1;\n" +
+ "public class E02 {\n" +
+ " public void foo() {\n" +
+ " System.out.println(new E01.Old());\n" +
+ " E01 e = new E01();\n" +
+ " e.old();\n" +
+ " System.out.println(E01.x);\n" +
+ " System.out.println(E01.y);\n" +
+ " }\n" +
+ " class E03 extends E01 {\n" +
+ " protected void old() {}\n" +
+ " }\n" +
+ "}"
+ };
+ runner.expectedCompilerLog =
+ "----------\n" +
+ "1. WARNING in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor E01.Old() is deprecated since version 1.0\n" +
+ "----------\n" +
+ "2. WARNING in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^\n" +
+ "The type E01.Old is deprecated since version 1.0\n" +
+ "----------\n" +
+ "3. WARNING in test1\\E02.java (at line 5)\n" +
+ " E01 e = new E01();\n" +
+ " ^^^^^\n" +
+ "The constructor E01() is deprecated since version 3.0.0\n" +
+ "----------\n" +
+ "4. WARNING in test1\\E02.java (at line 6)\n" +
+ " e.old();\n" +
+ " ^^^^^\n" +
+ "The method old() from the type E01 is deprecated since version 4-SNAPSHOT\n" +
+ "----------\n" +
+ "5. WARNING in test1\\E02.java (at line 7)\n" +
+ " System.out.println(E01.x);\n" +
+ " ^\n" +
+ "The field E01.x is deprecated since version 2\n" +
+ "----------\n" +
+ "6. WARNING in test1\\E02.java (at line 8)\n" +
+ " System.out.println(E01.y);\n" +
+ " ^\n" +
+ "The field E01.y is deprecated since version 2\n" +
+ "----------\n" +
+ "7. WARNING in test1\\E02.java (at line 10)\n" +
+ " class E03 extends E01 {\n" +
+ " ^^^\n" +
+ "The constructor E01() is deprecated since version 3.0.0\n" +
+ "----------\n" +
+ "8. WARNING in test1\\E02.java (at line 11)\n" +
+ " protected void old() {}\n" +
+ " ^^^^^\n" +
+ "The method E02.E03.old() overrides a method from E01 that is deprecated since version 4-SNAPSHOT\n" +
+ "----------\n";
+ runner.runWarningTest();
+ }
+ public void testSinceBinary() {
+ Runner runner = new Runner();
+ runner.customOptions = new HashMap<>();
+ runner.customOptions.put(JavaCore.COMPILER_PB_DEPRECATION, CompilerOptions.WARNING);
+ runner.customOptions.put(JavaCore.COMPILER_PB_DEPRECATION_WHEN_OVERRIDING_DEPRECATED_METHOD, CompilerOptions.ENABLED);
+ runner.customOptions.put(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION, CompilerOptions.ERROR);
+ runner.testFiles =
+ new String[] {
+ "test1/E01.java",
+ "package test1;\n" +
+ "public class E01 {\n" +
+ " @Deprecated(since=\"1.0\") protected static class Old {}\n" +
+ " @Deprecated(since=\"2\") public static int x = 5, y= 10;\n" +
+ " @Deprecated(since=\"3.0.0\") public E01() {}\n" +
+ " @Deprecated(since=\"4-SNAPSHOT\") protected void old() {}\n" +
+ "}"
+ };
+ runner.runConformTest();
+ runner.shouldFlushOutputDirectory = false;
+ runner.testFiles =
+ new String[] {
+ "test1/E02.java",
+ "package test1;\n" +
+ "public class E02 {\n" +
+ " public void foo() {\n" +
+ " System.out.println(new E01.Old());\n" +
+ " E01 e = new E01();\n" +
+ " e.old();\n" +
+ " System.out.println(E01.x);\n" +
+ " System.out.println(E01.y);\n" +
+ " }\n" +
+ " class E03 extends E01 {\n" +
+ " protected void old() {}\n" +
+ " }\n" +
+ "}"
+ };
+ runner.expectedCompilerLog =
+ "----------\n" +
+ "1. WARNING in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor E01.Old() is deprecated since version 1.0\n" +
+ "----------\n" +
+ "2. WARNING in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^\n" +
+ "The type E01.Old is deprecated since version 1.0\n" +
+ "----------\n" +
+ "3. WARNING in test1\\E02.java (at line 5)\n" +
+ " E01 e = new E01();\n" +
+ " ^^^^^\n" +
+ "The constructor E01() is deprecated since version 3.0.0\n" +
+ "----------\n" +
+ "4. WARNING in test1\\E02.java (at line 6)\n" +
+ " e.old();\n" +
+ " ^^^^^\n" +
+ "The method old() from the type E01 is deprecated since version 4-SNAPSHOT\n" +
+ "----------\n" +
+ "5. WARNING in test1\\E02.java (at line 7)\n" +
+ " System.out.println(E01.x);\n" +
+ " ^\n" +
+ "The field E01.x is deprecated since version 2\n" +
+ "----------\n" +
+ "6. WARNING in test1\\E02.java (at line 8)\n" +
+ " System.out.println(E01.y);\n" +
+ " ^\n" +
+ "The field E01.y is deprecated since version 2\n" +
+ "----------\n" +
+ "7. WARNING in test1\\E02.java (at line 10)\n" +
+ " class E03 extends E01 {\n" +
+ " ^^^\n" +
+ "The constructor E01() is deprecated since version 3.0.0\n" +
+ "----------\n" +
+ "8. WARNING in test1\\E02.java (at line 11)\n" +
+ " protected void old() {}\n" +
+ " ^^^^^\n" +
+ "The method E02.E03.old() overrides a method from E01 that is deprecated since version 4-SNAPSHOT\n" +
+ "----------\n";
+ runner.runWarningTest();
+ }
+ public void testSinceTerminally() {
+ Runner runner = new Runner();
+ runner.customOptions = new HashMap<>();
+ runner.customOptions.put(JavaCore.COMPILER_PB_DEPRECATION, CompilerOptions.WARNING);
+ runner.customOptions.put(JavaCore.COMPILER_PB_DEPRECATION_WHEN_OVERRIDING_DEPRECATED_METHOD, CompilerOptions.ENABLED);
+ runner.customOptions.put(JavaCore.COMPILER_PB_TERMINAL_DEPRECATION, CompilerOptions.ERROR);
+ runner.testFiles =
+ new String[] {
+ "test1/E01.java",
+ "package test1;\n" +
+ "public class E01 {\n" +
+ " @Deprecated(since=\"1.0\", forRemoval=true) protected static class Old {}\n" +
+ " @Deprecated(since=\"2\", forRemoval=true) public static int x = 5, y= 10;\n" +
+ " @Deprecated(since=\"3.0.0\", forRemoval=true) public E01() {}\n" +
+ " @Deprecated(since=\"4-SNAPSHOT\", forRemoval=true) protected void old() {}\n" +
+ "}",
+ "test1/E02.java",
+ "package test1;\n" +
+ "public class E02 {\n" +
+ " public void foo() {\n" +
+ " System.out.println(new E01.Old());\n" +
+ " E01 e = new E01();\n" +
+ " e.old();\n" +
+ " System.out.println(E01.x);\n" +
+ " System.out.println(E01.y);\n" +
+ " }\n" +
+ " class E03 extends E01 {\n" +
+ " protected void old() {}\n" +
+ " }\n" +
+ "}"
+ };
+ runner.expectedCompilerLog =
+ "----------\n" +
+ "1. ERROR in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^^^^^^^\n" +
+ "The constructor E01.Old() has been deprecated since version 1.0 and marked for removal\n" +
+ "----------\n" +
+ "2. ERROR in test1\\E02.java (at line 4)\n" +
+ " System.out.println(new E01.Old());\n" +
+ " ^^^\n" +
+ "The type E01.Old has been deprecated since version 1.0 and marked for removal\n" +
+ "----------\n" +
+ "3. ERROR in test1\\E02.java (at line 5)\n" +
+ " E01 e = new E01();\n" +
+ " ^^^^^\n" +
+ "The constructor E01() has been deprecated since version 3.0.0 and marked for removal\n" +
+ "----------\n" +
+ "4. ERROR in test1\\E02.java (at line 6)\n" +
+ " e.old();\n" +
+ " ^^^^^\n" +
+ "The method old() from the type E01 has been deprecated since version 4-SNAPSHOT and marked for removal\n" +
+ "----------\n" +
+ "5. ERROR in test1\\E02.java (at line 7)\n" +
+ " System.out.println(E01.x);\n" +
+ " ^\n" +
+ "The field E01.x has been deprecated since version 2 and marked for removal\n" +
+ "----------\n" +
+ "6. ERROR in test1\\E02.java (at line 8)\n" +
+ " System.out.println(E01.y);\n" +
+ " ^\n" +
+ "The field E01.y has been deprecated since version 2 and marked for removal\n" +
+ "----------\n" +
+ "7. ERROR in test1\\E02.java (at line 10)\n" +
+ " class E03 extends E01 {\n" +
+ " ^^^\n" +
+ "The constructor E01() has been deprecated since version 3.0.0 and marked for removal\n" +
+ "----------\n" +
+ "8. ERROR in test1\\E02.java (at line 11)\n" +
+ " protected void old() {}\n" +
+ " ^^^^^\n" +
+ "The method E02.E03.old() overrides a method from E01 that has been deprecated since version 4-SNAPSHOT and marked for removal\n" +
+ "----------\n";
+ runner.javacTestOptions =
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError;
+ runner.runNegativeTest();
+ }
public static Class<?> testClass() {
return Deprecated9Test.class;
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java
index f59d3c316..c75a8b517 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,22 +10,70 @@
*******************************************************************************/
package org.eclipse.jdt.core.tests.compiler.regression;
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.core.tests.util.Util;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
+import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import junit.framework.Test;
@SuppressWarnings({ "unchecked", "rawtypes" })
public class DeprecatedTest extends AbstractRegressionTest {
+
+static {
+// TESTS_NAMES = new String[] { "test008a" };
+}
+
+protected char[][] invisibleType;
+
public DeprecatedTest(String name) {
super(name);
}
public static Test suite() {
return buildAllCompliancesTestSuite(testClass());
}
+
+@Override
+protected void tearDown() throws Exception {
+ this.invisibleType = null;
+ super.tearDown();
+}
+
+@Override
+protected INameEnvironment getNameEnvironment(final String[] testFiles, String[] classPaths) {
+ // constructs a name environment that is able to hide a type of name 'this.invisibleType':
+ this.classpaths = classPaths == null ? getDefaultClassPaths() : classPaths;
+ return new InMemoryNameEnvironment(testFiles, getClassLibs(classPaths == null)) {
+ @Override
+ public NameEnvironmentAnswer findType(char[][] compoundTypeName) {
+ if (DeprecatedTest.this.invisibleType != null && CharOperation.equals(DeprecatedTest.this.invisibleType, compoundTypeName))
+ return null;
+ return super.findType(compoundTypeName);
+ }
+ @Override
+ public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) {
+ if (DeprecatedTest.this.invisibleType != null && DeprecatedTest.this.invisibleType.length == packageName.length+1) {
+ char[][] packName = CharOperation.subarray(DeprecatedTest.this.invisibleType, 0, DeprecatedTest.this.invisibleType.length-1);
+ if (CharOperation.equals(packageName, packName)) {
+ char[] simpleName = DeprecatedTest.this.invisibleType[DeprecatedTest.this.invisibleType.length-1];
+ if (CharOperation.equals(simpleName, typeName))
+ return null;
+ }
+ }
+ return super.findType(typeName, packageName);
+ }
+ };
+}
+
public void test001() {
this.runNegativeTest(new String[] {
"p/B.java",
@@ -316,6 +364,47 @@ public void test008() {
false, // flush previous output dir content
null); // custom options
}
+// variation of test008 on behalf of Bug 526335 - [9][hovering] Deprecation warning should show the new 'since' deprecation value
+// verify that we don't attempt to access java.lang.Deprecated in a 1.4 based compilation.
+public void test008a() throws IOException {
+ String jarPath = LIB_DIR+File.separator+"p008"+File.separator+"x.jar";
+ Util.createJar(new String[] {
+ "X.java",
+ "package p008;\n" +
+ "@Deprecated\n" +
+ "public class X {\n" +
+ "}\n",
+ },
+ jarPath,
+ "1.5");
+
+ Runner runner = new Runner();
+ runner.testFiles =
+ new String[] {
+ "Y.java",
+ "public class Y {\n" +
+ " void foo() {\n" +
+ " p008.X x;\n" +
+ " }\n" +
+ "}\n",
+ };
+ String[] libs = getDefaultClassPaths();
+ libs = Arrays.copyOf(libs, libs.length+1);
+ libs[libs.length-1] = jarPath;
+ runner.classLibraries = libs;
+ runner.expectedCompilerLog =
+ "----------\n" +
+ "1. WARNING in Y.java (at line 3)\n" +
+ " p008.X x;\n" +
+ " ^\n" +
+ "The type X is deprecated\n" +
+ "----------\n";
+ if (this.complianceLevel < ClassFileConstants.JDK1_5) {
+ // simulate we were running on a JRE without java.lang.Deprecated
+ this.invisibleType = TypeConstants.JAVA_LANG_DEPRECATED;
+ }
+ runner.runWarningTest();
+}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=88124 - variation
public void test009() {
this.runNegativeTest(
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
index 6024c5d3f..07dd703b1 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java
@@ -39805,24 +39805,11 @@ public void test1142() {
"}\n", // =================
},
// compiler results
- this.complianceLevel < ClassFileConstants.JDK1_8 ?
"----------\n" + /* expected compiler log */
"1. ERROR in X.java (at line 5)\n" +
" return compound(asList(a, b));\n" +
" ^^^^^^^^\n" +
"The method compound(Iterable<? extends Comparator<? super T>>) in the type X is not applicable for the arguments (List<Comparator<? extends Object>>)\n" +
- "----------\n"
- // 1.8+ ATM, we generate an extra error due to inner poly expression evaluation.
- :"----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " return compound(asList(a, b));\n" +
- " ^^^^^^^^\n" +
- "The method compound(Iterable<? extends Comparator<? super T>>) in the type X is not applicable for the arguments (List<Comparator<? extends Object>>)\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " return compound(asList(a, b));\n" +
- " ^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from List<Comparator<? extends Object>> to Iterable<? extends Comparator<? super T>>\n" +
"----------\n",
// javac options
JavacTestOptions.JavacHasABug.JavacBug6573446 /* javac test options */);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
index a3fb59f99..65df2f512 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
@@ -1235,12 +1235,7 @@ public void testBug425493() {
" ^^^^^^^^^^^^\n" +
"The method addAttribute(Test.Attribute<T>, T) in the type Test is not applicable for the arguments (Test.Attribute<capture#1-of ?>, capture#2-of ?)\n" +
"----------\n" +
- "2. ERROR in Test.java (at line 3)\n" +
- " addAttribute(java.util.Objects.requireNonNull(attribute, \"\"),\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Test.Attribute<capture#1-of ?> to Test.Attribute<T>\n" +
- "----------\n" +
- "3. ERROR in Test.java (at line 5)\n" +
+ "2. ERROR in Test.java (at line 5)\n" +
" addAttribute(attribute, attribute.getDefault());\n" +
" ^^^^^^^^^^^^\n" +
"The method addAttribute(Test.Attribute<T>, T) in the type Test is not applicable for the arguments (Test.Attribute<capture#3-of ?>, capture#4-of ?)\n" +
@@ -7019,11 +7014,6 @@ public void testBug502350() {
" Stuff.func(Comparator.naturalOrder());\n" +
" ^^^^\n" +
"The method func(Comparator<T>) in the type Stuff is not applicable for the arguments (Comparator<Comparable<Comparable<B>>>)\n" +
- "----------\n" +
- "2. ERROR in makeCompilerFreeze\\EclipseJava8Bug.java (at line 20)\n" +
- " Stuff.func(Comparator.naturalOrder());\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Type mismatch: cannot convert from Comparator<Comparable<Comparable<B>>> to Comparator<T>\n" +
"----------\n"
);
}
@@ -8548,4 +8538,40 @@ public void testBug508834_comment0() {
"Type safety: The expression of type Action[] needs unchecked conversion to conform to Action<S2>[]\n" +
"----------\n");
}
+ public void testBug519147() {
+ runConformTest(
+ new String[] {
+ "Main.java",
+ "import java.util.HashMap;\n" +
+ "import java.util.HashSet;\n" +
+ "import java.util.Set;\n" +
+ "\n" +
+ "public class Main<MyKey, MyValue> {\n" +
+ "\n" +
+ " static class MyMap<K, V> extends HashMap<K, V> {\n" +
+ " public MyMap<K, V> putAllReturning(MyMap<K, V> c) { putAll(c); return this; }\n" +
+ " public MyMap<K, V> putReturning(K key, V value) { put(key, value); return this; }\n" +
+ " }\n" +
+ "\n" +
+ " public Main() {\n" +
+ " Set<MyValue> values = new HashSet<>(); // actually something better\n" +
+ " final MyMap<MyKey, MyValue> myMap =\n" +
+ " values.stream()\n" +
+ " .reduce(\n" +
+ " new MyMap<MyKey, MyValue>(),\n" +
+ " (map, value) -> {\n" +
+ " Set<MyKey> keys = new HashSet<>(); // actually something better\n" +
+ "\n" +
+ " return keys.stream()\n" +
+ " .reduce(\n" +
+ " map, // this would work syntactically: new MyMap<MyKey, MyValue>(),\n" +
+ " (map2, key) -> map2.putReturning(key, value),\n" +
+ " MyMap::putAllReturning);\n" +
+ " },\n" +
+ " MyMap::putAllReturning\n" +
+ " );\n" +
+ " }\n" +
+ "}\n"
+ });
+ }
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java
index da87c14a3..c1d45d113 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java
@@ -708,6 +708,54 @@ public void testBug520874i() {
"Cycle detected: a cycle exists in the type hierarchy between A and C\n" +
"----------\n");
}
+public void testBug526681() {
+ runNegativeTest(
+ new String[] {
+ "p/A.java",
+ "package p;\n" +
+ "import p.B;\n" +
+ "public class A extends B {\n" +
+ " public static abstract class C {}\n" +
+ "}\n",
+ "p/B.java",
+ "package p;\n" +
+ "import p.A.C;\n" +
+ "public abstract class B extends C {}"
+ },
+ "----------\n" +
+ "1. ERROR in p\\A.java (at line 3)\n" +
+ " public class A extends B {\n" +
+ " ^\n" +
+ "The hierarchy of the type A is inconsistent\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in p\\B.java (at line 3)\n" +
+ " public abstract class B extends C {}\n" +
+ " ^\n" +
+ "Cycle detected: a cycle exists in the type hierarchy between B and A\n" +
+ "----------\n");
+}
+public void testBug527731() {
+ if (this.complianceLevel < ClassFileConstants.JDK1_8) return; // uses diamond, 1.7-inference fails, only 1.8 is good
+ runConformTest(
+ new String[] {
+ "OuterClass.java",
+ "import java.util.ArrayList;\n" +
+ "\n" +
+ "public class OuterClass<T> extends ArrayList<OuterClass.InnerTypedClass<T>> {\n" +
+ " \n" +
+ " public static interface InnerInterface {}\n" +
+ " \n" +
+ " public static class InnerTypedClass<T> implements InnerInterface {}\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " OuterClass<String> outerClass = new OuterClass<>();\n" +
+ " outerClass.add(new InnerTypedClass<>());\n" +
+ " System.out.println(outerClass);\n" +
+ " }\n" +
+ "}\n"
+ });
+}
public static Class<InnerClass15Test> testClass() {
return InnerClass15Test.class;
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java
index f0db088e5..8cf336fac 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2016 Jesper Steen Moller, IBM and others.
+ * Copyright (c) 2013, 2018 Jesper Steen Moller, IBM and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -426,41 +426,45 @@ public void test004() throws Exception {
" constant #15 utf8: \"SUCCESS\"\n" +
" constant #16 field_ref: #1.#17 X.s Ljava/lang/String;\n" +
" constant #17 name_and_type: #5.#6 s Ljava/lang/String;\n" +
- " constant #18 name_and_type: #19.#20 produce (Ljava/lang/String;)LStringProducer;\n" +
- " constant #19 utf8: \"produce\"\n" +
- " constant #20 utf8: \"(Ljava/lang/String;)LStringProducer;\"\n" +
- " constant #21 invoke dynamic: #0 #18 produce (Ljava/lang/String;)LStringProducer;\n" +
- " constant #22 field_ref: #1.#23 X.referenceExpression LStringProducer;\n" +
- " constant #23 name_and_type: #7.#8 referenceExpression LStringProducer;\n" +
- " constant #24 utf8: \"LineNumberTable\"\n" +
- " constant #25 utf8: \"LocalVariableTable\"\n" +
- " constant #26 utf8: \"this\"\n" +
- " constant #27 utf8: \"LX;\"\n" +
- " constant #28 utf8: \"SourceFile\"\n" +
- " constant #29 utf8: \"X.java\"\n" +
- " constant #30 utf8: \"BootstrapMethods\"\n" +
- " constant #31 method_ref: #32.#34 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #32 class: #33 java/lang/invoke/LambdaMetafactory\n" +
- " constant #33 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
- " constant #34 name_and_type: #35.#36 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
- " constant #35 utf8: \"metafactory\"\n" +
- " constant #36 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
- " constant #37 method handle: invokestatic (6) #31 \n" +
- " constant #38 utf8: \"()Ljava/lang/String;\"\n" +
- " constant #39 method type: #38 ()Ljava/lang/String;\n" +
- " constant #40 method_ref: #41.#43 java/lang/String.toString ()Ljava/lang/String;\n" +
- " constant #41 class: #42 java/lang/String\n" +
- " constant #42 utf8: \"java/lang/String\"\n" +
- " constant #43 name_and_type: #44.#38 toString ()Ljava/lang/String;\n" +
- " constant #44 utf8: \"toString\"\n" +
- " constant #45 method handle: invokevirtual (5) #40 \n" +
- " constant #46 method type: #38 ()Ljava/lang/String;\n" +
- " constant #47 utf8: \"InnerClasses\"\n" +
- " constant #48 class: #49 java/lang/invoke/MethodHandles$Lookup\n" +
- " constant #49 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
- " constant #50 class: #51 java/lang/invoke/MethodHandles\n" +
- " constant #51 utf8: \"java/lang/invoke/MethodHandles\"\n" +
- " constant #52 utf8: \"Lookup\"\n" +
+ " constant #18 method_ref: #3.#19 java/lang/Object.getClass ()Ljava/lang/Class;\n" +
+ " constant #19 name_and_type: #20.#21 getClass ()Ljava/lang/Class;\n" +
+ " constant #20 utf8: \"getClass\"\n" +
+ " constant #21 utf8: \"()Ljava/lang/Class;\"\n" +
+ " constant #22 name_and_type: #23.#24 produce (Ljava/lang/String;)LStringProducer;\n" +
+ " constant #23 utf8: \"produce\"\n" +
+ " constant #24 utf8: \"(Ljava/lang/String;)LStringProducer;\"\n" +
+ " constant #25 invoke dynamic: #0 #22 produce (Ljava/lang/String;)LStringProducer;\n" +
+ " constant #26 field_ref: #1.#27 X.referenceExpression LStringProducer;\n" +
+ " constant #27 name_and_type: #7.#8 referenceExpression LStringProducer;\n" +
+ " constant #28 utf8: \"LineNumberTable\"\n" +
+ " constant #29 utf8: \"LocalVariableTable\"\n" +
+ " constant #30 utf8: \"this\"\n" +
+ " constant #31 utf8: \"LX;\"\n" +
+ " constant #32 utf8: \"SourceFile\"\n" +
+ " constant #33 utf8: \"X.java\"\n" +
+ " constant #34 utf8: \"BootstrapMethods\"\n" +
+ " constant #35 method_ref: #36.#38 java/lang/invoke/LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #36 class: #37 java/lang/invoke/LambdaMetafactory\n" +
+ " constant #37 utf8: \"java/lang/invoke/LambdaMetafactory\"\n" +
+ " constant #38 name_and_type: #39.#40 metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " constant #39 utf8: \"metafactory\"\n" +
+ " constant #40 utf8: \"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\"\n" +
+ " constant #41 method handle: invokestatic (6) #35 \n" +
+ " constant #42 utf8: \"()Ljava/lang/String;\"\n" +
+ " constant #43 method type: #42 ()Ljava/lang/String;\n" +
+ " constant #44 method_ref: #45.#47 java/lang/String.toString ()Ljava/lang/String;\n" +
+ " constant #45 class: #46 java/lang/String\n" +
+ " constant #46 utf8: \"java/lang/String\"\n" +
+ " constant #47 name_and_type: #48.#42 toString ()Ljava/lang/String;\n" +
+ " constant #48 utf8: \"toString\"\n" +
+ " constant #49 method handle: invokevirtual (5) #44 \n" +
+ " constant #50 method type: #42 ()Ljava/lang/String;\n" +
+ " constant #51 utf8: \"InnerClasses\"\n" +
+ " constant #52 class: #53 java/lang/invoke/MethodHandles$Lookup\n" +
+ " constant #53 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" +
+ " constant #54 class: #55 java/lang/invoke/MethodHandles\n" +
+ " constant #55 utf8: \"java/lang/invoke/MethodHandles\"\n" +
+ " constant #56 utf8: \"Lookup\"\n" +
" \n" +
" // Field descriptor #6 Ljava/lang/String;\n" +
" java.lang.String s;\n" +
@@ -469,7 +473,7 @@ public void test004() throws Exception {
" public StringProducer referenceExpression;\n" +
" \n" +
" // Method descriptor #10 ()V\n" +
- " // Stack: 2, Locals: 1\n" +
+ " // Stack: 3, Locals: 1\n" +
" public X();\n" +
" 0 aload_0 [this]\n" +
" 1 invokespecial java.lang.Object() [12]\n" +
@@ -479,27 +483,29 @@ public void test004() throws Exception {
" 10 aload_0 [this]\n" +
" 11 aload_0 [this]\n" +
" 12 getfield X.s : java.lang.String [16]\n" +
- " 15 invokedynamic 0 produce(java.lang.String) : StringProducer [21]\n" +
- " 20 putfield X.referenceExpression : StringProducer [22]\n" +
- " 23 return\n" +
+ " 15 dup\n" +
+ " 16 invokevirtual java.lang.Object.getClass() : java.lang.Class [18]\n" +
+ " 19 pop\n" +
+ " 20 invokedynamic 0 produce(java.lang.String) : StringProducer [25]\n" +
+ " 25 putfield X.referenceExpression : StringProducer [26]\n" +
+ " 28 return\n" +
" Line numbers:\n" +
" [pc: 0, line: 1]\n" +
" [pc: 4, line: 2]\n" +
" [pc: 10, line: 3]\n" +
- " [pc: 23, line: 1]\n" +
+ " [pc: 28, line: 1]\n" +
" Local variable table:\n" +
- " [pc: 0, pc: 24] local: this index: 0 type: X\n" +
+ " [pc: 0, pc: 29] local: this index: 0 type: X\n" +
"\n" +
" Inner classes:\n" +
- " [inner class info: #48 java/lang/invoke/MethodHandles$Lookup, outer class info: #50 java/lang/invoke/MethodHandles\n" +
- " inner name: #52 Lookup, accessflags: 25 public static final]\n" +
+ " [inner class info: #52 java/lang/invoke/MethodHandles$Lookup, outer class info: #54 java/lang/invoke/MethodHandles\n" +
+ " inner name: #56 Lookup, accessflags: 25 public static final]\n" +
"Bootstrap methods:\n" +
- " 0 : # 37 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;" +
- "Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
+ " 0 : # 41 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;\n" +
" Method arguments:\n" +
- " #39 ()Ljava/lang/String;\n" +
- " #45 java/lang/String.toString:()Ljava/lang/String;\n" +
- " #46 ()Ljava/lang/String;\n" +
+ " #43 ()Ljava/lang/String;\n" +
+ " #49 java/lang/String.toString:()Ljava/lang/String;\n" +
+ " #50 ()Ljava/lang/String;\n" +
"}";
verifyClassFile(expectedOutput, "X.class", ClassFileBytesDisassembler.SYSTEM);
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
index f844985c7..22b3ef7c2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2017 IBM Corporation and others.
+ * Copyright (c) 2011, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1585,7 +1585,7 @@ public void test055() {
"}\n" +
"public class X {\n" +
" public static void main(String[] args) {\n" +
- " X x = null;\n" +
+ " X x = new X();\n" +
" I i = x::foo;\n" +
" }\n" +
" int foo(int x) {\n" +
@@ -1607,8 +1607,8 @@ public void test056() {
"public class X {\n" +
" public static void main(String[] args) {\n" +
" X x = null;\n" +
- " I i = x::foo;\n" +
" try {\n" +
+ " I i = x::foo;\n" +
" i.foo(10);\n" +
" } catch (NullPointerException npe) {\n" +
" System.out.println(npe.getMessage());\n" +
@@ -6699,6 +6699,72 @@ public void testBug522469a() {
"The target type of this expression is not a well formed parameterized type due to bound(s) mismatch\n" +
"----------\n");
}
+public void testBug521182() {
+ runConformTest(
+ new String[] {
+ "MethodRef.java",
+ "import java.util.function.Supplier;\n" +
+ "public class MethodRef {\n" +
+ " public static void m(Supplier<?> s) {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " Object ref = null;\n" +
+ " try {\n" +
+ " m(ref::toString);\n" +
+ " System.out.println(\"A NPE should have been thrown !!!!!\");\n" +
+ " } catch (NullPointerException e) {\n" +
+ " System.out.println(\"Success\");\n" +
+ " }\n" +
+ " }\n" +
+ "}"
+ },
+ "Success");
+}
+public void testBug521182a() {
+ runConformTest(
+ new String[] {
+ "MethodRef.java",
+ "import java.util.function.Supplier;\n" +
+ "public class MethodRef {\n" +
+ " Object field = null;\n" +
+ " public static void m(Supplier<?> s) {\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " MethodRef ref = new MethodRef();\n" +
+ " m(ref.field::toString);\n" +
+ " System.out.println(\"A NPE should have been thrown !!!!!\");\n" +
+ " } catch (NullPointerException e) {\n" +
+ " System.out.println(\"Success\");\n" +
+ " }\n" +
+ " }\n" +
+ "}"
+ },
+ "Success");
+}
+public void testBug521182b() {
+ runConformTest(
+ new String[] {
+ "MethodRef.java",
+ "import java.util.function.Supplier;\n" +
+ "public class MethodRef {\n" +
+ " public static void m(Supplier<?> s) {\n" +
+ " }\n" +
+ " public static Object get() {\n" +
+ " return null;\n" +
+ " }\n" +
+ " public static void main(String[] args) {\n" +
+ " try {\n" +
+ " m(get()::toString);\n" +
+ " System.out.println(\"A NPE should have been thrown !!!!!\");\n" +
+ " } catch (NullPointerException e) {\n" +
+ " System.out.println(\"Success\");\n" +
+ " }\n" +
+ " }\n" +
+ "}"
+ },
+ "Success");
+}
public static Class testClass() {
return LambdaExpressionsTest.class;
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
index adaf39754..458fa2589 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016, 2017 IBM Corporation and others.
+ * Copyright (c) 2016, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -4376,4 +4376,136 @@ public void testBug521362_emptyFile() {
false,
"");
}
+ public void testBug508889_001() throws Exception {
+ this.runConformTest(
+ new String[] {
+ "module-info.java",
+ "module mymodule {\n" +
+ "}",
+ },
+ "\"" + OUTPUT_DIR + File.separator + "module-info.java\""
+ + " -9 -source 9 -target 9 -d \"" + OUTPUT_DIR + "\"",
+ "",
+ "",
+ true);
+ String expectedOutput = "// Compiled from module-info.java (version 9 : 53.0, no super bit)\n" +
+ " module mymodule {\n" +
+ " // Version: \n" +
+ "\n" +
+ " requires java.base;\n" +
+ "\n" +
+ "}";
+ checkDisassembledClassFile(OUTPUT_DIR + File.separator + "module-info.class", "module-info", expectedOutput);
+ }
+ public void testBug508889_002() throws Exception {
+ File outputDirectory = new File(OUTPUT_DIR);
+ Util.flushDirectoryContent(outputDirectory);
+ String out = "bin";
+ String directory = OUTPUT_DIR + File.separator + "src";
+ String moduleLoc = directory + File.separator + "mod.one";
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
+ "module mod.one { \n" +
+ " exports pack1;\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "pack1", "X11.java",
+ "package pack1;\n" +
+ "public class X11 {\n" +
+ "}");
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+ .append(" -9 ")
+ .append(" -classpath \"")
+ .append(Util.getJavaClassLibsAsString())
+ .append("\" ");
+
+ runConformModuleTest(files,
+ buffer,
+ "",
+ "",
+ false);
+ String expectedOutput = "// Compiled from module-info.java (version 9 : 53.0, no super bit)\n" +
+ " module mod.one {\n" +
+ " // Version: \n" +
+ "\n" +
+ " requires java.base;\n" +
+ "\n" +
+ " exports pack1;\n" +
+ "\n" +
+ "}";
+ checkDisassembledClassFile(OUTPUT_DIR + File.separator + out + File.separator + "module-info.class", "module-info", expectedOutput);
+ }
+ public void testBug508889_003() throws Exception {
+ File outputDirectory = new File(OUTPUT_DIR);
+ Util.flushDirectoryContent(outputDirectory);
+ String out = "bin";
+ String directory = OUTPUT_DIR + File.separator + "src";
+ String moduleLoc = directory + File.separator + "mod.one";
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
+ "module mod.one { \n" +
+ " exports pack1;\n" +
+ " exports pack2 to second;\n" +
+ " opens pack3;\n" +
+ " opens pack4 to third;\n" +
+ " uses pack5.X51;\n" +
+ " provides pack1.I11 with pack1.X11;\n" +
+ " requires transitive java.sql;\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "pack1", "I11.java",
+ "package pack1;\n" +
+ "public interface I11 {\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "pack1", "X11.java",
+ "package pack1;\n" +
+ "public class X11 implements I11{\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "pack2", "X21.java",
+ "package pack2;\n" +
+ "public class X21 {\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "pack3", "X31.java",
+ "package pack3;\n" +
+ "public class X31 {\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "pack4", "X41.java",
+ "package pack4;\n" +
+ "public class X41 {\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "pack5", "X51.java",
+ "package pack5;\n" +
+ "public class X51 {\n" +
+ "}");
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+ .append(" -9 ")
+ .append(" -classpath \"")
+ .append(Util.getJavaClassLibsAsString())
+ .append("\" ");
+
+ runConformModuleTest(files,
+ buffer,
+ "",
+ "",
+ false);
+ String expectedOutput = "// Compiled from module-info.java (version 9 : 53.0, no super bit)\n" +
+ " module mod.one {\n" +
+ " // Version: \n" +
+ "\n" +
+ " requires transitive java.sql;\n" +
+ " requires java.base;\n" +
+ "\n" +
+ " exports pack1;\n" +
+ " exports pack2 to second;\n" +
+ "\n" +
+ " opens pack3;\n" +
+ " opens pack4 to third;\n" +
+ "\n" +
+ " uses pack5.X51\n" +
+ "\n" +
+ " provides pack1.I11 with pack1.X11;\n" +
+ "\n" +
+ "}";
+ checkDisassembledClassFile(OUTPUT_DIR + File.separator + out + File.separator + "module-info.class", "module-info", expectedOutput);
+ }
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
index 90d2bda19..b6ad4458a 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
@@ -6905,8 +6905,8 @@ public void test443467() throws Exception {
"----------\n" +
"1. ERROR in BuildIdeMain.java (at line 9)\n" +
" filter2.map(p -> new SimpleEntry<>(updateToFile.get(p), p->ideFiles.get(p)));\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
- "The target type of this expression must be a functional interface\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Cannot infer type arguments for SimpleEntry<>\n" +
"----------\n");
}
public void testBug445227() {
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
index aa42a17d8..9854659ae 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -2854,7 +2854,221 @@ public void test410892_6() {
options);
}
}
-
+public void test526911() {
+ String [] sourceFiles =
+ new String[] {
+ "Main.java",
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Main().run();\n" +
+ " }\n" +
+ " \n" +
+ " private void run() {\n" +
+ " V v = new VA();\n" +
+ " I i = I.create(v);\n" +
+ " System.out.printf(\"%d %d\", i.m1(), i.m2());\n" +
+ " }\n" +
+ "}\n",
+ "XI.java",
+ "public class XI implements I {\n" +
+ " V v;\n" +
+ " public XI(V v) {\n" +
+ " this.v = v;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m1() {\n" +
+ " return 1;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m2() {\n" +
+ " return 11;\n" +
+ " }\n" +
+ "}\n",
+ "YI.java",
+ "public class YI implements I {\n" +
+ " V v;\n" +
+ " public YI(V v) {\n" +
+ " this.v = v;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m1() {\n" +
+ " return 2;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m2() {\n" +
+ " return 22;\n" +
+ " }\n" +
+ "}\n",
+ "V.java",
+ "public class V {\n" +
+ " public enum T { A, B, C }\n" +
+ " private T t;\n" +
+ " public V(T t) {\n" +
+ " this.t = t;\n" +
+ " }\n" +
+ " public T getT() { return t; }\n" +
+ "}\n" +
+ "class VA extends V {\n" +
+ " VA() {\n" +
+ " super(T.A);\n" +
+ " }\n" +
+ "}",
+ "I.java",
+ "enum H { X, Y }\n" +
+ "public interface I {\n" +
+ " public static final int i = 0;\n" +
+ " public int m1();\n" +
+ " public int m2();\n" +
+ " public static I create(V v) { \n" +
+ " V.T t = v.getT();\n" +
+ " H h = getH(t);\n" +
+ " switch (h) { // depending on H i need different implementations of I. XI and YI provide them\n" +
+ " case X:\n" +
+ " return new XI(v);\n" +
+ " case Y:\n" +
+ " return new YI(v);\n" +
+ " default:\n" +
+ " throw new Error();\n" +
+ " } \n" +
+ " }\n" +
+ " static H getH(V.T t) { // different T's require different H's to handle them\n" +
+ " switch (t) {\n" +
+ " case A:\n" +
+ " return H.X;\n" +
+ " case B:\n" +
+ " case C:\n" +
+ " return H.Y;\n" +
+ " }\n" +
+ " throw new Error();\n" +
+ " }\n" +
+ "}",
+ "X.java",
+ "public class X {\n" +
+ " static {\n" +
+ " int var1 = 0;\n" +
+ " int var2 = 0;\n" +
+ " String s = \"Test2\";\n" +
+ " switch (s) {\n" +
+ " case \"test\": \n" +
+ " var2 = ++var1 % 2;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ "}",
+ };
+ if (this.complianceLevel >= ClassFileConstants.JDK1_8) {
+ this.runConformTest(sourceFiles, "1 11");
+ }
+}
+public void test526911a() {
+ // target 1.8, run with 9, should work fine
+ if (this.complianceLevel < ClassFileConstants.JDK9)
+ return;
+ Map options = getCompilerOptions();
+ options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8);
+ String [] sourceFiles =
+ new String[] {
+ "Main.java",
+ "public class Main {\n" +
+ " public static void main(String[] args) {\n" +
+ " new Main().run();\n" +
+ " }\n" +
+ " \n" +
+ " private void run() {\n" +
+ " V v = new VA();\n" +
+ " I i = I.create(v);\n" +
+ " System.out.printf(\"%d %d\", i.m1(), i.m2());\n" +
+ " }\n" +
+ "}\n",
+ "XI.java",
+ "public class XI implements I {\n" +
+ " V v;\n" +
+ " public XI(V v) {\n" +
+ " this.v = v;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m1() {\n" +
+ " return 1;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m2() {\n" +
+ " return 11;\n" +
+ " }\n" +
+ "}\n",
+ "YI.java",
+ "public class YI implements I {\n" +
+ " V v;\n" +
+ " public YI(V v) {\n" +
+ " this.v = v;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m1() {\n" +
+ " return 2;\n" +
+ " }\n" +
+ " @Override\n" +
+ " public int m2() {\n" +
+ " return 22;\n" +
+ " }\n" +
+ "}\n",
+ "V.java",
+ "public class V {\n" +
+ " public enum T { A, B, C }\n" +
+ " private T t;\n" +
+ " public V(T t) {\n" +
+ " this.t = t;\n" +
+ " }\n" +
+ " public T getT() { return t; }\n" +
+ "}\n" +
+ "class VA extends V {\n" +
+ " VA() {\n" +
+ " super(T.A);\n" +
+ " }\n" +
+ "}",
+ "I.java",
+ "enum H { X, Y }\n" +
+ "public interface I {\n" +
+ " public static final int i = 0;\n" +
+ " public int m1();\n" +
+ " public int m2();\n" +
+ " public static I create(V v) { \n" +
+ " V.T t = v.getT();\n" +
+ " H h = getH(t);\n" +
+ " switch (h) { // depending on H i need different implementations of I. XI and YI provide them\n" +
+ " case X:\n" +
+ " return new XI(v);\n" +
+ " case Y:\n" +
+ " return new YI(v);\n" +
+ " default:\n" +
+ " throw new Error();\n" +
+ " } \n" +
+ " }\n" +
+ " static H getH(V.T t) { // different T's require different H's to handle them\n" +
+ " switch (t) {\n" +
+ " case A:\n" +
+ " return H.X;\n" +
+ " case B:\n" +
+ " case C:\n" +
+ " return H.Y;\n" +
+ " }\n" +
+ " throw new Error();\n" +
+ " }\n" +
+ "}",
+ "X.java",
+ "public class X {\n" +
+ " static {\n" +
+ " int var1 = 0;\n" +
+ " int var2 = 0;\n" +
+ " String s = \"Test2\";\n" +
+ " switch (s) {\n" +
+ " case \"test\": \n" +
+ " var2 = ++var1 % 2;\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ "}",
+ };
+ this.runConformTest(sourceFiles, "1 11", options);
+}
public static Class testClass() {
return SwitchTest.class;
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java
index 572ce8626..e0c994b87 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2014 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11990,2532 +11990,2542 @@ public void test0016() {
.append("2340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124")
.append("0224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464")
.append("246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500");
- this.runConformTest(
- new String[] {
- "X.java",
- "public enum X {\n" +
- " X0(0),\n" +
- " X1(1),\n" +
- " X2(2),\n" +
- " X3(3),\n" +
- " X4(4),\n" +
- " X5(5),\n" +
- " X6(6),\n" +
- " X7(7),\n" +
- " X8(8),\n" +
- " X9(9),\n" +
- " X10(10),\n" +
- " X11(11),\n" +
- " X12(12),\n" +
- " X13(13),\n" +
- " X14(14),\n" +
- " X15(15),\n" +
- " X16(16),\n" +
- " X17(17),\n" +
- " X18(18),\n" +
- " X19(19),\n" +
- " X20(20),\n" +
- " X21(21),\n" +
- " X22(22),\n" +
- " X23(23),\n" +
- " X24(24),\n" +
- " X25(25),\n" +
- " X26(26),\n" +
- " X27(27),\n" +
- " X28(28),\n" +
- " X29(29),\n" +
- " X30(30),\n" +
- " X31(31),\n" +
- " X32(32),\n" +
- " X33(33),\n" +
- " X34(34),\n" +
- " X35(35),\n" +
- " X36(36),\n" +
- " X37(37),\n" +
- " X38(38),\n" +
- " X39(39),\n" +
- " X40(40),\n" +
- " X41(41),\n" +
- " X42(42),\n" +
- " X43(43),\n" +
- " X44(44),\n" +
- " X45(45),\n" +
- " X46(46),\n" +
- " X47(47),\n" +
- " X48(48),\n" +
- " X49(49),\n" +
- " X50(50),\n" +
- " X51(51),\n" +
- " X52(52),\n" +
- " X53(53),\n" +
- " X54(54),\n" +
- " X55(55),\n" +
- " X56(56),\n" +
- " X57(57),\n" +
- " X58(58),\n" +
- " X59(59),\n" +
- " X60(60),\n" +
- " X61(61),\n" +
- " X62(62),\n" +
- " X63(63),\n" +
- " X64(64),\n" +
- " X65(65),\n" +
- " X66(66),\n" +
- " X67(67),\n" +
- " X68(68),\n" +
- " X69(69),\n" +
- " X70(70),\n" +
- " X71(71),\n" +
- " X72(72),\n" +
- " X73(73),\n" +
- " X74(74),\n" +
- " X75(75),\n" +
- " X76(76),\n" +
- " X77(77),\n" +
- " X78(78),\n" +
- " X79(79),\n" +
- " X80(80),\n" +
- " X81(81),\n" +
- " X82(82),\n" +
- " X83(83),\n" +
- " X84(84),\n" +
- " X85(85),\n" +
- " X86(86),\n" +
- " X87(87),\n" +
- " X88(88),\n" +
- " X89(89),\n" +
- " X90(90),\n" +
- " X91(91),\n" +
- " X92(92),\n" +
- " X93(93),\n" +
- " X94(94),\n" +
- " X95(95),\n" +
- " X96(96),\n" +
- " X97(97),\n" +
- " X98(98),\n" +
- " X99(99),\n" +
- " X100(100),\n" +
- " X101(101),\n" +
- " X102(102),\n" +
- " X103(103),\n" +
- " X104(104),\n" +
- " X105(105),\n" +
- " X106(106),\n" +
- " X107(107),\n" +
- " X108(108),\n" +
- " X109(109),\n" +
- " X110(110),\n" +
- " X111(111),\n" +
- " X112(112),\n" +
- " X113(113),\n" +
- " X114(114),\n" +
- " X115(115),\n" +
- " X116(116),\n" +
- " X117(117),\n" +
- " X118(118),\n" +
- " X119(119),\n" +
- " X120(120),\n" +
- " X121(121),\n" +
- " X122(122),\n" +
- " X123(123),\n" +
- " X124(124),\n" +
- " X125(125),\n" +
- " X126(126),\n" +
- " X127(127),\n" +
- " X128(128),\n" +
- " X129(129),\n" +
- " X130(130),\n" +
- " X131(131),\n" +
- " X132(132),\n" +
- " X133(133),\n" +
- " X134(134),\n" +
- " X135(135),\n" +
- " X136(136),\n" +
- " X137(137),\n" +
- " X138(138),\n" +
- " X139(139),\n" +
- " X140(140),\n" +
- " X141(141),\n" +
- " X142(142),\n" +
- " X143(143),\n" +
- " X144(144),\n" +
- " X145(145),\n" +
- " X146(146),\n" +
- " X147(147),\n" +
- " X148(148),\n" +
- " X149(149),\n" +
- " X150(150),\n" +
- " X151(151),\n" +
- " X152(152),\n" +
- " X153(153),\n" +
- " X154(154),\n" +
- " X155(155),\n" +
- " X156(156),\n" +
- " X157(157),\n" +
- " X158(158),\n" +
- " X159(159),\n" +
- " X160(160),\n" +
- " X161(161),\n" +
- " X162(162),\n" +
- " X163(163),\n" +
- " X164(164),\n" +
- " X165(165),\n" +
- " X166(166),\n" +
- " X167(167),\n" +
- " X168(168),\n" +
- " X169(169),\n" +
- " X170(170),\n" +
- " X171(171),\n" +
- " X172(172),\n" +
- " X173(173),\n" +
- " X174(174),\n" +
- " X175(175),\n" +
- " X176(176),\n" +
- " X177(177),\n" +
- " X178(178),\n" +
- " X179(179),\n" +
- " X180(180),\n" +
- " X181(181),\n" +
- " X182(182),\n" +
- " X183(183),\n" +
- " X184(184),\n" +
- " X185(185),\n" +
- " X186(186),\n" +
- " X187(187),\n" +
- " X188(188),\n" +
- " X189(189),\n" +
- " X190(190),\n" +
- " X191(191),\n" +
- " X192(192),\n" +
- " X193(193),\n" +
- " X194(194),\n" +
- " X195(195),\n" +
- " X196(196),\n" +
- " X197(197),\n" +
- " X198(198),\n" +
- " X199(199),\n" +
- " X200(200),\n" +
- " X201(201),\n" +
- " X202(202),\n" +
- " X203(203),\n" +
- " X204(204),\n" +
- " X205(205),\n" +
- " X206(206),\n" +
- " X207(207),\n" +
- " X208(208),\n" +
- " X209(209),\n" +
- " X210(210),\n" +
- " X211(211),\n" +
- " X212(212),\n" +
- " X213(213),\n" +
- " X214(214),\n" +
- " X215(215),\n" +
- " X216(216),\n" +
- " X217(217),\n" +
- " X218(218),\n" +
- " X219(219),\n" +
- " X220(220),\n" +
- " X221(221),\n" +
- " X222(222),\n" +
- " X223(223),\n" +
- " X224(224),\n" +
- " X225(225),\n" +
- " X226(226),\n" +
- " X227(227),\n" +
- " X228(228),\n" +
- " X229(229),\n" +
- " X230(230),\n" +
- " X231(231),\n" +
- " X232(232),\n" +
- " X233(233),\n" +
- " X234(234),\n" +
- " X235(235),\n" +
- " X236(236),\n" +
- " X237(237),\n" +
- " X238(238),\n" +
- " X239(239),\n" +
- " X240(240),\n" +
- " X241(241),\n" +
- " X242(242),\n" +
- " X243(243),\n" +
- " X244(244),\n" +
- " X245(245),\n" +
- " X246(246),\n" +
- " X247(247),\n" +
- " X248(248),\n" +
- " X249(249),\n" +
- " X250(250),\n" +
- " X251(251),\n" +
- " X252(252),\n" +
- " X253(253),\n" +
- " X254(254),\n" +
- " X255(255),\n" +
- " X256(256),\n" +
- " X257(257),\n" +
- " X258(258),\n" +
- " X259(259),\n" +
- " X260(260),\n" +
- " X261(261),\n" +
- " X262(262),\n" +
- " X263(263),\n" +
- " X264(264),\n" +
- " X265(265),\n" +
- " X266(266),\n" +
- " X267(267),\n" +
- " X268(268),\n" +
- " X269(269),\n" +
- " X270(270),\n" +
- " X271(271),\n" +
- " X272(272),\n" +
- " X273(273),\n" +
- " X274(274),\n" +
- " X275(275),\n" +
- " X276(276),\n" +
- " X277(277),\n" +
- " X278(278),\n" +
- " X279(279),\n" +
- " X280(280),\n" +
- " X281(281),\n" +
- " X282(282),\n" +
- " X283(283),\n" +
- " X284(284),\n" +
- " X285(285),\n" +
- " X286(286),\n" +
- " X287(287),\n" +
- " X288(288),\n" +
- " X289(289),\n" +
- " X290(290),\n" +
- " X291(291),\n" +
- " X292(292),\n" +
- " X293(293),\n" +
- " X294(294),\n" +
- " X295(295),\n" +
- " X296(296),\n" +
- " X297(297),\n" +
- " X298(298),\n" +
- " X299(299),\n" +
- " X300(300),\n" +
- " X301(301),\n" +
- " X302(302),\n" +
- " X303(303),\n" +
- " X304(304),\n" +
- " X305(305),\n" +
- " X306(306),\n" +
- " X307(307),\n" +
- " X308(308),\n" +
- " X309(309),\n" +
- " X310(310),\n" +
- " X311(311),\n" +
- " X312(312),\n" +
- " X313(313),\n" +
- " X314(314),\n" +
- " X315(315),\n" +
- " X316(316),\n" +
- " X317(317),\n" +
- " X318(318),\n" +
- " X319(319),\n" +
- " X320(320),\n" +
- " X321(321),\n" +
- " X322(322),\n" +
- " X323(323),\n" +
- " X324(324),\n" +
- " X325(325),\n" +
- " X326(326),\n" +
- " X327(327),\n" +
- " X328(328),\n" +
- " X329(329),\n" +
- " X330(330),\n" +
- " X331(331),\n" +
- " X332(332),\n" +
- " X333(333),\n" +
- " X334(334),\n" +
- " X335(335),\n" +
- " X336(336),\n" +
- " X337(337),\n" +
- " X338(338),\n" +
- " X339(339),\n" +
- " X340(340),\n" +
- " X341(341),\n" +
- " X342(342),\n" +
- " X343(343),\n" +
- " X344(344),\n" +
- " X345(345),\n" +
- " X346(346),\n" +
- " X347(347),\n" +
- " X348(348),\n" +
- " X349(349),\n" +
- " X350(350),\n" +
- " X351(351),\n" +
- " X352(352),\n" +
- " X353(353),\n" +
- " X354(354),\n" +
- " X355(355),\n" +
- " X356(356),\n" +
- " X357(357),\n" +
- " X358(358),\n" +
- " X359(359),\n" +
- " X360(360),\n" +
- " X361(361),\n" +
- " X362(362),\n" +
- " X363(363),\n" +
- " X364(364),\n" +
- " X365(365),\n" +
- " X366(366),\n" +
- " X367(367),\n" +
- " X368(368),\n" +
- " X369(369),\n" +
- " X370(370),\n" +
- " X371(371),\n" +
- " X372(372),\n" +
- " X373(373),\n" +
- " X374(374),\n" +
- " X375(375),\n" +
- " X376(376),\n" +
- " X377(377),\n" +
- " X378(378),\n" +
- " X379(379),\n" +
- " X380(380),\n" +
- " X381(381),\n" +
- " X382(382),\n" +
- " X383(383),\n" +
- " X384(384),\n" +
- " X385(385),\n" +
- " X386(386),\n" +
- " X387(387),\n" +
- " X388(388),\n" +
- " X389(389),\n" +
- " X390(390),\n" +
- " X391(391),\n" +
- " X392(392),\n" +
- " X393(393),\n" +
- " X394(394),\n" +
- " X395(395),\n" +
- " X396(396),\n" +
- " X397(397),\n" +
- " X398(398),\n" +
- " X399(399),\n" +
- " X400(400),\n" +
- " X401(401),\n" +
- " X402(402),\n" +
- " X403(403),\n" +
- " X404(404),\n" +
- " X405(405),\n" +
- " X406(406),\n" +
- " X407(407),\n" +
- " X408(408),\n" +
- " X409(409),\n" +
- " X410(410),\n" +
- " X411(411),\n" +
- " X412(412),\n" +
- " X413(413),\n" +
- " X414(414),\n" +
- " X415(415),\n" +
- " X416(416),\n" +
- " X417(417),\n" +
- " X418(418),\n" +
- " X419(419),\n" +
- " X420(420),\n" +
- " X421(421),\n" +
- " X422(422),\n" +
- " X423(423),\n" +
- " X424(424),\n" +
- " X425(425),\n" +
- " X426(426),\n" +
- " X427(427),\n" +
- " X428(428),\n" +
- " X429(429),\n" +
- " X430(430),\n" +
- " X431(431),\n" +
- " X432(432),\n" +
- " X433(433),\n" +
- " X434(434),\n" +
- " X435(435),\n" +
- " X436(436),\n" +
- " X437(437),\n" +
- " X438(438),\n" +
- " X439(439),\n" +
- " X440(440),\n" +
- " X441(441),\n" +
- " X442(442),\n" +
- " X443(443),\n" +
- " X444(444),\n" +
- " X445(445),\n" +
- " X446(446),\n" +
- " X447(447),\n" +
- " X448(448),\n" +
- " X449(449),\n" +
- " X450(450),\n" +
- " X451(451),\n" +
- " X452(452),\n" +
- " X453(453),\n" +
- " X454(454),\n" +
- " X455(455),\n" +
- " X456(456),\n" +
- " X457(457),\n" +
- " X458(458),\n" +
- " X459(459),\n" +
- " X460(460),\n" +
- " X461(461),\n" +
- " X462(462),\n" +
- " X463(463),\n" +
- " X464(464),\n" +
- " X465(465),\n" +
- " X466(466),\n" +
- " X467(467),\n" +
- " X468(468),\n" +
- " X469(469),\n" +
- " X470(470),\n" +
- " X471(471),\n" +
- " X472(472),\n" +
- " X473(473),\n" +
- " X474(474),\n" +
- " X475(475),\n" +
- " X476(476),\n" +
- " X477(477),\n" +
- " X478(478),\n" +
- " X479(479),\n" +
- " X480(480),\n" +
- " X481(481),\n" +
- " X482(482),\n" +
- " X483(483),\n" +
- " X484(484),\n" +
- " X485(485),\n" +
- " X486(486),\n" +
- " X487(487),\n" +
- " X488(488),\n" +
- " X489(489),\n" +
- " X490(490),\n" +
- " X491(491),\n" +
- " X492(492),\n" +
- " X493(493),\n" +
- " X494(494),\n" +
- " X495(495),\n" +
- " X496(496),\n" +
- " X497(497),\n" +
- " X498(498),\n" +
- " X499(499),\n" +
- " X500(500),\n" +
- " X501(501),\n" +
- " X502(502),\n" +
- " X503(503),\n" +
- " X504(504),\n" +
- " X505(505),\n" +
- " X506(506),\n" +
- " X507(507),\n" +
- " X508(508),\n" +
- " X509(509),\n" +
- " X510(510),\n" +
- " X511(511),\n" +
- " X512(512),\n" +
- " X513(513),\n" +
- " X514(514),\n" +
- " X515(515),\n" +
- " X516(516),\n" +
- " X517(517),\n" +
- " X518(518),\n" +
- " X519(519),\n" +
- " X520(520),\n" +
- " X521(521),\n" +
- " X522(522),\n" +
- " X523(523),\n" +
- " X524(524),\n" +
- " X525(525),\n" +
- " X526(526),\n" +
- " X527(527),\n" +
- " X528(528),\n" +
- " X529(529),\n" +
- " X530(530),\n" +
- " X531(531),\n" +
- " X532(532),\n" +
- " X533(533),\n" +
- " X534(534),\n" +
- " X535(535),\n" +
- " X536(536),\n" +
- " X537(537),\n" +
- " X538(538),\n" +
- " X539(539),\n" +
- " X540(540),\n" +
- " X541(541),\n" +
- " X542(542),\n" +
- " X543(543),\n" +
- " X544(544),\n" +
- " X545(545),\n" +
- " X546(546),\n" +
- " X547(547),\n" +
- " X548(548),\n" +
- " X549(549),\n" +
- " X550(550),\n" +
- " X551(551),\n" +
- " X552(552),\n" +
- " X553(553),\n" +
- " X554(554),\n" +
- " X555(555),\n" +
- " X556(556),\n" +
- " X557(557),\n" +
- " X558(558),\n" +
- " X559(559),\n" +
- " X560(560),\n" +
- " X561(561),\n" +
- " X562(562),\n" +
- " X563(563),\n" +
- " X564(564),\n" +
- " X565(565),\n" +
- " X566(566),\n" +
- " X567(567),\n" +
- " X568(568),\n" +
- " X569(569),\n" +
- " X570(570),\n" +
- " X571(571),\n" +
- " X572(572),\n" +
- " X573(573),\n" +
- " X574(574),\n" +
- " X575(575),\n" +
- " X576(576),\n" +
- " X577(577),\n" +
- " X578(578),\n" +
- " X579(579),\n" +
- " X580(580),\n" +
- " X581(581),\n" +
- " X582(582),\n" +
- " X583(583),\n" +
- " X584(584),\n" +
- " X585(585),\n" +
- " X586(586),\n" +
- " X587(587),\n" +
- " X588(588),\n" +
- " X589(589),\n" +
- " X590(590),\n" +
- " X591(591),\n" +
- " X592(592),\n" +
- " X593(593),\n" +
- " X594(594),\n" +
- " X595(595),\n" +
- " X596(596),\n" +
- " X597(597),\n" +
- " X598(598),\n" +
- " X599(599),\n" +
- " X600(600),\n" +
- " X601(601),\n" +
- " X602(602),\n" +
- " X603(603),\n" +
- " X604(604),\n" +
- " X605(605),\n" +
- " X606(606),\n" +
- " X607(607),\n" +
- " X608(608),\n" +
- " X609(609),\n" +
- " X610(610),\n" +
- " X611(611),\n" +
- " X612(612),\n" +
- " X613(613),\n" +
- " X614(614),\n" +
- " X615(615),\n" +
- " X616(616),\n" +
- " X617(617),\n" +
- " X618(618),\n" +
- " X619(619),\n" +
- " X620(620),\n" +
- " X621(621),\n" +
- " X622(622),\n" +
- " X623(623),\n" +
- " X624(624),\n" +
- " X625(625),\n" +
- " X626(626),\n" +
- " X627(627),\n" +
- " X628(628),\n" +
- " X629(629),\n" +
- " X630(630),\n" +
- " X631(631),\n" +
- " X632(632),\n" +
- " X633(633),\n" +
- " X634(634),\n" +
- " X635(635),\n" +
- " X636(636),\n" +
- " X637(637),\n" +
- " X638(638),\n" +
- " X639(639),\n" +
- " X640(640),\n" +
- " X641(641),\n" +
- " X642(642),\n" +
- " X643(643),\n" +
- " X644(644),\n" +
- " X645(645),\n" +
- " X646(646),\n" +
- " X647(647),\n" +
- " X648(648),\n" +
- " X649(649),\n" +
- " X650(650),\n" +
- " X651(651),\n" +
- " X652(652),\n" +
- " X653(653),\n" +
- " X654(654),\n" +
- " X655(655),\n" +
- " X656(656),\n" +
- " X657(657),\n" +
- " X658(658),\n" +
- " X659(659),\n" +
- " X660(660),\n" +
- " X661(661),\n" +
- " X662(662),\n" +
- " X663(663),\n" +
- " X664(664),\n" +
- " X665(665),\n" +
- " X666(666),\n" +
- " X667(667),\n" +
- " X668(668),\n" +
- " X669(669),\n" +
- " X670(670),\n" +
- " X671(671),\n" +
- " X672(672),\n" +
- " X673(673),\n" +
- " X674(674),\n" +
- " X675(675),\n" +
- " X676(676),\n" +
- " X677(677),\n" +
- " X678(678),\n" +
- " X679(679),\n" +
- " X680(680),\n" +
- " X681(681),\n" +
- " X682(682),\n" +
- " X683(683),\n" +
- " X684(684),\n" +
- " X685(685),\n" +
- " X686(686),\n" +
- " X687(687),\n" +
- " X688(688),\n" +
- " X689(689),\n" +
- " X690(690),\n" +
- " X691(691),\n" +
- " X692(692),\n" +
- " X693(693),\n" +
- " X694(694),\n" +
- " X695(695),\n" +
- " X696(696),\n" +
- " X697(697),\n" +
- " X698(698),\n" +
- " X699(699),\n" +
- " X700(700),\n" +
- " X701(701),\n" +
- " X702(702),\n" +
- " X703(703),\n" +
- " X704(704),\n" +
- " X705(705),\n" +
- " X706(706),\n" +
- " X707(707),\n" +
- " X708(708),\n" +
- " X709(709),\n" +
- " X710(710),\n" +
- " X711(711),\n" +
- " X712(712),\n" +
- " X713(713),\n" +
- " X714(714),\n" +
- " X715(715),\n" +
- " X716(716),\n" +
- " X717(717),\n" +
- " X718(718),\n" +
- " X719(719),\n" +
- " X720(720),\n" +
- " X721(721),\n" +
- " X722(722),\n" +
- " X723(723),\n" +
- " X724(724),\n" +
- " X725(725),\n" +
- " X726(726),\n" +
- " X727(727),\n" +
- " X728(728),\n" +
- " X729(729),\n" +
- " X730(730),\n" +
- " X731(731),\n" +
- " X732(732),\n" +
- " X733(733),\n" +
- " X734(734),\n" +
- " X735(735),\n" +
- " X736(736),\n" +
- " X737(737),\n" +
- " X738(738),\n" +
- " X739(739),\n" +
- " X740(740),\n" +
- " X741(741),\n" +
- " X742(742),\n" +
- " X743(743),\n" +
- " X744(744),\n" +
- " X745(745),\n" +
- " X746(746),\n" +
- " X747(747),\n" +
- " X748(748),\n" +
- " X749(749),\n" +
- " X750(750),\n" +
- " X751(751),\n" +
- " X752(752),\n" +
- " X753(753),\n" +
- " X754(754),\n" +
- " X755(755),\n" +
- " X756(756),\n" +
- " X757(757),\n" +
- " X758(758),\n" +
- " X759(759),\n" +
- " X760(760),\n" +
- " X761(761),\n" +
- " X762(762),\n" +
- " X763(763),\n" +
- " X764(764),\n" +
- " X765(765),\n" +
- " X766(766),\n" +
- " X767(767),\n" +
- " X768(768),\n" +
- " X769(769),\n" +
- " X770(770),\n" +
- " X771(771),\n" +
- " X772(772),\n" +
- " X773(773),\n" +
- " X774(774),\n" +
- " X775(775),\n" +
- " X776(776),\n" +
- " X777(777),\n" +
- " X778(778),\n" +
- " X779(779),\n" +
- " X780(780),\n" +
- " X781(781),\n" +
- " X782(782),\n" +
- " X783(783),\n" +
- " X784(784),\n" +
- " X785(785),\n" +
- " X786(786),\n" +
- " X787(787),\n" +
- " X788(788),\n" +
- " X789(789),\n" +
- " X790(790),\n" +
- " X791(791),\n" +
- " X792(792),\n" +
- " X793(793),\n" +
- " X794(794),\n" +
- " X795(795),\n" +
- " X796(796),\n" +
- " X797(797),\n" +
- " X798(798),\n" +
- " X799(799),\n" +
- " X800(800),\n" +
- " X801(801),\n" +
- " X802(802),\n" +
- " X803(803),\n" +
- " X804(804),\n" +
- " X805(805),\n" +
- " X806(806),\n" +
- " X807(807),\n" +
- " X808(808),\n" +
- " X809(809),\n" +
- " X810(810),\n" +
- " X811(811),\n" +
- " X812(812),\n" +
- " X813(813),\n" +
- " X814(814),\n" +
- " X815(815),\n" +
- " X816(816),\n" +
- " X817(817),\n" +
- " X818(818),\n" +
- " X819(819),\n" +
- " X820(820),\n" +
- " X821(821),\n" +
- " X822(822),\n" +
- " X823(823),\n" +
- " X824(824),\n" +
- " X825(825),\n" +
- " X826(826),\n" +
- " X827(827),\n" +
- " X828(828),\n" +
- " X829(829),\n" +
- " X830(830),\n" +
- " X831(831),\n" +
- " X832(832),\n" +
- " X833(833),\n" +
- " X834(834),\n" +
- " X835(835),\n" +
- " X836(836),\n" +
- " X837(837),\n" +
- " X838(838),\n" +
- " X839(839),\n" +
- " X840(840),\n" +
- " X841(841),\n" +
- " X842(842),\n" +
- " X843(843),\n" +
- " X844(844),\n" +
- " X845(845),\n" +
- " X846(846),\n" +
- " X847(847),\n" +
- " X848(848),\n" +
- " X849(849),\n" +
- " X850(850),\n" +
- " X851(851),\n" +
- " X852(852),\n" +
- " X853(853),\n" +
- " X854(854),\n" +
- " X855(855),\n" +
- " X856(856),\n" +
- " X857(857),\n" +
- " X858(858),\n" +
- " X859(859),\n" +
- " X860(860),\n" +
- " X861(861),\n" +
- " X862(862),\n" +
- " X863(863),\n" +
- " X864(864),\n" +
- " X865(865),\n" +
- " X866(866),\n" +
- " X867(867),\n" +
- " X868(868),\n" +
- " X869(869),\n" +
- " X870(870),\n" +
- " X871(871),\n" +
- " X872(872),\n" +
- " X873(873),\n" +
- " X874(874),\n" +
- " X875(875),\n" +
- " X876(876),\n" +
- " X877(877),\n" +
- " X878(878),\n" +
- " X879(879),\n" +
- " X880(880),\n" +
- " X881(881),\n" +
- " X882(882),\n" +
- " X883(883),\n" +
- " X884(884),\n" +
- " X885(885),\n" +
- " X886(886),\n" +
- " X887(887),\n" +
- " X888(888),\n" +
- " X889(889),\n" +
- " X890(890),\n" +
- " X891(891),\n" +
- " X892(892),\n" +
- " X893(893),\n" +
- " X894(894),\n" +
- " X895(895),\n" +
- " X896(896),\n" +
- " X897(897),\n" +
- " X898(898),\n" +
- " X899(899),\n" +
- " X900(900),\n" +
- " X901(901),\n" +
- " X902(902),\n" +
- " X903(903),\n" +
- " X904(904),\n" +
- " X905(905),\n" +
- " X906(906),\n" +
- " X907(907),\n" +
- " X908(908),\n" +
- " X909(909),\n" +
- " X910(910),\n" +
- " X911(911),\n" +
- " X912(912),\n" +
- " X913(913),\n" +
- " X914(914),\n" +
- " X915(915),\n" +
- " X916(916),\n" +
- " X917(917),\n" +
- " X918(918),\n" +
- " X919(919),\n" +
- " X920(920),\n" +
- " X921(921),\n" +
- " X922(922),\n" +
- " X923(923),\n" +
- " X924(924),\n" +
- " X925(925),\n" +
- " X926(926),\n" +
- " X927(927),\n" +
- " X928(928),\n" +
- " X929(929),\n" +
- " X930(930),\n" +
- " X931(931),\n" +
- " X932(932),\n" +
- " X933(933),\n" +
- " X934(934),\n" +
- " X935(935),\n" +
- " X936(936),\n" +
- " X937(937),\n" +
- " X938(938),\n" +
- " X939(939),\n" +
- " X940(940),\n" +
- " X941(941),\n" +
- " X942(942),\n" +
- " X943(943),\n" +
- " X944(944),\n" +
- " X945(945),\n" +
- " X946(946),\n" +
- " X947(947),\n" +
- " X948(948),\n" +
- " X949(949),\n" +
- " X950(950),\n" +
- " X951(951),\n" +
- " X952(952),\n" +
- " X953(953),\n" +
- " X954(954),\n" +
- " X955(955),\n" +
- " X956(956),\n" +
- " X957(957),\n" +
- " X958(958),\n" +
- " X959(959),\n" +
- " X960(960),\n" +
- " X961(961),\n" +
- " X962(962),\n" +
- " X963(963),\n" +
- " X964(964),\n" +
- " X965(965),\n" +
- " X966(966),\n" +
- " X967(967),\n" +
- " X968(968),\n" +
- " X969(969),\n" +
- " X970(970),\n" +
- " X971(971),\n" +
- " X972(972),\n" +
- " X973(973),\n" +
- " X974(974),\n" +
- " X975(975),\n" +
- " X976(976),\n" +
- " X977(977),\n" +
- " X978(978),\n" +
- " X979(979),\n" +
- " X980(980),\n" +
- " X981(981),\n" +
- " X982(982),\n" +
- " X983(983),\n" +
- " X984(984),\n" +
- " X985(985),\n" +
- " X986(986),\n" +
- " X987(987),\n" +
- " X988(988),\n" +
- " X989(989),\n" +
- " X990(990),\n" +
- " X991(991),\n" +
- " X992(992),\n" +
- " X993(993),\n" +
- " X994(994),\n" +
- " X995(995),\n" +
- " X996(996),\n" +
- " X997(997),\n" +
- " X998(998),\n" +
- " X999(999),\n" +
- " X1000(1000),\n" +
- " X1001(1001),\n" +
- " X1002(1002),\n" +
- " X1003(1003),\n" +
- " X1004(1004),\n" +
- " X1005(1005),\n" +
- " X1006(1006),\n" +
- " X1007(1007),\n" +
- " X1008(1008),\n" +
- " X1009(1009),\n" +
- " X1010(1010),\n" +
- " X1011(1011),\n" +
- " X1012(1012),\n" +
- " X1013(1013),\n" +
- " X1014(1014),\n" +
- " X1015(1015),\n" +
- " X1016(1016),\n" +
- " X1017(1017),\n" +
- " X1018(1018),\n" +
- " X1019(1019),\n" +
- " X1020(1020),\n" +
- " X1021(1021),\n" +
- " X1022(1022),\n" +
- " X1023(1023),\n" +
- " X1024(1024),\n" +
- " X1025(1025),\n" +
- " X1026(1026),\n" +
- " X1027(1027),\n" +
- " X1028(1028),\n" +
- " X1029(1029),\n" +
- " X1030(1030),\n" +
- " X1031(1031),\n" +
- " X1032(1032),\n" +
- " X1033(1033),\n" +
- " X1034(1034),\n" +
- " X1035(1035),\n" +
- " X1036(1036),\n" +
- " X1037(1037),\n" +
- " X1038(1038),\n" +
- " X1039(1039),\n" +
- " X1040(1040),\n" +
- " X1041(1041),\n" +
- " X1042(1042),\n" +
- " X1043(1043),\n" +
- " X1044(1044),\n" +
- " X1045(1045),\n" +
- " X1046(1046),\n" +
- " X1047(1047),\n" +
- " X1048(1048),\n" +
- " X1049(1049),\n" +
- " X1050(1050),\n" +
- " X1051(1051),\n" +
- " X1052(1052),\n" +
- " X1053(1053),\n" +
- " X1054(1054),\n" +
- " X1055(1055),\n" +
- " X1056(1056),\n" +
- " X1057(1057),\n" +
- " X1058(1058),\n" +
- " X1059(1059),\n" +
- " X1060(1060),\n" +
- " X1061(1061),\n" +
- " X1062(1062),\n" +
- " X1063(1063),\n" +
- " X1064(1064),\n" +
- " X1065(1065),\n" +
- " X1066(1066),\n" +
- " X1067(1067),\n" +
- " X1068(1068),\n" +
- " X1069(1069),\n" +
- " X1070(1070),\n" +
- " X1071(1071),\n" +
- " X1072(1072),\n" +
- " X1073(1073),\n" +
- " X1074(1074),\n" +
- " X1075(1075),\n" +
- " X1076(1076),\n" +
- " X1077(1077),\n" +
- " X1078(1078),\n" +
- " X1079(1079),\n" +
- " X1080(1080),\n" +
- " X1081(1081),\n" +
- " X1082(1082),\n" +
- " X1083(1083),\n" +
- " X1084(1084),\n" +
- " X1085(1085),\n" +
- " X1086(1086),\n" +
- " X1087(1087),\n" +
- " X1088(1088),\n" +
- " X1089(1089),\n" +
- " X1090(1090),\n" +
- " X1091(1091),\n" +
- " X1092(1092),\n" +
- " X1093(1093),\n" +
- " X1094(1094),\n" +
- " X1095(1095),\n" +
- " X1096(1096),\n" +
- " X1097(1097),\n" +
- " X1098(1098),\n" +
- " X1099(1099),\n" +
- " X1100(1100),\n" +
- " X1101(1101),\n" +
- " X1102(1102),\n" +
- " X1103(1103),\n" +
- " X1104(1104),\n" +
- " X1105(1105),\n" +
- " X1106(1106),\n" +
- " X1107(1107),\n" +
- " X1108(1108),\n" +
- " X1109(1109),\n" +
- " X1110(1110),\n" +
- " X1111(1111),\n" +
- " X1112(1112),\n" +
- " X1113(1113),\n" +
- " X1114(1114),\n" +
- " X1115(1115),\n" +
- " X1116(1116),\n" +
- " X1117(1117),\n" +
- " X1118(1118),\n" +
- " X1119(1119),\n" +
- " X1120(1120),\n" +
- " X1121(1121),\n" +
- " X1122(1122),\n" +
- " X1123(1123),\n" +
- " X1124(1124),\n" +
- " X1125(1125),\n" +
- " X1126(1126),\n" +
- " X1127(1127),\n" +
- " X1128(1128),\n" +
- " X1129(1129),\n" +
- " X1130(1130),\n" +
- " X1131(1131),\n" +
- " X1132(1132),\n" +
- " X1133(1133),\n" +
- " X1134(1134),\n" +
- " X1135(1135),\n" +
- " X1136(1136),\n" +
- " X1137(1137),\n" +
- " X1138(1138),\n" +
- " X1139(1139),\n" +
- " X1140(1140),\n" +
- " X1141(1141),\n" +
- " X1142(1142),\n" +
- " X1143(1143),\n" +
- " X1144(1144),\n" +
- " X1145(1145),\n" +
- " X1146(1146),\n" +
- " X1147(1147),\n" +
- " X1148(1148),\n" +
- " X1149(1149),\n" +
- " X1150(1150),\n" +
- " X1151(1151),\n" +
- " X1152(1152),\n" +
- " X1153(1153),\n" +
- " X1154(1154),\n" +
- " X1155(1155),\n" +
- " X1156(1156),\n" +
- " X1157(1157),\n" +
- " X1158(1158),\n" +
- " X1159(1159),\n" +
- " X1160(1160),\n" +
- " X1161(1161),\n" +
- " X1162(1162),\n" +
- " X1163(1163),\n" +
- " X1164(1164),\n" +
- " X1165(1165),\n" +
- " X1166(1166),\n" +
- " X1167(1167),\n" +
- " X1168(1168),\n" +
- " X1169(1169),\n" +
- " X1170(1170),\n" +
- " X1171(1171),\n" +
- " X1172(1172),\n" +
- " X1173(1173),\n" +
- " X1174(1174),\n" +
- " X1175(1175),\n" +
- " X1176(1176),\n" +
- " X1177(1177),\n" +
- " X1178(1178),\n" +
- " X1179(1179),\n" +
- " X1180(1180),\n" +
- " X1181(1181),\n" +
- " X1182(1182),\n" +
- " X1183(1183),\n" +
- " X1184(1184),\n" +
- " X1185(1185),\n" +
- " X1186(1186),\n" +
- " X1187(1187),\n" +
- " X1188(1188),\n" +
- " X1189(1189),\n" +
- " X1190(1190),\n" +
- " X1191(1191),\n" +
- " X1192(1192),\n" +
- " X1193(1193),\n" +
- " X1194(1194),\n" +
- " X1195(1195),\n" +
- " X1196(1196),\n" +
- " X1197(1197),\n" +
- " X1198(1198),\n" +
- " X1199(1199),\n" +
- " X1200(1200),\n" +
- " X1201(1201),\n" +
- " X1202(1202),\n" +
- " X1203(1203),\n" +
- " X1204(1204),\n" +
- " X1205(1205),\n" +
- " X1206(1206),\n" +
- " X1207(1207),\n" +
- " X1208(1208),\n" +
- " X1209(1209),\n" +
- " X1210(1210),\n" +
- " X1211(1211),\n" +
- " X1212(1212),\n" +
- " X1213(1213),\n" +
- " X1214(1214),\n" +
- " X1215(1215),\n" +
- " X1216(1216),\n" +
- " X1217(1217),\n" +
- " X1218(1218),\n" +
- " X1219(1219),\n" +
- " X1220(1220),\n" +
- " X1221(1221),\n" +
- " X1222(1222),\n" +
- " X1223(1223),\n" +
- " X1224(1224),\n" +
- " X1225(1225),\n" +
- " X1226(1226),\n" +
- " X1227(1227),\n" +
- " X1228(1228),\n" +
- " X1229(1229),\n" +
- " X1230(1230),\n" +
- " X1231(1231),\n" +
- " X1232(1232),\n" +
- " X1233(1233),\n" +
- " X1234(1234),\n" +
- " X1235(1235),\n" +
- " X1236(1236),\n" +
- " X1237(1237),\n" +
- " X1238(1238),\n" +
- " X1239(1239),\n" +
- " X1240(1240),\n" +
- " X1241(1241),\n" +
- " X1242(1242),\n" +
- " X1243(1243),\n" +
- " X1244(1244),\n" +
- " X1245(1245),\n" +
- " X1246(1246),\n" +
- " X1247(1247),\n" +
- " X1248(1248),\n" +
- " X1249(1249),\n" +
- " X1250(1250),\n" +
- " X1251(1251),\n" +
- " X1252(1252),\n" +
- " X1253(1253),\n" +
- " X1254(1254),\n" +
- " X1255(1255),\n" +
- " X1256(1256),\n" +
- " X1257(1257),\n" +
- " X1258(1258),\n" +
- " X1259(1259),\n" +
- " X1260(1260),\n" +
- " X1261(1261),\n" +
- " X1262(1262),\n" +
- " X1263(1263),\n" +
- " X1264(1264),\n" +
- " X1265(1265),\n" +
- " X1266(1266),\n" +
- " X1267(1267),\n" +
- " X1268(1268),\n" +
- " X1269(1269),\n" +
- " X1270(1270),\n" +
- " X1271(1271),\n" +
- " X1272(1272),\n" +
- " X1273(1273),\n" +
- " X1274(1274),\n" +
- " X1275(1275),\n" +
- " X1276(1276),\n" +
- " X1277(1277),\n" +
- " X1278(1278),\n" +
- " X1279(1279),\n" +
- " X1280(1280),\n" +
- " X1281(1281),\n" +
- " X1282(1282),\n" +
- " X1283(1283),\n" +
- " X1284(1284),\n" +
- " X1285(1285),\n" +
- " X1286(1286),\n" +
- " X1287(1287),\n" +
- " X1288(1288),\n" +
- " X1289(1289),\n" +
- " X1290(1290),\n" +
- " X1291(1291),\n" +
- " X1292(1292),\n" +
- " X1293(1293),\n" +
- " X1294(1294),\n" +
- " X1295(1295),\n" +
- " X1296(1296),\n" +
- " X1297(1297),\n" +
- " X1298(1298),\n" +
- " X1299(1299),\n" +
- " X1300(1300),\n" +
- " X1301(1301),\n" +
- " X1302(1302),\n" +
- " X1303(1303),\n" +
- " X1304(1304),\n" +
- " X1305(1305),\n" +
- " X1306(1306),\n" +
- " X1307(1307),\n" +
- " X1308(1308),\n" +
- " X1309(1309),\n" +
- " X1310(1310),\n" +
- " X1311(1311),\n" +
- " X1312(1312),\n" +
- " X1313(1313),\n" +
- " X1314(1314),\n" +
- " X1315(1315),\n" +
- " X1316(1316),\n" +
- " X1317(1317),\n" +
- " X1318(1318),\n" +
- " X1319(1319),\n" +
- " X1320(1320),\n" +
- " X1321(1321),\n" +
- " X1322(1322),\n" +
- " X1323(1323),\n" +
- " X1324(1324),\n" +
- " X1325(1325),\n" +
- " X1326(1326),\n" +
- " X1327(1327),\n" +
- " X1328(1328),\n" +
- " X1329(1329),\n" +
- " X1330(1330),\n" +
- " X1331(1331),\n" +
- " X1332(1332),\n" +
- " X1333(1333),\n" +
- " X1334(1334),\n" +
- " X1335(1335),\n" +
- " X1336(1336),\n" +
- " X1337(1337),\n" +
- " X1338(1338),\n" +
- " X1339(1339),\n" +
- " X1340(1340),\n" +
- " X1341(1341),\n" +
- " X1342(1342),\n" +
- " X1343(1343),\n" +
- " X1344(1344),\n" +
- " X1345(1345),\n" +
- " X1346(1346),\n" +
- " X1347(1347),\n" +
- " X1348(1348),\n" +
- " X1349(1349),\n" +
- " X1350(1350),\n" +
- " X1351(1351),\n" +
- " X1352(1352),\n" +
- " X1353(1353),\n" +
- " X1354(1354),\n" +
- " X1355(1355),\n" +
- " X1356(1356),\n" +
- " X1357(1357),\n" +
- " X1358(1358),\n" +
- " X1359(1359),\n" +
- " X1360(1360),\n" +
- " X1361(1361),\n" +
- " X1362(1362),\n" +
- " X1363(1363),\n" +
- " X1364(1364),\n" +
- " X1365(1365),\n" +
- " X1366(1366),\n" +
- " X1367(1367),\n" +
- " X1368(1368),\n" +
- " X1369(1369),\n" +
- " X1370(1370),\n" +
- " X1371(1371),\n" +
- " X1372(1372),\n" +
- " X1373(1373),\n" +
- " X1374(1374),\n" +
- " X1375(1375),\n" +
- " X1376(1376),\n" +
- " X1377(1377),\n" +
- " X1378(1378),\n" +
- " X1379(1379),\n" +
- " X1380(1380),\n" +
- " X1381(1381),\n" +
- " X1382(1382),\n" +
- " X1383(1383),\n" +
- " X1384(1384),\n" +
- " X1385(1385),\n" +
- " X1386(1386),\n" +
- " X1387(1387),\n" +
- " X1388(1388),\n" +
- " X1389(1389),\n" +
- " X1390(1390),\n" +
- " X1391(1391),\n" +
- " X1392(1392),\n" +
- " X1393(1393),\n" +
- " X1394(1394),\n" +
- " X1395(1395),\n" +
- " X1396(1396),\n" +
- " X1397(1397),\n" +
- " X1398(1398),\n" +
- " X1399(1399),\n" +
- " X1400(1400),\n" +
- " X1401(1401),\n" +
- " X1402(1402),\n" +
- " X1403(1403),\n" +
- " X1404(1404),\n" +
- " X1405(1405),\n" +
- " X1406(1406),\n" +
- " X1407(1407),\n" +
- " X1408(1408),\n" +
- " X1409(1409),\n" +
- " X1410(1410),\n" +
- " X1411(1411),\n" +
- " X1412(1412),\n" +
- " X1413(1413),\n" +
- " X1414(1414),\n" +
- " X1415(1415),\n" +
- " X1416(1416),\n" +
- " X1417(1417),\n" +
- " X1418(1418),\n" +
- " X1419(1419),\n" +
- " X1420(1420),\n" +
- " X1421(1421),\n" +
- " X1422(1422),\n" +
- " X1423(1423),\n" +
- " X1424(1424),\n" +
- " X1425(1425),\n" +
- " X1426(1426),\n" +
- " X1427(1427),\n" +
- " X1428(1428),\n" +
- " X1429(1429),\n" +
- " X1430(1430),\n" +
- " X1431(1431),\n" +
- " X1432(1432),\n" +
- " X1433(1433),\n" +
- " X1434(1434),\n" +
- " X1435(1435),\n" +
- " X1436(1436),\n" +
- " X1437(1437),\n" +
- " X1438(1438),\n" +
- " X1439(1439),\n" +
- " X1440(1440),\n" +
- " X1441(1441),\n" +
- " X1442(1442),\n" +
- " X1443(1443),\n" +
- " X1444(1444),\n" +
- " X1445(1445),\n" +
- " X1446(1446),\n" +
- " X1447(1447),\n" +
- " X1448(1448),\n" +
- " X1449(1449),\n" +
- " X1450(1450),\n" +
- " X1451(1451),\n" +
- " X1452(1452),\n" +
- " X1453(1453),\n" +
- " X1454(1454),\n" +
- " X1455(1455),\n" +
- " X1456(1456),\n" +
- " X1457(1457),\n" +
- " X1458(1458),\n" +
- " X1459(1459),\n" +
- " X1460(1460),\n" +
- " X1461(1461),\n" +
- " X1462(1462),\n" +
- " X1463(1463),\n" +
- " X1464(1464),\n" +
- " X1465(1465),\n" +
- " X1466(1466),\n" +
- " X1467(1467),\n" +
- " X1468(1468),\n" +
- " X1469(1469),\n" +
- " X1470(1470),\n" +
- " X1471(1471),\n" +
- " X1472(1472),\n" +
- " X1473(1473),\n" +
- " X1474(1474),\n" +
- " X1475(1475),\n" +
- " X1476(1476),\n" +
- " X1477(1477),\n" +
- " X1478(1478),\n" +
- " X1479(1479),\n" +
- " X1480(1480),\n" +
- " X1481(1481),\n" +
- " X1482(1482),\n" +
- " X1483(1483),\n" +
- " X1484(1484),\n" +
- " X1485(1485),\n" +
- " X1486(1486),\n" +
- " X1487(1487),\n" +
- " X1488(1488),\n" +
- " X1489(1489),\n" +
- " X1490(1490),\n" +
- " X1491(1491),\n" +
- " X1492(1492),\n" +
- " X1493(1493),\n" +
- " X1494(1494),\n" +
- " X1495(1495),\n" +
- " X1496(1496),\n" +
- " X1497(1497),\n" +
- " X1498(1498),\n" +
- " X1499(1499),\n" +
- " X1500(1500),\n" +
- " X1501(1501),\n" +
- " X1502(1502),\n" +
- " X1503(1503),\n" +
- " X1504(1504),\n" +
- " X1505(1505),\n" +
- " X1506(1506),\n" +
- " X1507(1507),\n" +
- " X1508(1508),\n" +
- " X1509(1509),\n" +
- " X1510(1510),\n" +
- " X1511(1511),\n" +
- " X1512(1512),\n" +
- " X1513(1513),\n" +
- " X1514(1514),\n" +
- " X1515(1515),\n" +
- " X1516(1516),\n" +
- " X1517(1517),\n" +
- " X1518(1518),\n" +
- " X1519(1519),\n" +
- " X1520(1520),\n" +
- " X1521(1521),\n" +
- " X1522(1522),\n" +
- " X1523(1523),\n" +
- " X1524(1524),\n" +
- " X1525(1525),\n" +
- " X1526(1526),\n" +
- " X1527(1527),\n" +
- " X1528(1528),\n" +
- " X1529(1529),\n" +
- " X1530(1530),\n" +
- " X1531(1531),\n" +
- " X1532(1532),\n" +
- " X1533(1533),\n" +
- " X1534(1534),\n" +
- " X1535(1535),\n" +
- " X1536(1536),\n" +
- " X1537(1537),\n" +
- " X1538(1538),\n" +
- " X1539(1539),\n" +
- " X1540(1540),\n" +
- " X1541(1541),\n" +
- " X1542(1542),\n" +
- " X1543(1543),\n" +
- " X1544(1544),\n" +
- " X1545(1545),\n" +
- " X1546(1546),\n" +
- " X1547(1547),\n" +
- " X1548(1548),\n" +
- " X1549(1549),\n" +
- " X1550(1550),\n" +
- " X1551(1551),\n" +
- " X1552(1552),\n" +
- " X1553(1553),\n" +
- " X1554(1554),\n" +
- " X1555(1555),\n" +
- " X1556(1556),\n" +
- " X1557(1557),\n" +
- " X1558(1558),\n" +
- " X1559(1559),\n" +
- " X1560(1560),\n" +
- " X1561(1561),\n" +
- " X1562(1562),\n" +
- " X1563(1563),\n" +
- " X1564(1564),\n" +
- " X1565(1565),\n" +
- " X1566(1566),\n" +
- " X1567(1567),\n" +
- " X1568(1568),\n" +
- " X1569(1569),\n" +
- " X1570(1570),\n" +
- " X1571(1571),\n" +
- " X1572(1572),\n" +
- " X1573(1573),\n" +
- " X1574(1574),\n" +
- " X1575(1575),\n" +
- " X1576(1576),\n" +
- " X1577(1577),\n" +
- " X1578(1578),\n" +
- " X1579(1579),\n" +
- " X1580(1580),\n" +
- " X1581(1581),\n" +
- " X1582(1582),\n" +
- " X1583(1583),\n" +
- " X1584(1584),\n" +
- " X1585(1585),\n" +
- " X1586(1586),\n" +
- " X1587(1587),\n" +
- " X1588(1588),\n" +
- " X1589(1589),\n" +
- " X1590(1590),\n" +
- " X1591(1591),\n" +
- " X1592(1592),\n" +
- " X1593(1593),\n" +
- " X1594(1594),\n" +
- " X1595(1595),\n" +
- " X1596(1596),\n" +
- " X1597(1597),\n" +
- " X1598(1598),\n" +
- " X1599(1599),\n" +
- " X1600(1600),\n" +
- " X1601(1601),\n" +
- " X1602(1602),\n" +
- " X1603(1603),\n" +
- " X1604(1604),\n" +
- " X1605(1605),\n" +
- " X1606(1606),\n" +
- " X1607(1607),\n" +
- " X1608(1608),\n" +
- " X1609(1609),\n" +
- " X1610(1610),\n" +
- " X1611(1611),\n" +
- " X1612(1612),\n" +
- " X1613(1613),\n" +
- " X1614(1614),\n" +
- " X1615(1615),\n" +
- " X1616(1616),\n" +
- " X1617(1617),\n" +
- " X1618(1618),\n" +
- " X1619(1619),\n" +
- " X1620(1620),\n" +
- " X1621(1621),\n" +
- " X1622(1622),\n" +
- " X1623(1623),\n" +
- " X1624(1624),\n" +
- " X1625(1625),\n" +
- " X1626(1626),\n" +
- " X1627(1627),\n" +
- " X1628(1628),\n" +
- " X1629(1629),\n" +
- " X1630(1630),\n" +
- " X1631(1631),\n" +
- " X1632(1632),\n" +
- " X1633(1633),\n" +
- " X1634(1634),\n" +
- " X1635(1635),\n" +
- " X1636(1636),\n" +
- " X1637(1637),\n" +
- " X1638(1638),\n" +
- " X1639(1639),\n" +
- " X1640(1640),\n" +
- " X1641(1641),\n" +
- " X1642(1642),\n" +
- " X1643(1643),\n" +
- " X1644(1644),\n" +
- " X1645(1645),\n" +
- " X1646(1646),\n" +
- " X1647(1647),\n" +
- " X1648(1648),\n" +
- " X1649(1649),\n" +
- " X1650(1650),\n" +
- " X1651(1651),\n" +
- " X1652(1652),\n" +
- " X1653(1653),\n" +
- " X1654(1654),\n" +
- " X1655(1655),\n" +
- " X1656(1656),\n" +
- " X1657(1657),\n" +
- " X1658(1658),\n" +
- " X1659(1659),\n" +
- " X1660(1660),\n" +
- " X1661(1661),\n" +
- " X1662(1662),\n" +
- " X1663(1663),\n" +
- " X1664(1664),\n" +
- " X1665(1665),\n" +
- " X1666(1666),\n" +
- " X1667(1667),\n" +
- " X1668(1668),\n" +
- " X1669(1669),\n" +
- " X1670(1670),\n" +
- " X1671(1671),\n" +
- " X1672(1672),\n" +
- " X1673(1673),\n" +
- " X1674(1674),\n" +
- " X1675(1675),\n" +
- " X1676(1676),\n" +
- " X1677(1677),\n" +
- " X1678(1678),\n" +
- " X1679(1679),\n" +
- " X1680(1680),\n" +
- " X1681(1681),\n" +
- " X1682(1682),\n" +
- " X1683(1683),\n" +
- " X1684(1684),\n" +
- " X1685(1685),\n" +
- " X1686(1686),\n" +
- " X1687(1687),\n" +
- " X1688(1688),\n" +
- " X1689(1689),\n" +
- " X1690(1690),\n" +
- " X1691(1691),\n" +
- " X1692(1692),\n" +
- " X1693(1693),\n" +
- " X1694(1694),\n" +
- " X1695(1695),\n" +
- " X1696(1696),\n" +
- " X1697(1697),\n" +
- " X1698(1698),\n" +
- " X1699(1699),\n" +
- " X1700(1700),\n" +
- " X1701(1701),\n" +
- " X1702(1702),\n" +
- " X1703(1703),\n" +
- " X1704(1704),\n" +
- " X1705(1705),\n" +
- " X1706(1706),\n" +
- " X1707(1707),\n" +
- " X1708(1708),\n" +
- " X1709(1709),\n" +
- " X1710(1710),\n" +
- " X1711(1711),\n" +
- " X1712(1712),\n" +
- " X1713(1713),\n" +
- " X1714(1714),\n" +
- " X1715(1715),\n" +
- " X1716(1716),\n" +
- " X1717(1717),\n" +
- " X1718(1718),\n" +
- " X1719(1719),\n" +
- " X1720(1720),\n" +
- " X1721(1721),\n" +
- " X1722(1722),\n" +
- " X1723(1723),\n" +
- " X1724(1724),\n" +
- " X1725(1725),\n" +
- " X1726(1726),\n" +
- " X1727(1727),\n" +
- " X1728(1728),\n" +
- " X1729(1729),\n" +
- " X1730(1730),\n" +
- " X1731(1731),\n" +
- " X1732(1732),\n" +
- " X1733(1733),\n" +
- " X1734(1734),\n" +
- " X1735(1735),\n" +
- " X1736(1736),\n" +
- " X1737(1737),\n" +
- " X1738(1738),\n" +
- " X1739(1739),\n" +
- " X1740(1740),\n" +
- " X1741(1741),\n" +
- " X1742(1742),\n" +
- " X1743(1743),\n" +
- " X1744(1744),\n" +
- " X1745(1745),\n" +
- " X1746(1746),\n" +
- " X1747(1747),\n" +
- " X1748(1748),\n" +
- " X1749(1749),\n" +
- " X1750(1750),\n" +
- " X1751(1751),\n" +
- " X1752(1752),\n" +
- " X1753(1753),\n" +
- " X1754(1754),\n" +
- " X1755(1755),\n" +
- " X1756(1756),\n" +
- " X1757(1757),\n" +
- " X1758(1758),\n" +
- " X1759(1759),\n" +
- " X1760(1760),\n" +
- " X1761(1761),\n" +
- " X1762(1762),\n" +
- " X1763(1763),\n" +
- " X1764(1764),\n" +
- " X1765(1765),\n" +
- " X1766(1766),\n" +
- " X1767(1767),\n" +
- " X1768(1768),\n" +
- " X1769(1769),\n" +
- " X1770(1770),\n" +
- " X1771(1771),\n" +
- " X1772(1772),\n" +
- " X1773(1773),\n" +
- " X1774(1774),\n" +
- " X1775(1775),\n" +
- " X1776(1776),\n" +
- " X1777(1777),\n" +
- " X1778(1778),\n" +
- " X1779(1779),\n" +
- " X1780(1780),\n" +
- " X1781(1781),\n" +
- " X1782(1782),\n" +
- " X1783(1783),\n" +
- " X1784(1784),\n" +
- " X1785(1785),\n" +
- " X1786(1786),\n" +
- " X1787(1787),\n" +
- " X1788(1788),\n" +
- " X1789(1789),\n" +
- " X1790(1790),\n" +
- " X1791(1791),\n" +
- " X1792(1792),\n" +
- " X1793(1793),\n" +
- " X1794(1794),\n" +
- " X1795(1795),\n" +
- " X1796(1796),\n" +
- " X1797(1797),\n" +
- " X1798(1798),\n" +
- " X1799(1799),\n" +
- " X1800(1800),\n" +
- " X1801(1801),\n" +
- " X1802(1802),\n" +
- " X1803(1803),\n" +
- " X1804(1804),\n" +
- " X1805(1805),\n" +
- " X1806(1806),\n" +
- " X1807(1807),\n" +
- " X1808(1808),\n" +
- " X1809(1809),\n" +
- " X1810(1810),\n" +
- " X1811(1811),\n" +
- " X1812(1812),\n" +
- " X1813(1813),\n" +
- " X1814(1814),\n" +
- " X1815(1815),\n" +
- " X1816(1816),\n" +
- " X1817(1817),\n" +
- " X1818(1818),\n" +
- " X1819(1819),\n" +
- " X1820(1820),\n" +
- " X1821(1821),\n" +
- " X1822(1822),\n" +
- " X1823(1823),\n" +
- " X1824(1824),\n" +
- " X1825(1825),\n" +
- " X1826(1826),\n" +
- " X1827(1827),\n" +
- " X1828(1828),\n" +
- " X1829(1829),\n" +
- " X1830(1830),\n" +
- " X1831(1831),\n" +
- " X1832(1832),\n" +
- " X1833(1833),\n" +
- " X1834(1834),\n" +
- " X1835(1835),\n" +
- " X1836(1836),\n" +
- " X1837(1837),\n" +
- " X1838(1838),\n" +
- " X1839(1839),\n" +
- " X1840(1840),\n" +
- " X1841(1841),\n" +
- " X1842(1842),\n" +
- " X1843(1843),\n" +
- " X1844(1844),\n" +
- " X1845(1845),\n" +
- " X1846(1846),\n" +
- " X1847(1847),\n" +
- " X1848(1848),\n" +
- " X1849(1849),\n" +
- " X1850(1850),\n" +
- " X1851(1851),\n" +
- " X1852(1852),\n" +
- " X1853(1853),\n" +
- " X1854(1854),\n" +
- " X1855(1855),\n" +
- " X1856(1856),\n" +
- " X1857(1857),\n" +
- " X1858(1858),\n" +
- " X1859(1859),\n" +
- " X1860(1860),\n" +
- " X1861(1861),\n" +
- " X1862(1862),\n" +
- " X1863(1863),\n" +
- " X1864(1864),\n" +
- " X1865(1865),\n" +
- " X1866(1866),\n" +
- " X1867(1867),\n" +
- " X1868(1868),\n" +
- " X1869(1869),\n" +
- " X1870(1870),\n" +
- " X1871(1871),\n" +
- " X1872(1872),\n" +
- " X1873(1873),\n" +
- " X1874(1874),\n" +
- " X1875(1875),\n" +
- " X1876(1876),\n" +
- " X1877(1877),\n" +
- " X1878(1878),\n" +
- " X1879(1879),\n" +
- " X1880(1880),\n" +
- " X1881(1881),\n" +
- " X1882(1882),\n" +
- " X1883(1883),\n" +
- " X1884(1884),\n" +
- " X1885(1885),\n" +
- " X1886(1886),\n" +
- " X1887(1887),\n" +
- " X1888(1888),\n" +
- " X1889(1889),\n" +
- " X1890(1890),\n" +
- " X1891(1891),\n" +
- " X1892(1892),\n" +
- " X1893(1893),\n" +
- " X1894(1894),\n" +
- " X1895(1895),\n" +
- " X1896(1896),\n" +
- " X1897(1897),\n" +
- " X1898(1898),\n" +
- " X1899(1899),\n" +
- " X1900(1900),\n" +
- " X1901(1901),\n" +
- " X1902(1902),\n" +
- " X1903(1903),\n" +
- " X1904(1904),\n" +
- " X1905(1905),\n" +
- " X1906(1906),\n" +
- " X1907(1907),\n" +
- " X1908(1908),\n" +
- " X1909(1909),\n" +
- " X1910(1910),\n" +
- " X1911(1911),\n" +
- " X1912(1912),\n" +
- " X1913(1913),\n" +
- " X1914(1914),\n" +
- " X1915(1915),\n" +
- " X1916(1916),\n" +
- " X1917(1917),\n" +
- " X1918(1918),\n" +
- " X1919(1919),\n" +
- " X1920(1920),\n" +
- " X1921(1921),\n" +
- " X1922(1922),\n" +
- " X1923(1923),\n" +
- " X1924(1924),\n" +
- " X1925(1925),\n" +
- " X1926(1926),\n" +
- " X1927(1927),\n" +
- " X1928(1928),\n" +
- " X1929(1929),\n" +
- " X1930(1930),\n" +
- " X1931(1931),\n" +
- " X1932(1932),\n" +
- " X1933(1933),\n" +
- " X1934(1934),\n" +
- " X1935(1935),\n" +
- " X1936(1936),\n" +
- " X1937(1937),\n" +
- " X1938(1938),\n" +
- " X1939(1939),\n" +
- " X1940(1940),\n" +
- " X1941(1941),\n" +
- " X1942(1942),\n" +
- " X1943(1943),\n" +
- " X1944(1944),\n" +
- " X1945(1945),\n" +
- " X1946(1946),\n" +
- " X1947(1947),\n" +
- " X1948(1948),\n" +
- " X1949(1949),\n" +
- " X1950(1950),\n" +
- " X1951(1951),\n" +
- " X1952(1952),\n" +
- " X1953(1953),\n" +
- " X1954(1954),\n" +
- " X1955(1955),\n" +
- " X1956(1956),\n" +
- " X1957(1957),\n" +
- " X1958(1958),\n" +
- " X1959(1959),\n" +
- " X1960(1960),\n" +
- " X1961(1961),\n" +
- " X1962(1962),\n" +
- " X1963(1963),\n" +
- " X1964(1964),\n" +
- " X1965(1965),\n" +
- " X1966(1966),\n" +
- " X1967(1967),\n" +
- " X1968(1968),\n" +
- " X1969(1969),\n" +
- " X1970(1970),\n" +
- " X1971(1971),\n" +
- " X1972(1972),\n" +
- " X1973(1973),\n" +
- " X1974(1974),\n" +
- " X1975(1975),\n" +
- " X1976(1976),\n" +
- " X1977(1977),\n" +
- " X1978(1978),\n" +
- " X1979(1979),\n" +
- " X1980(1980),\n" +
- " X1981(1981),\n" +
- " X1982(1982),\n" +
- " X1983(1983),\n" +
- " X1984(1984),\n" +
- " X1985(1985),\n" +
- " X1986(1986),\n" +
- " X1987(1987),\n" +
- " X1988(1988),\n" +
- " X1989(1989),\n" +
- " X1990(1990),\n" +
- " X1991(1991),\n" +
- " X1992(1992),\n" +
- " X1993(1993),\n" +
- " X1994(1994),\n" +
- " X1995(1995),\n" +
- " X1996(1996),\n" +
- " X1997(1997),\n" +
- " X1998(1998),\n" +
- " X1999(1999),\n" +
- " X2000(2000),\n" +
- " X2001(2001),\n" +
- " X2002(2002),\n" +
- " X2003(2003),\n" +
- " X2004(2004),\n" +
- " X2005(2005),\n" +
- " X2006(2006),\n" +
- " X2007(2007),\n" +
- " X2008(2008),\n" +
- " X2009(2009),\n" +
- " X2010(2010),\n" +
- " X2011(2011),\n" +
- " X2012(2012),\n" +
- " X2013(2013),\n" +
- " X2014(2014),\n" +
- " X2015(2015),\n" +
- " X2016(2016),\n" +
- " X2017(2017),\n" +
- " X2018(2018),\n" +
- " X2019(2019),\n" +
- " X2020(2020),\n" +
- " X2021(2021),\n" +
- " X2022(2022),\n" +
- " X2023(2023),\n" +
- " X2024(2024),\n" +
- " X2025(2025),\n" +
- " X2026(2026),\n" +
- " X2027(2027),\n" +
- " X2028(2028),\n" +
- " X2029(2029),\n" +
- " X2030(2030),\n" +
- " X2031(2031),\n" +
- " X2032(2032),\n" +
- " X2033(2033),\n" +
- " X2034(2034),\n" +
- " X2035(2035),\n" +
- " X2036(2036),\n" +
- " X2037(2037),\n" +
- " X2038(2038),\n" +
- " X2039(2039),\n" +
- " X2040(2040),\n" +
- " X2041(2041),\n" +
- " X2042(2042),\n" +
- " X2043(2043),\n" +
- " X2044(2044),\n" +
- " X2045(2045),\n" +
- " X2046(2046),\n" +
- " X2047(2047),\n" +
- " X2048(2048),\n" +
- " X2049(2049),\n" +
- " X2050(2050),\n" +
- " X2051(2051),\n" +
- " X2052(2052),\n" +
- " X2053(2053),\n" +
- " X2054(2054),\n" +
- " X2055(2055),\n" +
- " X2056(2056),\n" +
- " X2057(2057),\n" +
- " X2058(2058),\n" +
- " X2059(2059),\n" +
- " X2060(2060),\n" +
- " X2061(2061),\n" +
- " X2062(2062),\n" +
- " X2063(2063),\n" +
- " X2064(2064),\n" +
- " X2065(2065),\n" +
- " X2066(2066),\n" +
- " X2067(2067),\n" +
- " X2068(2068),\n" +
- " X2069(2069),\n" +
- " X2070(2070),\n" +
- " X2071(2071),\n" +
- " X2072(2072),\n" +
- " X2073(2073),\n" +
- " X2074(2074),\n" +
- " X2075(2075),\n" +
- " X2076(2076),\n" +
- " X2077(2077),\n" +
- " X2078(2078),\n" +
- " X2079(2079),\n" +
- " X2080(2080),\n" +
- " X2081(2081),\n" +
- " X2082(2082),\n" +
- " X2083(2083),\n" +
- " X2084(2084),\n" +
- " X2085(2085),\n" +
- " X2086(2086),\n" +
- " X2087(2087),\n" +
- " X2088(2088),\n" +
- " X2089(2089),\n" +
- " X2090(2090),\n" +
- " X2091(2091),\n" +
- " X2092(2092),\n" +
- " X2093(2093),\n" +
- " X2094(2094),\n" +
- " X2095(2095),\n" +
- " X2096(2096),\n" +
- " X2097(2097),\n" +
- " X2098(2098),\n" +
- " X2099(2099),\n" +
- " X2100(2100),\n" +
- " X2101(2101),\n" +
- " X2102(2102),\n" +
- " X2103(2103),\n" +
- " X2104(2104),\n" +
- " X2105(2105),\n" +
- " X2106(2106),\n" +
- " X2107(2107),\n" +
- " X2108(2108),\n" +
- " X2109(2109),\n" +
- " X2110(2110),\n" +
- " X2111(2111),\n" +
- " X2112(2112),\n" +
- " X2113(2113),\n" +
- " X2114(2114),\n" +
- " X2115(2115),\n" +
- " X2116(2116),\n" +
- " X2117(2117),\n" +
- " X2118(2118),\n" +
- " X2119(2119),\n" +
- " X2120(2120),\n" +
- " X2121(2121),\n" +
- " X2122(2122),\n" +
- " X2123(2123),\n" +
- " X2124(2124),\n" +
- " X2125(2125),\n" +
- " X2126(2126),\n" +
- " X2127(2127),\n" +
- " X2128(2128),\n" +
- " X2129(2129),\n" +
- " X2130(2130),\n" +
- " X2131(2131),\n" +
- " X2132(2132),\n" +
- " X2133(2133),\n" +
- " X2134(2134),\n" +
- " X2135(2135),\n" +
- " X2136(2136),\n" +
- " X2137(2137),\n" +
- " X2138(2138),\n" +
- " X2139(2139),\n" +
- " X2140(2140),\n" +
- " X2141(2141),\n" +
- " X2142(2142),\n" +
- " X2143(2143),\n" +
- " X2144(2144),\n" +
- " X2145(2145),\n" +
- " X2146(2146),\n" +
- " X2147(2147),\n" +
- " X2148(2148),\n" +
- " X2149(2149),\n" +
- " X2150(2150),\n" +
- " X2151(2151),\n" +
- " X2152(2152),\n" +
- " X2153(2153),\n" +
- " X2154(2154),\n" +
- " X2155(2155),\n" +
- " X2156(2156),\n" +
- " X2157(2157),\n" +
- " X2158(2158),\n" +
- " X2159(2159),\n" +
- " X2160(2160),\n" +
- " X2161(2161),\n" +
- " X2162(2162),\n" +
- " X2163(2163),\n" +
- " X2164(2164),\n" +
- " X2165(2165),\n" +
- " X2166(2166),\n" +
- " X2167(2167),\n" +
- " X2168(2168),\n" +
- " X2169(2169),\n" +
- " X2170(2170),\n" +
- " X2171(2171),\n" +
- " X2172(2172),\n" +
- " X2173(2173),\n" +
- " X2174(2174),\n" +
- " X2175(2175),\n" +
- " X2176(2176),\n" +
- " X2177(2177),\n" +
- " X2178(2178),\n" +
- " X2179(2179),\n" +
- " X2180(2180),\n" +
- " X2181(2181),\n" +
- " X2182(2182),\n" +
- " X2183(2183),\n" +
- " X2184(2184),\n" +
- " X2185(2185),\n" +
- " X2186(2186),\n" +
- " X2187(2187),\n" +
- " X2188(2188),\n" +
- " X2189(2189),\n" +
- " X2190(2190),\n" +
- " X2191(2191),\n" +
- " X2192(2192),\n" +
- " X2193(2193),\n" +
- " X2194(2194),\n" +
- " X2195(2195),\n" +
- " X2196(2196),\n" +
- " X2197(2197),\n" +
- " X2198(2198),\n" +
- " X2199(2199),\n" +
- " X2200(2200),\n" +
- " X2201(2201),\n" +
- " X2202(2202),\n" +
- " X2203(2203),\n" +
- " X2204(2204),\n" +
- " X2205(2205),\n" +
- " X2206(2206),\n" +
- " X2207(2207),\n" +
- " X2208(2208),\n" +
- " X2209(2209),\n" +
- " X2210(2210),\n" +
- " X2211(2211),\n" +
- " X2212(2212),\n" +
- " X2213(2213),\n" +
- " X2214(2214),\n" +
- " X2215(2215),\n" +
- " X2216(2216),\n" +
- " X2217(2217),\n" +
- " X2218(2218),\n" +
- " X2219(2219),\n" +
- " X2220(2220),\n" +
- " X2221(2221),\n" +
- " X2222(2222),\n" +
- " X2223(2223),\n" +
- " X2224(2224),\n" +
- " X2225(2225),\n" +
- " X2226(2226),\n" +
- " X2227(2227),\n" +
- " X2228(2228),\n" +
- " X2229(2229),\n" +
- " X2230(2230),\n" +
- " X2231(2231),\n" +
- " X2232(2232),\n" +
- " X2233(2233),\n" +
- " X2234(2234),\n" +
- " X2235(2235),\n" +
- " X2236(2236),\n" +
- " X2237(2237),\n" +
- " X2238(2238),\n" +
- " X2239(2239),\n" +
- " X2240(2240),\n" +
- " X2241(2241),\n" +
- " X2242(2242),\n" +
- " X2243(2243),\n" +
- " X2244(2244),\n" +
- " X2245(2245),\n" +
- " X2246(2246),\n" +
- " X2247(2247),\n" +
- " X2248(2248),\n" +
- " X2249(2249),\n" +
- " X2250(2250),\n" +
- " X2251(2251),\n" +
- " X2252(2252),\n" +
- " X2253(2253),\n" +
- " X2254(2254),\n" +
- " X2255(2255),\n" +
- " X2256(2256),\n" +
- " X2257(2257),\n" +
- " X2258(2258),\n" +
- " X2259(2259),\n" +
- " X2260(2260),\n" +
- " X2261(2261),\n" +
- " X2262(2262),\n" +
- " X2263(2263),\n" +
- " X2264(2264),\n" +
- " X2265(2265),\n" +
- " X2266(2266),\n" +
- " X2267(2267),\n" +
- " X2268(2268),\n" +
- " X2269(2269),\n" +
- " X2270(2270),\n" +
- " X2271(2271),\n" +
- " X2272(2272),\n" +
- " X2273(2273),\n" +
- " X2274(2274),\n" +
- " X2275(2275),\n" +
- " X2276(2276),\n" +
- " X2277(2277),\n" +
- " X2278(2278),\n" +
- " X2279(2279),\n" +
- " X2280(2280),\n" +
- " X2281(2281),\n" +
- " X2282(2282),\n" +
- " X2283(2283),\n" +
- " X2284(2284),\n" +
- " X2285(2285),\n" +
- " X2286(2286),\n" +
- " X2287(2287),\n" +
- " X2288(2288),\n" +
- " X2289(2289),\n" +
- " X2290(2290),\n" +
- " X2291(2291),\n" +
- " X2292(2292),\n" +
- " X2293(2293),\n" +
- " X2294(2294),\n" +
- " X2295(2295),\n" +
- " X2296(2296),\n" +
- " X2297(2297),\n" +
- " X2298(2298),\n" +
- " X2299(2299),\n" +
- " X2300(2300),\n" +
- " X2301(2301),\n" +
- " X2302(2302),\n" +
- " X2303(2303),\n" +
- " X2304(2304),\n" +
- " X2305(2305),\n" +
- " X2306(2306),\n" +
- " X2307(2307),\n" +
- " X2308(2308),\n" +
- " X2309(2309),\n" +
- " X2310(2310),\n" +
- " X2311(2311),\n" +
- " X2312(2312),\n" +
- " X2313(2313),\n" +
- " X2314(2314),\n" +
- " X2315(2315),\n" +
- " X2316(2316),\n" +
- " X2317(2317),\n" +
- " X2318(2318),\n" +
- " X2319(2319),\n" +
- " X2320(2320),\n" +
- " X2321(2321),\n" +
- " X2322(2322),\n" +
- " X2323(2323),\n" +
- " X2324(2324),\n" +
- " X2325(2325),\n" +
- " X2326(2326),\n" +
- " X2327(2327),\n" +
- " X2328(2328),\n" +
- " X2329(2329),\n" +
- " X2330(2330),\n" +
- " X2331(2331),\n" +
- " X2332(2332),\n" +
- " X2333(2333),\n" +
- " X2334(2334),\n" +
- " X2335(2335),\n" +
- " X2336(2336),\n" +
- " X2337(2337),\n" +
- " X2338(2338),\n" +
- " X2339(2339),\n" +
- " X2340(2340),\n" +
- " X2341(2341),\n" +
- " X2342(2342),\n" +
- " X2343(2343),\n" +
- " X2344(2344),\n" +
- " X2345(2345),\n" +
- " X2346(2346),\n" +
- " X2347(2347),\n" +
- " X2348(2348),\n" +
- " X2349(2349),\n" +
- " X2350(2350),\n" +
- " X2351(2351),\n" +
- " X2352(2352),\n" +
- " X2353(2353),\n" +
- " X2354(2354),\n" +
- " X2355(2355),\n" +
- " X2356(2356),\n" +
- " X2357(2357),\n" +
- " X2358(2358),\n" +
- " X2359(2359),\n" +
- " X2360(2360),\n" +
- " X2361(2361),\n" +
- " X2362(2362),\n" +
- " X2363(2363),\n" +
- " X2364(2364),\n" +
- " X2365(2365),\n" +
- " X2366(2366),\n" +
- " X2367(2367),\n" +
- " X2368(2368),\n" +
- " X2369(2369),\n" +
- " X2370(2370),\n" +
- " X2371(2371),\n" +
- " X2372(2372),\n" +
- " X2373(2373),\n" +
- " X2374(2374),\n" +
- " X2375(2375),\n" +
- " X2376(2376),\n" +
- " X2377(2377),\n" +
- " X2378(2378),\n" +
- " X2379(2379),\n" +
- " X2380(2380),\n" +
- " X2381(2381),\n" +
- " X2382(2382),\n" +
- " X2383(2383),\n" +
- " X2384(2384),\n" +
- " X2385(2385),\n" +
- " X2386(2386),\n" +
- " X2387(2387),\n" +
- " X2388(2388),\n" +
- " X2389(2389),\n" +
- " X2390(2390),\n" +
- " X2391(2391),\n" +
- " X2392(2392),\n" +
- " X2393(2393),\n" +
- " X2394(2394),\n" +
- " X2395(2395),\n" +
- " X2396(2396),\n" +
- " X2397(2397),\n" +
- " X2398(2398),\n" +
- " X2399(2399),\n" +
- " X2400(2400),\n" +
- " X2401(2401),\n" +
- " X2402(2402),\n" +
- " X2403(2403),\n" +
- " X2404(2404),\n" +
- " X2405(2405),\n" +
- " X2406(2406),\n" +
- " X2407(2407),\n" +
- " X2408(2408),\n" +
- " X2409(2409),\n" +
- " X2410(2410),\n" +
- " X2411(2411),\n" +
- " X2412(2412),\n" +
- " X2413(2413),\n" +
- " X2414(2414),\n" +
- " X2415(2415),\n" +
- " X2416(2416),\n" +
- " X2417(2417),\n" +
- " X2418(2418),\n" +
- " X2419(2419),\n" +
- " X2420(2420),\n" +
- " X2421(2421),\n" +
- " X2422(2422),\n" +
- " X2423(2423),\n" +
- " X2424(2424),\n" +
- " X2425(2425),\n" +
- " X2426(2426),\n" +
- " X2427(2427),\n" +
- " X2428(2428),\n" +
- " X2429(2429),\n" +
- " X2430(2430),\n" +
- " X2431(2431),\n" +
- " X2432(2432),\n" +
- " X2433(2433),\n" +
- " X2434(2434),\n" +
- " X2435(2435),\n" +
- " X2436(2436),\n" +
- " X2437(2437),\n" +
- " X2438(2438),\n" +
- " X2439(2439),\n" +
- " X2440(2440),\n" +
- " X2441(2441),\n" +
- " X2442(2442),\n" +
- " X2443(2443),\n" +
- " X2444(2444),\n" +
- " X2445(2445),\n" +
- " X2446(2446),\n" +
- " X2447(2447),\n" +
- " X2448(2448),\n" +
- " X2449(2449),\n" +
- " X2450(2450),\n" +
- " X2451(2451),\n" +
- " X2452(2452),\n" +
- " X2453(2453),\n" +
- " X2454(2454),\n" +
- " X2455(2455),\n" +
- " X2456(2456),\n" +
- " X2457(2457),\n" +
- " X2458(2458),\n" +
- " X2459(2459),\n" +
- " X2460(2460),\n" +
- " X2461(2461),\n" +
- " X2462(2462),\n" +
- " X2463(2463),\n" +
- " X2464(2464),\n" +
- " X2465(2465),\n" +
- " X2466(2466),\n" +
- " X2467(2467),\n" +
- " X2468(2468),\n" +
- " X2469(2469),\n" +
- " X2470(2470),\n" +
- " X2471(2471),\n" +
- " X2472(2472),\n" +
- " X2473(2473),\n" +
- " X2474(2474),\n" +
- " X2475(2475),\n" +
- " X2476(2476),\n" +
- " X2477(2477),\n" +
- " X2478(2478),\n" +
- " X2479(2479),\n" +
- " X2480(2480),\n" +
- " X2481(2481),\n" +
- " X2482(2482),\n" +
- " X2483(2483),\n" +
- " X2484(2484),\n" +
- " X2485(2485),\n" +
- " X2486(2486),\n" +
- " X2487(2487),\n" +
- " X2488(2488),\n" +
- " X2489(2489),\n" +
- " X2490(2490),\n" +
- " X2491(2491),\n" +
- " X2492(2492),\n" +
- " X2493(2493),\n" +
- " X2494(2494),\n" +
- " X2495(2495),\n" +
- " X2496(2496),\n" +
- " X2497(2497),\n" +
- " X2498(2498),\n" +
- " X2499(2499),\n" +
- " ;\n" +
- "\n" +
- " private int value;\n" +
- " X(int i) {\n" +
- " this.value = i;\n" +
- " }\n" +
- " \n" +
- " public static void main(String[] args) {\n" +
- " int i = 0;\n" +
- " for (X x : X.values()) {\n" +
- " i++;\n" +
- " System.out.print(x);\n" +
- " }\n" +
- " System.out.print(i);\n" +
- " }\n" +
- " \n" +
- " public String toString() {\n" +
- " return Integer.toString(this.value);\n" +
- " }\n" +
- "}"
- },
- buffer.toString());
+
+ String[] src = {
+ "X.java",
+ "public enum X {\n" +
+ " X0(0),\n" +
+ " X1(1),\n" +
+ " X2(2),\n" +
+ " X3(3),\n" +
+ " X4(4),\n" +
+ " X5(5),\n" +
+ " X6(6),\n" +
+ " X7(7),\n" +
+ " X8(8),\n" +
+ " X9(9),\n" +
+ " X10(10),\n" +
+ " X11(11),\n" +
+ " X12(12),\n" +
+ " X13(13),\n" +
+ " X14(14),\n" +
+ " X15(15),\n" +
+ " X16(16),\n" +
+ " X17(17),\n" +
+ " X18(18),\n" +
+ " X19(19),\n" +
+ " X20(20),\n" +
+ " X21(21),\n" +
+ " X22(22),\n" +
+ " X23(23),\n" +
+ " X24(24),\n" +
+ " X25(25),\n" +
+ " X26(26),\n" +
+ " X27(27),\n" +
+ " X28(28),\n" +
+ " X29(29),\n" +
+ " X30(30),\n" +
+ " X31(31),\n" +
+ " X32(32),\n" +
+ " X33(33),\n" +
+ " X34(34),\n" +
+ " X35(35),\n" +
+ " X36(36),\n" +
+ " X37(37),\n" +
+ " X38(38),\n" +
+ " X39(39),\n" +
+ " X40(40),\n" +
+ " X41(41),\n" +
+ " X42(42),\n" +
+ " X43(43),\n" +
+ " X44(44),\n" +
+ " X45(45),\n" +
+ " X46(46),\n" +
+ " X47(47),\n" +
+ " X48(48),\n" +
+ " X49(49),\n" +
+ " X50(50),\n" +
+ " X51(51),\n" +
+ " X52(52),\n" +
+ " X53(53),\n" +
+ " X54(54),\n" +
+ " X55(55),\n" +
+ " X56(56),\n" +
+ " X57(57),\n" +
+ " X58(58),\n" +
+ " X59(59),\n" +
+ " X60(60),\n" +
+ " X61(61),\n" +
+ " X62(62),\n" +
+ " X63(63),\n" +
+ " X64(64),\n" +
+ " X65(65),\n" +
+ " X66(66),\n" +
+ " X67(67),\n" +
+ " X68(68),\n" +
+ " X69(69),\n" +
+ " X70(70),\n" +
+ " X71(71),\n" +
+ " X72(72),\n" +
+ " X73(73),\n" +
+ " X74(74),\n" +
+ " X75(75),\n" +
+ " X76(76),\n" +
+ " X77(77),\n" +
+ " X78(78),\n" +
+ " X79(79),\n" +
+ " X80(80),\n" +
+ " X81(81),\n" +
+ " X82(82),\n" +
+ " X83(83),\n" +
+ " X84(84),\n" +
+ " X85(85),\n" +
+ " X86(86),\n" +
+ " X87(87),\n" +
+ " X88(88),\n" +
+ " X89(89),\n" +
+ " X90(90),\n" +
+ " X91(91),\n" +
+ " X92(92),\n" +
+ " X93(93),\n" +
+ " X94(94),\n" +
+ " X95(95),\n" +
+ " X96(96),\n" +
+ " X97(97),\n" +
+ " X98(98),\n" +
+ " X99(99),\n" +
+ " X100(100),\n" +
+ " X101(101),\n" +
+ " X102(102),\n" +
+ " X103(103),\n" +
+ " X104(104),\n" +
+ " X105(105),\n" +
+ " X106(106),\n" +
+ " X107(107),\n" +
+ " X108(108),\n" +
+ " X109(109),\n" +
+ " X110(110),\n" +
+ " X111(111),\n" +
+ " X112(112),\n" +
+ " X113(113),\n" +
+ " X114(114),\n" +
+ " X115(115),\n" +
+ " X116(116),\n" +
+ " X117(117),\n" +
+ " X118(118),\n" +
+ " X119(119),\n" +
+ " X120(120),\n" +
+ " X121(121),\n" +
+ " X122(122),\n" +
+ " X123(123),\n" +
+ " X124(124),\n" +
+ " X125(125),\n" +
+ " X126(126),\n" +
+ " X127(127),\n" +
+ " X128(128),\n" +
+ " X129(129),\n" +
+ " X130(130),\n" +
+ " X131(131),\n" +
+ " X132(132),\n" +
+ " X133(133),\n" +
+ " X134(134),\n" +
+ " X135(135),\n" +
+ " X136(136),\n" +
+ " X137(137),\n" +
+ " X138(138),\n" +
+ " X139(139),\n" +
+ " X140(140),\n" +
+ " X141(141),\n" +
+ " X142(142),\n" +
+ " X143(143),\n" +
+ " X144(144),\n" +
+ " X145(145),\n" +
+ " X146(146),\n" +
+ " X147(147),\n" +
+ " X148(148),\n" +
+ " X149(149),\n" +
+ " X150(150),\n" +
+ " X151(151),\n" +
+ " X152(152),\n" +
+ " X153(153),\n" +
+ " X154(154),\n" +
+ " X155(155),\n" +
+ " X156(156),\n" +
+ " X157(157),\n" +
+ " X158(158),\n" +
+ " X159(159),\n" +
+ " X160(160),\n" +
+ " X161(161),\n" +
+ " X162(162),\n" +
+ " X163(163),\n" +
+ " X164(164),\n" +
+ " X165(165),\n" +
+ " X166(166),\n" +
+ " X167(167),\n" +
+ " X168(168),\n" +
+ " X169(169),\n" +
+ " X170(170),\n" +
+ " X171(171),\n" +
+ " X172(172),\n" +
+ " X173(173),\n" +
+ " X174(174),\n" +
+ " X175(175),\n" +
+ " X176(176),\n" +
+ " X177(177),\n" +
+ " X178(178),\n" +
+ " X179(179),\n" +
+ " X180(180),\n" +
+ " X181(181),\n" +
+ " X182(182),\n" +
+ " X183(183),\n" +
+ " X184(184),\n" +
+ " X185(185),\n" +
+ " X186(186),\n" +
+ " X187(187),\n" +
+ " X188(188),\n" +
+ " X189(189),\n" +
+ " X190(190),\n" +
+ " X191(191),\n" +
+ " X192(192),\n" +
+ " X193(193),\n" +
+ " X194(194),\n" +
+ " X195(195),\n" +
+ " X196(196),\n" +
+ " X197(197),\n" +
+ " X198(198),\n" +
+ " X199(199),\n" +
+ " X200(200),\n" +
+ " X201(201),\n" +
+ " X202(202),\n" +
+ " X203(203),\n" +
+ " X204(204),\n" +
+ " X205(205),\n" +
+ " X206(206),\n" +
+ " X207(207),\n" +
+ " X208(208),\n" +
+ " X209(209),\n" +
+ " X210(210),\n" +
+ " X211(211),\n" +
+ " X212(212),\n" +
+ " X213(213),\n" +
+ " X214(214),\n" +
+ " X215(215),\n" +
+ " X216(216),\n" +
+ " X217(217),\n" +
+ " X218(218),\n" +
+ " X219(219),\n" +
+ " X220(220),\n" +
+ " X221(221),\n" +
+ " X222(222),\n" +
+ " X223(223),\n" +
+ " X224(224),\n" +
+ " X225(225),\n" +
+ " X226(226),\n" +
+ " X227(227),\n" +
+ " X228(228),\n" +
+ " X229(229),\n" +
+ " X230(230),\n" +
+ " X231(231),\n" +
+ " X232(232),\n" +
+ " X233(233),\n" +
+ " X234(234),\n" +
+ " X235(235),\n" +
+ " X236(236),\n" +
+ " X237(237),\n" +
+ " X238(238),\n" +
+ " X239(239),\n" +
+ " X240(240),\n" +
+ " X241(241),\n" +
+ " X242(242),\n" +
+ " X243(243),\n" +
+ " X244(244),\n" +
+ " X245(245),\n" +
+ " X246(246),\n" +
+ " X247(247),\n" +
+ " X248(248),\n" +
+ " X249(249),\n" +
+ " X250(250),\n" +
+ " X251(251),\n" +
+ " X252(252),\n" +
+ " X253(253),\n" +
+ " X254(254),\n" +
+ " X255(255),\n" +
+ " X256(256),\n" +
+ " X257(257),\n" +
+ " X258(258),\n" +
+ " X259(259),\n" +
+ " X260(260),\n" +
+ " X261(261),\n" +
+ " X262(262),\n" +
+ " X263(263),\n" +
+ " X264(264),\n" +
+ " X265(265),\n" +
+ " X266(266),\n" +
+ " X267(267),\n" +
+ " X268(268),\n" +
+ " X269(269),\n" +
+ " X270(270),\n" +
+ " X271(271),\n" +
+ " X272(272),\n" +
+ " X273(273),\n" +
+ " X274(274),\n" +
+ " X275(275),\n" +
+ " X276(276),\n" +
+ " X277(277),\n" +
+ " X278(278),\n" +
+ " X279(279),\n" +
+ " X280(280),\n" +
+ " X281(281),\n" +
+ " X282(282),\n" +
+ " X283(283),\n" +
+ " X284(284),\n" +
+ " X285(285),\n" +
+ " X286(286),\n" +
+ " X287(287),\n" +
+ " X288(288),\n" +
+ " X289(289),\n" +
+ " X290(290),\n" +
+ " X291(291),\n" +
+ " X292(292),\n" +
+ " X293(293),\n" +
+ " X294(294),\n" +
+ " X295(295),\n" +
+ " X296(296),\n" +
+ " X297(297),\n" +
+ " X298(298),\n" +
+ " X299(299),\n" +
+ " X300(300),\n" +
+ " X301(301),\n" +
+ " X302(302),\n" +
+ " X303(303),\n" +
+ " X304(304),\n" +
+ " X305(305),\n" +
+ " X306(306),\n" +
+ " X307(307),\n" +
+ " X308(308),\n" +
+ " X309(309),\n" +
+ " X310(310),\n" +
+ " X311(311),\n" +
+ " X312(312),\n" +
+ " X313(313),\n" +
+ " X314(314),\n" +
+ " X315(315),\n" +
+ " X316(316),\n" +
+ " X317(317),\n" +
+ " X318(318),\n" +
+ " X319(319),\n" +
+ " X320(320),\n" +
+ " X321(321),\n" +
+ " X322(322),\n" +
+ " X323(323),\n" +
+ " X324(324),\n" +
+ " X325(325),\n" +
+ " X326(326),\n" +
+ " X327(327),\n" +
+ " X328(328),\n" +
+ " X329(329),\n" +
+ " X330(330),\n" +
+ " X331(331),\n" +
+ " X332(332),\n" +
+ " X333(333),\n" +
+ " X334(334),\n" +
+ " X335(335),\n" +
+ " X336(336),\n" +
+ " X337(337),\n" +
+ " X338(338),\n" +
+ " X339(339),\n" +
+ " X340(340),\n" +
+ " X341(341),\n" +
+ " X342(342),\n" +
+ " X343(343),\n" +
+ " X344(344),\n" +
+ " X345(345),\n" +
+ " X346(346),\n" +
+ " X347(347),\n" +
+ " X348(348),\n" +
+ " X349(349),\n" +
+ " X350(350),\n" +
+ " X351(351),\n" +
+ " X352(352),\n" +
+ " X353(353),\n" +
+ " X354(354),\n" +
+ " X355(355),\n" +
+ " X356(356),\n" +
+ " X357(357),\n" +
+ " X358(358),\n" +
+ " X359(359),\n" +
+ " X360(360),\n" +
+ " X361(361),\n" +
+ " X362(362),\n" +
+ " X363(363),\n" +
+ " X364(364),\n" +
+ " X365(365),\n" +
+ " X366(366),\n" +
+ " X367(367),\n" +
+ " X368(368),\n" +
+ " X369(369),\n" +
+ " X370(370),\n" +
+ " X371(371),\n" +
+ " X372(372),\n" +
+ " X373(373),\n" +
+ " X374(374),\n" +
+ " X375(375),\n" +
+ " X376(376),\n" +
+ " X377(377),\n" +
+ " X378(378),\n" +
+ " X379(379),\n" +
+ " X380(380),\n" +
+ " X381(381),\n" +
+ " X382(382),\n" +
+ " X383(383),\n" +
+ " X384(384),\n" +
+ " X385(385),\n" +
+ " X386(386),\n" +
+ " X387(387),\n" +
+ " X388(388),\n" +
+ " X389(389),\n" +
+ " X390(390),\n" +
+ " X391(391),\n" +
+ " X392(392),\n" +
+ " X393(393),\n" +
+ " X394(394),\n" +
+ " X395(395),\n" +
+ " X396(396),\n" +
+ " X397(397),\n" +
+ " X398(398),\n" +
+ " X399(399),\n" +
+ " X400(400),\n" +
+ " X401(401),\n" +
+ " X402(402),\n" +
+ " X403(403),\n" +
+ " X404(404),\n" +
+ " X405(405),\n" +
+ " X406(406),\n" +
+ " X407(407),\n" +
+ " X408(408),\n" +
+ " X409(409),\n" +
+ " X410(410),\n" +
+ " X411(411),\n" +
+ " X412(412),\n" +
+ " X413(413),\n" +
+ " X414(414),\n" +
+ " X415(415),\n" +
+ " X416(416),\n" +
+ " X417(417),\n" +
+ " X418(418),\n" +
+ " X419(419),\n" +
+ " X420(420),\n" +
+ " X421(421),\n" +
+ " X422(422),\n" +
+ " X423(423),\n" +
+ " X424(424),\n" +
+ " X425(425),\n" +
+ " X426(426),\n" +
+ " X427(427),\n" +
+ " X428(428),\n" +
+ " X429(429),\n" +
+ " X430(430),\n" +
+ " X431(431),\n" +
+ " X432(432),\n" +
+ " X433(433),\n" +
+ " X434(434),\n" +
+ " X435(435),\n" +
+ " X436(436),\n" +
+ " X437(437),\n" +
+ " X438(438),\n" +
+ " X439(439),\n" +
+ " X440(440),\n" +
+ " X441(441),\n" +
+ " X442(442),\n" +
+ " X443(443),\n" +
+ " X444(444),\n" +
+ " X445(445),\n" +
+ " X446(446),\n" +
+ " X447(447),\n" +
+ " X448(448),\n" +
+ " X449(449),\n" +
+ " X450(450),\n" +
+ " X451(451),\n" +
+ " X452(452),\n" +
+ " X453(453),\n" +
+ " X454(454),\n" +
+ " X455(455),\n" +
+ " X456(456),\n" +
+ " X457(457),\n" +
+ " X458(458),\n" +
+ " X459(459),\n" +
+ " X460(460),\n" +
+ " X461(461),\n" +
+ " X462(462),\n" +
+ " X463(463),\n" +
+ " X464(464),\n" +
+ " X465(465),\n" +
+ " X466(466),\n" +
+ " X467(467),\n" +
+ " X468(468),\n" +
+ " X469(469),\n" +
+ " X470(470),\n" +
+ " X471(471),\n" +
+ " X472(472),\n" +
+ " X473(473),\n" +
+ " X474(474),\n" +
+ " X475(475),\n" +
+ " X476(476),\n" +
+ " X477(477),\n" +
+ " X478(478),\n" +
+ " X479(479),\n" +
+ " X480(480),\n" +
+ " X481(481),\n" +
+ " X482(482),\n" +
+ " X483(483),\n" +
+ " X484(484),\n" +
+ " X485(485),\n" +
+ " X486(486),\n" +
+ " X487(487),\n" +
+ " X488(488),\n" +
+ " X489(489),\n" +
+ " X490(490),\n" +
+ " X491(491),\n" +
+ " X492(492),\n" +
+ " X493(493),\n" +
+ " X494(494),\n" +
+ " X495(495),\n" +
+ " X496(496),\n" +
+ " X497(497),\n" +
+ " X498(498),\n" +
+ " X499(499),\n" +
+ " X500(500),\n" +
+ " X501(501),\n" +
+ " X502(502),\n" +
+ " X503(503),\n" +
+ " X504(504),\n" +
+ " X505(505),\n" +
+ " X506(506),\n" +
+ " X507(507),\n" +
+ " X508(508),\n" +
+ " X509(509),\n" +
+ " X510(510),\n" +
+ " X511(511),\n" +
+ " X512(512),\n" +
+ " X513(513),\n" +
+ " X514(514),\n" +
+ " X515(515),\n" +
+ " X516(516),\n" +
+ " X517(517),\n" +
+ " X518(518),\n" +
+ " X519(519),\n" +
+ " X520(520),\n" +
+ " X521(521),\n" +
+ " X522(522),\n" +
+ " X523(523),\n" +
+ " X524(524),\n" +
+ " X525(525),\n" +
+ " X526(526),\n" +
+ " X527(527),\n" +
+ " X528(528),\n" +
+ " X529(529),\n" +
+ " X530(530),\n" +
+ " X531(531),\n" +
+ " X532(532),\n" +
+ " X533(533),\n" +
+ " X534(534),\n" +
+ " X535(535),\n" +
+ " X536(536),\n" +
+ " X537(537),\n" +
+ " X538(538),\n" +
+ " X539(539),\n" +
+ " X540(540),\n" +
+ " X541(541),\n" +
+ " X542(542),\n" +
+ " X543(543),\n" +
+ " X544(544),\n" +
+ " X545(545),\n" +
+ " X546(546),\n" +
+ " X547(547),\n" +
+ " X548(548),\n" +
+ " X549(549),\n" +
+ " X550(550),\n" +
+ " X551(551),\n" +
+ " X552(552),\n" +
+ " X553(553),\n" +
+ " X554(554),\n" +
+ " X555(555),\n" +
+ " X556(556),\n" +
+ " X557(557),\n" +
+ " X558(558),\n" +
+ " X559(559),\n" +
+ " X560(560),\n" +
+ " X561(561),\n" +
+ " X562(562),\n" +
+ " X563(563),\n" +
+ " X564(564),\n" +
+ " X565(565),\n" +
+ " X566(566),\n" +
+ " X567(567),\n" +
+ " X568(568),\n" +
+ " X569(569),\n" +
+ " X570(570),\n" +
+ " X571(571),\n" +
+ " X572(572),\n" +
+ " X573(573),\n" +
+ " X574(574),\n" +
+ " X575(575),\n" +
+ " X576(576),\n" +
+ " X577(577),\n" +
+ " X578(578),\n" +
+ " X579(579),\n" +
+ " X580(580),\n" +
+ " X581(581),\n" +
+ " X582(582),\n" +
+ " X583(583),\n" +
+ " X584(584),\n" +
+ " X585(585),\n" +
+ " X586(586),\n" +
+ " X587(587),\n" +
+ " X588(588),\n" +
+ " X589(589),\n" +
+ " X590(590),\n" +
+ " X591(591),\n" +
+ " X592(592),\n" +
+ " X593(593),\n" +
+ " X594(594),\n" +
+ " X595(595),\n" +
+ " X596(596),\n" +
+ " X597(597),\n" +
+ " X598(598),\n" +
+ " X599(599),\n" +
+ " X600(600),\n" +
+ " X601(601),\n" +
+ " X602(602),\n" +
+ " X603(603),\n" +
+ " X604(604),\n" +
+ " X605(605),\n" +
+ " X606(606),\n" +
+ " X607(607),\n" +
+ " X608(608),\n" +
+ " X609(609),\n" +
+ " X610(610),\n" +
+ " X611(611),\n" +
+ " X612(612),\n" +
+ " X613(613),\n" +
+ " X614(614),\n" +
+ " X615(615),\n" +
+ " X616(616),\n" +
+ " X617(617),\n" +
+ " X618(618),\n" +
+ " X619(619),\n" +
+ " X620(620),\n" +
+ " X621(621),\n" +
+ " X622(622),\n" +
+ " X623(623),\n" +
+ " X624(624),\n" +
+ " X625(625),\n" +
+ " X626(626),\n" +
+ " X627(627),\n" +
+ " X628(628),\n" +
+ " X629(629),\n" +
+ " X630(630),\n" +
+ " X631(631),\n" +
+ " X632(632),\n" +
+ " X633(633),\n" +
+ " X634(634),\n" +
+ " X635(635),\n" +
+ " X636(636),\n" +
+ " X637(637),\n" +
+ " X638(638),\n" +
+ " X639(639),\n" +
+ " X640(640),\n" +
+ " X641(641),\n" +
+ " X642(642),\n" +
+ " X643(643),\n" +
+ " X644(644),\n" +
+ " X645(645),\n" +
+ " X646(646),\n" +
+ " X647(647),\n" +
+ " X648(648),\n" +
+ " X649(649),\n" +
+ " X650(650),\n" +
+ " X651(651),\n" +
+ " X652(652),\n" +
+ " X653(653),\n" +
+ " X654(654),\n" +
+ " X655(655),\n" +
+ " X656(656),\n" +
+ " X657(657),\n" +
+ " X658(658),\n" +
+ " X659(659),\n" +
+ " X660(660),\n" +
+ " X661(661),\n" +
+ " X662(662),\n" +
+ " X663(663),\n" +
+ " X664(664),\n" +
+ " X665(665),\n" +
+ " X666(666),\n" +
+ " X667(667),\n" +
+ " X668(668),\n" +
+ " X669(669),\n" +
+ " X670(670),\n" +
+ " X671(671),\n" +
+ " X672(672),\n" +
+ " X673(673),\n" +
+ " X674(674),\n" +
+ " X675(675),\n" +
+ " X676(676),\n" +
+ " X677(677),\n" +
+ " X678(678),\n" +
+ " X679(679),\n" +
+ " X680(680),\n" +
+ " X681(681),\n" +
+ " X682(682),\n" +
+ " X683(683),\n" +
+ " X684(684),\n" +
+ " X685(685),\n" +
+ " X686(686),\n" +
+ " X687(687),\n" +
+ " X688(688),\n" +
+ " X689(689),\n" +
+ " X690(690),\n" +
+ " X691(691),\n" +
+ " X692(692),\n" +
+ " X693(693),\n" +
+ " X694(694),\n" +
+ " X695(695),\n" +
+ " X696(696),\n" +
+ " X697(697),\n" +
+ " X698(698),\n" +
+ " X699(699),\n" +
+ " X700(700),\n" +
+ " X701(701),\n" +
+ " X702(702),\n" +
+ " X703(703),\n" +
+ " X704(704),\n" +
+ " X705(705),\n" +
+ " X706(706),\n" +
+ " X707(707),\n" +
+ " X708(708),\n" +
+ " X709(709),\n" +
+ " X710(710),\n" +
+ " X711(711),\n" +
+ " X712(712),\n" +
+ " X713(713),\n" +
+ " X714(714),\n" +
+ " X715(715),\n" +
+ " X716(716),\n" +
+ " X717(717),\n" +
+ " X718(718),\n" +
+ " X719(719),\n" +
+ " X720(720),\n" +
+ " X721(721),\n" +
+ " X722(722),\n" +
+ " X723(723),\n" +
+ " X724(724),\n" +
+ " X725(725),\n" +
+ " X726(726),\n" +
+ " X727(727),\n" +
+ " X728(728),\n" +
+ " X729(729),\n" +
+ " X730(730),\n" +
+ " X731(731),\n" +
+ " X732(732),\n" +
+ " X733(733),\n" +
+ " X734(734),\n" +
+ " X735(735),\n" +
+ " X736(736),\n" +
+ " X737(737),\n" +
+ " X738(738),\n" +
+ " X739(739),\n" +
+ " X740(740),\n" +
+ " X741(741),\n" +
+ " X742(742),\n" +
+ " X743(743),\n" +
+ " X744(744),\n" +
+ " X745(745),\n" +
+ " X746(746),\n" +
+ " X747(747),\n" +
+ " X748(748),\n" +
+ " X749(749),\n" +
+ " X750(750),\n" +
+ " X751(751),\n" +
+ " X752(752),\n" +
+ " X753(753),\n" +
+ " X754(754),\n" +
+ " X755(755),\n" +
+ " X756(756),\n" +
+ " X757(757),\n" +
+ " X758(758),\n" +
+ " X759(759),\n" +
+ " X760(760),\n" +
+ " X761(761),\n" +
+ " X762(762),\n" +
+ " X763(763),\n" +
+ " X764(764),\n" +
+ " X765(765),\n" +
+ " X766(766),\n" +
+ " X767(767),\n" +
+ " X768(768),\n" +
+ " X769(769),\n" +
+ " X770(770),\n" +
+ " X771(771),\n" +
+ " X772(772),\n" +
+ " X773(773),\n" +
+ " X774(774),\n" +
+ " X775(775),\n" +
+ " X776(776),\n" +
+ " X777(777),\n" +
+ " X778(778),\n" +
+ " X779(779),\n" +
+ " X780(780),\n" +
+ " X781(781),\n" +
+ " X782(782),\n" +
+ " X783(783),\n" +
+ " X784(784),\n" +
+ " X785(785),\n" +
+ " X786(786),\n" +
+ " X787(787),\n" +
+ " X788(788),\n" +
+ " X789(789),\n" +
+ " X790(790),\n" +
+ " X791(791),\n" +
+ " X792(792),\n" +
+ " X793(793),\n" +
+ " X794(794),\n" +
+ " X795(795),\n" +
+ " X796(796),\n" +
+ " X797(797),\n" +
+ " X798(798),\n" +
+ " X799(799),\n" +
+ " X800(800),\n" +
+ " X801(801),\n" +
+ " X802(802),\n" +
+ " X803(803),\n" +
+ " X804(804),\n" +
+ " X805(805),\n" +
+ " X806(806),\n" +
+ " X807(807),\n" +
+ " X808(808),\n" +
+ " X809(809),\n" +
+ " X810(810),\n" +
+ " X811(811),\n" +
+ " X812(812),\n" +
+ " X813(813),\n" +
+ " X814(814),\n" +
+ " X815(815),\n" +
+ " X816(816),\n" +
+ " X817(817),\n" +
+ " X818(818),\n" +
+ " X819(819),\n" +
+ " X820(820),\n" +
+ " X821(821),\n" +
+ " X822(822),\n" +
+ " X823(823),\n" +
+ " X824(824),\n" +
+ " X825(825),\n" +
+ " X826(826),\n" +
+ " X827(827),\n" +
+ " X828(828),\n" +
+ " X829(829),\n" +
+ " X830(830),\n" +
+ " X831(831),\n" +
+ " X832(832),\n" +
+ " X833(833),\n" +
+ " X834(834),\n" +
+ " X835(835),\n" +
+ " X836(836),\n" +
+ " X837(837),\n" +
+ " X838(838),\n" +
+ " X839(839),\n" +
+ " X840(840),\n" +
+ " X841(841),\n" +
+ " X842(842),\n" +
+ " X843(843),\n" +
+ " X844(844),\n" +
+ " X845(845),\n" +
+ " X846(846),\n" +
+ " X847(847),\n" +
+ " X848(848),\n" +
+ " X849(849),\n" +
+ " X850(850),\n" +
+ " X851(851),\n" +
+ " X852(852),\n" +
+ " X853(853),\n" +
+ " X854(854),\n" +
+ " X855(855),\n" +
+ " X856(856),\n" +
+ " X857(857),\n" +
+ " X858(858),\n" +
+ " X859(859),\n" +
+ " X860(860),\n" +
+ " X861(861),\n" +
+ " X862(862),\n" +
+ " X863(863),\n" +
+ " X864(864),\n" +
+ " X865(865),\n" +
+ " X866(866),\n" +
+ " X867(867),\n" +
+ " X868(868),\n" +
+ " X869(869),\n" +
+ " X870(870),\n" +
+ " X871(871),\n" +
+ " X872(872),\n" +
+ " X873(873),\n" +
+ " X874(874),\n" +
+ " X875(875),\n" +
+ " X876(876),\n" +
+ " X877(877),\n" +
+ " X878(878),\n" +
+ " X879(879),\n" +
+ " X880(880),\n" +
+ " X881(881),\n" +
+ " X882(882),\n" +
+ " X883(883),\n" +
+ " X884(884),\n" +
+ " X885(885),\n" +
+ " X886(886),\n" +
+ " X887(887),\n" +
+ " X888(888),\n" +
+ " X889(889),\n" +
+ " X890(890),\n" +
+ " X891(891),\n" +
+ " X892(892),\n" +
+ " X893(893),\n" +
+ " X894(894),\n" +
+ " X895(895),\n" +
+ " X896(896),\n" +
+ " X897(897),\n" +
+ " X898(898),\n" +
+ " X899(899),\n" +
+ " X900(900),\n" +
+ " X901(901),\n" +
+ " X902(902),\n" +
+ " X903(903),\n" +
+ " X904(904),\n" +
+ " X905(905),\n" +
+ " X906(906),\n" +
+ " X907(907),\n" +
+ " X908(908),\n" +
+ " X909(909),\n" +
+ " X910(910),\n" +
+ " X911(911),\n" +
+ " X912(912),\n" +
+ " X913(913),\n" +
+ " X914(914),\n" +
+ " X915(915),\n" +
+ " X916(916),\n" +
+ " X917(917),\n" +
+ " X918(918),\n" +
+ " X919(919),\n" +
+ " X920(920),\n" +
+ " X921(921),\n" +
+ " X922(922),\n" +
+ " X923(923),\n" +
+ " X924(924),\n" +
+ " X925(925),\n" +
+ " X926(926),\n" +
+ " X927(927),\n" +
+ " X928(928),\n" +
+ " X929(929),\n" +
+ " X930(930),\n" +
+ " X931(931),\n" +
+ " X932(932),\n" +
+ " X933(933),\n" +
+ " X934(934),\n" +
+ " X935(935),\n" +
+ " X936(936),\n" +
+ " X937(937),\n" +
+ " X938(938),\n" +
+ " X939(939),\n" +
+ " X940(940),\n" +
+ " X941(941),\n" +
+ " X942(942),\n" +
+ " X943(943),\n" +
+ " X944(944),\n" +
+ " X945(945),\n" +
+ " X946(946),\n" +
+ " X947(947),\n" +
+ " X948(948),\n" +
+ " X949(949),\n" +
+ " X950(950),\n" +
+ " X951(951),\n" +
+ " X952(952),\n" +
+ " X953(953),\n" +
+ " X954(954),\n" +
+ " X955(955),\n" +
+ " X956(956),\n" +
+ " X957(957),\n" +
+ " X958(958),\n" +
+ " X959(959),\n" +
+ " X960(960),\n" +
+ " X961(961),\n" +
+ " X962(962),\n" +
+ " X963(963),\n" +
+ " X964(964),\n" +
+ " X965(965),\n" +
+ " X966(966),\n" +
+ " X967(967),\n" +
+ " X968(968),\n" +
+ " X969(969),\n" +
+ " X970(970),\n" +
+ " X971(971),\n" +
+ " X972(972),\n" +
+ " X973(973),\n" +
+ " X974(974),\n" +
+ " X975(975),\n" +
+ " X976(976),\n" +
+ " X977(977),\n" +
+ " X978(978),\n" +
+ " X979(979),\n" +
+ " X980(980),\n" +
+ " X981(981),\n" +
+ " X982(982),\n" +
+ " X983(983),\n" +
+ " X984(984),\n" +
+ " X985(985),\n" +
+ " X986(986),\n" +
+ " X987(987),\n" +
+ " X988(988),\n" +
+ " X989(989),\n" +
+ " X990(990),\n" +
+ " X991(991),\n" +
+ " X992(992),\n" +
+ " X993(993),\n" +
+ " X994(994),\n" +
+ " X995(995),\n" +
+ " X996(996),\n" +
+ " X997(997),\n" +
+ " X998(998),\n" +
+ " X999(999),\n" +
+ " X1000(1000),\n" +
+ " X1001(1001),\n" +
+ " X1002(1002),\n" +
+ " X1003(1003),\n" +
+ " X1004(1004),\n" +
+ " X1005(1005),\n" +
+ " X1006(1006),\n" +
+ " X1007(1007),\n" +
+ " X1008(1008),\n" +
+ " X1009(1009),\n" +
+ " X1010(1010),\n" +
+ " X1011(1011),\n" +
+ " X1012(1012),\n" +
+ " X1013(1013),\n" +
+ " X1014(1014),\n" +
+ " X1015(1015),\n" +
+ " X1016(1016),\n" +
+ " X1017(1017),\n" +
+ " X1018(1018),\n" +
+ " X1019(1019),\n" +
+ " X1020(1020),\n" +
+ " X1021(1021),\n" +
+ " X1022(1022),\n" +
+ " X1023(1023),\n" +
+ " X1024(1024),\n" +
+ " X1025(1025),\n" +
+ " X1026(1026),\n" +
+ " X1027(1027),\n" +
+ " X1028(1028),\n" +
+ " X1029(1029),\n" +
+ " X1030(1030),\n" +
+ " X1031(1031),\n" +
+ " X1032(1032),\n" +
+ " X1033(1033),\n" +
+ " X1034(1034),\n" +
+ " X1035(1035),\n" +
+ " X1036(1036),\n" +
+ " X1037(1037),\n" +
+ " X1038(1038),\n" +
+ " X1039(1039),\n" +
+ " X1040(1040),\n" +
+ " X1041(1041),\n" +
+ " X1042(1042),\n" +
+ " X1043(1043),\n" +
+ " X1044(1044),\n" +
+ " X1045(1045),\n" +
+ " X1046(1046),\n" +
+ " X1047(1047),\n" +
+ " X1048(1048),\n" +
+ " X1049(1049),\n" +
+ " X1050(1050),\n" +
+ " X1051(1051),\n" +
+ " X1052(1052),\n" +
+ " X1053(1053),\n" +
+ " X1054(1054),\n" +
+ " X1055(1055),\n" +
+ " X1056(1056),\n" +
+ " X1057(1057),\n" +
+ " X1058(1058),\n" +
+ " X1059(1059),\n" +
+ " X1060(1060),\n" +
+ " X1061(1061),\n" +
+ " X1062(1062),\n" +
+ " X1063(1063),\n" +
+ " X1064(1064),\n" +
+ " X1065(1065),\n" +
+ " X1066(1066),\n" +
+ " X1067(1067),\n" +
+ " X1068(1068),\n" +
+ " X1069(1069),\n" +
+ " X1070(1070),\n" +
+ " X1071(1071),\n" +
+ " X1072(1072),\n" +
+ " X1073(1073),\n" +
+ " X1074(1074),\n" +
+ " X1075(1075),\n" +
+ " X1076(1076),\n" +
+ " X1077(1077),\n" +
+ " X1078(1078),\n" +
+ " X1079(1079),\n" +
+ " X1080(1080),\n" +
+ " X1081(1081),\n" +
+ " X1082(1082),\n" +
+ " X1083(1083),\n" +
+ " X1084(1084),\n" +
+ " X1085(1085),\n" +
+ " X1086(1086),\n" +
+ " X1087(1087),\n" +
+ " X1088(1088),\n" +
+ " X1089(1089),\n" +
+ " X1090(1090),\n" +
+ " X1091(1091),\n" +
+ " X1092(1092),\n" +
+ " X1093(1093),\n" +
+ " X1094(1094),\n" +
+ " X1095(1095),\n" +
+ " X1096(1096),\n" +
+ " X1097(1097),\n" +
+ " X1098(1098),\n" +
+ " X1099(1099),\n" +
+ " X1100(1100),\n" +
+ " X1101(1101),\n" +
+ " X1102(1102),\n" +
+ " X1103(1103),\n" +
+ " X1104(1104),\n" +
+ " X1105(1105),\n" +
+ " X1106(1106),\n" +
+ " X1107(1107),\n" +
+ " X1108(1108),\n" +
+ " X1109(1109),\n" +
+ " X1110(1110),\n" +
+ " X1111(1111),\n" +
+ " X1112(1112),\n" +
+ " X1113(1113),\n" +
+ " X1114(1114),\n" +
+ " X1115(1115),\n" +
+ " X1116(1116),\n" +
+ " X1117(1117),\n" +
+ " X1118(1118),\n" +
+ " X1119(1119),\n" +
+ " X1120(1120),\n" +
+ " X1121(1121),\n" +
+ " X1122(1122),\n" +
+ " X1123(1123),\n" +
+ " X1124(1124),\n" +
+ " X1125(1125),\n" +
+ " X1126(1126),\n" +
+ " X1127(1127),\n" +
+ " X1128(1128),\n" +
+ " X1129(1129),\n" +
+ " X1130(1130),\n" +
+ " X1131(1131),\n" +
+ " X1132(1132),\n" +
+ " X1133(1133),\n" +
+ " X1134(1134),\n" +
+ " X1135(1135),\n" +
+ " X1136(1136),\n" +
+ " X1137(1137),\n" +
+ " X1138(1138),\n" +
+ " X1139(1139),\n" +
+ " X1140(1140),\n" +
+ " X1141(1141),\n" +
+ " X1142(1142),\n" +
+ " X1143(1143),\n" +
+ " X1144(1144),\n" +
+ " X1145(1145),\n" +
+ " X1146(1146),\n" +
+ " X1147(1147),\n" +
+ " X1148(1148),\n" +
+ " X1149(1149),\n" +
+ " X1150(1150),\n" +
+ " X1151(1151),\n" +
+ " X1152(1152),\n" +
+ " X1153(1153),\n" +
+ " X1154(1154),\n" +
+ " X1155(1155),\n" +
+ " X1156(1156),\n" +
+ " X1157(1157),\n" +
+ " X1158(1158),\n" +
+ " X1159(1159),\n" +
+ " X1160(1160),\n" +
+ " X1161(1161),\n" +
+ " X1162(1162),\n" +
+ " X1163(1163),\n" +
+ " X1164(1164),\n" +
+ " X1165(1165),\n" +
+ " X1166(1166),\n" +
+ " X1167(1167),\n" +
+ " X1168(1168),\n" +
+ " X1169(1169),\n" +
+ " X1170(1170),\n" +
+ " X1171(1171),\n" +
+ " X1172(1172),\n" +
+ " X1173(1173),\n" +
+ " X1174(1174),\n" +
+ " X1175(1175),\n" +
+ " X1176(1176),\n" +
+ " X1177(1177),\n" +
+ " X1178(1178),\n" +
+ " X1179(1179),\n" +
+ " X1180(1180),\n" +
+ " X1181(1181),\n" +
+ " X1182(1182),\n" +
+ " X1183(1183),\n" +
+ " X1184(1184),\n" +
+ " X1185(1185),\n" +
+ " X1186(1186),\n" +
+ " X1187(1187),\n" +
+ " X1188(1188),\n" +
+ " X1189(1189),\n" +
+ " X1190(1190),\n" +
+ " X1191(1191),\n" +
+ " X1192(1192),\n" +
+ " X1193(1193),\n" +
+ " X1194(1194),\n" +
+ " X1195(1195),\n" +
+ " X1196(1196),\n" +
+ " X1197(1197),\n" +
+ " X1198(1198),\n" +
+ " X1199(1199),\n" +
+ " X1200(1200),\n" +
+ " X1201(1201),\n" +
+ " X1202(1202),\n" +
+ " X1203(1203),\n" +
+ " X1204(1204),\n" +
+ " X1205(1205),\n" +
+ " X1206(1206),\n" +
+ " X1207(1207),\n" +
+ " X1208(1208),\n" +
+ " X1209(1209),\n" +
+ " X1210(1210),\n" +
+ " X1211(1211),\n" +
+ " X1212(1212),\n" +
+ " X1213(1213),\n" +
+ " X1214(1214),\n" +
+ " X1215(1215),\n" +
+ " X1216(1216),\n" +
+ " X1217(1217),\n" +
+ " X1218(1218),\n" +
+ " X1219(1219),\n" +
+ " X1220(1220),\n" +
+ " X1221(1221),\n" +
+ " X1222(1222),\n" +
+ " X1223(1223),\n" +
+ " X1224(1224),\n" +
+ " X1225(1225),\n" +
+ " X1226(1226),\n" +
+ " X1227(1227),\n" +
+ " X1228(1228),\n" +
+ " X1229(1229),\n" +
+ " X1230(1230),\n" +
+ " X1231(1231),\n" +
+ " X1232(1232),\n" +
+ " X1233(1233),\n" +
+ " X1234(1234),\n" +
+ " X1235(1235),\n" +
+ " X1236(1236),\n" +
+ " X1237(1237),\n" +
+ " X1238(1238),\n" +
+ " X1239(1239),\n" +
+ " X1240(1240),\n" +
+ " X1241(1241),\n" +
+ " X1242(1242),\n" +
+ " X1243(1243),\n" +
+ " X1244(1244),\n" +
+ " X1245(1245),\n" +
+ " X1246(1246),\n" +
+ " X1247(1247),\n" +
+ " X1248(1248),\n" +
+ " X1249(1249),\n" +
+ " X1250(1250),\n" +
+ " X1251(1251),\n" +
+ " X1252(1252),\n" +
+ " X1253(1253),\n" +
+ " X1254(1254),\n" +
+ " X1255(1255),\n" +
+ " X1256(1256),\n" +
+ " X1257(1257),\n" +
+ " X1258(1258),\n" +
+ " X1259(1259),\n" +
+ " X1260(1260),\n" +
+ " X1261(1261),\n" +
+ " X1262(1262),\n" +
+ " X1263(1263),\n" +
+ " X1264(1264),\n" +
+ " X1265(1265),\n" +
+ " X1266(1266),\n" +
+ " X1267(1267),\n" +
+ " X1268(1268),\n" +
+ " X1269(1269),\n" +
+ " X1270(1270),\n" +
+ " X1271(1271),\n" +
+ " X1272(1272),\n" +
+ " X1273(1273),\n" +
+ " X1274(1274),\n" +
+ " X1275(1275),\n" +
+ " X1276(1276),\n" +
+ " X1277(1277),\n" +
+ " X1278(1278),\n" +
+ " X1279(1279),\n" +
+ " X1280(1280),\n" +
+ " X1281(1281),\n" +
+ " X1282(1282),\n" +
+ " X1283(1283),\n" +
+ " X1284(1284),\n" +
+ " X1285(1285),\n" +
+ " X1286(1286),\n" +
+ " X1287(1287),\n" +
+ " X1288(1288),\n" +
+ " X1289(1289),\n" +
+ " X1290(1290),\n" +
+ " X1291(1291),\n" +
+ " X1292(1292),\n" +
+ " X1293(1293),\n" +
+ " X1294(1294),\n" +
+ " X1295(1295),\n" +
+ " X1296(1296),\n" +
+ " X1297(1297),\n" +
+ " X1298(1298),\n" +
+ " X1299(1299),\n" +
+ " X1300(1300),\n" +
+ " X1301(1301),\n" +
+ " X1302(1302),\n" +
+ " X1303(1303),\n" +
+ " X1304(1304),\n" +
+ " X1305(1305),\n" +
+ " X1306(1306),\n" +
+ " X1307(1307),\n" +
+ " X1308(1308),\n" +
+ " X1309(1309),\n" +
+ " X1310(1310),\n" +
+ " X1311(1311),\n" +
+ " X1312(1312),\n" +
+ " X1313(1313),\n" +
+ " X1314(1314),\n" +
+ " X1315(1315),\n" +
+ " X1316(1316),\n" +
+ " X1317(1317),\n" +
+ " X1318(1318),\n" +
+ " X1319(1319),\n" +
+ " X1320(1320),\n" +
+ " X1321(1321),\n" +
+ " X1322(1322),\n" +
+ " X1323(1323),\n" +
+ " X1324(1324),\n" +
+ " X1325(1325),\n" +
+ " X1326(1326),\n" +
+ " X1327(1327),\n" +
+ " X1328(1328),\n" +
+ " X1329(1329),\n" +
+ " X1330(1330),\n" +
+ " X1331(1331),\n" +
+ " X1332(1332),\n" +
+ " X1333(1333),\n" +
+ " X1334(1334),\n" +
+ " X1335(1335),\n" +
+ " X1336(1336),\n" +
+ " X1337(1337),\n" +
+ " X1338(1338),\n" +
+ " X1339(1339),\n" +
+ " X1340(1340),\n" +
+ " X1341(1341),\n" +
+ " X1342(1342),\n" +
+ " X1343(1343),\n" +
+ " X1344(1344),\n" +
+ " X1345(1345),\n" +
+ " X1346(1346),\n" +
+ " X1347(1347),\n" +
+ " X1348(1348),\n" +
+ " X1349(1349),\n" +
+ " X1350(1350),\n" +
+ " X1351(1351),\n" +
+ " X1352(1352),\n" +
+ " X1353(1353),\n" +
+ " X1354(1354),\n" +
+ " X1355(1355),\n" +
+ " X1356(1356),\n" +
+ " X1357(1357),\n" +
+ " X1358(1358),\n" +
+ " X1359(1359),\n" +
+ " X1360(1360),\n" +
+ " X1361(1361),\n" +
+ " X1362(1362),\n" +
+ " X1363(1363),\n" +
+ " X1364(1364),\n" +
+ " X1365(1365),\n" +
+ " X1366(1366),\n" +
+ " X1367(1367),\n" +
+ " X1368(1368),\n" +
+ " X1369(1369),\n" +
+ " X1370(1370),\n" +
+ " X1371(1371),\n" +
+ " X1372(1372),\n" +
+ " X1373(1373),\n" +
+ " X1374(1374),\n" +
+ " X1375(1375),\n" +
+ " X1376(1376),\n" +
+ " X1377(1377),\n" +
+ " X1378(1378),\n" +
+ " X1379(1379),\n" +
+ " X1380(1380),\n" +
+ " X1381(1381),\n" +
+ " X1382(1382),\n" +
+ " X1383(1383),\n" +
+ " X1384(1384),\n" +
+ " X1385(1385),\n" +
+ " X1386(1386),\n" +
+ " X1387(1387),\n" +
+ " X1388(1388),\n" +
+ " X1389(1389),\n" +
+ " X1390(1390),\n" +
+ " X1391(1391),\n" +
+ " X1392(1392),\n" +
+ " X1393(1393),\n" +
+ " X1394(1394),\n" +
+ " X1395(1395),\n" +
+ " X1396(1396),\n" +
+ " X1397(1397),\n" +
+ " X1398(1398),\n" +
+ " X1399(1399),\n" +
+ " X1400(1400),\n" +
+ " X1401(1401),\n" +
+ " X1402(1402),\n" +
+ " X1403(1403),\n" +
+ " X1404(1404),\n" +
+ " X1405(1405),\n" +
+ " X1406(1406),\n" +
+ " X1407(1407),\n" +
+ " X1408(1408),\n" +
+ " X1409(1409),\n" +
+ " X1410(1410),\n" +
+ " X1411(1411),\n" +
+ " X1412(1412),\n" +
+ " X1413(1413),\n" +
+ " X1414(1414),\n" +
+ " X1415(1415),\n" +
+ " X1416(1416),\n" +
+ " X1417(1417),\n" +
+ " X1418(1418),\n" +
+ " X1419(1419),\n" +
+ " X1420(1420),\n" +
+ " X1421(1421),\n" +
+ " X1422(1422),\n" +
+ " X1423(1423),\n" +
+ " X1424(1424),\n" +
+ " X1425(1425),\n" +
+ " X1426(1426),\n" +
+ " X1427(1427),\n" +
+ " X1428(1428),\n" +
+ " X1429(1429),\n" +
+ " X1430(1430),\n" +
+ " X1431(1431),\n" +
+ " X1432(1432),\n" +
+ " X1433(1433),\n" +
+ " X1434(1434),\n" +
+ " X1435(1435),\n" +
+ " X1436(1436),\n" +
+ " X1437(1437),\n" +
+ " X1438(1438),\n" +
+ " X1439(1439),\n" +
+ " X1440(1440),\n" +
+ " X1441(1441),\n" +
+ " X1442(1442),\n" +
+ " X1443(1443),\n" +
+ " X1444(1444),\n" +
+ " X1445(1445),\n" +
+ " X1446(1446),\n" +
+ " X1447(1447),\n" +
+ " X1448(1448),\n" +
+ " X1449(1449),\n" +
+ " X1450(1450),\n" +
+ " X1451(1451),\n" +
+ " X1452(1452),\n" +
+ " X1453(1453),\n" +
+ " X1454(1454),\n" +
+ " X1455(1455),\n" +
+ " X1456(1456),\n" +
+ " X1457(1457),\n" +
+ " X1458(1458),\n" +
+ " X1459(1459),\n" +
+ " X1460(1460),\n" +
+ " X1461(1461),\n" +
+ " X1462(1462),\n" +
+ " X1463(1463),\n" +
+ " X1464(1464),\n" +
+ " X1465(1465),\n" +
+ " X1466(1466),\n" +
+ " X1467(1467),\n" +
+ " X1468(1468),\n" +
+ " X1469(1469),\n" +
+ " X1470(1470),\n" +
+ " X1471(1471),\n" +
+ " X1472(1472),\n" +
+ " X1473(1473),\n" +
+ " X1474(1474),\n" +
+ " X1475(1475),\n" +
+ " X1476(1476),\n" +
+ " X1477(1477),\n" +
+ " X1478(1478),\n" +
+ " X1479(1479),\n" +
+ " X1480(1480),\n" +
+ " X1481(1481),\n" +
+ " X1482(1482),\n" +
+ " X1483(1483),\n" +
+ " X1484(1484),\n" +
+ " X1485(1485),\n" +
+ " X1486(1486),\n" +
+ " X1487(1487),\n" +
+ " X1488(1488),\n" +
+ " X1489(1489),\n" +
+ " X1490(1490),\n" +
+ " X1491(1491),\n" +
+ " X1492(1492),\n" +
+ " X1493(1493),\n" +
+ " X1494(1494),\n" +
+ " X1495(1495),\n" +
+ " X1496(1496),\n" +
+ " X1497(1497),\n" +
+ " X1498(1498),\n" +
+ " X1499(1499),\n" +
+ " X1500(1500),\n" +
+ " X1501(1501),\n" +
+ " X1502(1502),\n" +
+ " X1503(1503),\n" +
+ " X1504(1504),\n" +
+ " X1505(1505),\n" +
+ " X1506(1506),\n" +
+ " X1507(1507),\n" +
+ " X1508(1508),\n" +
+ " X1509(1509),\n" +
+ " X1510(1510),\n" +
+ " X1511(1511),\n" +
+ " X1512(1512),\n" +
+ " X1513(1513),\n" +
+ " X1514(1514),\n" +
+ " X1515(1515),\n" +
+ " X1516(1516),\n" +
+ " X1517(1517),\n" +
+ " X1518(1518),\n" +
+ " X1519(1519),\n" +
+ " X1520(1520),\n" +
+ " X1521(1521),\n" +
+ " X1522(1522),\n" +
+ " X1523(1523),\n" +
+ " X1524(1524),\n" +
+ " X1525(1525),\n" +
+ " X1526(1526),\n" +
+ " X1527(1527),\n" +
+ " X1528(1528),\n" +
+ " X1529(1529),\n" +
+ " X1530(1530),\n" +
+ " X1531(1531),\n" +
+ " X1532(1532),\n" +
+ " X1533(1533),\n" +
+ " X1534(1534),\n" +
+ " X1535(1535),\n" +
+ " X1536(1536),\n" +
+ " X1537(1537),\n" +
+ " X1538(1538),\n" +
+ " X1539(1539),\n" +
+ " X1540(1540),\n" +
+ " X1541(1541),\n" +
+ " X1542(1542),\n" +
+ " X1543(1543),\n" +
+ " X1544(1544),\n" +
+ " X1545(1545),\n" +
+ " X1546(1546),\n" +
+ " X1547(1547),\n" +
+ " X1548(1548),\n" +
+ " X1549(1549),\n" +
+ " X1550(1550),\n" +
+ " X1551(1551),\n" +
+ " X1552(1552),\n" +
+ " X1553(1553),\n" +
+ " X1554(1554),\n" +
+ " X1555(1555),\n" +
+ " X1556(1556),\n" +
+ " X1557(1557),\n" +
+ " X1558(1558),\n" +
+ " X1559(1559),\n" +
+ " X1560(1560),\n" +
+ " X1561(1561),\n" +
+ " X1562(1562),\n" +
+ " X1563(1563),\n" +
+ " X1564(1564),\n" +
+ " X1565(1565),\n" +
+ " X1566(1566),\n" +
+ " X1567(1567),\n" +
+ " X1568(1568),\n" +
+ " X1569(1569),\n" +
+ " X1570(1570),\n" +
+ " X1571(1571),\n" +
+ " X1572(1572),\n" +
+ " X1573(1573),\n" +
+ " X1574(1574),\n" +
+ " X1575(1575),\n" +
+ " X1576(1576),\n" +
+ " X1577(1577),\n" +
+ " X1578(1578),\n" +
+ " X1579(1579),\n" +
+ " X1580(1580),\n" +
+ " X1581(1581),\n" +
+ " X1582(1582),\n" +
+ " X1583(1583),\n" +
+ " X1584(1584),\n" +
+ " X1585(1585),\n" +
+ " X1586(1586),\n" +
+ " X1587(1587),\n" +
+ " X1588(1588),\n" +
+ " X1589(1589),\n" +
+ " X1590(1590),\n" +
+ " X1591(1591),\n" +
+ " X1592(1592),\n" +
+ " X1593(1593),\n" +
+ " X1594(1594),\n" +
+ " X1595(1595),\n" +
+ " X1596(1596),\n" +
+ " X1597(1597),\n" +
+ " X1598(1598),\n" +
+ " X1599(1599),\n" +
+ " X1600(1600),\n" +
+ " X1601(1601),\n" +
+ " X1602(1602),\n" +
+ " X1603(1603),\n" +
+ " X1604(1604),\n" +
+ " X1605(1605),\n" +
+ " X1606(1606),\n" +
+ " X1607(1607),\n" +
+ " X1608(1608),\n" +
+ " X1609(1609),\n" +
+ " X1610(1610),\n" +
+ " X1611(1611),\n" +
+ " X1612(1612),\n" +
+ " X1613(1613),\n" +
+ " X1614(1614),\n" +
+ " X1615(1615),\n" +
+ " X1616(1616),\n" +
+ " X1617(1617),\n" +
+ " X1618(1618),\n" +
+ " X1619(1619),\n" +
+ " X1620(1620),\n" +
+ " X1621(1621),\n" +
+ " X1622(1622),\n" +
+ " X1623(1623),\n" +
+ " X1624(1624),\n" +
+ " X1625(1625),\n" +
+ " X1626(1626),\n" +
+ " X1627(1627),\n" +
+ " X1628(1628),\n" +
+ " X1629(1629),\n" +
+ " X1630(1630),\n" +
+ " X1631(1631),\n" +
+ " X1632(1632),\n" +
+ " X1633(1633),\n" +
+ " X1634(1634),\n" +
+ " X1635(1635),\n" +
+ " X1636(1636),\n" +
+ " X1637(1637),\n" +
+ " X1638(1638),\n" +
+ " X1639(1639),\n" +
+ " X1640(1640),\n" +
+ " X1641(1641),\n" +
+ " X1642(1642),\n" +
+ " X1643(1643),\n" +
+ " X1644(1644),\n" +
+ " X1645(1645),\n" +
+ " X1646(1646),\n" +
+ " X1647(1647),\n" +
+ " X1648(1648),\n" +
+ " X1649(1649),\n" +
+ " X1650(1650),\n" +
+ " X1651(1651),\n" +
+ " X1652(1652),\n" +
+ " X1653(1653),\n" +
+ " X1654(1654),\n" +
+ " X1655(1655),\n" +
+ " X1656(1656),\n" +
+ " X1657(1657),\n" +
+ " X1658(1658),\n" +
+ " X1659(1659),\n" +
+ " X1660(1660),\n" +
+ " X1661(1661),\n" +
+ " X1662(1662),\n" +
+ " X1663(1663),\n" +
+ " X1664(1664),\n" +
+ " X1665(1665),\n" +
+ " X1666(1666),\n" +
+ " X1667(1667),\n" +
+ " X1668(1668),\n" +
+ " X1669(1669),\n" +
+ " X1670(1670),\n" +
+ " X1671(1671),\n" +
+ " X1672(1672),\n" +
+ " X1673(1673),\n" +
+ " X1674(1674),\n" +
+ " X1675(1675),\n" +
+ " X1676(1676),\n" +
+ " X1677(1677),\n" +
+ " X1678(1678),\n" +
+ " X1679(1679),\n" +
+ " X1680(1680),\n" +
+ " X1681(1681),\n" +
+ " X1682(1682),\n" +
+ " X1683(1683),\n" +
+ " X1684(1684),\n" +
+ " X1685(1685),\n" +
+ " X1686(1686),\n" +
+ " X1687(1687),\n" +
+ " X1688(1688),\n" +
+ " X1689(1689),\n" +
+ " X1690(1690),\n" +
+ " X1691(1691),\n" +
+ " X1692(1692),\n" +
+ " X1693(1693),\n" +
+ " X1694(1694),\n" +
+ " X1695(1695),\n" +
+ " X1696(1696),\n" +
+ " X1697(1697),\n" +
+ " X1698(1698),\n" +
+ " X1699(1699),\n" +
+ " X1700(1700),\n" +
+ " X1701(1701),\n" +
+ " X1702(1702),\n" +
+ " X1703(1703),\n" +
+ " X1704(1704),\n" +
+ " X1705(1705),\n" +
+ " X1706(1706),\n" +
+ " X1707(1707),\n" +
+ " X1708(1708),\n" +
+ " X1709(1709),\n" +
+ " X1710(1710),\n" +
+ " X1711(1711),\n" +
+ " X1712(1712),\n" +
+ " X1713(1713),\n" +
+ " X1714(1714),\n" +
+ " X1715(1715),\n" +
+ " X1716(1716),\n" +
+ " X1717(1717),\n" +
+ " X1718(1718),\n" +
+ " X1719(1719),\n" +
+ " X1720(1720),\n" +
+ " X1721(1721),\n" +
+ " X1722(1722),\n" +
+ " X1723(1723),\n" +
+ " X1724(1724),\n" +
+ " X1725(1725),\n" +
+ " X1726(1726),\n" +
+ " X1727(1727),\n" +
+ " X1728(1728),\n" +
+ " X1729(1729),\n" +
+ " X1730(1730),\n" +
+ " X1731(1731),\n" +
+ " X1732(1732),\n" +
+ " X1733(1733),\n" +
+ " X1734(1734),\n" +
+ " X1735(1735),\n" +
+ " X1736(1736),\n" +
+ " X1737(1737),\n" +
+ " X1738(1738),\n" +
+ " X1739(1739),\n" +
+ " X1740(1740),\n" +
+ " X1741(1741),\n" +
+ " X1742(1742),\n" +
+ " X1743(1743),\n" +
+ " X1744(1744),\n" +
+ " X1745(1745),\n" +
+ " X1746(1746),\n" +
+ " X1747(1747),\n" +
+ " X1748(1748),\n" +
+ " X1749(1749),\n" +
+ " X1750(1750),\n" +
+ " X1751(1751),\n" +
+ " X1752(1752),\n" +
+ " X1753(1753),\n" +
+ " X1754(1754),\n" +
+ " X1755(1755),\n" +
+ " X1756(1756),\n" +
+ " X1757(1757),\n" +
+ " X1758(1758),\n" +
+ " X1759(1759),\n" +
+ " X1760(1760),\n" +
+ " X1761(1761),\n" +
+ " X1762(1762),\n" +
+ " X1763(1763),\n" +
+ " X1764(1764),\n" +
+ " X1765(1765),\n" +
+ " X1766(1766),\n" +
+ " X1767(1767),\n" +
+ " X1768(1768),\n" +
+ " X1769(1769),\n" +
+ " X1770(1770),\n" +
+ " X1771(1771),\n" +
+ " X1772(1772),\n" +
+ " X1773(1773),\n" +
+ " X1774(1774),\n" +
+ " X1775(1775),\n" +
+ " X1776(1776),\n" +
+ " X1777(1777),\n" +
+ " X1778(1778),\n" +
+ " X1779(1779),\n" +
+ " X1780(1780),\n" +
+ " X1781(1781),\n" +
+ " X1782(1782),\n" +
+ " X1783(1783),\n" +
+ " X1784(1784),\n" +
+ " X1785(1785),\n" +
+ " X1786(1786),\n" +
+ " X1787(1787),\n" +
+ " X1788(1788),\n" +
+ " X1789(1789),\n" +
+ " X1790(1790),\n" +
+ " X1791(1791),\n" +
+ " X1792(1792),\n" +
+ " X1793(1793),\n" +
+ " X1794(1794),\n" +
+ " X1795(1795),\n" +
+ " X1796(1796),\n" +
+ " X1797(1797),\n" +
+ " X1798(1798),\n" +
+ " X1799(1799),\n" +
+ " X1800(1800),\n" +
+ " X1801(1801),\n" +
+ " X1802(1802),\n" +
+ " X1803(1803),\n" +
+ " X1804(1804),\n" +
+ " X1805(1805),\n" +
+ " X1806(1806),\n" +
+ " X1807(1807),\n" +
+ " X1808(1808),\n" +
+ " X1809(1809),\n" +
+ " X1810(1810),\n" +
+ " X1811(1811),\n" +
+ " X1812(1812),\n" +
+ " X1813(1813),\n" +
+ " X1814(1814),\n" +
+ " X1815(1815),\n" +
+ " X1816(1816),\n" +
+ " X1817(1817),\n" +
+ " X1818(1818),\n" +
+ " X1819(1819),\n" +
+ " X1820(1820),\n" +
+ " X1821(1821),\n" +
+ " X1822(1822),\n" +
+ " X1823(1823),\n" +
+ " X1824(1824),\n" +
+ " X1825(1825),\n" +
+ " X1826(1826),\n" +
+ " X1827(1827),\n" +
+ " X1828(1828),\n" +
+ " X1829(1829),\n" +
+ " X1830(1830),\n" +
+ " X1831(1831),\n" +
+ " X1832(1832),\n" +
+ " X1833(1833),\n" +
+ " X1834(1834),\n" +
+ " X1835(1835),\n" +
+ " X1836(1836),\n" +
+ " X1837(1837),\n" +
+ " X1838(1838),\n" +
+ " X1839(1839),\n" +
+ " X1840(1840),\n" +
+ " X1841(1841),\n" +
+ " X1842(1842),\n" +
+ " X1843(1843),\n" +
+ " X1844(1844),\n" +
+ " X1845(1845),\n" +
+ " X1846(1846),\n" +
+ " X1847(1847),\n" +
+ " X1848(1848),\n" +
+ " X1849(1849),\n" +
+ " X1850(1850),\n" +
+ " X1851(1851),\n" +
+ " X1852(1852),\n" +
+ " X1853(1853),\n" +
+ " X1854(1854),\n" +
+ " X1855(1855),\n" +
+ " X1856(1856),\n" +
+ " X1857(1857),\n" +
+ " X1858(1858),\n" +
+ " X1859(1859),\n" +
+ " X1860(1860),\n" +
+ " X1861(1861),\n" +
+ " X1862(1862),\n" +
+ " X1863(1863),\n" +
+ " X1864(1864),\n" +
+ " X1865(1865),\n" +
+ " X1866(1866),\n" +
+ " X1867(1867),\n" +
+ " X1868(1868),\n" +
+ " X1869(1869),\n" +
+ " X1870(1870),\n" +
+ " X1871(1871),\n" +
+ " X1872(1872),\n" +
+ " X1873(1873),\n" +
+ " X1874(1874),\n" +
+ " X1875(1875),\n" +
+ " X1876(1876),\n" +
+ " X1877(1877),\n" +
+ " X1878(1878),\n" +
+ " X1879(1879),\n" +
+ " X1880(1880),\n" +
+ " X1881(1881),\n" +
+ " X1882(1882),\n" +
+ " X1883(1883),\n" +
+ " X1884(1884),\n" +
+ " X1885(1885),\n" +
+ " X1886(1886),\n" +
+ " X1887(1887),\n" +
+ " X1888(1888),\n" +
+ " X1889(1889),\n" +
+ " X1890(1890),\n" +
+ " X1891(1891),\n" +
+ " X1892(1892),\n" +
+ " X1893(1893),\n" +
+ " X1894(1894),\n" +
+ " X1895(1895),\n" +
+ " X1896(1896),\n" +
+ " X1897(1897),\n" +
+ " X1898(1898),\n" +
+ " X1899(1899),\n" +
+ " X1900(1900),\n" +
+ " X1901(1901),\n" +
+ " X1902(1902),\n" +
+ " X1903(1903),\n" +
+ " X1904(1904),\n" +
+ " X1905(1905),\n" +
+ " X1906(1906),\n" +
+ " X1907(1907),\n" +
+ " X1908(1908),\n" +
+ " X1909(1909),\n" +
+ " X1910(1910),\n" +
+ " X1911(1911),\n" +
+ " X1912(1912),\n" +
+ " X1913(1913),\n" +
+ " X1914(1914),\n" +
+ " X1915(1915),\n" +
+ " X1916(1916),\n" +
+ " X1917(1917),\n" +
+ " X1918(1918),\n" +
+ " X1919(1919),\n" +
+ " X1920(1920),\n" +
+ " X1921(1921),\n" +
+ " X1922(1922),\n" +
+ " X1923(1923),\n" +
+ " X1924(1924),\n" +
+ " X1925(1925),\n" +
+ " X1926(1926),\n" +
+ " X1927(1927),\n" +
+ " X1928(1928),\n" +
+ " X1929(1929),\n" +
+ " X1930(1930),\n" +
+ " X1931(1931),\n" +
+ " X1932(1932),\n" +
+ " X1933(1933),\n" +
+ " X1934(1934),\n" +
+ " X1935(1935),\n" +
+ " X1936(1936),\n" +
+ " X1937(1937),\n" +
+ " X1938(1938),\n" +
+ " X1939(1939),\n" +
+ " X1940(1940),\n" +
+ " X1941(1941),\n" +
+ " X1942(1942),\n" +
+ " X1943(1943),\n" +
+ " X1944(1944),\n" +
+ " X1945(1945),\n" +
+ " X1946(1946),\n" +
+ " X1947(1947),\n" +
+ " X1948(1948),\n" +
+ " X1949(1949),\n" +
+ " X1950(1950),\n" +
+ " X1951(1951),\n" +
+ " X1952(1952),\n" +
+ " X1953(1953),\n" +
+ " X1954(1954),\n" +
+ " X1955(1955),\n" +
+ " X1956(1956),\n" +
+ " X1957(1957),\n" +
+ " X1958(1958),\n" +
+ " X1959(1959),\n" +
+ " X1960(1960),\n" +
+ " X1961(1961),\n" +
+ " X1962(1962),\n" +
+ " X1963(1963),\n" +
+ " X1964(1964),\n" +
+ " X1965(1965),\n" +
+ " X1966(1966),\n" +
+ " X1967(1967),\n" +
+ " X1968(1968),\n" +
+ " X1969(1969),\n" +
+ " X1970(1970),\n" +
+ " X1971(1971),\n" +
+ " X1972(1972),\n" +
+ " X1973(1973),\n" +
+ " X1974(1974),\n" +
+ " X1975(1975),\n" +
+ " X1976(1976),\n" +
+ " X1977(1977),\n" +
+ " X1978(1978),\n" +
+ " X1979(1979),\n" +
+ " X1980(1980),\n" +
+ " X1981(1981),\n" +
+ " X1982(1982),\n" +
+ " X1983(1983),\n" +
+ " X1984(1984),\n" +
+ " X1985(1985),\n" +
+ " X1986(1986),\n" +
+ " X1987(1987),\n" +
+ " X1988(1988),\n" +
+ " X1989(1989),\n" +
+ " X1990(1990),\n" +
+ " X1991(1991),\n" +
+ " X1992(1992),\n" +
+ " X1993(1993),\n" +
+ " X1994(1994),\n" +
+ " X1995(1995),\n" +
+ " X1996(1996),\n" +
+ " X1997(1997),\n" +
+ " X1998(1998),\n" +
+ " X1999(1999),\n" +
+ " X2000(2000),\n" +
+ " X2001(2001),\n" +
+ " X2002(2002),\n" +
+ " X2003(2003),\n" +
+ " X2004(2004),\n" +
+ " X2005(2005),\n" +
+ " X2006(2006),\n" +
+ " X2007(2007),\n" +
+ " X2008(2008),\n" +
+ " X2009(2009),\n" +
+ " X2010(2010),\n" +
+ " X2011(2011),\n" +
+ " X2012(2012),\n" +
+ " X2013(2013),\n" +
+ " X2014(2014),\n" +
+ " X2015(2015),\n" +
+ " X2016(2016),\n" +
+ " X2017(2017),\n" +
+ " X2018(2018),\n" +
+ " X2019(2019),\n" +
+ " X2020(2020),\n" +
+ " X2021(2021),\n" +
+ " X2022(2022),\n" +
+ " X2023(2023),\n" +
+ " X2024(2024),\n" +
+ " X2025(2025),\n" +
+ " X2026(2026),\n" +
+ " X2027(2027),\n" +
+ " X2028(2028),\n" +
+ " X2029(2029),\n" +
+ " X2030(2030),\n" +
+ " X2031(2031),\n" +
+ " X2032(2032),\n" +
+ " X2033(2033),\n" +
+ " X2034(2034),\n" +
+ " X2035(2035),\n" +
+ " X2036(2036),\n" +
+ " X2037(2037),\n" +
+ " X2038(2038),\n" +
+ " X2039(2039),\n" +
+ " X2040(2040),\n" +
+ " X2041(2041),\n" +
+ " X2042(2042),\n" +
+ " X2043(2043),\n" +
+ " X2044(2044),\n" +
+ " X2045(2045),\n" +
+ " X2046(2046),\n" +
+ " X2047(2047),\n" +
+ " X2048(2048),\n" +
+ " X2049(2049),\n" +
+ " X2050(2050),\n" +
+ " X2051(2051),\n" +
+ " X2052(2052),\n" +
+ " X2053(2053),\n" +
+ " X2054(2054),\n" +
+ " X2055(2055),\n" +
+ " X2056(2056),\n" +
+ " X2057(2057),\n" +
+ " X2058(2058),\n" +
+ " X2059(2059),\n" +
+ " X2060(2060),\n" +
+ " X2061(2061),\n" +
+ " X2062(2062),\n" +
+ " X2063(2063),\n" +
+ " X2064(2064),\n" +
+ " X2065(2065),\n" +
+ " X2066(2066),\n" +
+ " X2067(2067),\n" +
+ " X2068(2068),\n" +
+ " X2069(2069),\n" +
+ " X2070(2070),\n" +
+ " X2071(2071),\n" +
+ " X2072(2072),\n" +
+ " X2073(2073),\n" +
+ " X2074(2074),\n" +
+ " X2075(2075),\n" +
+ " X2076(2076),\n" +
+ " X2077(2077),\n" +
+ " X2078(2078),\n" +
+ " X2079(2079),\n" +
+ " X2080(2080),\n" +
+ " X2081(2081),\n" +
+ " X2082(2082),\n" +
+ " X2083(2083),\n" +
+ " X2084(2084),\n" +
+ " X2085(2085),\n" +
+ " X2086(2086),\n" +
+ " X2087(2087),\n" +
+ " X2088(2088),\n" +
+ " X2089(2089),\n" +
+ " X2090(2090),\n" +
+ " X2091(2091),\n" +
+ " X2092(2092),\n" +
+ " X2093(2093),\n" +
+ " X2094(2094),\n" +
+ " X2095(2095),\n" +
+ " X2096(2096),\n" +
+ " X2097(2097),\n" +
+ " X2098(2098),\n" +
+ " X2099(2099),\n" +
+ " X2100(2100),\n" +
+ " X2101(2101),\n" +
+ " X2102(2102),\n" +
+ " X2103(2103),\n" +
+ " X2104(2104),\n" +
+ " X2105(2105),\n" +
+ " X2106(2106),\n" +
+ " X2107(2107),\n" +
+ " X2108(2108),\n" +
+ " X2109(2109),\n" +
+ " X2110(2110),\n" +
+ " X2111(2111),\n" +
+ " X2112(2112),\n" +
+ " X2113(2113),\n" +
+ " X2114(2114),\n" +
+ " X2115(2115),\n" +
+ " X2116(2116),\n" +
+ " X2117(2117),\n" +
+ " X2118(2118),\n" +
+ " X2119(2119),\n" +
+ " X2120(2120),\n" +
+ " X2121(2121),\n" +
+ " X2122(2122),\n" +
+ " X2123(2123),\n" +
+ " X2124(2124),\n" +
+ " X2125(2125),\n" +
+ " X2126(2126),\n" +
+ " X2127(2127),\n" +
+ " X2128(2128),\n" +
+ " X2129(2129),\n" +
+ " X2130(2130),\n" +
+ " X2131(2131),\n" +
+ " X2132(2132),\n" +
+ " X2133(2133),\n" +
+ " X2134(2134),\n" +
+ " X2135(2135),\n" +
+ " X2136(2136),\n" +
+ " X2137(2137),\n" +
+ " X2138(2138),\n" +
+ " X2139(2139),\n" +
+ " X2140(2140),\n" +
+ " X2141(2141),\n" +
+ " X2142(2142),\n" +
+ " X2143(2143),\n" +
+ " X2144(2144),\n" +
+ " X2145(2145),\n" +
+ " X2146(2146),\n" +
+ " X2147(2147),\n" +
+ " X2148(2148),\n" +
+ " X2149(2149),\n" +
+ " X2150(2150),\n" +
+ " X2151(2151),\n" +
+ " X2152(2152),\n" +
+ " X2153(2153),\n" +
+ " X2154(2154),\n" +
+ " X2155(2155),\n" +
+ " X2156(2156),\n" +
+ " X2157(2157),\n" +
+ " X2158(2158),\n" +
+ " X2159(2159),\n" +
+ " X2160(2160),\n" +
+ " X2161(2161),\n" +
+ " X2162(2162),\n" +
+ " X2163(2163),\n" +
+ " X2164(2164),\n" +
+ " X2165(2165),\n" +
+ " X2166(2166),\n" +
+ " X2167(2167),\n" +
+ " X2168(2168),\n" +
+ " X2169(2169),\n" +
+ " X2170(2170),\n" +
+ " X2171(2171),\n" +
+ " X2172(2172),\n" +
+ " X2173(2173),\n" +
+ " X2174(2174),\n" +
+ " X2175(2175),\n" +
+ " X2176(2176),\n" +
+ " X2177(2177),\n" +
+ " X2178(2178),\n" +
+ " X2179(2179),\n" +
+ " X2180(2180),\n" +
+ " X2181(2181),\n" +
+ " X2182(2182),\n" +
+ " X2183(2183),\n" +
+ " X2184(2184),\n" +
+ " X2185(2185),\n" +
+ " X2186(2186),\n" +
+ " X2187(2187),\n" +
+ " X2188(2188),\n" +
+ " X2189(2189),\n" +
+ " X2190(2190),\n" +
+ " X2191(2191),\n" +
+ " X2192(2192),\n" +
+ " X2193(2193),\n" +
+ " X2194(2194),\n" +
+ " X2195(2195),\n" +
+ " X2196(2196),\n" +
+ " X2197(2197),\n" +
+ " X2198(2198),\n" +
+ " X2199(2199),\n" +
+ " X2200(2200),\n" +
+ " X2201(2201),\n" +
+ " X2202(2202),\n" +
+ " X2203(2203),\n" +
+ " X2204(2204),\n" +
+ " X2205(2205),\n" +
+ " X2206(2206),\n" +
+ " X2207(2207),\n" +
+ " X2208(2208),\n" +
+ " X2209(2209),\n" +
+ " X2210(2210),\n" +
+ " X2211(2211),\n" +
+ " X2212(2212),\n" +
+ " X2213(2213),\n" +
+ " X2214(2214),\n" +
+ " X2215(2215),\n" +
+ " X2216(2216),\n" +
+ " X2217(2217),\n" +
+ " X2218(2218),\n" +
+ " X2219(2219),\n" +
+ " X2220(2220),\n" +
+ " X2221(2221),\n" +
+ " X2222(2222),\n" +
+ " X2223(2223),\n" +
+ " X2224(2224),\n" +
+ " X2225(2225),\n" +
+ " X2226(2226),\n" +
+ " X2227(2227),\n" +
+ " X2228(2228),\n" +
+ " X2229(2229),\n" +
+ " X2230(2230),\n" +
+ " X2231(2231),\n" +
+ " X2232(2232),\n" +
+ " X2233(2233),\n" +
+ " X2234(2234),\n" +
+ " X2235(2235),\n" +
+ " X2236(2236),\n" +
+ " X2237(2237),\n" +
+ " X2238(2238),\n" +
+ " X2239(2239),\n" +
+ " X2240(2240),\n" +
+ " X2241(2241),\n" +
+ " X2242(2242),\n" +
+ " X2243(2243),\n" +
+ " X2244(2244),\n" +
+ " X2245(2245),\n" +
+ " X2246(2246),\n" +
+ " X2247(2247),\n" +
+ " X2248(2248),\n" +
+ " X2249(2249),\n" +
+ " X2250(2250),\n" +
+ " X2251(2251),\n" +
+ " X2252(2252),\n" +
+ " X2253(2253),\n" +
+ " X2254(2254),\n" +
+ " X2255(2255),\n" +
+ " X2256(2256),\n" +
+ " X2257(2257),\n" +
+ " X2258(2258),\n" +
+ " X2259(2259),\n" +
+ " X2260(2260),\n" +
+ " X2261(2261),\n" +
+ " X2262(2262),\n" +
+ " X2263(2263),\n" +
+ " X2264(2264),\n" +
+ " X2265(2265),\n" +
+ " X2266(2266),\n" +
+ " X2267(2267),\n" +
+ " X2268(2268),\n" +
+ " X2269(2269),\n" +
+ " X2270(2270),\n" +
+ " X2271(2271),\n" +
+ " X2272(2272),\n" +
+ " X2273(2273),\n" +
+ " X2274(2274),\n" +
+ " X2275(2275),\n" +
+ " X2276(2276),\n" +
+ " X2277(2277),\n" +
+ " X2278(2278),\n" +
+ " X2279(2279),\n" +
+ " X2280(2280),\n" +
+ " X2281(2281),\n" +
+ " X2282(2282),\n" +
+ " X2283(2283),\n" +
+ " X2284(2284),\n" +
+ " X2285(2285),\n" +
+ " X2286(2286),\n" +
+ " X2287(2287),\n" +
+ " X2288(2288),\n" +
+ " X2289(2289),\n" +
+ " X2290(2290),\n" +
+ " X2291(2291),\n" +
+ " X2292(2292),\n" +
+ " X2293(2293),\n" +
+ " X2294(2294),\n" +
+ " X2295(2295),\n" +
+ " X2296(2296),\n" +
+ " X2297(2297),\n" +
+ " X2298(2298),\n" +
+ " X2299(2299),\n" +
+ " X2300(2300),\n" +
+ " X2301(2301),\n" +
+ " X2302(2302),\n" +
+ " X2303(2303),\n" +
+ " X2304(2304),\n" +
+ " X2305(2305),\n" +
+ " X2306(2306),\n" +
+ " X2307(2307),\n" +
+ " X2308(2308),\n" +
+ " X2309(2309),\n" +
+ " X2310(2310),\n" +
+ " X2311(2311),\n" +
+ " X2312(2312),\n" +
+ " X2313(2313),\n" +
+ " X2314(2314),\n" +
+ " X2315(2315),\n" +
+ " X2316(2316),\n" +
+ " X2317(2317),\n" +
+ " X2318(2318),\n" +
+ " X2319(2319),\n" +
+ " X2320(2320),\n" +
+ " X2321(2321),\n" +
+ " X2322(2322),\n" +
+ " X2323(2323),\n" +
+ " X2324(2324),\n" +
+ " X2325(2325),\n" +
+ " X2326(2326),\n" +
+ " X2327(2327),\n" +
+ " X2328(2328),\n" +
+ " X2329(2329),\n" +
+ " X2330(2330),\n" +
+ " X2331(2331),\n" +
+ " X2332(2332),\n" +
+ " X2333(2333),\n" +
+ " X2334(2334),\n" +
+ " X2335(2335),\n" +
+ " X2336(2336),\n" +
+ " X2337(2337),\n" +
+ " X2338(2338),\n" +
+ " X2339(2339),\n" +
+ " X2340(2340),\n" +
+ " X2341(2341),\n" +
+ " X2342(2342),\n" +
+ " X2343(2343),\n" +
+ " X2344(2344),\n" +
+ " X2345(2345),\n" +
+ " X2346(2346),\n" +
+ " X2347(2347),\n" +
+ " X2348(2348),\n" +
+ " X2349(2349),\n" +
+ " X2350(2350),\n" +
+ " X2351(2351),\n" +
+ " X2352(2352),\n" +
+ " X2353(2353),\n" +
+ " X2354(2354),\n" +
+ " X2355(2355),\n" +
+ " X2356(2356),\n" +
+ " X2357(2357),\n" +
+ " X2358(2358),\n" +
+ " X2359(2359),\n" +
+ " X2360(2360),\n" +
+ " X2361(2361),\n" +
+ " X2362(2362),\n" +
+ " X2363(2363),\n" +
+ " X2364(2364),\n" +
+ " X2365(2365),\n" +
+ " X2366(2366),\n" +
+ " X2367(2367),\n" +
+ " X2368(2368),\n" +
+ " X2369(2369),\n" +
+ " X2370(2370),\n" +
+ " X2371(2371),\n" +
+ " X2372(2372),\n" +
+ " X2373(2373),\n" +
+ " X2374(2374),\n" +
+ " X2375(2375),\n" +
+ " X2376(2376),\n" +
+ " X2377(2377),\n" +
+ " X2378(2378),\n" +
+ " X2379(2379),\n" +
+ " X2380(2380),\n" +
+ " X2381(2381),\n" +
+ " X2382(2382),\n" +
+ " X2383(2383),\n" +
+ " X2384(2384),\n" +
+ " X2385(2385),\n" +
+ " X2386(2386),\n" +
+ " X2387(2387),\n" +
+ " X2388(2388),\n" +
+ " X2389(2389),\n" +
+ " X2390(2390),\n" +
+ " X2391(2391),\n" +
+ " X2392(2392),\n" +
+ " X2393(2393),\n" +
+ " X2394(2394),\n" +
+ " X2395(2395),\n" +
+ " X2396(2396),\n" +
+ " X2397(2397),\n" +
+ " X2398(2398),\n" +
+ " X2399(2399),\n" +
+ " X2400(2400),\n" +
+ " X2401(2401),\n" +
+ " X2402(2402),\n" +
+ " X2403(2403),\n" +
+ " X2404(2404),\n" +
+ " X2405(2405),\n" +
+ " X2406(2406),\n" +
+ " X2407(2407),\n" +
+ " X2408(2408),\n" +
+ " X2409(2409),\n" +
+ " X2410(2410),\n" +
+ " X2411(2411),\n" +
+ " X2412(2412),\n" +
+ " X2413(2413),\n" +
+ " X2414(2414),\n" +
+ " X2415(2415),\n" +
+ " X2416(2416),\n" +
+ " X2417(2417),\n" +
+ " X2418(2418),\n" +
+ " X2419(2419),\n" +
+ " X2420(2420),\n" +
+ " X2421(2421),\n" +
+ " X2422(2422),\n" +
+ " X2423(2423),\n" +
+ " X2424(2424),\n" +
+ " X2425(2425),\n" +
+ " X2426(2426),\n" +
+ " X2427(2427),\n" +
+ " X2428(2428),\n" +
+ " X2429(2429),\n" +
+ " X2430(2430),\n" +
+ " X2431(2431),\n" +
+ " X2432(2432),\n" +
+ " X2433(2433),\n" +
+ " X2434(2434),\n" +
+ " X2435(2435),\n" +
+ " X2436(2436),\n" +
+ " X2437(2437),\n" +
+ " X2438(2438),\n" +
+ " X2439(2439),\n" +
+ " X2440(2440),\n" +
+ " X2441(2441),\n" +
+ " X2442(2442),\n" +
+ " X2443(2443),\n" +
+ " X2444(2444),\n" +
+ " X2445(2445),\n" +
+ " X2446(2446),\n" +
+ " X2447(2447),\n" +
+ " X2448(2448),\n" +
+ " X2449(2449),\n" +
+ " X2450(2450),\n" +
+ " X2451(2451),\n" +
+ " X2452(2452),\n" +
+ " X2453(2453),\n" +
+ " X2454(2454),\n" +
+ " X2455(2455),\n" +
+ " X2456(2456),\n" +
+ " X2457(2457),\n" +
+ " X2458(2458),\n" +
+ " X2459(2459),\n" +
+ " X2460(2460),\n" +
+ " X2461(2461),\n" +
+ " X2462(2462),\n" +
+ " X2463(2463),\n" +
+ " X2464(2464),\n" +
+ " X2465(2465),\n" +
+ " X2466(2466),\n" +
+ " X2467(2467),\n" +
+ " X2468(2468),\n" +
+ " X2469(2469),\n" +
+ " X2470(2470),\n" +
+ " X2471(2471),\n" +
+ " X2472(2472),\n" +
+ " X2473(2473),\n" +
+ " X2474(2474),\n" +
+ " X2475(2475),\n" +
+ " X2476(2476),\n" +
+ " X2477(2477),\n" +
+ " X2478(2478),\n" +
+ " X2479(2479),\n" +
+ " X2480(2480),\n" +
+ " X2481(2481),\n" +
+ " X2482(2482),\n" +
+ " X2483(2483),\n" +
+ " X2484(2484),\n" +
+ " X2485(2485),\n" +
+ " X2486(2486),\n" +
+ " X2487(2487),\n" +
+ " X2488(2488),\n" +
+ " X2489(2489),\n" +
+ " X2490(2490),\n" +
+ " X2491(2491),\n" +
+ " X2492(2492),\n" +
+ " X2493(2493),\n" +
+ " X2494(2494),\n" +
+ " X2495(2495),\n" +
+ " X2496(2496),\n" +
+ " X2497(2497),\n" +
+ " X2498(2498),\n" +
+ " X2499(2499),\n" +
+ " ;\n" +
+ "\n" +
+ " private int value;\n" +
+ " X(int i) {\n" +
+ " this.value = i;\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " int i = 0;\n" +
+ " for (X x : X.values()) {\n" +
+ " i++;\n" +
+ " System.out.print(x);\n" +
+ " }\n" +
+ " System.out.print(i);\n" +
+ " }\n" +
+ " \n" +
+ " public String toString() {\n" +
+ " return Integer.toString(this.value);\n" +
+ " }\n" +
+ "}"
+ };
+ if (this.complianceLevel < ClassFileConstants.JDK9) {
+ this.runConformTest(src, buffer.toString());
+ } else {
+ this.runNegativeTest(src,
+ "----------\n" +
+ "1. ERROR in X.java (at line 1)\n" +
+ " public enum X {\n" +
+ " ^\n" +
+ "The code for the static initializer is exceeding the 65535 bytes limit\n" +
+ "----------\n");
+ }
}
public void test0017() {
if (this.complianceLevel <= ClassFileConstants.JDK1_4) return;
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java
index 9254c0bbf..13285981d 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java
@@ -40,6 +40,7 @@ import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.IVariableBinding;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.MethodInvocation;
+import org.eclipse.jdt.core.dom.ModuleDeclaration;
import org.eclipse.jdt.core.dom.NodeFinder;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.TypeDeclaration;
@@ -73,6 +74,29 @@ public class StandAloneASTParserTest extends AbstractRegressionTest {
parser.setUnitName(unitName);
return parser.createAST(null);
}
+ public void testBug529654_001() {
+ String contents =
+ "module m {\n" +
+ "}";
+ ASTParser parser = ASTParser.newParser(AST_JLS_LATEST);
+ parser.setSource(contents.toCharArray());
+ parser.setEnvironment(null, null, null, true);
+ parser.setResolveBindings(true);
+ parser.setStatementsRecovery(true);
+ parser.setBindingsRecovery(true);
+ parser.setUnitName("module-info.java");
+ Map<String, String> options = getCompilerOptions();
+ options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_9);
+ options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_9);
+ options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_9);
+ parser.setCompilerOptions(options);
+
+ ASTNode node = parser.createAST(null);
+ assertTrue("Should be a compilation unit", node instanceof CompilationUnit);
+ CompilationUnit unit = (CompilationUnit) node;
+ ModuleDeclaration module = unit.getModule();
+ assertTrue("Incorrect Module Name", module.getName().getFullyQualifiedName().equals("m"));
+ }
public void test1() {
String contents =
"package p;\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java
index 32faad073..687e3e8c7 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java
@@ -30,6 +30,11 @@ import org.eclipse.jdt.core.tests.util.Util;
@SuppressWarnings({ "unchecked", "rawtypes" })
public abstract class LocalVMLauncher implements RuntimeConstants {
+ static final String[] env = System.getenv().entrySet().stream()
+ .filter(e -> !"JAVA_TOOL_OPTIONS".equals(e.getKey()))
+ .map(e -> e.getKey() + "=" + e.getValue())
+ .toArray(String[]::new);
+
/**
* Whether the target has a file system and thus whether it supports writing
* class files to disk. See org.eclipse.jdt.core.tests.eval.target.CodeSnippetRunner for more
@@ -132,7 +137,7 @@ protected Process execCommandLine() throws TargetException {
// Use Runtime.exec(String[]) with tokens because Runtime.exec(String) with commandLineString
// does not properly handle spaces in arguments on Unix/Linux platforms.
String[] commandLine = getCommandLine();
- vmProcess= Runtime.getRuntime().exec(commandLine);
+ vmProcess= Runtime.getRuntime().exec(commandLine, env);
} catch (IOException e) {
throw new TargetException("Error launching VM at " + this.vmPath);
}
diff --git a/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
index 1f2963921..d3cadda0d 100644
--- a/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.core.tests.model;singleton:=true
-Bundle-Version: 3.10.360.qualifier
+Bundle-Version: 3.10.361.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.jdt.core.tests,
diff --git a/org.eclipse.jdt.core.tests.model/pom.xml b/org.eclipse.jdt.core.tests.model/pom.xml
index 202a5880e..a693b3f26 100644
--- a/org.eclipse.jdt.core.tests.model/pom.xml
+++ b/org.eclipse.jdt.core.tests.model/pom.xml
@@ -15,12 +15,12 @@
<parent>
<artifactId>tests-pom</artifactId>
<groupId>eclipse.jdt.core</groupId>
- <version>4.7.2-SNAPSHOT</version>
+ <version>4.7.3-SNAPSHOT</version>
<relativePath>../tests-pom/</relativePath>
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.core.tests.model</artifactId>
- <version>3.10.360-SNAPSHOT</version>
+ <version>3.10.361-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava9Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava9Tests.java
index 15566b271..56e6a51dc 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava9Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava9Tests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016, 2017 IBM Corporation and others.
+ * Copyright (c) 2016, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,6 +20,7 @@ import org.eclipse.jdt.core.tests.model.Java9ElementTests;
import org.eclipse.jdt.core.tests.model.JavaConventionTests;
import org.eclipse.jdt.core.tests.model.JavaSearchBugs9Tests;
import org.eclipse.jdt.core.tests.model.ModuleBuilderTests;
+import org.eclipse.jdt.core.tests.model.ModuleOptionsTests;
import org.eclipse.jdt.core.tests.model.ResolveTests9;
import org.eclipse.jdt.core.tests.util.AbstractCompilerTest;
@@ -36,6 +37,7 @@ public class RunAllJava9Tests extends TestCase {
public static Class[] getAllTestClasses() {
return new Class[] {
ModuleBuilderTests.class,
+ ModuleOptionsTests.class,
Java9ElementTests.class,
JavaSearchBugs9Tests.class,
CompletionTests9.class,
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
index 616d8a4fd..9d87a31c1 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java
@@ -5337,4 +5337,24 @@ public void testBug497719_0001() throws JavaModelException {
TryStatement tryStatement = (TryStatement)methodDeclaration.getBody().statements().get(2);
assertEquals("Try Statement should be malformed", ASTNode.MALFORMED, (tryStatement.getFlags() & ASTNode.MALFORMED));
}
+public void testBug526449_001() throws JavaModelException {
+ String contents =
+ "class com.google.android.gms.common.X {\n" +
+ " class zzc {\n" +
+ " void getBytes() {\n" +
+ " this;\n" +
+ " }\n" +
+ " }\n" +
+ "\n" +
+ " class zze {\n" +
+ " zza zzLC[] = {\n" +
+ " new zzc(){}, \n" +
+ " new zzc(){}\n" +
+ " };\n" +
+ " }\n" +
+ "}\n";
+ this.workingCopy = getWorkingCopy("/Converter18/src/jsr308/myex/X.java", true/*resolve*/);
+ ASTNode node = buildAST(contents, this.workingCopy, false);
+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
+}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
index 74c1cdcaf..ac0257d79 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -3257,6 +3257,10 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
new CompilerOptions(options).toString());
}
+ protected IPath getJRE9Path() {
+ return new Path(System.getProperty("java.home") + "/lib/jrt-fs.jar");
+ }
+
/**
* Wait for autobuild notification to occur
*/
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java
index 4c19df141..c2ff7ff07 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AllJavaModelTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -47,6 +47,7 @@ private static Class[] getAllTestClasses() {
JavaProjectTests.class,
// Modularity tests (Java 9)
ModuleBuilderTests.class,
+ ModuleOptionsTests.class,
// Compilation unit tests
CompilationUnitTests.class,
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
index 49b80783f..187043395 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016, 2017 IBM Corporation and others.
+ * Copyright (c) 2016, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@ import java.util.Hashtable;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.CompletionProposal;
import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
@@ -315,7 +316,7 @@ public void test486988_0009() throws Exception {
ICompilationUnit unit = getCompilationUnit(filePath);
unit.codeComplete(cursorLocation, requestor);
- String expected = "[PROPOSAL]{org.eclipse.foo, org.eclipse.foo, null, null, 49}";
+ String expected = "[MODULE_REF]{org.eclipse.foo, org.eclipse.foo, null, null, 49}";
assertResults(expected, requestor.getResults());
} finally {
deleteProject(project1);
@@ -349,11 +350,12 @@ public void test522604_0001() throws Exception {
ICompilationUnit unit = getCompilationUnit(filePath);
unit.codeComplete(cursorLocation, requestor);
- String expected = "[PROPOSAL]{j.s.r, j.s.r, null, null, 49}";
+ String expected = "[MODULE_REF]{j.s.r, j.s.r, null, null, 49}";
assertResults(expected, requestor.getResults());
} finally {
deleteProject(project1);
deleteProject(project2);
+ deleteProject(project3);
}
}
@@ -391,7 +393,7 @@ public void test486988_0010() throws Exception {
ICompilationUnit unit = getCompilationUnit(filePath);
unit.codeComplete(cursorLocation, requestor);
- String expected = "[PROPOSAL]{com.greetings, com.greetings, null, null, 49}";
+ String expected = "[MODULE_REF]{com.greetings, com.greetings, null, null, 49}";
assertResults(expected, requestor.getResults());
} finally {
deleteProject(project1);
@@ -604,6 +606,7 @@ public void test486988_0015() throws Exception {
String filePath2 = "/Completion9_2/src/module-info.java";
createFile(filePath2, fileContent2);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
+ addClasspathEntry(project1, JavaCore.newContainerEntry(project2.getPath()));
project1.close(); // sync
project2.close();
@@ -616,8 +619,10 @@ public void test486988_0015() throws Exception {
ICompilationUnit unit = getCompilationUnit(filePath1);
unit.codeComplete(cursorLocation, requestor);
- String expected = "pack11[PACKAGE_REF]{pack11, pack11, null, null, 49}\n" +
- "pack11.packinternal[PACKAGE_REF]{pack11.packinternal, pack11.packinternal, null, null, 49}\n" +
+ String expected = "Y12[TYPE_REF]{pack12.Y12, pack12, Lpack12.Y12;, null, 39}\n" +
+ "Z12[TYPE_REF]{pack11.packinternal.Z12, pack11.packinternal, Lpack11.packinternal.Z12;, null, 39}\n" +
+ "pack11[PACKAGE_REF]{pack11, pack11, null, null, 49}\n" +
+ "pack11.packinternal[PACKAGE_REF]{pack11.packinternal, pack11.packinternal, null, null, 49}\n" +
"pack12[PACKAGE_REF]{pack12, pack12, null, null, 49}"
//+ "\nShow me the type Honey!!"
;
@@ -873,4 +878,340 @@ public void test527099_001() throws Exception {
deleteProject(project2);
}
}
+
+public void test527873_001() throws Exception {
+ IJavaProject project1 = createJavaProject("Completion9_1", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project2 = createJavaProject("Completion9_2", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ try {
+ project1.open(null);
+ createType("/Completion9_1/src/", "pack11", "X11");
+ createType("/Completion9_1/src/", "pack11.packinternal", "Z11");
+ createTypePlus("/Completion9_1/src/", "pack11.packinternal", "Z12", "implements pack22.I22", true /* isClass */, false /* createFolder */);
+ createType("/Completion9_1/src/", "pack12", "X12");
+ createTypePlus("/Completion9_1/src/", "pack12", "Y12", "implements pack22.I22", true /* isClass */, false /* createFolder */);
+ String filePath1 = "/Completion9_1/src/module-info.java";
+ String completeBehind = "with ";
+ String fileContent1 = "module first {\n"
+ + "requires second;\n"
+ + "provides pack22.I22 " + completeBehind
+ + "}\n";
+ createFile(filePath1, fileContent1);
+ addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
+
+ project2.open(null);
+ createType("/Completion9_2/src/", "pack21", "X21");
+ createType("/Completion9_2/src/", "pack22", "X22");
+ createTypePlus("/Completion9_2/src/", "pack22", "I22", null, false /* isClass */, false /* createFolder */);
+
+ String fileContent2 = "module second { "
+ + "exports pack21 to first;\n"
+ + "exports pack22 to first;\n"
+ + "}\n";
+ String filePath2 = "/Completion9_2/src/module-info.java";
+ createFile(filePath2, fileContent2);
+ addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
+ addClasspathEntry(project1, JavaCore.newContainerEntry(project2.getPath()));
+
+ project1.close(); // sync
+ project2.close();
+ project2.open(null);
+ project1.open(null);
+
+ int cursorLocation = fileContent1.lastIndexOf(completeBehind) + completeBehind.length();
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+
+ ICompilationUnit unit = getCompilationUnit(filePath1);
+ unit.codeComplete(cursorLocation, requestor);
+
+ String expected =
+ "Y12[TYPE_REF]{pack12.Y12, pack12, Lpack12.Y12;, null, 39}\n" +
+ "Z12[TYPE_REF]{pack11.packinternal.Z12, pack11.packinternal, Lpack11.packinternal.Z12;, null, 39}\n" +
+ "pack11[PACKAGE_REF]{pack11, pack11, null, null, 39}\n" +
+ "pack11.packinternal[PACKAGE_REF]{pack11.packinternal, pack11.packinternal, null, null, 39}\n" +
+ "pack12[PACKAGE_REF]{pack12, pack12, null, null, 39}";
+ assertResults(expected, requestor.getResults());
+ } finally {
+ deleteProject(project1);
+ deleteProject(project2);
+ }
+}
+public void test527873_002() throws Exception {
+ IJavaProject project1 = createJavaProject("Completion9_1", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project2 = createJavaProject("Completion9_2", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ try {
+ project1.open(null);
+ createType("/Completion9_1/src/", "pack11", "X11");
+ createType("/Completion9_1/src/", "pack11.packinternal", "Z11");
+ createTypePlus("/Completion9_1/src/", "pack11.packinternal", "Z12", "implements pack22.I22", true /* isClass */, false /* createFolder */);
+ createType("/Completion9_1/src/", "pack12", "X12");
+ createTypePlus("/Completion9_1/src/", "pack12", "Y12", "implements pack22.I22", true /* isClass */, false /* createFolder */);
+ createTypePlus("/Completion9_1/src/", "", "X", "implements pack22.I22", true /* isClass */, false /* createFolder */);
+ String filePath1 = "/Completion9_1/src/module-info.java";
+ String completeBehind = "with ";
+ String fileContent1 = "module first {\n"
+ + "requires second;\n"
+ + "provides pack22.I22 " + completeBehind
+ + "}\n";
+ createFile(filePath1, fileContent1);
+ addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
+
+ project2.open(null);
+ createType("/Completion9_2/src/", "pack21", "X21");
+ createType("/Completion9_2/src/", "pack22", "X22");
+ createTypePlus("/Completion9_2/src/", "pack22", "I22", null, false /* isClass */, false /* createFolder */);
+
+ String fileContent2 = "module second { "
+ + "exports pack21 to first;\n"
+ + "exports pack22 to first;\n"
+ + "}\n";
+ String filePath2 = "/Completion9_2/src/module-info.java";
+ createFile(filePath2, fileContent2);
+ addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
+ addClasspathEntry(project1, JavaCore.newContainerEntry(project2.getPath()));
+
+ project1.close(); // sync
+ project2.close();
+ project2.open(null);
+ project1.open(null);
+
+ int cursorLocation = fileContent1.lastIndexOf(completeBehind) + completeBehind.length();
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+
+ ICompilationUnit unit = getCompilationUnit(filePath1);
+ unit.codeComplete(cursorLocation, requestor);
+
+ String expected =
+ "Y12[TYPE_REF]{pack12.Y12, pack12, Lpack12.Y12;, null, 39}\n" +
+ "Z12[TYPE_REF]{pack11.packinternal.Z12, pack11.packinternal, Lpack11.packinternal.Z12;, null, 39}\n" +
+ "pack11[PACKAGE_REF]{pack11, pack11, null, null, 39}\n" +
+ "pack11.packinternal[PACKAGE_REF]{pack11.packinternal, pack11.packinternal, null, null, 39}\n" +
+ "pack12[PACKAGE_REF]{pack12, pack12, null, null, 39}\n" +
+ "X[TYPE_REF]{X, , LX;, null, 42}"
+ ;
+ assertResults(expected, requestor.getResults());
+ } finally {
+ deleteProject(project1);
+ deleteProject(project2);
+ }
+}
+public void testBug529123_001() throws Exception {
+ IJavaProject project1 = createJavaProject("Completion9_1", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ try {
+ project1.open(null);
+ String filePath = "/Completion9_1/src/module-info.java";
+ String fileContent = "module Com";
+ createFile(filePath, fileContent);
+ String completeBehind = "Com";
+ int cursorLocation = fileContent.lastIndexOf(completeBehind) + completeBehind.length();
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+
+ ICompilationUnit unit = getCompilationUnit(filePath);
+ unit.codeComplete(cursorLocation, requestor);
+
+ String expected = "Completion9_1[MODULE_DECLARATION]{Completion9_1, Completion9_1, null, Completion9_1, 31}";
+ assertResults(expected, requestor.getResults());
+ } finally {
+ deleteProject(project1);
+ }
+}
+public void testBug529123_002() throws Exception {
+ String pName = "Completion9-1"; // with a -,
+ IJavaProject project1 = createJavaProject(pName, new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ try {
+ project1.open(null);
+ String filePath = "/" + pName +"/src/module-info.java";
+ String fileContent = "module Com";
+ createFile(filePath, fileContent);
+ String completeBehind = "Com";
+ int cursorLocation = fileContent.lastIndexOf(completeBehind) + completeBehind.length();
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+
+ ICompilationUnit unit = getCompilationUnit(filePath);
+ unit.codeComplete(cursorLocation, requestor);
+
+ String expected = "";
+ assertResults(expected, requestor.getResults());
+ } finally {
+ deleteProject(project1);
+ }
+}
+public void testBug529123_003() throws Exception {
+ String pName = "529123"; // a number - invalid module name but a valid project name
+ IJavaProject project1 = createJavaProject(pName, new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ try {
+ project1.open(null);
+ String filePath = "/" + pName +"/src/module-info.java";
+ String fileContent = "module Com";
+ createFile(filePath, fileContent);
+ String completeBehind = "Com";
+ int cursorLocation = fileContent.lastIndexOf(completeBehind) + completeBehind.length();
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+
+ ICompilationUnit unit = getCompilationUnit(filePath);
+ unit.codeComplete(cursorLocation, requestor);
+
+ String expected = "";
+ assertResults(expected, requestor.getResults());
+ } finally {
+ deleteProject(project1);
+ }
+}
+public void testBug529123_004() throws Exception {
+ String pName = "module.name.test"; // with dots
+ IJavaProject project1 = createJavaProject(pName, new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ try {
+ project1.open(null);
+ String filePath = "/" + pName +"/src/module-info.java";
+ String fileContent = "module Com";
+ createFile(filePath, fileContent);
+ String completeBehind = "Com";
+ int cursorLocation = fileContent.lastIndexOf(completeBehind) + completeBehind.length();
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+
+ ICompilationUnit unit = getCompilationUnit(filePath);
+ unit.codeComplete(cursorLocation, requestor);
+
+ String expected = "";
+ assertResults(expected, requestor.getResults());
+ } finally {
+ deleteProject(project1);
+ }
+}
+public void testBug529123_005() throws Exception {
+ IJavaProject project1 = createJavaProject("Completion9_1", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ try {
+ project1.open(null);
+ String filePath = "/Completion9_1/src/module-info.java";
+ String fileContent = "module Com";
+ createFile(filePath, fileContent);
+ String completeBehind = "Com";
+ int cursorLocation = fileContent.lastIndexOf(completeBehind) + completeBehind.length();
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+
+ ICompilationUnit unit = getCompilationUnit(filePath);
+ unit.codeComplete(cursorLocation, requestor);
+
+ String expected = "Completion9_1[MODULE_DECLARATION]{Completion9_1, Completion9_1, null, Completion9_1, 31}";
+ String[] actual = requestor.getStringsResult();
+ assertTrue("Null result", actual != null);
+ assertTrue("Incorrect number of elements", actual.length == 1);
+ assertResults(expected, requestor.getResults());
+ } finally {
+ deleteProject(project1);
+ }
+}
+public void testBug528948_001() throws Exception {
+ IJavaProject project1 = createJavaProject("Completion9_1", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project2 = createJavaProject("Completion9_2", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ try {
+ project1.open(null);
+ createType("/Completion9_1/src/", "pack11", "X11");
+ createType("/Completion9_1/src/", "pack12", "X12");
+ String filePath1 = "/Completion9_1/src/module-info.java";
+ String completeBehind = "uses ";
+ String fileContent1 = "module first {\n"
+ + "requires second;\n"
+ + completeBehind
+ + "}\n";
+ createFile(filePath1, fileContent1);
+
+ project2.open(null);
+ createType("/Completion9_2/src/", "pack21", "X21");
+ createType("/Completion9_2/src/", "pack22", "X22");
+
+ String fileContent2 = "module second { "
+ + "exports pack21 to first;"
+ + "}\n";
+ String filePath2 = "/Completion9_2/src/module-info.java";
+ createFile(filePath2, fileContent2);
+
+ project1.close(); // sync
+ project2.close();
+ project2.open(null);
+ project1.open(null);
+
+ int cursorLocation = fileContent1.lastIndexOf(completeBehind) + completeBehind.length();
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+ waitUntilIndexesReady();
+
+ ICompilationUnit unit = getCompilationUnit(filePath1);
+ unit.codeComplete(cursorLocation, requestor);
+
+ CompletionProposal[] proposals = requestor.getProposals();
+ assertTrue(proposals != null);
+ int count = 0;
+ for (CompletionProposal proposal : proposals) {
+ if (proposal == null) break;
+ ++count;
+ int start = proposal.getReplaceStart();
+ int end = proposal.getReplaceEnd();
+ assertTrue(start > 0);
+ assertTrue(end > 0);
+ }
+ assertTrue("Incorrect Number of Proposals", count == 2);
+ String expected = "X11[TYPE_REF]{pack11.X11, pack11, Lpack11.X11;, null, 39}\n" +
+ "X12[TYPE_REF]{pack12.X12, pack12, Lpack12.X12;, null, 39}";
+ assertResults(expected, requestor.getResults());
+ } finally {
+ deleteProject(project1);
+ deleteProject(project2);
+ }
+}
+public void testBug528948_002() throws Exception {
+ IJavaProject project1 = createJavaProject("Completion9_1", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project2 = createJavaProject("Completion9_2", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ try {
+ project1.open(null);
+ createType("/Completion9_1/src/", "pack11", "X11");
+ createType("/Completion9_1/src/", "pack12", "X12");
+ String filePath1 = "/Completion9_1/src/module-info.java";
+ String completeBehind = "provides ";
+ String fileContent1 = "module first {\n"
+ + "requires second;\n"
+ + completeBehind
+ + "}\n";
+ createFile(filePath1, fileContent1);
+
+ project2.open(null);
+ createType("/Completion9_2/src/", "pack21", "X21");
+ createType("/Completion9_2/src/", "pack22", "X22");
+
+ String fileContent2 = "module second { "
+ + "exports pack21 to first;"
+ + "}\n";
+ String filePath2 = "/Completion9_2/src/module-info.java";
+ createFile(filePath2, fileContent2);
+
+ project1.close(); // sync
+ project2.close();
+ project2.open(null);
+ project1.open(null);
+
+ int cursorLocation = fileContent1.lastIndexOf(completeBehind) + completeBehind.length();
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+ waitUntilIndexesReady();
+
+ ICompilationUnit unit = getCompilationUnit(filePath1);
+ unit.codeComplete(cursorLocation, requestor);
+
+ CompletionProposal[] proposals = requestor.getProposals();
+ assertTrue(proposals != null);
+ int count = 0;
+ for (CompletionProposal proposal : proposals) {
+ if (proposal == null) break;
+ ++count;
+ int start = proposal.getReplaceStart();
+ int end = proposal.getReplaceEnd();
+ assertTrue(start > 0);
+ assertTrue(end > 0);
+ }
+ assertTrue("Incorrect Number of Proposals", count == 2);
+ String expected = "X11[TYPE_REF]{pack11.X11, pack11, Lpack11.X11;, null, 39}\n" +
+ "X12[TYPE_REF]{pack12.X12, pack12, Lpack12.X12;, null, 39}";
+ assertResults(expected, requestor.getResults());
+ } finally {
+ deleteProject(project1);
+ deleteProject(project2);
+ }
+}
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
index 6ba2dd8f7..08c9e3952 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2015 IBM Corporation and others.
+ * Copyright (c) 2004, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -249,6 +249,9 @@ public class CompletionTestsRequestor2 extends CompletionRequestor {
return this.problem == null ? "" : this.problem.getMessage();
}
+ public CompletionProposal[] getProposals() {
+ return this.proposals;
+ }
/*
* Get sorted results in ascending order
*/
@@ -354,6 +357,12 @@ public class CompletionTestsRequestor2 extends CompletionRequestor {
buffer.append("<CONSTRUCTOR>"); //$NON-NLS-1$
}
break;
+ case CompletionProposal.MODULE_DECLARATION :
+ buffer.append("MODULE_DECLARATION"); //$NON-NLS-1$
+ break;
+ case CompletionProposal.MODULE_REF :
+ buffer.append("MODULE_REF"); //$NON-NLS-1$
+ break;
case CompletionProposal.PACKAGE_REF :
buffer.append("PACKAGE_REF"); //$NON-NLS-1$
break;
@@ -590,6 +599,7 @@ public class CompletionTestsRequestor2 extends CompletionRequestor {
case CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION :
return new String(proposal.getName());
case CompletionProposal.PACKAGE_REF:
+ case CompletionProposal.MODULE_DECLARATION:
return new String(proposal.getDeclarationSignature());
}
return "";
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Java9ElementTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Java9ElementTests.java
index e0dfe5a60..a01c78dc7 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Java9ElementTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Java9ElementTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017 IBM Corporation and others.
+ * Copyright (c) 2017, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,6 +37,8 @@ import org.eclipse.jdt.core.ToolFactory;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.provisional.JavaModelAccess;
import org.eclipse.jdt.core.tests.util.AbstractCompilerTest;
+import org.eclipse.jdt.core.tests.util.Util;
+import org.eclipse.jdt.core.util.ClassFileBytesDisassembler;
import org.eclipse.jdt.core.util.IAttributeNamesConstants;
import org.eclipse.jdt.core.util.IClassFileAttribute;
import org.eclipse.jdt.core.util.IClassFileReader;
@@ -1225,6 +1227,86 @@ public class Java9ElementTests extends AbstractJavaModelTests {
deleteProject("mod.zero");
}
}
+ public void testModuleAttributes_disassembler_508889_001() throws Exception {
+ try {
+ IJavaProject javaProject = createJava9Project("mod.zero");
+
+ createFolder("/mod.zero/src/test0");
+ createFile("/mod.zero/src/test0/SPQR.java",
+ "package test0;\n" +
+ "\n" +
+ "public class SPQR {}");
+
+ createFolder("/mod.zero/src/test1");
+ createFile("/mod.zero/src/test1/Service.java",
+ "package test1;\n" +
+ "\n" +
+ "public interface Service {}");
+
+ createFolder("/mod.zero/src/test2");
+ createFile("/mod.zero/src/test2/Impl.java",
+ "package test2;\n" +
+ "\n" +
+ "public class Impl implements test1.Service {}");
+
+ createFolder("/mod.zero/src/testDont");
+ createFile("/mod.zero/src/testDont/Show.java",
+ "package testDont;\n" +
+ "\n" +
+ "public class Show {}");
+
+ String content = "module mod.zero {\n" +
+ " exports test0;\n" +
+ " opens test1;\n" +
+ " provides test1.Service with test2.Impl;\n" +
+ "}\n";
+ createFile("/mod.zero/src/module-info.java", content);
+
+ javaProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+
+ ICompilationUnit unit = getCompilationUnit("/mod.zero/src/module-info.java");
+ IModuleDescription module = unit.getModule();
+
+ Map<String,String> attributes = new HashMap<>();
+ attributes.put(String.valueOf(IAttributeNamesConstants.MODULE_MAIN_CLASS), "test0.SPQR");
+ attributes.put(String.valueOf(IAttributeNamesConstants.MODULE_PACKAGES), "");
+
+ byte[] bytes = JavaCore.compileWithAttributes(module, attributes);
+
+ ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
+ String result = disassembler.disassemble(bytes, "\n", ClassFileBytesDisassembler.DETAILED);
+ String expectedOutput = "// Compiled from module-info.java (version 9 : 53.0, no super bit)\n" +
+ " module mod.zero {\n" +
+ " // Version: \n" +
+ "\n" +
+ " requires java.base;\n" +
+ "\n" +
+ " exports test0;\n" +
+ "\n" +
+ " opens test1;\n" +
+ "\n" +
+ " provides test1.Service with test2.Impl;\n" +
+ " \n" +
+ " Module packages:\n" +
+ " test0\n" +
+ " test1\n" +
+ " test2\n" +
+ "\n" +
+ " Module main class:\n" +
+ " test0.SPQR\n" +
+ "\n" +
+ "}";
+ int index = result.indexOf(expectedOutput);
+ if (index == -1 || expectedOutput.length() == 0) {
+ System.out.println(Util.displayString(result, 2));
+ }
+ if (index == -1) {
+ assertEquals("Wrong contents", expectedOutput, result);
+ }
+ } finally {
+ deleteProject("mod.zero");
+ }
+ }
public void testAutoModule1() throws Exception {
try {
IJavaProject project1 = createJavaProject("my_mod", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java
index 0f868ee6f..4e29db6d5 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java
index 57d1cf736..a2a4abfd8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugs9Tests.java
@@ -28,6 +28,7 @@ import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.ReferenceMatch;
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.SearchParticipant;
import org.eclipse.jdt.core.search.SearchPattern;
import org.eclipse.jdt.core.search.TypeReferenceMatch;
import junit.framework.Test;
@@ -2387,5 +2388,32 @@ public void testBug521221_001() throws Exception {
deleteProject("JavaSearchBugs9");
}
}
+public void testBug522455_001() throws CoreException {
+ this.workingCopies = new ICompilationUnit[2];
+ this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/pack/MyAnnot.java",
+ "package pack;\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "@Target({ElementType.MODULE})\n" +
+ "@interface MyAnnot {}\n"
+ );
+ this.workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/module-info.java",
+ "import pack.*;\n" +
+ "@MyAnnot\n" +
+ "module mod.one {}");
+
+ SearchPattern pattern = SearchPattern.createPattern(
+ "MyAnnot",
+ ANNOTATION_TYPE,
+ REFERENCES,
+ EXACT_RULE);
+ new SearchEngine(this.workingCopies).search(pattern,
+ new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
+ getJavaSearchWorkingCopiesScope(),
+ this.resultCollector,
+ null);
+ assertSearchResults("src/module-info.java mod.one [MyAnnot] EXACT_MATCH");
+}
+
// Add more tests here
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
index 65ffee313..1070abe3a 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
@@ -5916,6 +5916,105 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
}
+ public void testBug522670() throws Exception {
+ if (!isJRE9) return;
+ Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
+ try {
+ Hashtable<String, String> newOptions=new Hashtable<>(javaCoreOptions);
+ newOptions.put(CompilerOptions.OPTION_Store_Annotations, JavaCore.ENABLED);
+ JavaCore.setOptions(newOptions);
+ IJavaProject p1 = setupModuleProject("util",
+ new String[] {
+ "src/module-info.java",
+ "module util {\n" +
+ " exports my.util;\n" +
+ "}\n" +
+ "",
+ "src/my/util/Data.java",
+ "package my.util;\n" +
+ "public class Data {\n" +
+ "}\n" +
+ "",
+ "src/my/util/AnnotatedInModule.java",
+ "package my.util;\n" +
+ "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@interface Y {\n" +
+ "}\n" +
+ "public abstract class AnnotatedInModule {\n" +
+ " abstract public @Y Data getTime();\n" +
+ "}\n" +
+ "",
+ });
+ IJavaProject p2 = setupModuleProject("util2",
+ new String[] {
+ "src/module-info.java",
+ "module util2 {\n" +
+ " exports my.util.nested;\n" +
+ "}\n" +
+ "",
+ "src/my/util/nested/Unrelated.java",
+ "package my.util.nested;\n" +
+ "class Unrelated {\n" +
+ "}\n" +
+ "",
+ });
+ String[] sources3 = {
+ "src/a/other/AnnotatedInOtherNonModule.java",
+ "package a.other;\n" +
+ "import static java.lang.annotation.ElementType.TYPE_USE;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import my.util.Data;\n" +
+ "@Target(TYPE_USE)\n" +
+ "@interface X {\n" +
+ "}\n" +
+ "public class AnnotatedInOtherNonModule {\n" +
+ " @X\n" +
+ " Data generationDate;\n" +
+ "}\n" +
+ "",
+ };
+ IClasspathAttribute[] attr = { JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true") };
+ // modulepath
+ IClasspathEntry[] deps3 = { JavaCore.newProjectEntry(p1.getPath(), null, false, attr, false) };
+ IJavaProject p3 = setupModuleProject("other", sources3, deps3);
+
+ String[] sources4 = {
+ "src/test/Test.java",
+ "package test;\n" +
+ "\n" +
+ "import a.other.AnnotatedInOtherNonModule;\n" +
+ "import my.util.AnnotatedInModule;\n" +
+ "import my.util.Data;\n" +
+ "\n" +
+ "public class Test extends AnnotatedInOtherNonModule {\n" +
+ " public Data f(AnnotatedInModule calendar) {\n" +
+ " return calendar.getTime();\n" +
+ " }\n" +
+ "}\n" +
+ "",
+ };
+ IClasspathEntry[] deps4 = { //
+ // modulepath (with split package my.util)
+ JavaCore.newProjectEntry(p1.getPath(), null, false, attr, false), //
+ JavaCore.newProjectEntry(p2.getPath(), null, false, attr, false), //
+ // classpath
+ JavaCore.newProjectEntry(p3.getPath()) //
+ };
+ IJavaProject p4 = setupModuleProject("test", sources4, deps4);
+ p4.getProject().getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+
+ assertNoErrors();
+ } finally {
+ JavaCore.setOptions(javaCoreOptions);
+ deleteProject("util");
+ deleteProject("util2");
+ deleteProject("other");
+ deleteProject("test");
+ }
+ }
+
public void testBug525522() throws Exception {
if (!isJRE9) return;
String save = System.getProperty("modules.to.load");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleOptionsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleOptionsTests.java
new file mode 100644
index 000000000..543dcc7a6
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleOptionsTests.java
@@ -0,0 +1,706 @@
+/*******************************************************************************
+ * Copyright (c) 2018 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jdt.core.tests.model;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.tests.util.Util;
+import org.eclipse.jdt.internal.compiler.util.JRTUtil;
+import org.eclipse.jdt.internal.core.ClasspathAttribute;
+import org.eclipse.jdt.internal.core.builder.ClasspathJrt;
+
+import junit.framework.Test;
+
+public class ModuleOptionsTests extends ModifyingResourceTests {
+
+ public ModuleOptionsTests(String name) {
+ super(name);
+ }
+
+ static {
+// TESTS_NAMES = new String[] { "testAddReads" };
+ }
+
+ private String savedModulesOption = null;
+ public static Test suite() {
+ return buildModelTestSuite(ModuleOptionsTests.class, BYTECODE_DECLARATION_ORDER);
+ }
+ public void setUpSuite() throws Exception {
+ super.setUpSuite();
+ this.savedModulesOption = System.getProperty("modules.to.load", "");
+ System.setProperty("modules.to.load", "");
+ JRTUtil.reset();
+ ClasspathJrt.resetCaches();
+ }
+ public void tearDownSuite() throws Exception {
+ System.setProperty("modules.to.load", this.savedModulesOption);
+ super.tearDownSuite();
+ }
+ // testing auto rebuild after change of limit-modules
+ public void testLimitModules3() throws CoreException, IOException {
+ if (!isJRE9) return;
+ try {
+ IClasspathAttribute[] attributes = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.LIMIT_MODULES, "java.se") // test transitive closure
+ };
+ IJavaProject project = createJava9ProjectWithJREAttributes("org.astro", new String[]{"src", "src2"}, attributes);
+
+ String[] sources = {
+ "src/module-info.java",
+ "module org.astro {\n" +
+ " requires java.base;\n" +
+ " requires java.desktop;\n" +
+ " requires java.datatransfer;\n" +
+ " requires java.sql;\n" +
+ "}\n",
+ "src/org/astro/Test2.java",
+ "package org.astro;\n" +
+ "class Test2 {\n" +
+ " java.awt.Window window;\n" +
+ "}\n",
+ "src2/org/astro/Test3.java",
+ "package org.astro;\n" +
+ "class Test3 {\n" +
+ " java.awt.datatransfer.Clipboard clippy;\n" +
+ "}\n"
+ };
+ createSourceFiles(project, sources);
+
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "",
+ markers);
+
+ IClasspathAttribute[] newLimits = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.LIMIT_MODULES, "java.base,java.sql") // no more awt etc
+ };
+ setJRECPAttributes(project, newLimits);
+
+ getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
+
+ markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ Arrays.sort(markers, (a,b) -> a.getAttribute(IMarker.CHAR_START, 0) - b.getAttribute(IMarker.CHAR_START, 0));
+ assertMarkers("Unexpected markers",
+ "java.awt cannot be resolved to a type\n" +
+ "java.awt cannot be resolved to a type\n" +
+ "java.desktop cannot be resolved to a module\n" +
+ "java.datatransfer cannot be resolved to a module",
+ markers);
+ } finally {
+ this.deleteProject("org.astro");
+ }
+ }
+ public void testAddExports() throws CoreException, IOException {
+ if (!isJRE9) return;
+ try {
+ String[] sources = {
+ "src/module-info.java",
+ "module org.astro {\n" +
+ " requires java.base;\n" +
+ " requires java.desktop;\n" +
+ " requires java.datatransfer;\n" +
+ " requires java.sql;\n" +
+ "}\n",
+ "src/org/astro/Test2.java",
+ "package org.astro;\n" +
+ "public class Test2 {\n" +
+ " java.awt.Window window;\n" +
+ "}\n",
+ "src2/org/astro/Test3.java",
+ "package org.astro;\n" +
+ "class Test3 {\n" +
+ " java.awt.datatransfer.Clipboard clippy;\n" +
+ "}\n"
+ };
+ IJavaProject project = setupModuleProject("org.astro", new String[] {"src", "src2"}, sources, null);
+
+ sources = new String[] {
+ "src/module-info.java",
+ "module test {\n" +
+ " requires org.astro;\n" +
+ "}\n",
+ "src/test/Test.java",
+ "package test;\n" +
+ "class Test {\n" +
+ " org.astro.Test2 t;\n" +
+ "}\n"
+ };
+ IClasspathAttribute[] attributes = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_EXPORTS, "org.astro/org.astro=test")
+ };
+ IClasspathEntry cp = JavaCore.newProjectEntry(project.getPath(), null, false, attributes, false);
+ IJavaProject p2 = setupModuleProject("test", sources, new IClasspathEntry[] {cp});
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "",
+ markers);
+
+ IClasspathAttribute[] newAttrs = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true")
+ };
+ setCPAttributes(p2, newAttrs, cp);
+
+ getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
+
+ markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "The type org.astro.Test2 is not accessible",
+ markers);
+ } finally {
+ this.deleteProject("org.astro");
+ this.deleteProject("test");
+ }
+ }
+
+ public void testAddExports_JRE() throws CoreException, IOException {
+ if (!isJRE9) return;
+ try {
+ String[] sources = {
+ "src/module-info.java",
+ "module org.astro {\n" +
+ " requires java.base;\n" +
+ " requires java.desktop;\n" +
+ " requires java.datatransfer;\n" +
+ " requires java.sql;\n" +
+ "}\n",
+ "src/org/astro/Test2.java",
+ "package org.astro;\n" +
+ "public class Test2 {\n" +
+ " int test(jdk.internal.misc.Unsafe unsafe) {\n" +
+ " return unsafe.addressSize();\n" +
+ " }" +
+ "}\n",
+ };
+ IClasspathAttribute[] attrs = new IClasspathAttribute[] {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_EXPORTS, "java.base/jdk.internal.misc=org.astro")
+ };
+ IJavaProject project = createJava9ProjectWithJREAttributes("org.astro", new String[] {"src"}, attrs);
+ createSourceFiles(project, sources);
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "",
+ markers);
+
+ IClasspathAttribute[] newAttrs = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true")
+ };
+ setJRECPAttributes(project, newAttrs);
+
+ getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
+
+ markers = project.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "The type jdk.internal.misc.Unsafe is not accessible",
+ markers);
+ } finally {
+ this.deleteProject("org.astro");
+ }
+ }
+ public void testAddExports_multi() throws CoreException, IOException {
+ if (!isJRE9) return;
+ try {
+ String[] sources = {
+ "src/module-info.java",
+ "module org.astro {\n" +
+ " requires java.base;\n" +
+ " requires java.desktop;\n" +
+ " requires java.datatransfer;\n" +
+ " requires java.sql;\n" +
+ "}\n",
+ "src/org/astro/Test2.java",
+ "package org.astro;\n" +
+ "public class Test2 {\n" +
+ " java.awt.Window window;\n" +
+ "}\n",
+ "src2/org/astro/sub/Test3.java",
+ "package org.astro.sub;\n" +
+ "public class Test3 {\n" +
+ " java.awt.datatransfer.Clipboard clippy;\n" +
+ "}\n"
+ };
+ IJavaProject project = setupModuleProject("org.astro", new String[] {"src", "src2"}, sources, null);
+
+ sources = new String[] {
+ "src/module-info.java",
+ "module test {\n" +
+ " requires org.astro;\n" +
+ "}\n",
+ "src/test/Test.java",
+ "package test;\n" +
+ "class Test {\n" +
+ " org.astro.Test2 t;\n" +
+ " org.astro.sub.Test3 t3;\n" +
+ "}\n"
+ };
+ IClasspathAttribute[] attributes = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_EXPORTS, "org.astro/org.astro=test")
+ };
+ IClasspathEntry cp = JavaCore.newProjectEntry(project.getPath(), null, false, attributes, false);
+ IJavaProject p2 = setupModuleProject("test", sources, new IClasspathEntry[] {cp});
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "The type org.astro.sub.Test3 is not accessible",
+ markers);
+
+ IClasspathAttribute[] newAttrs = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_EXPORTS, "org.astro/org.astro=test:org.astro/org.astro.sub=test")
+ };
+ setCPAttributes(p2, newAttrs, cp);
+
+ getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
+
+ markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "",
+ markers);
+ } finally {
+ this.deleteProject("org.astro");
+ this.deleteProject("test");
+ }
+ }
+ public void testAddExports_classFolder() throws CoreException, IOException {
+ if (!isJRE9) return;
+ try {
+ String[] sources = {
+ "src/module-info.java",
+ "module org.astro {\n" +
+ " requires java.base;\n" +
+ " requires java.desktop;\n" +
+ " requires java.datatransfer;\n" +
+ " requires java.sql;\n" +
+ "}\n",
+ "src/org/astro/Test2.java",
+ "package org.astro;\n" +
+ "public class Test2 {\n" +
+ " java.awt.Window window;\n" +
+ "}\n",
+ "src2/org/astro/sub/Test3.java",
+ "package org.astro.sub;\n" +
+ "public class Test3 {\n" +
+ " java.awt.datatransfer.Clipboard clippy;\n" +
+ "}\n"
+ };
+ IJavaProject project = setupModuleProject("org.astro", new String[] {"src", "src2"}, sources, null);
+
+ sources = new String[] {
+ "src/module-info.java",
+ "module test {\n" +
+ " requires org.astro;\n" +
+ "}\n",
+ "src/test/Test.java",
+ "package test;\n" +
+ "class Test {\n" +
+ " org.astro.Test2 t;\n" +
+ " org.astro.sub.Test3 t3;\n" +
+ "}\n"
+ };
+ IClasspathAttribute[] attributes = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_EXPORTS, "org.astro/org.astro=test")
+ };
+ IClasspathEntry cp = JavaCore.newLibraryEntry(project.getProject().findMember("bin").getFullPath(), null,
+ null, null, attributes, false);
+ IJavaProject p2 = setupModuleProject("test", sources, new IClasspathEntry[] {cp});
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "The type org.astro.sub.Test3 is not accessible",
+ markers);
+
+ IClasspathAttribute[] newAttrs = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_EXPORTS, "org.astro/org.astro=test:org.astro/org.astro.sub=test")
+ };
+ setCPAttributes(p2, newAttrs, cp);
+
+ getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
+
+ markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "",
+ markers);
+ } finally {
+ this.deleteProject("org.astro");
+ this.deleteProject("test");
+ }
+ }
+ public void testAddReads() throws CoreException, IOException {
+ if (!isJRE9) return;
+ String libPath = "externalLib/mod.one.jar";
+ try {
+ String[] sources = new String[] {
+ "src/module-info.java",
+ "module org.astro {\n" +
+ " exports org.astro;\n" +
+ "}",
+ "src/org/astro/World.java",
+ "package org.astro;\n" +
+ "public interface World {\n" +
+ " public String name();\n" +
+ "}"
+ };
+ IJavaProject p = setupModuleProject("org.astro", sources);
+
+ String[] src1 = new String[] {
+ "src/module-info.java",
+ "module mod.one {\n" +
+ " exports one.p;\n" +
+ "}\n",
+ "src/org/astro/World.java",
+ "package org.astro;\n" +
+ "public interface World { public String name(); }\n",
+ "src/one/p/C.java",
+ "package one.p;\n" +
+ "public class C implements org.astro.World {\n" +
+ " public String name() {\n" +
+ " return \"C\";\n" +
+ " }\n" +
+ "}\n"
+ };
+ IJavaProject p1 = setupModuleProject("mod.one", src1);
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ // jar-up without the required class, should be supplied by the other module
+ deleteFile("/mod.one/src/org/astro/World.java");
+ deleteFile("/mod.one/bin/org/astro/World.class");
+ File rootDir = new File(p1.getProject().findMember("bin").getLocation().toString());
+ Util.zip(rootDir, getExternalResourcePath(libPath));
+
+ String[] src2 = new String[] {
+ "src/module-info.java",
+ "module com.greetings {\n" +
+ " requires mod.one;\n" +
+ "}",
+ "src/com/greetings/MyTest.java",
+ "package com.greetings;\n" +
+ "public class MyTest extends one.p.C {}"
+ };
+ IClasspathEntry dep1 = JavaCore.newProjectEntry(p.getPath(), null, false,
+ new IClasspathAttribute[] {new ClasspathAttribute("module", "true")},
+ false/*not exported*/);
+ IClasspathEntry dep2 = JavaCore.newLibraryEntry(new Path(getExternalResourcePath(libPath)), null, null, null,
+ new IClasspathAttribute[] {
+ new ClasspathAttribute("module", "true"),
+ new ClasspathAttribute(IClasspathAttribute.ADD_READS, "mod.one=org.astro")
+ },
+ false/*not exported*/);
+ IJavaProject p2 = setupModuleProject("com.greetings", src2, new IClasspathEntry[] { dep1, dep2 });
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers", "", markers);
+ IClasspathAttribute[] attrs = new IClasspathAttribute[] {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true")
+ };
+ setCPAttributes(p2, attrs, dep2);
+ getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
+ markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "The project was not built since its build path is incomplete. Cannot find the class file for org.astro.World. Fix the build path then try building this project\n" +
+ "The type org.astro.World cannot be resolved. It is indirectly referenced from required .class files",
+ markers);
+ } finally {
+ deleteExternalResource(libPath);
+ deleteProject("mod.one");
+ deleteProject("org.astro");
+ deleteProject("com.greetings");
+ }
+ }
+ public void testAddReads2() throws CoreException, IOException {
+ if (!isJRE9) return;
+ String libPath = "externalLib/mod.one.jar";
+ try {
+ String[] sources = new String[] {
+ "src/module-info.java",
+ "module org.astro {\n" +
+ " exports org.astro;\n" +
+ "}",
+ "src/org/astro/World.java",
+ "package org.astro;\n" +
+ "public interface World {\n" +
+ " public String name();\n" +
+ "}"
+ };
+ IJavaProject p = setupModuleProject("org.astro", sources);
+
+ String[] src1 = new String[] {
+ "src/module-info.java",
+ "module mod.one {\n" +
+ " exports one.p;\n" +
+ "}\n",
+ "src/org/astro/World.java",
+ "package org.astro;\n" +
+ "public interface World { public String name(); }\n",
+ "src/one/p/C.java",
+ "package one.p;\n" +
+ "public class C implements org.astro.World {\n" +
+ " public String name() {\n" +
+ " return \"C\";\n" +
+ " }\n" +
+ "}\n"
+ };
+ IJavaProject p1 = setupModuleProject("mod.one", src1);
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ // jar-up without the required class, should be supplied by the other module
+ deleteFile("/mod.one/src/org/astro/World.java");
+ deleteFile("/mod.one/bin/org/astro/World.class");
+ File rootDir = new File(p1.getProject().findMember("bin").getLocation().toString());
+ Util.zip(rootDir, getExternalResourcePath(libPath));
+
+ String[] src2 = new String[] {
+ "src/module-info.java",
+ "module com.greetings {\n" +
+ " requires mod.one;\n" +
+ "}",
+ "src/com/greetings/MyTest.java",
+ "package com.greetings;\n" +
+ "public class MyTest extends one.p.C {}"
+ };
+ IClasspathEntry dep1 = JavaCore.newProjectEntry(p.getPath(), null, false,
+ new IClasspathAttribute[] {new ClasspathAttribute("module", "true")},
+ false/*not exported*/);
+ IClasspathEntry dep2 = JavaCore.newLibraryEntry(new Path(getExternalResourcePath(libPath)), null, null, null,
+ new IClasspathAttribute[] {
+ new ClasspathAttribute("module", "true"),
+ },
+ false/*not exported*/);
+ IJavaProject p2 = setupModuleProject("com.greetings", src2, new IClasspathEntry[] { dep1, dep2 });
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "The project was not built since its build path is incomplete. Cannot find the class file for org.astro.World. Fix the build path then try building this project\n" +
+ "The type org.astro.World cannot be resolved. It is indirectly referenced from required .class files",
+ markers);
+ IClasspathAttribute[] attrs = new IClasspathAttribute[] {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_READS, "mod.one=org.astro")
+ };
+ setCPAttributes(p2, attrs, dep2);
+ getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
+ markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers", "", markers);
+ } finally {
+ deleteExternalResource(libPath);
+ deleteProject("mod.one");
+ deleteProject("org.astro");
+ deleteProject("com.greetings");
+ }
+ }
+ public void _testPatchModule() throws CoreException, IOException {
+ if (!isJRE9) return;
+ try {
+ String[] sources = {
+ "src/module-info.java",
+ "module org.astro {\n" +
+ " requires java.base;\n" +
+ " requires java.desktop;\n" +
+ " requires java.datatransfer;\n" +
+ " requires java.sql;\n" +
+ " exports org.astro;\n" +
+ "}\n",
+ "src/org/astro/Test2.java",
+ "package org.astro;\n" +
+ "public class Test2 {\n" +
+ " java.awt.Window window;\n" +
+ "}\n"
+ };
+ IJavaProject project = setupModuleProject("org.astro", sources);
+
+ sources = new String[] {
+ "src/code/Code.java",
+ "package code;\n" +
+ "class Code {\n" +
+ "}\n",
+ "src2/org/astro/Galaxy.java",
+ "package org.astro;\n" +
+ "public class Galaxy { }\n"
+ };
+ IClasspathAttribute[] attributes = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ };
+ IClasspathEntry cp = JavaCore.newProjectEntry(project.getPath(), null, false, attributes, false);
+ IJavaProject p2 = setupModuleProject("patch", new String[] {"src", "src2"}, sources, null);
+ attributes = new IClasspathAttribute[] {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.PATCH_MODULE, "org.astro")
+ };
+ IClasspathEntry cp2 = JavaCore.newProjectEntry(p2.getPath(), null, false, attributes, false);
+ sources = new String[] {
+ "src/module-info.java",
+ "module test {\n" +
+ " requires org.astro;\n" +
+ "}\n",
+ "src/test/Test.java",
+ "package test;\n" +
+ "class Test {\n" +
+ " org.astro.World w = null;\n" +
+ " org.astro.Galaxy g = null;\n" +
+ "}\n",
+ };
+ IJavaProject p3 = setupModuleProject("test", sources, new IClasspathEntry[] {cp, cp2});
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = p3.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "",
+ markers);
+ } finally {
+ this.deleteProject("org.astro");
+ this.deleteProject("patch");
+ this.deleteProject("test");
+ }
+
+ }
+ public void testPatchModule() throws CoreException, IOException {
+ if (!isJRE9) return;
+ try {
+ IClasspathAttribute[] attributes = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true")
+ };
+ IJavaProject patchProject = createJava9ProjectWithJREAttributes("org.astro.patch", new String[]{"src", "src2"}, attributes);
+
+ String[] patchSources = {
+ "src/org/astro/Test2.java",
+ "package org.astro;\n" +
+ "class Test2 {\n" +
+ " int test(jdk.internal.misc.Unsafe unsafe) {\n" +
+ " return unsafe.addressSize();\n" +
+ " }\n" +
+ "}\n",
+ "src2/jdk/internal/misc/Test3.java",
+ "package jdk.internal.misc;\n" +
+ "class Test3 {\n" +
+ " Signal.NativeHandler handler;\n" + // package access
+ "}\n"
+ };
+ createSourceFiles(patchProject, patchSources);
+
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = patchProject.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "The type jdk.internal.misc.Unsafe is not accessible\n" +
+ "Signal cannot be resolved to a type",
+ markers);
+
+ attributes = new IClasspathAttribute[] {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.PATCH_MODULE, "java.base")
+ };
+ setJRECPAttributes(patchProject, attributes);
+
+ getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
+
+ markers = patchProject.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "",
+ markers);
+ } finally {
+ this.deleteProject("org.astro.patch");
+ }
+ }
+ public void testPatchModule2() throws CoreException, IOException {
+ if (!isJRE9) return;
+ try {
+ IClasspathAttribute[] attributes = {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ JavaCore.newClasspathAttribute(IClasspathAttribute.PATCH_MODULE, "java.base")
+ };
+ IJavaProject patchProject = createJava9ProjectWithJREAttributes("org.astro.patch", new String[]{"src", "src2"}, attributes);
+
+ String[] patchSources = {
+ "src/org/astro/Test2.java",
+ "package org.astro;\n" +
+ "class Test2 {\n" +
+ " int test(jdk.internal.misc.Unsafe unsafe) {\n" +
+ " return unsafe.addressSize();\n" +
+ " }\n" +
+ "}\n",
+ "src2/jdk/internal/misc/Test3.java",
+ "package jdk.internal.misc;\n" +
+ "class Test3 {\n" +
+ " Signal.NativeHandler handler;\n" + // package access
+ "}\n"
+ };
+ createSourceFiles(patchProject, patchSources);
+
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+
+ attributes = new IClasspathAttribute[] {
+ JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true"),
+ };
+ setJRECPAttributes(patchProject, attributes);
+
+ getWorkspace().build(IncrementalProjectBuilder.AUTO_BUILD, null);
+
+ IMarker[] markers = patchProject.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("Unexpected markers",
+ "The type jdk.internal.misc.Unsafe is not accessible\n" +
+ "Signal cannot be resolved to a type",
+ markers);
+ } finally {
+ this.deleteProject("org.astro.patch");
+ }
+ }
+ private void setCPAttributes(IJavaProject javaProject, IClasspathAttribute[] attributes, IClasspathEntry entryToReplace) throws JavaModelException {
+ IClasspathEntry[] oldClasspath= javaProject.getRawClasspath();
+ int nEntries= oldClasspath.length;
+ IClasspathEntry[] newEntries= Arrays.copyOf(oldClasspath, nEntries);
+ for (int i = 0; i < newEntries.length; i++) {
+ if (newEntries[i].getPath().equals(entryToReplace.getPath())) {
+ switch(entryToReplace.getEntryKind()) {
+ case IClasspathEntry.CPE_PROJECT:
+ newEntries[i] = JavaCore.newProjectEntry(entryToReplace.getPath(), entryToReplace.getAccessRules(), entryToReplace.combineAccessRules(), attributes, entryToReplace.isExported());
+ break;
+ case IClasspathEntry.CPE_LIBRARY:
+ newEntries[i] = JavaCore.newLibraryEntry(entryToReplace.getPath(), newEntries[i].getSourceAttachmentPath(), null, null, attributes, false);
+ break;
+ default:
+ // not supported
+ break;
+ }
+ break;
+ }
+ }
+ javaProject.setRawClasspath(newEntries, null);
+ }
+ private void setJRECPAttributes(IJavaProject javaProject, IClasspathAttribute[] attributes) throws JavaModelException {
+ IClasspathEntry[] oldClasspath= javaProject.getRawClasspath();
+ int nEntries= oldClasspath.length;
+ IClasspathEntry[] newEntries= Arrays.copyOf(oldClasspath, nEntries);
+ for (int i = 0; i < newEntries.length; i++) {
+ if (newEntries[i].getPath().equals(getJRE9Path())) {
+ newEntries[i] = JavaCore.newLibraryEntry(getJRE9Path(), newEntries[i].getSourceAttachmentPath(), null, null, attributes, false);
+ break;
+ }
+ }
+ javaProject.setRawClasspath(newEntries, null);
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java
index f2f7628ee..09321c409 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@ import junit.framework.Test;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTNode;
@@ -2019,4 +2020,22 @@ public class ASTRewritingTypeDeclTest extends ASTRewritingTest {
assertEqualString(preview, expected);
}
+ public void testBug526097a() throws Exception {
+ IPackageFragment pack1 = this.sourceFolder.getPackageFragment(IPackageFragmentRoot.DEFAULT_PACKAGEROOT_PATH);
+ StringBuffer buf= new StringBuffer();
+ buf.append("public class T");
+ ICompilationUnit cu= pack1.createCompilationUnit("Test.java", buf.toString(), false, null);
+ CompilationUnit astRoot= createAST(getAST8(), cu, true, false);
+ List<TypeDeclaration> types = astRoot.types();
+ TypeDeclaration typeDeclaration = types.get(0);
+ SimpleName simpleName = typeDeclaration.getName();
+ AST ast= astRoot.getAST();
+ ASTRewrite rewrite= ASTRewrite.create(ast);
+ rewrite.replace(simpleName, ast.newSimpleName("Test"), null);
+ String preview= evaluateRewrite(cu, rewrite);
+ buf= new StringBuffer();
+ buf.append("public class Test");
+ assertEqualString(preview, buf.toString());
+ }
+
}
diff --git a/org.eclipse.jdt.core/.settings/.api_filters b/org.eclipse.jdt.core/.settings/.api_filters
index 2a97fecb6..affb36e82 100644
--- a/org.eclipse.jdt.core/.settings/.api_filters
+++ b/org.eclipse.jdt.core/.settings/.api_filters
@@ -13,6 +13,12 @@
<message_argument value="3.13.0"/>
</message_arguments>
</filter>
+ <filter comment="new API was backported" id="924844039">
+ <message_arguments>
+ <message_argument value="3.13.101"/>
+ <message_argument value="3.13.100"/>
+ </message_arguments>
+ </filter>
<filter id="924844039">
<message_arguments>
<message_argument value="3.13.50"/>
diff --git a/org.eclipse.jdt.core/META-INF/MANIFEST.MF b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
index 386a0c268..35aff84a7 100644
--- a/org.eclipse.jdt.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.core; singleton:=true
-Bundle-Version: 3.13.100.v_OTDT_r261_qualifier
+Bundle-Version: 3.13.101.v_OTDT_r261_qualifier
Bundle-Activator: org.eclipse.jdt.core.JavaCore
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
index 1fb56216e..5f948cdae 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -747,7 +747,7 @@ public final class CompletionEngine
private INameEnvironment noCacheNameEnvironment;
char[] source;
ModuleDeclaration moduleDeclaration;
- boolean isPackageVisibilityCompletion = false;
+ boolean skipDefaultPackage = false;
char[] completionToken;
char[] qualifiedCompletionToken;
@@ -1367,7 +1367,7 @@ public final class CompletionEngine
if (!isValidPackageName(packageName)) return;
- if (this.isPackageVisibilityCompletion &&
+ if (this.skipDefaultPackage &&
CharOperation.equals(packageName, CharOperation.NO_CHAR))
return;
@@ -2107,7 +2107,7 @@ public final class CompletionEngine
buildContext(parsedUnit.moduleDeclaration, null, parsedUnit, null, null);
//this.requestor.setIgnored(CompletionProposal.MODULE_DECLARATION, false); //TODO: Hack until ui fixes this issue.
if(!this.requestor.isIgnored(CompletionProposal.MODULE_DECLARATION)) {
- findModuleName(parsedUnit);
+ proposeModuleName(parsedUnit);
}
debugPrintf();
return;
@@ -2169,6 +2169,7 @@ public final class CompletionEngine
TypeReference implementation = implementations[j];
if (implementation instanceof CompletionOnProvidesImplementationsSingleTypeReference ||
implementation instanceof CompletionOnProvidesImplementationsQualifiedTypeReference) {
+ this.skipDefaultPackage = true;
contextAccepted = checkForCNF(implementation, parsedUnit, false);
return;
} else if (implementation instanceof CompletionOnKeyword) {
@@ -2200,6 +2201,8 @@ public final class CompletionEngine
e.scope,
e.insideTypeAnnotation);
}
+ } finally {
+ this.skipDefaultPackage = false;
}
}
// scan the package & import statements first
@@ -2417,6 +2420,8 @@ public final class CompletionEngine
this.lookupEnvironment.buildTypeBindings(parsedUnit, null);
this.lookupEnvironment.completeTypeBindings(parsedUnit, true);
parsedUnit.resolve();
+ this.startPosition = ref.sourceStart;
+ this.endPosition = ref.sourceEnd > ref.sourceStart ? ref.sourceEnd : ref.sourceStart;
if ((this.unitScope = parsedUnit.scope) != null) {
if (showAll) {
char[][] tokens = ref.getTypeName();
@@ -2439,7 +2444,7 @@ public final class CompletionEngine
private boolean completeOnPackageVisibilityStatements(boolean contextAccepted,
CompilationUnitDeclaration parsedUnit, PackageVisibilityStatement[] pvsStmts) {
try {
- this.isPackageVisibilityCompletion = true;
+ this.skipDefaultPackage = true;
for (int i = 0, l = pvsStmts.length; i < l; ++i) {
PackageVisibilityStatement pvs = pvsStmts[i];
if (pvs instanceof CompletionOnKeywordModuleInfo) { // dummy pvs statement
@@ -2480,7 +2485,7 @@ public final class CompletionEngine
}
}
} finally {
- this.isPackageVisibilityCompletion = false;
+ this.skipDefaultPackage = false;
}
return contextAccepted;
}
@@ -11438,20 +11443,23 @@ public final class CompletionEngine
createOverrideRoleProposal(superTeam, superRoleName, roleTypeSignature, superRole.getFlags());
}
// SH}
- private void findModuleName(CompilationUnitDeclaration parsedUnit) {
- char[] fileName1 = parsedUnit.getFileName();
- if (fileName1 == null || !CharOperation.endsWith(fileName1, MODULE_INFO_FILE_NAME)) return;
- int lastFileSeparatorIndex = fileName1.length - (MODULE_INFO_FILE_NAME.length + 1);
- if (lastFileSeparatorIndex <= 0) return;
- int prevFileSeparatorIndex = CharOperation.lastIndexOf(fileName1[lastFileSeparatorIndex], fileName1, 0, lastFileSeparatorIndex - 1);
- prevFileSeparatorIndex = prevFileSeparatorIndex < 0 ? 0 : prevFileSeparatorIndex + 1;
- char[] moduleName = CharOperation.subarray(fileName1, prevFileSeparatorIndex, lastFileSeparatorIndex);
- if (moduleName == null || moduleName.length == 0) return;
+
+ private void proposeModuleName(CompilationUnitDeclaration parsedUnit) {
+ String projectName = this.javaProject.getElementName();
+ char[] moduleName = projectName.toCharArray();
+ if (moduleName.length > 0) {// do not propose invalid names
+ if (!Character.isJavaIdentifierStart(moduleName[0])) return;
+ for (char c : moduleName) {
+ if (!Character.isJavaIdentifierPart(c) && c != '.') return;
+ }
+ }
this.completionToken = CharOperation.concatWith(this.moduleDeclaration.tokens, '.');
+ setSourceRange(this.moduleDeclaration.sourceStart, this.moduleDeclaration.bodyStart);
if (this.completionToken.length > 0 && !CharOperation.prefixEquals(this.completionToken, moduleName)) return;
InternalCompletionProposal proposal = createProposal(CompletionProposal.MODULE_DECLARATION, this.actualCompletionPosition);
proposal.setName(moduleName);
+ proposal.setDeclarationSignature(moduleName);
proposal.setCompletion(moduleName);
proposal.setReplaceRange((this.startPosition < 0) ? 0 : this.startPosition - this.offset, this.endPosition - this.offset);
proposal.setTokenRange((this.tokenStart < 0) ? 0 : this.tokenStart - this.offset, this.tokenEnd - this.offset);
@@ -13794,6 +13802,12 @@ public final class CompletionEngine
case CompletionProposal.METHOD_REF_WITH_CASTED_RECEIVER :
buffer.append("METHOD_REF_WITH_CASTED_RECEIVER"); //$NON-NLS-1$
break;
+ case CompletionProposal.MODULE_DECLARATION :
+ buffer.append("MODULE_DECLARATION"); //$NON-NLS-1$
+ break;
+ case CompletionProposal.MODULE_REF :
+ buffer.append("MODULE_REF"); //$NON-NLS-1$
+ break;
case CompletionProposal.PACKAGE_REF :
buffer.append("PACKAGE_REF"); //$NON-NLS-1$
break;
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java
index 23e59c60a..6973ab39d 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2016 IBM Corporation and others.
+ * Copyright (c) 2004, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1787,6 +1787,12 @@ public class InternalCompletionProposal extends CompletionProposal {
buffer.append("<CONSTRUCTOR>"); //$NON-NLS-1$
}
break;
+ case CompletionProposal.MODULE_DECLARATION :
+ buffer.append("MODULE_DECLARATION"); //$NON-NLS-1$
+ break;
+ case CompletionProposal.MODULE_REF :
+ buffer.append("MODULE_REF"); //$NON-NLS-1$
+ break;
case CompletionProposal.PACKAGE_REF :
buffer.append("PACKAGE_REF"); //$NON-NLS-1$
break;
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 572b4bbbe..d497b3437 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1940,6 +1940,7 @@ void setSourceStart(int sourceStart);
/** @since 3.14 */
int DuplicateResource = Internal + 1251;
+ // terminally
/** @since 3.14 */
int UsingTerminallyDeprecatedType = TypeRelated + 1400;
/** @since 3.14 */
@@ -1950,7 +1951,30 @@ void setSourceStart(int sourceStart);
int UsingTerminallyDeprecatedField = FieldRelated + 1403;
/** @since 3.14 */
int OverridingTerminallyDeprecatedMethod = MethodRelated + 1404;
+ // with since
+ /** @since 3.13 */
+ int UsingDeprecatedSinceVersionType = TypeRelated + 1405;
+ /** @since 3.13 */
+ int UsingDeprecatedSinceVersionMethod = MethodRelated + 1406;
+ /** @since 3.13 */
+ int UsingDeprecatedSinceVersionConstructor = MethodRelated + 1407;
+ /** @since 3.13 */
+ int UsingDeprecatedSinceVersionField = FieldRelated + 1408;
+ /** @since 3.13 */
+ int OverridingDeprecatedSinceVersionMethod = MethodRelated + 1409;
+ // terminally with since
+ /** @since 3.13 */
+ int UsingTerminallyDeprecatedSinceVersionType = TypeRelated + 1410;
+ /** @since 3.13 */
+ int UsingTerminallyDeprecatedSinceVersionMethod = MethodRelated + 1411;
+ /** @since 3.13 */
+ int UsingTerminallyDeprecatedSinceVersionConstructor = MethodRelated + 1412;
+ /** @since 3.13 */
+ int UsingTerminallyDeprecatedSinceVersionField = FieldRelated + 1413;
+ /** @since 3.13 */
+ int OverridingTerminallyDeprecatedSinceVersionMethod = MethodRelated + 1414;
+
/** @since 3.14 */
int NotAccessibleType = TypeRelated + 1450;
/** @since 3.14 */
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
index 0b3d47dec..678d325df 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
@@ -793,7 +793,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
type.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
if (length > 0) {
annotations = new AnnotationBinding[length];
- type.setAnnotations(annotations);
+ type.setAnnotations(annotations, false);
}
break;
case Binding.METHOD :
@@ -802,7 +802,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
method.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
if (length > 0) {
annotations = new AnnotationBinding[length];
- method.setAnnotations(annotations);
+ method.setAnnotations(annotations, false);
}
break;
//{ObjectTeams: method mappings
@@ -813,7 +813,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
mapping.tagBits |= TagBits.AnnotationResolved;
if (length > 0) {
annotations = new AnnotationBinding[length];
- mapping.setAnnotations(annotations);
+ mapping.setAnnotations(annotations, false);
}
break;
// SH}
@@ -823,7 +823,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
field.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
if (length > 0) {
annotations = new AnnotationBinding[length];
- field.setAnnotations(annotations);
+ field.setAnnotations(annotations, false);
}
break;
case Binding.LOCAL :
@@ -832,7 +832,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
local.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
if (length > 0) {
annotations = new AnnotationBinding[length];
- local.setAnnotations(annotations, scope);
+ local.setAnnotations(annotations, scope, false);
}
break;
case Binding.TYPE_PARAMETER :
@@ -846,7 +846,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
module.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
if (length > 0) {
annotations = new AnnotationBinding[length];
- module.setAnnotations(annotations, scope);
+ module.setAnnotations(annotations, scope, false);
}
break;
default :
@@ -1152,7 +1152,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
}
if (newLength != length) {
System.arraycopy(recipientAnnotations, 0, recipientAnnotations = new AnnotationBinding[newLength], 0, newLength);
- recipient.setAnnotations(recipientAnnotations, scope);
+ recipient.setAnnotations(recipientAnnotations, scope, false);
}
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java
index 510472371..83014d971 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java
@@ -900,12 +900,15 @@ public abstract class Annotation extends Expression {
pairs[i].resolveTypeExpecting(scope, null); // resilient
}
}
-// if (scope.compilerOptions().storeAnnotations)
this.compilerAnnotation = scope.environment().createAnnotation((ReferenceBinding) this.resolvedType, computeElementValuePairs());
// recognize standard annotations ?
long tagBits = detectStandardAnnotation(scope, annotationType, valueAttribute);
int defaultNullness = (int)(tagBits & Binding.NullnessDefaultMASK);
tagBits &= ~Binding.NullnessDefaultMASK;
+ CompilerOptions compilerOptions = scope.compilerOptions();
+ if ((tagBits & TagBits.AnnotationDeprecated) != 0 && compilerOptions.complianceLevel >= ClassFileConstants.JDK9 && !compilerOptions.storeAnnotations) {
+ this.recipient.setAnnotations(new AnnotationBinding[] {this.compilerAnnotation}, true); // force storing enhanced deprecation
+ }
// record annotation positions in the compilation result
scope.referenceCompilationUnit().recordSuppressWarnings(IrritantSet.NLS, null, this.sourceStart, this.declarationSourceEnd, scope.referenceContext());
@@ -935,7 +938,7 @@ public abstract class Annotation extends Expression {
// SH}
start = typeDeclaration.declarationSourceStart;
}
- recordSuppressWarnings(scope, start, typeDeclaration.declarationSourceEnd, scope.compilerOptions().suppressWarnings);
+ recordSuppressWarnings(scope, start, typeDeclaration.declarationSourceEnd, compilerOptions.suppressWarnings);
}
sourceType.defaultNullness |= defaultNullness;
break;
@@ -945,7 +948,7 @@ public abstract class Annotation extends Expression {
if ((tagBits & TagBits.AnnotationSuppressWarnings) != 0) {
sourceType = (SourceTypeBinding) sourceMethod.declaringClass;
AbstractMethodDeclaration methodDeclaration = sourceType.scope.referenceContext.declarationOf(sourceMethod);
- recordSuppressWarnings(scope, methodDeclaration.declarationSourceStart, methodDeclaration.declarationSourceEnd, scope.compilerOptions().suppressWarnings);
+ recordSuppressWarnings(scope, methodDeclaration.declarationSourceStart, methodDeclaration.declarationSourceEnd, compilerOptions.suppressWarnings);
}
long nullBits = sourceMethod.tagBits & TagBits.AnnotationNullMASK;
if (nullBits == TagBits.AnnotationNullMASK) {
@@ -953,7 +956,7 @@ public abstract class Annotation extends Expression {
sourceMethod.tagBits &= ~TagBits.AnnotationNullMASK; // avoid secondary problems
}
if (nullBits != 0 && sourceMethod.isConstructor()) {
- if (scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8)
+ if (compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8)
scope.problemReporter().nullAnnotationUnsupportedLocation(this);
// for declaration annotations the inapplicability will be reported below
sourceMethod.tagBits &= ~TagBits.AnnotationNullMASK;
@@ -977,7 +980,7 @@ public abstract class Annotation extends Expression {
if ((tagBits & TagBits.AnnotationSuppressWarnings) != 0) {
sourceType = (SourceTypeBinding) sourceField.declaringClass;
FieldDeclaration fieldDeclaration = sourceType.scope.referenceContext.declarationOf(sourceField);
- recordSuppressWarnings(scope, fieldDeclaration.declarationSourceStart, fieldDeclaration.declarationSourceEnd, scope.compilerOptions().suppressWarnings);
+ recordSuppressWarnings(scope, fieldDeclaration.declarationSourceStart, fieldDeclaration.declarationSourceEnd, compilerOptions.suppressWarnings);
}
if (defaultNullness != 0) {
sourceType = (SourceTypeBinding) sourceField.declaringClass;
@@ -1004,7 +1007,7 @@ public abstract class Annotation extends Expression {
}
if ((tagBits & TagBits.AnnotationSuppressWarnings) != 0) {
LocalDeclaration localDeclaration = variable.declaration;
- recordSuppressWarnings(scope, localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd, scope.compilerOptions().suppressWarnings);
+ recordSuppressWarnings(scope, localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd, compilerOptions.suppressWarnings);
}
// note: defaultNullness for local declarations has been already been handled earlier by handleNonNullByDefault()
break;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java
index 17b00a341..ec5bf6c51 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@ package org.eclipse.jdt.internal.compiler.ast;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.ClassFile;
import org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.codegen.BranchLabel;
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
import org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
@@ -221,13 +222,14 @@ public class Clinit extends AbstractMethodDeclaration {
jumpLabel.place();
codeStream.fieldAccess(Opcodes.OPC_putstatic, this.assertionSyntheticFieldBinding, null /* default declaringClass */);
}
+ boolean isJava9 = classScope.compilerOptions().complianceLevel >= ClassFileConstants.JDK9;
// generate static fields/initializers/enum constants
final FieldDeclaration[] fieldDeclarations = declaringType.fields;
int sourcePosition = -1;
int remainingFieldCount = 0;
if (TypeDeclaration.kind(declaringType.modifiers) == TypeDeclaration.ENUM_DECL) {
int enumCount = declaringType.enumConstantsCounter;
- if (enumCount > ENUM_CONSTANTS_THRESHOLD) {
+ if (!isJava9 && enumCount > ENUM_CONSTANTS_THRESHOLD) {
// generate synthetic methods to initialize all the enum constants
int begin = -1;
int count = 0;
@@ -355,6 +357,9 @@ public class Clinit extends AbstractMethodDeclaration {
classScope.problemReporter().roleCantInitializeStaticField(ifcField);
}
// SH}
+ if (isJava9) {
+ declaringType.binding.generateSyntheticFinalFieldInitialization(codeStream);
+ }
}
if (codeStream.position == 0) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
index dec5751b4..37f229168 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
@@ -54,6 +54,7 @@ import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationPosition;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
import org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
+import org.eclipse.jdt.internal.compiler.codegen.Opcodes;
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.eclipse.jdt.internal.compiler.flow.FieldInitsFakingFlowContext;
import org.eclipse.jdt.internal.compiler.flow.FlowContext;
@@ -337,6 +338,13 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
buffer.append('(');
if (this.haveReceiver) {
this.lhs.generateCode(currentScope, codeStream, true);
+ if (isMethodReference() && !this.lhs.isThis() && !this.lhs.isSuper()) {
+ MethodBinding mb = currentScope.getJavaLangObject().getExactMethod(TypeConstants.GETCLASS,
+ Binding.NO_PARAMETERS, currentScope.compilationUnitScope());
+ codeStream.dup();
+ codeStream.invoke(Opcodes.OPC_invokevirtual, mb, mb.declaringClass);
+ codeStream.pop();
+ }
if (this.lhs.isSuper() && !this.actualMethodBinding.isPrivate()) {
if (this.lhs instanceof QualifiedSuperReference) {
QualifiedSuperReference qualifiedSuperReference = (QualifiedSuperReference) this.lhs;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
index 0d38f75c8..5b9be9923 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1290,6 +1290,22 @@ private void internalAnalyseCode(FlowContext flowContext, FlowInfo flowInfo) {
//{ObjectTeams: RoFi with incomplete method bodies don't analyze:
if (this.compilationUnit == null || this.compilationUnit.parseMethodBodies)
// SH}
+ if (this.scope.compilerOptions().complianceLevel >= ClassFileConstants.JDK9) {
+ // synthesize <clinit> if one is not present. Required to initialize
+ // synthetic final fields as modifying final fields outside of a <clinit>
+ // is disallowed in Java 9
+ if (this.methods == null || !this.methods[0].isClinit()) {
+ Clinit clinit = new Clinit(this.compilationResult);
+ clinit.declarationSourceStart = clinit.sourceStart = this.sourceStart;
+ clinit.declarationSourceEnd = clinit.sourceEnd = this.sourceEnd;
+ clinit.bodyEnd = this.sourceEnd;
+ int length = this.methods == null ? 0 : this.methods.length;
+ AbstractMethodDeclaration[] methodDeclarations = new AbstractMethodDeclaration[length + 1];
+ methodDeclarations[0] = clinit;
+ if (this.methods != null)
+ System.arraycopy(this.methods, 0, methodDeclarations, 1, length);
+ }
+ }
if (this.methods != null) {
UnconditionalFlowInfo outerInfo = flowInfo.unconditionalFieldLessCopy();
FlowInfo constructorInfo = nonStaticFieldInfo.unconditionalInits().discardNonFieldInitializations().addInitializationsFrom(outerInfo);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
index cab5512b5..f95e9b47d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
@@ -779,8 +779,8 @@ public TypeBinding resolveTypeArgument(ClassScope classScope, ReferenceBinding g
boolean pauseHierarchyCheck = false;
try {
if (ref.isHierarchyBeingConnected()) {
+ pauseHierarchyCheck = (ref.tagBits & TagBits.PauseHierarchyCheck) == 0;
ref.tagBits |= TagBits.PauseHierarchyCheck;
- pauseHierarchyCheck = true;
}
return resolveType(classScope, Binding.DefaultLocationTypeArgument);
} finally {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/AnnotationInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/AnnotationInfo.java
index 222468224..8927392c2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/AnnotationInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/AnnotationInfo.java
@@ -163,6 +163,10 @@ public IBinaryElementValuePair[] getElementValuePairs() {
public char[] getTypeName() {
return this.typename;
}
+@Override
+public boolean isDeprecatedAnnotation() {
+ return (this.standardAnnotationTagBits & (TagBits.AnnotationDeprecated | TagBits.AnnotationTerminallyDeprecated)) != 0;
+}
void initialize() {
if (this.pairs == null)
decodeAnnotation();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfo.java
index bba584ca6..de19990f4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfo.java
@@ -16,8 +16,8 @@ import org.eclipse.jdt.internal.compiler.codegen.AttributeNamesConstants;
public class AnnotationMethodInfo extends MethodInfo {
protected Object defaultValue = null;
-public static MethodInfo createAnnotationMethod(byte classFileBytes[], int offsets[], int offset) {
- MethodInfo methodInfo = new MethodInfo(classFileBytes, offsets, offset);
+public static MethodInfo createAnnotationMethod(byte classFileBytes[], int offsets[], int offset, long version) {
+ MethodInfo methodInfo = new MethodInfo(classFileBytes, offsets, offset, version);
int attributesCount = methodInfo.u2At(6);
int readOffset = 8;
AnnotationInfo[] annotations = null;
@@ -98,7 +98,7 @@ public static MethodInfo createAnnotationMethod(byte classFileBytes[], int offse
}
AnnotationMethodInfo(MethodInfo methodInfo, Object defaultValue) {
- super(methodInfo.reference, methodInfo.constantPoolOffsets, methodInfo.structOffset);
+ super(methodInfo.reference, methodInfo.constantPoolOffsets, methodInfo.structOffset, methodInfo.version);
this.defaultValue = defaultValue;
this.accessFlags = methodInfo.accessFlags;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
index d489cb7c0..300aed4e8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
@@ -357,7 +357,7 @@ public ClassFileReader(byte[] classFileBytes, char[] fileName, boolean fullyInit
FieldInfo field;
this.fields = new FieldInfo[this.fieldsCount];
for (int i = 0; i < this.fieldsCount; i++) {
- field = FieldInfo.createField(this.reference, this.constantPoolOffsets, readOffset);
+ field = FieldInfo.createField(this.reference, this.constantPoolOffsets, readOffset, this.version);
this.fields[i] = field;
readOffset += field.sizeInBytes();
}
@@ -370,8 +370,8 @@ public ClassFileReader(byte[] classFileBytes, char[] fileName, boolean fullyInit
boolean isAnnotationType = (this.accessFlags & ClassFileConstants.AccAnnotation) != 0;
for (int i = 0; i < this.methodsCount; i++) {
this.methods[i] = isAnnotationType
- ? AnnotationMethodInfo.createAnnotationMethod(this.reference, this.constantPoolOffsets, readOffset)
- : MethodInfo.createMethod(this.reference, this.constantPoolOffsets, readOffset);
+ ? AnnotationMethodInfo.createAnnotationMethod(this.reference, this.constantPoolOffsets, readOffset, this.version)
+ : MethodInfo.createMethod(this.reference, this.constantPoolOffsets, readOffset, this.version);
readOffset += this.methods[i].sizeInBytes();
}
}
@@ -658,11 +658,12 @@ private void decodeAnnotations(int offset, boolean runtimeVisible) {
long standardTagBits = newInfo.standardAnnotationTagBits;
if (standardTagBits != 0) {
this.tagBits |= standardTagBits;
- } else {
- if (newInfos == null)
- newInfos = new AnnotationInfo[numberOfAnnotations - i];
- newInfos[newInfoCount++] = newInfo;
+ if (this.version < ClassFileConstants.JDK9 || (standardTagBits & TagBits.AnnotationDeprecated) == 0)
+ continue;
}
+ if (newInfos == null)
+ newInfos = new AnnotationInfo[numberOfAnnotations - i];
+ newInfos[newInfoCount++] = newInfo;
}
if (newInfos == null)
return; // nothing to record in this.annotations
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java
index 5f549afe6..884e4f3ee 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java
@@ -22,6 +22,7 @@ import org.eclipse.jdt.internal.compiler.env.IBinaryField;
import org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
import org.eclipse.jdt.internal.compiler.impl.*;
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
+import org.eclipse.jdt.internal.compiler.lookup.TagBits;
import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
import org.eclipse.jdt.internal.compiler.util.Util;
import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
@@ -47,14 +48,15 @@ public class FieldInfo extends ClassFileStruct implements IBinaryField, Comparab
protected int signatureUtf8Offset;
protected long tagBits;
protected Object wrappedConstantValue;
+ protected long version;
//{ObjectTeams: field level attributes:
/* After reading a field its OT-attributes are stored here. */
private LinkedList<AbstractAttribute> fieldAttributes = new LinkedList<AbstractAttribute>();
// SH}
-public static FieldInfo createField(byte classFileBytes[], int offsets[], int offset) {
- FieldInfo fieldInfo = new FieldInfo(classFileBytes, offsets, offset);
+public static FieldInfo createField(byte classFileBytes[], int offsets[], int offset, long version) {
+ FieldInfo fieldInfo = new FieldInfo(classFileBytes, offsets, offset, version);
int attributesCount = fieldInfo.u2At(6);
int readOffset = 8;
@@ -120,11 +122,13 @@ public static FieldInfo createField(byte classFileBytes[], int offsets[], int of
* @param classFileBytes byte[]
* @param offsets int[]
* @param offset int
+ * @param version class file version
*/
-protected FieldInfo (byte classFileBytes[], int offsets[], int offset) {
+protected FieldInfo (byte classFileBytes[], int offsets[], int offset, long version) {
super(classFileBytes, offsets, offset);
this.accessFlags = -1;
this.signatureUtf8Offset = -1;
+ this.version = version;
}
private AnnotationInfo[] decodeAnnotations(int offset, boolean runtimeVisible) {
int numberOfAnnotations = u2At(offset + 6);
@@ -140,11 +144,12 @@ private AnnotationInfo[] decodeAnnotations(int offset, boolean runtimeVisible) {
long standardTagBits = newInfo.standardAnnotationTagBits;
if (standardTagBits != 0) {
this.tagBits |= standardTagBits;
- } else {
- if (newInfos == null)
- newInfos = new AnnotationInfo[numberOfAnnotations - i];
- newInfos[newInfoCount++] = newInfo;
+ if (this.version < ClassFileConstants.JDK9 || (standardTagBits & TagBits.AnnotationDeprecated) == 0)
+ continue;
}
+ if (newInfos == null)
+ newInfos = new AnnotationInfo[numberOfAnnotations - i];
+ newInfos[newInfoCount++] = newInfo;
}
if (newInfos != null) {
if (newInfoCount != newInfos.length)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.java
index c2190cdaf..c5470baf2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.java
@@ -16,7 +16,7 @@ public class FieldInfoWithAnnotation extends FieldInfo {
private AnnotationInfo[] annotations;
FieldInfoWithAnnotation(FieldInfo info, AnnotationInfo[] annos) {
- super(info.reference, info.constantPoolOffsets, info.structOffset);
+ super(info.reference, info.constantPoolOffsets, info.structOffset, info.version);
this.accessFlags = info.accessFlags;
this.attributeBytes = info.attributeBytes;
this.constant = info.constant;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
index 2b94b7638..c9606a054 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,6 +36,7 @@ import org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
import org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding;
import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.eclipse.jdt.internal.compiler.lookup.TagBits;
import org.eclipse.objectteams.otdt.internal.core.compiler.bytecode.AbstractAttribute;
import org.eclipse.objectteams.otdt.internal.core.compiler.bytecode.AnchorListAttribute;
import org.eclipse.objectteams.otdt.internal.core.compiler.bytecode.CopyInheritanceSourceAttribute;
@@ -68,6 +69,7 @@ public class MethodInfo extends ClassFileStruct implements IBinaryMethod, Compar
protected int signatureUtf8Offset;
protected long tagBits;
protected char[][] argumentNames;
+ protected long version;
//{ObjectTeams: method level attributes:
/* After reading a method its attributes are stored here. */
@@ -78,8 +80,8 @@ public class MethodInfo extends ClassFileStruct implements IBinaryMethod, Compar
static final int AccCallsBaseCtor = ASTNode.Bit1;
// SH}
-public static MethodInfo createMethod(byte classFileBytes[], int offsets[], int offset) {
- MethodInfo methodInfo = new MethodInfo(classFileBytes, offsets, offset);
+public static MethodInfo createMethod(byte classFileBytes[], int offsets[], int offset, long version) {
+ MethodInfo methodInfo = new MethodInfo(classFileBytes, offsets, offset, version);
int attributesCount = methodInfo.u2At(6);
int readOffset = 8;
AnnotationInfo[] annotations = null;
@@ -248,22 +250,25 @@ static AnnotationInfo[] decodeMethodAnnotations(int offset, boolean runtimeVisib
if (numberOfAnnotations > 0) {
AnnotationInfo[] annos = decodeAnnotations(offset + 8, runtimeVisible, numberOfAnnotations, methodInfo);
if (runtimeVisible){
- int numStandardAnnotations = 0;
+ int numRetainedAnnotations = 0;
for( int i=0; i<numberOfAnnotations; i++ ){
long standardAnnoTagBits = annos[i].standardAnnotationTagBits;
methodInfo.tagBits |= standardAnnoTagBits;
if(standardAnnoTagBits != 0){
- annos[i] = null;
- numStandardAnnotations ++;
+ if (methodInfo.version < ClassFileConstants.JDK9 || (standardAnnoTagBits & TagBits.AnnotationDeprecated) == 0) { // must retain enhanced deprecation
+ annos[i] = null;
+ continue;
+ }
}
+ numRetainedAnnotations++;
}
- if( numStandardAnnotations != 0 ){
- if( numStandardAnnotations == numberOfAnnotations )
+ if(numRetainedAnnotations != numberOfAnnotations){
+ if(numRetainedAnnotations == 0)
return null;
// need to resize
- AnnotationInfo[] temp = new AnnotationInfo[numberOfAnnotations - numStandardAnnotations ];
+ AnnotationInfo[] temp = new AnnotationInfo[numRetainedAnnotations];
int tmpIndex = 0;
for (int i = 0; i < numberOfAnnotations; i++)
if (annos[i] != null)
@@ -315,11 +320,13 @@ static AnnotationInfo[][] decodeParamAnnotations(int offset, boolean runtimeVisi
* @param classFileBytes byte[]
* @param offsets int[]
* @param offset int
+ * @param version class file version
*/
-protected MethodInfo (byte classFileBytes[], int offsets[], int offset) {
+protected MethodInfo (byte classFileBytes[], int offsets[], int offset, long version) {
super(classFileBytes, offsets, offset);
this.accessFlags = -1;
this.signatureUtf8Offset = -1;
+ this.version = version;
}
public int compareTo(Object o) {
MethodInfo otherMethod = (MethodInfo) o;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithAnnotations.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithAnnotations.java
index c2621f470..3e166a2a7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithAnnotations.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithAnnotations.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 BEA Systems, Inc.
+ * Copyright (c) 2005, 2018 BEA Systems, Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,7 +16,7 @@ public class MethodInfoWithAnnotations extends MethodInfo {
protected AnnotationInfo[] annotations;
MethodInfoWithAnnotations(MethodInfo methodInfo, AnnotationInfo[] annotations) {
- super(methodInfo.reference, methodInfo.constantPoolOffsets, methodInfo.structOffset);
+ super(methodInfo.reference, methodInfo.constantPoolOffsets, methodInfo.structOffset, methodInfo.version);
this.annotations = annotations;
this.accessFlags = methodInfo.accessFlags;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
index 21037212e..c1b504232 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
@@ -3169,8 +3169,11 @@ public void generateSyntheticBodyForSwitchTable(SyntheticMethodBinding methodBin
}
}
aload_0();
- dup();
- fieldAccess(Opcodes.OPC_putstatic, syntheticFieldBinding, null /* default declaringClass */);
+ if (scope.compilerOptions().complianceLevel < ClassFileConstants.JDK9) {
+ // Modifying a final field outside of the <clinit> method is not allowed in 9
+ dup();
+ fieldAccess(Opcodes.OPC_putstatic, syntheticFieldBinding, null /* default declaringClass */);
+ }
areturn();
removeVariable(localVariableBinding);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/AutomaticModuleNaming.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/AutomaticModuleNaming.java
index 765c0a149..bb1c9d1a3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/AutomaticModuleNaming.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/AutomaticModuleNaming.java
@@ -95,7 +95,7 @@ public class AutomaticModuleNaming {
dashLoop: for (index = start; index < end - 1; index++) {
if (name.charAt(index) == '-' && name.charAt(index + 1) >= '0' && name.charAt(index + 1) <= '9') {
for (int index2 = index + 2; index2 < end; index2++) {
- final char c = name.charAt(index2 + 1);
+ final char c = name.charAt(index2);
if (c == '.') {
break;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryAnnotation.java
index 36b1a1763..eae58956b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryAnnotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 BEA Systems, Inc.
+ * Copyright (c) 2005, 2018 BEA Systems, Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,5 +31,12 @@ IBinaryElementValuePair[] getElementValuePairs();
default boolean isExternalAnnotation() {
return false;
}
+
+/**
+ * @return true, if this is a @Deprecated annotation.
+ */
+default boolean isDeprecatedAnnotation() {
+ return false;
+}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java
index 1a2d237a3..f851a342c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017 GK Software AG, and others.
+ * Copyright (c) 2017, 2018 GK Software AG, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@ import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
+import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.util.SimpleSetOfCharArray;
/**
@@ -29,6 +30,88 @@ public interface IUpdatableModule {
*/
enum UpdateKind { MODULE, PACKAGE }
+ class AddExports implements Consumer<IUpdatableModule> {
+
+ char[] name;
+ char[][] targets;
+ public AddExports(char[] pkgName, char[][] targets) {
+ this.name = pkgName;
+ this.targets = targets;
+ }
+ @Override
+ public void accept(IUpdatableModule t) {
+ // TODO Auto-generated method stub
+ t.addExports(this.name, this.targets);
+ }
+
+ public char[] getName() {
+ return this.name;
+ }
+
+ public char[][] getTargetModules() {
+ return this.targets;
+ }
+
+ public UpdateKind getKind() {
+ return UpdateKind.PACKAGE;
+ }
+ @Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ if (!(other instanceof AddExports)) return false;
+ AddExports pu = (AddExports) other;
+
+ if (!CharOperation.equals(this.name, pu.name))
+ return false;
+ if (!CharOperation.equals(this.targets, pu.targets))
+ return false;
+ return true;
+ }
+ @Override
+ public int hashCode() {
+ int hash = CharOperation.hashCode(this.name);
+ if (this.targets != null) {
+ for (int i = 0; i < this.targets.length; i++) {
+ hash += 17 * CharOperation.hashCode(this.targets[i]);
+ }
+ }
+ return hash;
+ }
+ }
+
+ class AddReads implements Consumer<IUpdatableModule> {
+
+ char[] targetModule;
+
+ public AddReads(char[] target) {
+ this.targetModule = target;
+ }
+ @Override
+ public void accept(IUpdatableModule t) {
+ // TODO Auto-generated method stub
+ t.addReads(this.targetModule);
+ }
+
+ public char[] getTarget() {
+ return this.targetModule;
+ }
+
+ public UpdateKind getKind() {
+ return UpdateKind.MODULE;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ if (!(other instanceof AddReads)) return false;
+ AddReads mu = (AddReads) other;
+ return CharOperation.equals(this.targetModule, mu.targetModule);
+ }
+ @Override
+ public int hashCode() {
+ return CharOperation.hashCode(this.targetModule);
+ }
+ }
/** Structure for update operations, sorted by {@link UpdateKind}. */
class UpdatesByKind {
List<Consumer<IUpdatableModule>> moduleUpdates = Collections.emptyList();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
index c32b4c38a..6d5c0e44f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
@@ -55,10 +55,12 @@ import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
import org.eclipse.jdt.internal.compiler.classfmt.FieldInfo;
import org.eclipse.jdt.internal.compiler.classfmt.MethodInfo;
import org.eclipse.jdt.internal.compiler.classfmt.ExternalAnnotationProvider.IMethodAnnotationWalker;
+import org.eclipse.jdt.internal.compiler.classfmt.MethodInfoWithAnnotations;
import org.eclipse.jdt.internal.compiler.classfmt.NonNullDefaultAwareTypeAnnotationWalker;
import org.eclipse.jdt.internal.compiler.classfmt.TypeAnnotationWalker;
import org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
import org.eclipse.jdt.internal.compiler.env.*;
+import org.eclipse.jdt.internal.compiler.impl.BooleanConstant;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.impl.Constant;
import org.eclipse.jdt.internal.compiler.parser.Parser;
@@ -776,8 +778,27 @@ void cachePartsFrom(IBinaryType binaryType, boolean needFieldsAndMethods) {
this.version = reader.getVersion();
}
// SH}
- if (this.environment.globalOptions.storeAnnotations)
- setAnnotations(createAnnotations(binaryType.getAnnotations(), this.environment, missingTypeNames));
+ if (this.environment.globalOptions.storeAnnotations) {
+ setAnnotations(createAnnotations(binaryType.getAnnotations(), this.environment, missingTypeNames), false);
+ } else if (sourceLevel >= ClassFileConstants.JDK9 && isDeprecated() && binaryType.getAnnotations() != null) {
+ // prior to Java 9 all standard annotations were marker annotations, not needing to be stored,
+ // but since Java 9 we need more information from the @Deprecated annotation:
+ for (IBinaryAnnotation annotation : binaryType.getAnnotations()) {
+ if (annotation.isDeprecatedAnnotation()) {
+ AnnotationBinding[] annotationBindings = createAnnotations(new IBinaryAnnotation[] { annotation }, this.environment, missingTypeNames);
+ setAnnotations(annotationBindings, true); // force storing
+ for (ElementValuePair elementValuePair : annotationBindings[0].getElementValuePairs()) {
+ if (CharOperation.equals(elementValuePair.name, TypeConstants.FOR_REMOVAL)) {
+ if (elementValuePair.value instanceof BooleanConstant && ((BooleanConstant) elementValuePair.value).booleanValue()) {
+ this.tagBits |= TagBits.AnnotationTerminallyDeprecated;
+ markImplicitTerminalDeprecation(this);
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
if (this.isAnnotationType())
scanTypeForContainerAnnotation(binaryType, missingTypeNames);
} finally {
@@ -788,6 +809,21 @@ void cachePartsFrom(IBinaryType binaryType, boolean needFieldsAndMethods) {
this.methods = Binding.NO_METHODS;
}
}
+void markImplicitTerminalDeprecation(ReferenceBinding type) {
+ for (ReferenceBinding member : type.memberTypes()) {
+ member.tagBits |= TagBits.AnnotationTerminallyDeprecated;
+ markImplicitTerminalDeprecation(member);
+ }
+ MethodBinding[] methodsOfType = type.unResolvedMethods();
+ if (methodsOfType != null)
+ for (MethodBinding methodBinding : methodsOfType)
+ methodBinding.tagBits |= TagBits.AnnotationTerminallyDeprecated;
+
+ FieldBinding[] fieldsOfType = type.unResolvedFields();
+ if (fieldsOfType != null)
+ for (FieldBinding fieldBinding : fieldsOfType)
+ fieldBinding.tagBits |= TagBits.AnnotationTerminallyDeprecated;
+}
/* When creating a method we need to pass in any default 'nullness' from a @NNBD immediately on this method. */
private ITypeAnnotationWalker getTypeAnnotationWalker(IBinaryTypeAnnotation[] annotations, int nullness) {
@@ -849,16 +885,22 @@ private void createFields(IBinaryField[] iFields, IBinaryType binaryType, long s
binaryField.getModifiers() | ExtraCompilerModifiers.AccUnresolved,
this,
binaryField.getConstant());
+ boolean forceStoreAnnotations = !this.environment.globalOptions.storeAnnotations
+ && (this.environment.globalOptions.sourceLevel >= ClassFileConstants.JDK9
+ && binaryField.getAnnotations() != null
+ && (binaryField.getTagBits() & TagBits.AnnotationDeprecated) != 0);
if (firstAnnotatedFieldIndex < 0
//{ObjectTeams: read annotations within roles to enable copying:
/* orig:
- && this.environment.globalOptions.storeAnnotations
+ && (this.environment.globalOptions.storeAnnotations || forceStoreAnnotations)
:giro */
- && ( this.environment.globalOptions.storeAnnotations
+ && ( this.environment.globalOptions.storeAnnotations || forceStoreAnnotations
|| this.isRole())
// SH}
&& binaryField.getAnnotations() != null) {
firstAnnotatedFieldIndex = i;
+ if (forceStoreAnnotations)
+ storedAnnotations(true, true); // for Java 9 @Deprecated we need to force storing annotations
}
field.id = i; // ordinal
if (use15specifics)
@@ -882,7 +924,7 @@ private void createFields(IBinaryField[] iFields, IBinaryType binaryType, long s
if (firstAnnotatedFieldIndex >= 0) {
for (int i = firstAnnotatedFieldIndex; i <size; i++) {
IBinaryField binaryField = iFields[i];
- this.fields[i].setAnnotations(createAnnotations(binaryField.getAnnotations(), this.environment, missingTypeNames));
+ this.fields[i].setAnnotations(createAnnotations(binaryField.getAnnotations(), this.environment, missingTypeNames), false);
}
}
}
@@ -1117,7 +1159,13 @@ private MethodBinding createMethod(IBinaryMethod method, IBinaryType binaryType,
result.receiver = this.environment.createAnnotatedType(this, createAnnotations(receiverAnnotations, this.environment, missingTypeNames));
}
- if (this.environment.globalOptions.storeAnnotations) {
+ boolean forceStoreAnnotations = !this.environment.globalOptions.storeAnnotations
+ && (this.environment.globalOptions.sourceLevel >= ClassFileConstants.JDK9
+ && method instanceof MethodInfoWithAnnotations
+ && (method.getTagBits() & TagBits.AnnotationDeprecated) != 0);
+ if (this.environment.globalOptions.storeAnnotations || forceStoreAnnotations) {
+ if (forceStoreAnnotations)
+ storedAnnotations(true, true); // for Java 9 @Deprecated we need to force storing annotations
IBinaryAnnotation[] annotations = method.getAnnotations();
if (method.isConstructor()) {
IBinaryAnnotation[] tAnnotations = walker.toMethodReturn().getAnnotationsAtCursor(this.id, false);
@@ -1989,16 +2037,16 @@ public void tagAsHavingDefectiveContainerType() {
this.containerAnnotationType = new ProblemReferenceBinding(this.containerAnnotationType.compoundName, this.containerAnnotationType, ProblemReasons.DefectiveContainerAnnotationType);
}
-SimpleLookupTable storedAnnotations(boolean forceInitialize) {
+SimpleLookupTable storedAnnotations(boolean forceInitialize, boolean forceStore) {
if (!isPrototype())
- return this.prototype.storedAnnotations(forceInitialize);
+ return this.prototype.storedAnnotations(forceInitialize, forceStore);
if (forceInitialize && this.storedAnnotations == null) {
//{ObjectTeams: do support annotations for roles for the sake of copying:
if (!this.isRole())
// SH}
- if (!this.environment.globalOptions.storeAnnotations)
+ if (!this.environment.globalOptions.storeAnnotations && !forceStore)
return null; // not supported during this compile
this.storedAnnotations = new SimpleLookupTable(3);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
index 55efcbc3d..6960c85ca 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
@@ -210,10 +210,10 @@ public abstract class Binding {
public AnnotationBinding[] getAnnotations() {
return Binding.NO_ANNOTATIONS;
}
- public void setAnnotations(AnnotationBinding[] annotations, Scope scope) {
- setAnnotations(annotations);
+ public void setAnnotations(AnnotationBinding[] annotations, Scope scope, boolean forceStore) {
+ setAnnotations(annotations, forceStore);
}
- public void setAnnotations(AnnotationBinding[] annotations) {
+ public void setAnnotations(AnnotationBinding[] annotations, boolean forceStore) {
// Left to subtypes.
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
index fd8247c7b..28407f05b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
@@ -109,7 +109,7 @@ public FieldBinding(FieldBinding initialFieldBinding, ReferenceBinding declaring
super(initialFieldBinding.name, initialFieldBinding.type, initialFieldBinding.modifiers, initialFieldBinding.constant());
this.declaringClass = declaringClass;
this.id = initialFieldBinding.id;
- setAnnotations(initialFieldBinding.getAnnotations());
+ setAnnotations(initialFieldBinding.getAnnotations(), false);
}
/* API
* Answer the receiver's binding type from Binding.BindingID.
@@ -486,8 +486,8 @@ public final int kind() {
public FieldBinding original() {
return this;
}
-public void setAnnotations(AnnotationBinding[] annotations) {
- this.declaringClass.storeAnnotations(this, annotations);
+public void setAnnotations(AnnotationBinding[] annotations, boolean forceStore) {
+ this.declaringClass.storeAnnotations(this, annotations, forceStore);
}
public FieldDeclaration sourceField() {
SourceTypeBinding sourceType;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
index 32e01ddcf..239b3bb87 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
@@ -1659,9 +1659,12 @@ public class InferenceContext18 {
* unless the given candidate is tolerable to be compatible with buggy javac.
*/
public MethodBinding getReturnProblemMethodIfNeeded(TypeBinding expectedType, MethodBinding method) {
- if (InferenceContext18.SIMULATE_BUG_JDK_8026527 && expectedType != null
+ if (InferenceContext18.SIMULATE_BUG_JDK_8026527 && expectedType != null
+ && !(method.original() instanceof SyntheticFactoryMethodBinding)
&& (method.returnType instanceof ReferenceBinding || method.returnType instanceof ArrayBinding)) {
- if (method.returnType.erasure().isCompatibleWith(expectedType))
+ if (!expectedType.isProperType(true))
+ return null; // not ready
+ if (this.environment.convertToRawType(method.returnType.erasure(), false).isCompatibleWith(expectedType))
return method; // don't count as problem.
}
/* We used to check if expected type is null and if so return method, but that is wrong - it injects an incompatible method into overload resolution.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
index 03e9e9469..1890b8dba 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -269,14 +269,14 @@ public class LocalVariableBinding extends VariableBinding {
this.initializationCount++;
}
- public void setAnnotations(AnnotationBinding[] annotations, Scope scope) {
+ public void setAnnotations(AnnotationBinding[] annotations, Scope scope, boolean forceStore) {
// note: we don's use this.declaringScope because we might be called before Scope.addLocalVariable(this)
// which is where this.declaringScope is set.
if (scope == null)
return;
SourceTypeBinding sourceType = scope.enclosingSourceType();
if (sourceType != null)
- sourceType.storeAnnotations(this, annotations);
+ sourceType.storeAnnotations(this, annotations, forceStore);
}
public void resetInitializations() {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
index 99bcde999..01f66fbbe 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1450,8 +1450,8 @@ final public AnnotationBinding[] getTypeAnnotations() {
public void setTypeAnnotations(AnnotationBinding[] annotations) {
this.typeAnnotations = annotations;
}
-public void setAnnotations(AnnotationBinding[] annotations) {
- this.declaringClass.storeAnnotations(this, annotations);
+public void setAnnotations(AnnotationBinding[] annotations, boolean forceStore) {
+ this.declaringClass.storeAnnotations(this, annotations, forceStore);
}
public void setAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) {
this.declaringClass.storeAnnotationHolder(this, AnnotationHolder.storeAnnotations(annotations, parameterAnnotations, defaultValue, optionalEnv));
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
index 45f068437..9f4be1b2a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -2122,7 +2122,7 @@ protected void appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions opt
}
public AnnotationHolder retrieveAnnotationHolder(Binding binding, boolean forceInitialization) {
- SimpleLookupTable store = storedAnnotations(forceInitialization);
+ SimpleLookupTable store = storedAnnotations(forceInitialization, false);
return store == null ? null : (AnnotationHolder) store.get(binding);
}
@@ -2134,8 +2134,8 @@ AnnotationBinding[] retrieveAnnotations(Binding binding) {
return holder == null ? Binding.NO_ANNOTATIONS : holder.getAnnotations();
}
-public void setAnnotations(AnnotationBinding[] annotations) {
- storeAnnotations(this, annotations);
+public void setAnnotations(AnnotationBinding[] annotations, boolean forceStore) {
+ storeAnnotations(this, annotations, forceStore);
}
public void setContainerAnnotationType(ReferenceBinding value) {
// Leave this to subclasses
@@ -2299,11 +2299,11 @@ public char[] internalName() {
void storeAnnotationHolder(Binding binding, AnnotationHolder holder) {
if (holder == null) {
- SimpleLookupTable store = storedAnnotations(false);
+ SimpleLookupTable store = storedAnnotations(false, false);
if (store != null)
store.removeKey(binding);
} else {
- SimpleLookupTable store = storedAnnotations(true);
+ SimpleLookupTable store = storedAnnotations(true, false);
if (store != null)
store.put(binding, holder);
}
@@ -2312,15 +2312,15 @@ void storeAnnotationHolder(Binding binding, AnnotationHolder holder) {
//{ObjectTeams: accessible to classes in org.eclipse.objectteams...:
public
// SH}
-void storeAnnotations(Binding binding, AnnotationBinding[] annotations) {
+void storeAnnotations(Binding binding, AnnotationBinding[] annotations, boolean forceStore) {
AnnotationHolder holder = null;
if (annotations == null || annotations.length == 0) {
- SimpleLookupTable store = storedAnnotations(false);
+ SimpleLookupTable store = storedAnnotations(false, forceStore);
if (store != null)
holder = (AnnotationHolder) store.get(binding);
if (holder == null) return; // nothing to delete
} else {
- SimpleLookupTable store = storedAnnotations(true);
+ SimpleLookupTable store = storedAnnotations(true, forceStore);
if (store == null) return; // not supported
holder = (AnnotationHolder) store.get(binding);
if (holder == null)
@@ -2329,7 +2329,7 @@ void storeAnnotations(Binding binding, AnnotationBinding[] annotations) {
storeAnnotationHolder(binding, holder.setAnnotations(annotations));
}
-SimpleLookupTable storedAnnotations(boolean forceInitialize) {
+SimpleLookupTable storedAnnotations(boolean forceInitialize, boolean forceStore) {
return null; // overrride if interested in storing annotations for the receiver, its fields and methods
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
index 6074fe80d..5f12684d9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
@@ -110,7 +110,7 @@ public class SourceModuleBinding extends ModuleBinding {
return retrieveAnnotations(this);
}
public AnnotationHolder retrieveAnnotationHolder(Binding binding, boolean forceInitialization) {
- SimpleLookupTable store = storedAnnotations(forceInitialization);
+ SimpleLookupTable store = storedAnnotations(forceInitialization, false);
return store == null ? null : (AnnotationHolder) store.get(binding);
}
@@ -119,30 +119,30 @@ public class SourceModuleBinding extends ModuleBinding {
return holder == null ? Binding.NO_ANNOTATIONS : holder.getAnnotations();
}
- public void setAnnotations(AnnotationBinding[] annotations) {
- storeAnnotations(this, annotations);
+ public void setAnnotations(AnnotationBinding[] annotations, boolean forceStore) {
+ storeAnnotations(this, annotations, forceStore);
}
void storeAnnotationHolder(Binding binding, AnnotationHolder holder) {
if (holder == null) {
- SimpleLookupTable store = storedAnnotations(false);
+ SimpleLookupTable store = storedAnnotations(false, false);
if (store != null)
store.removeKey(binding);
} else {
- SimpleLookupTable store = storedAnnotations(true);
+ SimpleLookupTable store = storedAnnotations(true, false);
if (store != null)
store.put(binding, holder);
}
}
- void storeAnnotations(Binding binding, AnnotationBinding[] annotations) {
+ void storeAnnotations(Binding binding, AnnotationBinding[] annotations, boolean forceStore) {
AnnotationHolder holder = null;
if (annotations == null || annotations.length == 0) {
- SimpleLookupTable store = storedAnnotations(false);
+ SimpleLookupTable store = storedAnnotations(false, forceStore);
if (store != null)
holder = (AnnotationHolder) store.get(binding);
if (holder == null) return; // nothing to delete
} else {
- SimpleLookupTable store = storedAnnotations(true);
+ SimpleLookupTable store = storedAnnotations(true, forceStore);
if (store == null) return; // not supported
holder = (AnnotationHolder) store.get(binding);
if (holder == null)
@@ -151,11 +151,11 @@ public class SourceModuleBinding extends ModuleBinding {
storeAnnotationHolder(binding, holder.setAnnotations(annotations));
}
- SimpleLookupTable storedAnnotations(boolean forceInitialize) {
+ SimpleLookupTable storedAnnotations(boolean forceInitialize, boolean forceStore) {
if (forceInitialize && this.storedAnnotations == null && this.scope != null) { // scope null when no annotation cached, and type got processed fully (159631)
this.scope.referenceCompilationUnit().compilationResult.hasAnnotations = true;
final CompilerOptions globalOptions = this.scope.environment().globalOptions;
- if (!globalOptions.storeAnnotations)
+ if (!globalOptions.storeAnnotations && !forceStore)
return null; // not supported during this compile
this.storedAnnotations = new SimpleLookupTable(3);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
index 6d36121cd..8b2cae7c6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -51,6 +51,7 @@
package org.eclipse.jdt.internal.compiler.lookup;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -75,6 +76,8 @@ import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationPosition;
import org.eclipse.jdt.internal.compiler.ast.Expression.DecapsulationState;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.classfmt.ExternalAnnotationProvider;
+import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
+import org.eclipse.jdt.internal.compiler.codegen.Opcodes;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.impl.Constant;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions.WeavingScheme;
@@ -1807,6 +1810,20 @@ ReferenceBinding findTypeInTeamPackage(char[] name) {
return result;
}
//SH}
+public void generateSyntheticFinalFieldInitialization(CodeStream codeStream) {
+ if (this.synthetics == null || this.synthetics[SourceTypeBinding.FIELD_EMUL] == null)
+ return;
+ Collection<FieldBinding> syntheticFields = this.synthetics[SourceTypeBinding.FIELD_EMUL].values();
+ for (FieldBinding field : syntheticFields) {
+ if (CharOperation.prefixEquals(TypeConstants.SYNTHETIC_SWITCH_ENUM_TABLE, field.name)) {
+ MethodBinding[] accessors = (MethodBinding[]) this.synthetics[SourceTypeBinding.METHOD_EMUL].get(new String(field.name));
+ if (accessors == null || accessors[0] == null) // not a field for switch enum
+ continue;
+ codeStream.invoke(Opcodes.OPC_invokestatic, accessors[0], null /* default declaringClass */);
+ codeStream.fieldAccess(Opcodes.OPC_putstatic, field, null /* default declaringClass */);
+ }
+ }
+}
/* Answer the synthetic field for <actualOuterLocalVariable>
* or null if one does not exist.
*/
@@ -3426,9 +3443,9 @@ public final int sourceStart() {
return this.scope.referenceContext.sourceStart;
}
-SimpleLookupTable storedAnnotations(boolean forceInitialize) {
+SimpleLookupTable storedAnnotations(boolean forceInitialize, boolean forceStore) {
if (!isPrototype())
- return this.prototype.storedAnnotations(forceInitialize);
+ return this.prototype.storedAnnotations(forceInitialize, forceStore);
if (forceInitialize && this.storedAnnotations == null && this.scope != null) { // scope null when no annotation cached, and type got processed fully (159631)
this.scope.referenceCompilationUnit().compilationResult.hasAnnotations = true;
@@ -3436,7 +3453,7 @@ SimpleLookupTable storedAnnotations(boolean forceInitialize) {
//{ObjectTeams: do support annotations for roles for the sake of copying:
if (!this.isRole())
// SH}
- if (!globalOptions.storeAnnotations)
+ if (!globalOptions.storeAnnotations && !forceStore)
return null; // not supported during this compile
this.storedAnnotations = new SimpleLookupTable(3);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
index 4aa620110..b095822bf 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -167,6 +167,7 @@ public interface TypeConstants {
char[][] JAVA_UTIL_LIST = {JAVA, UTIL, "List".toCharArray()}; //$NON-NLS-1$
char[][] JAVA_LANG_DEPRECATED = {JAVA, LANG, "Deprecated".toCharArray()}; //$NON-NLS-1$
char[] FOR_REMOVAL = "forRemoval".toCharArray(); //$NON-NLS-1$
+ char[] SINCE = "since".toCharArray(); //$NON-NLS-1$
char[][] JAVA_LANG_ANNOTATION_DOCUMENTED = {JAVA, LANG, ANNOTATION, "Documented".toCharArray()}; //$NON-NLS-1$
char[][] JAVA_LANG_ANNOTATION_INHERITED = {JAVA, LANG, ANNOTATION, "Inherited".toCharArray()}; //$NON-NLS-1$
char[][] JAVA_LANG_ANNOTATION_REPEATABLE = {JAVA, LANG, ANNOTATION, "Repeatable".toCharArray()}; //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
index 7f39ec10c..fe3247ace 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
@@ -601,6 +601,9 @@ public class TypeSystem {
public void updateCaches(UnresolvedReferenceBinding unresolvedType, ReferenceBinding resolvedType) {
final int unresolvedTypeId = unresolvedType.id;
+ if (resolvedType.id != TypeIds.NoId) {
+ unresolvedType.id = resolvedType.id;
+ }
if (unresolvedTypeId != TypeIds.NoId) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=432977
TypeBinding[] derivedTypes = this.types[unresolvedTypeId];
@@ -608,7 +611,8 @@ public class TypeSystem {
if (derivedTypes[i] == null)
break;
if (derivedTypes[i] == unresolvedType) { //$IDENTITY-COMPARISON$
- resolvedType.id = unresolvedTypeId;
+ if(resolvedType.id == TypeIds.NoId)
+ resolvedType.id = unresolvedTypeId;
derivedTypes[i] = resolvedType;
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java
index 8934a075b..2c8d9a33a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java
@@ -126,9 +126,6 @@ public ReferenceBinding resolve(LookupEnvironment environment, boolean convertGe
// create a proxy for the missing BinaryType
targetType = environment.createMissingType(null, this.compoundName);
}
- if (targetType.id != TypeIds.NoId) {
- this.id = targetType.id;
- }
setResolvedType(targetType, environment);
}
if (convertGenericToRawType) {
@@ -154,7 +151,7 @@ public void swapUnresolved(UnresolvedReferenceBinding unresolvedType, ReferenceB
ReferenceBinding annotatedType = (ReferenceBinding) unannotatedType.clone(null);
this.resolvedType = annotatedType;
annotatedType.setTypeAnnotations(getTypeAnnotations(), environment.globalOptions.isAnnotationBasedNullAnalysisEnabled);
- annotatedType.id = unannotatedType.id = this.id;
+
environment.updateCaches(this, annotatedType);
if (this.wrappers != null)
for (int i = 0, l = this.wrappers.length; i < l; i++)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
index 77c68bf78..75cf9f46b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -7369,10 +7369,8 @@ protected void consumePackageDeclaration() {
// flush comments defined prior to import statements
impt.declarationEnd = this.endStatementPosition;
impt.declarationSourceEnd = flushCommentsDefinedPriorTo(impt.declarationSourceEnd);
-// JDT bug 526940
- if (this.firstToken == TerminalTokens.TokenNameQUESTION)
- this.unstackedAct = ACCEPT_ACTION;
-// TDJ
+ if (this.firstToken == TokenNameQUESTION)
+ this.unstackedAct = ACCEPT_ACTION; // force termination at goal
}
protected void consumePackageDeclarationName() {
// PackageDeclarationName ::= PackageComment 'package' Name RejectTypeAnnotations
@@ -14546,7 +14544,6 @@ try {
consumeRule(act);
act = this.unstackedAct;
-// JDT bug 526940
if (act == ACCEPT_ACTION) {
break ProcessTerminals;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
index 862e66776..7141b0480 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
@@ -249,7 +249,14 @@ public FieldDeclaration updatedFieldDeclaration(int depth, Set<TypeDeclaration>
}
}
}
- if (this.anonymousTypeCount > 0) this.fieldDeclaration.bits |= ASTNode.HasLocalType;
+ if (this.anonymousTypeCount > 0) {
+ this.fieldDeclaration.bits |= ASTNode.HasLocalType;
+ if (recoveredInitializers != null) {
+ recoveredInitializers.sourceStart = this.anonymousTypes[0].typeDeclaration.sourceStart;
+ recoveredInitializers.sourceEnd = this.anonymousTypes[this.anonymousTypeCount-1].
+ typeDeclaration.sourceEnd;
+ }
+ }
}
else if(this.fieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
// fieldDeclaration is an enum constant
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 806aebbfb..69b66b844 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -84,6 +84,7 @@ import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.eclipse.jdt.core.compiler.CategorizedProblem;
@@ -172,10 +173,13 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions.WeavingScheme;
import org.eclipse.jdt.internal.compiler.impl.IrritantSet;
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
+import org.eclipse.jdt.internal.compiler.impl.StringConstant;
+import org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding;
import org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
import org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.eclipse.jdt.internal.compiler.lookup.CaptureBinding;
+import org.eclipse.jdt.internal.compiler.lookup.ElementValuePair;
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.eclipse.jdt.internal.compiler.lookup.InvocationSite;
@@ -303,6 +307,11 @@ public static int getIrritant(int problemID) {
case IProblem.UsingDeprecatedMethod :
case IProblem.UsingDeprecatedConstructor :
case IProblem.UsingDeprecatedField :
+ case IProblem.OverridingDeprecatedSinceVersionMethod :
+ case IProblem.UsingDeprecatedSinceVersionType :
+ case IProblem.UsingDeprecatedSinceVersionMethod :
+ case IProblem.UsingDeprecatedSinceVersionConstructor :
+ case IProblem.UsingDeprecatedSinceVersionField :
return CompilerOptions.UsingDeprecatedAPI;
case IProblem.OverridingTerminallyDeprecatedMethod :
@@ -310,6 +319,11 @@ public static int getIrritant(int problemID) {
case IProblem.UsingTerminallyDeprecatedMethod :
case IProblem.UsingTerminallyDeprecatedConstructor :
case IProblem.UsingTerminallyDeprecatedField :
+ case IProblem.OverridingTerminallyDeprecatedSinceVersionMethod :
+ case IProblem.UsingTerminallyDeprecatedSinceVersionType :
+ case IProblem.UsingTerminallyDeprecatedSinceVersionMethod :
+ case IProblem.UsingTerminallyDeprecatedSinceVersionConstructor :
+ case IProblem.UsingTerminallyDeprecatedSinceVersionField :
return CompilerOptions.UsingTerminallyDeprecatedAPI;
case IProblem.LocalVariableIsNeverUsed :
@@ -1920,20 +1934,37 @@ public void defaultModifierIllegallySpecified(int sourceStart, int sourceEnd) {
sourceStart, sourceEnd);
}
-public void deprecatedField(FieldBinding field, ASTNode location) {
- this.handle(
- (field.tagBits & TagBits.AnnotationTerminallyDeprecated) == 0 ? IProblem.UsingDeprecatedField : IProblem.UsingTerminallyDeprecatedField,
- new String[] {new String(field.declaringClass.readableName()), new String(field.name)},
- new String[] {new String(field.declaringClass.shortReadableName()), new String(field.name)},
- nodeSourceStart(field, location),
- nodeSourceEnd(field, location));
+public void deprecatedField(final FieldBinding field, ASTNode location) {
+ String fieldName = new String(field.name);
+ int sourceStart = nodeSourceStart(field, location);
+ int sourceEnd = nodeSourceEnd(field, location);
+ String sinceValue = deprecatedSinceValue(() -> field.getAnnotations());
+ if (sinceValue != null) {
+ this.handle(
+ (field.tagBits & TagBits.AnnotationTerminallyDeprecated) == 0 ? IProblem.UsingDeprecatedSinceVersionField : IProblem.UsingTerminallyDeprecatedSinceVersionField,
+ new String[] {new String(field.declaringClass.readableName()), fieldName, sinceValue},
+ new String[] {new String(field.declaringClass.shortReadableName()), fieldName, sinceValue},
+ sourceStart, sourceEnd);
+ } else {
+ this.handle(
+ (field.tagBits & TagBits.AnnotationTerminallyDeprecated) == 0 ? IProblem.UsingDeprecatedField : IProblem.UsingTerminallyDeprecatedField,
+ new String[] {new String(field.declaringClass.readableName()), fieldName},
+ new String[] {new String(field.declaringClass.shortReadableName()), fieldName},
+ sourceStart, sourceEnd);
+ }
}
-public void deprecatedMethod(MethodBinding method, ASTNode location) {
+public void deprecatedMethod(final MethodBinding method, ASTNode location) {
+ // common arguments:
+ String readableClassName = new String(method.declaringClass.readableName());
+ String shortReadableClassName = new String(method.declaringClass.shortReadableName());
+ String selector = new String(method.selector);
+ String signature = typesAsString(method, false);
+ String shortSignature = typesAsString(method, true);
+
boolean isConstructor = method.isConstructor();
- boolean terminally = (method.tagBits & TagBits.AnnotationTerminallyDeprecated) != 0;
+ int start = -1;
if (isConstructor) {
- int start = -1;
if(location instanceof AllocationExpression) {
// omit the new keyword from the warning marker
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=300031
@@ -1943,25 +1974,50 @@ public void deprecatedMethod(MethodBinding method, ASTNode location) {
}
start = allocationExpression.type.sourceStart;
}
- this.handle(
- terminally ? IProblem.UsingTerminallyDeprecatedConstructor : IProblem.UsingDeprecatedConstructor,
- new String[] {new String(method.declaringClass.readableName()), typesAsString(method, false)},
- new String[] {new String(method.declaringClass.shortReadableName()), typesAsString(method, true)},
- (start == -1) ? location.sourceStart : start,
- location.sourceEnd);
} else {
- int start = -1;
if (location instanceof MessageSend) {
// start the warning marker from the location where the name of the method starts
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=300031
start = (int) (((MessageSend)location).nameSourcePosition >>> 32);
}
- this.handle(
- terminally ? IProblem.UsingTerminallyDeprecatedMethod : IProblem.UsingDeprecatedMethod,
- new String[] {new String(method.declaringClass.readableName()), new String(method.selector), typesAsString(method, false)},
- new String[] {new String(method.declaringClass.shortReadableName()), new String(method.selector), typesAsString(method, true)},
- (start == -1) ? location.sourceStart : start,
- location.sourceEnd);
+ }
+ int sourceStart = (start == -1) ? location.sourceStart : start;
+ int sourceEnd = location.sourceEnd;
+
+ // discriminate:
+ boolean terminally = (method.tagBits & TagBits.AnnotationTerminallyDeprecated) != 0;
+ String sinceValue = deprecatedSinceValue(() -> method.getAnnotations());
+ if (sinceValue == null && method.isConstructor()) {
+ sinceValue = deprecatedSinceValue(() -> method.declaringClass.getAnnotations()); // for default ctor
+ }
+ if (sinceValue != null) {
+ if (isConstructor) {
+ this.handle(
+ terminally ? IProblem.UsingTerminallyDeprecatedSinceVersionConstructor : IProblem.UsingDeprecatedSinceVersionConstructor,
+ new String[] {readableClassName, signature, sinceValue},
+ new String[] {shortReadableClassName, shortSignature, sinceValue},
+ sourceStart, sourceEnd);
+ } else {
+ this.handle(
+ terminally ? IProblem.UsingTerminallyDeprecatedSinceVersionMethod : IProblem.UsingDeprecatedSinceVersionMethod,
+ new String[] {readableClassName, selector, signature, sinceValue},
+ new String[] {shortReadableClassName, selector, shortSignature, sinceValue},
+ sourceStart, sourceEnd);
+ }
+ } else {
+ if (isConstructor) {
+ this.handle(
+ terminally ? IProblem.UsingTerminallyDeprecatedConstructor : IProblem.UsingDeprecatedConstructor,
+ new String[] {readableClassName, signature},
+ new String[] {shortReadableClassName, shortSignature},
+ sourceStart, sourceEnd);
+ } else {
+ this.handle(
+ terminally ? IProblem.UsingTerminallyDeprecatedMethod : IProblem.UsingDeprecatedMethod,
+ new String[] {readableClassName, selector, signature},
+ new String[] {shortReadableClassName, selector, shortSignature},
+ sourceStart, sourceEnd);
+ }
}
}
public void deprecatedType(TypeBinding type, ASTNode location) {
@@ -1971,7 +2027,7 @@ public void deprecatedType(TypeBinding type, ASTNode location) {
// a deprecated type in a qualified reference (see bug 292510)
public void deprecatedType(TypeBinding type, ASTNode location, int index) {
if (location == null) return; // 1G828DN - no type ref for synthetic arguments
- type = type.leafComponentType();
+ final TypeBinding leafType = type.leafComponentType();
int sourceStart = -1;
if (location instanceof QualifiedTypeReference) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=300031
QualifiedTypeReference ref = (QualifiedTypeReference) location;
@@ -1979,12 +2035,36 @@ public void deprecatedType(TypeBinding type, ASTNode location, int index) {
sourceStart = (int) (ref.sourcePositions[index] >> 32);
}
}
- this.handle(
- ((type.tagBits & TagBits.AnnotationTerminallyDeprecated) == 0) ? IProblem.UsingDeprecatedType : IProblem.UsingTerminallyDeprecatedType,
- new String[] {new String(type.readableName())},
- new String[] {new String(type.shortReadableName())},
- (sourceStart == -1) ? location.sourceStart : sourceStart,
- nodeSourceEnd(null, location, index));
+ String sinceValue = deprecatedSinceValue(() -> leafType.getAnnotations());
+ if (sinceValue != null) {
+ this.handle(
+ ((leafType.tagBits & TagBits.AnnotationTerminallyDeprecated) == 0) ? IProblem.UsingDeprecatedSinceVersionType : IProblem.UsingTerminallyDeprecatedSinceVersionType,
+ new String[] {new String(leafType.readableName()), sinceValue},
+ new String[] {new String(leafType.shortReadableName()), sinceValue},
+ (sourceStart == -1) ? location.sourceStart : sourceStart,
+ nodeSourceEnd(null, location, index));
+ } else {
+ this.handle(
+ ((leafType.tagBits & TagBits.AnnotationTerminallyDeprecated) == 0) ? IProblem.UsingDeprecatedType : IProblem.UsingTerminallyDeprecatedType,
+ new String[] {new String(leafType.readableName())},
+ new String[] {new String(leafType.shortReadableName())},
+ (sourceStart == -1) ? location.sourceStart : sourceStart,
+ nodeSourceEnd(null, location, index));
+ }
+}
+String deprecatedSinceValue(Supplier<AnnotationBinding[]> annotations) {
+ if (this.options != null && this.options.complianceLevel >= ClassFileConstants.JDK9) {
+ for (AnnotationBinding annotationBinding : annotations.get()) {
+ if (annotationBinding.getAnnotationType().id == TypeIds.T_JavaLangDeprecated) {
+ for (ElementValuePair elementValuePair : annotationBinding.getElementValuePairs()) {
+ if (CharOperation.equals(elementValuePair.getName(), TypeConstants.SINCE) && elementValuePair.value instanceof StringConstant)
+ return ((StringConstant) elementValuePair.value).stringValue();
+ }
+ break;
+ }
+ }
+ }
+ return null;
}
public void disallowedTargetForAnnotation(Annotation annotation) {
this.handle(
@@ -7587,25 +7667,45 @@ public void operatorOnlyValidOnNumericType(CompoundAssignment assignment, TypeB
assignment.sourceEnd);
}
public void overridesDeprecatedMethod(MethodBinding localMethod, MethodBinding inheritedMethod) {
- this.handle(
- (inheritedMethod.tagBits & TagBits.AnnotationTerminallyDeprecated) != 0
+ String localMethodName = new String(
+ CharOperation.concat(
+ localMethod.declaringClass.readableName(),
+ localMethod.readableName(),
+ '.'));
+ String localMethodShortName = new String(
+ CharOperation.concat(
+ localMethod.declaringClass.shortReadableName(),
+ localMethod.shortReadableName(),
+ '.'));
+ String sinceValue = deprecatedSinceValue(() -> inheritedMethod.getAnnotations());
+ if (sinceValue != null) {
+ this.handle(
+ (inheritedMethod.tagBits & TagBits.AnnotationTerminallyDeprecated) != 0
+ ? IProblem.OverridingTerminallyDeprecatedSinceVersionMethod : IProblem.OverridingDeprecatedSinceVersionMethod,
+ new String[] {
+ localMethodName,
+ new String(inheritedMethod.declaringClass.readableName()),
+ sinceValue},
+ new String[] {
+ localMethodShortName,
+ new String(inheritedMethod.declaringClass.shortReadableName()),
+ sinceValue},
+ localMethod.sourceStart(),
+ localMethod.sourceEnd());
+
+ } else {
+ this.handle(
+ (inheritedMethod.tagBits & TagBits.AnnotationTerminallyDeprecated) != 0
? IProblem.OverridingTerminallyDeprecatedMethod : IProblem.OverridingDeprecatedMethod,
- new String[] {
- new String(
- CharOperation.concat(
- localMethod.declaringClass.readableName(),
- localMethod.readableName(),
- '.')),
- new String(inheritedMethod.declaringClass.readableName())},
- new String[] {
- new String(
- CharOperation.concat(
- localMethod.declaringClass.shortReadableName(),
- localMethod.shortReadableName(),
- '.')),
- new String(inheritedMethod.declaringClass.shortReadableName())},
- localMethod.sourceStart(),
- localMethod.sourceEnd());
+ new String[] {
+ localMethodName,
+ new String(inheritedMethod.declaringClass.readableName())},
+ new String[] {
+ localMethodShortName,
+ new String(inheritedMethod.declaringClass.shortReadableName())},
+ localMethod.sourceStart(),
+ localMethod.sourceEnd());
+ }
}
public void overridesMethodWithoutSuperInvocation(MethodBinding localMethod) {
this.handle(
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
index 6a4673325..7405519e3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2017 IBM Corporation and others.
+# Copyright (c) 2000, 2018 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -912,6 +912,18 @@
1403 = The field {0}.{1} has been deprecated and marked for removal
1404 = The method {0} overrides a method from {1} that has been deprecated and marked for removal
+1405 = The type {0} is deprecated since version {1}
+1406 = The method {1}({2}) from the type {0} is deprecated since version {3}
+1407 = The constructor {0}({1}) is deprecated since version {2}
+1408 = The field {0}.{1} is deprecated since version {2}
+1409 = The method {0} overrides a method from {1} that is deprecated since version {2}
+
+1410 = The type {0} has been deprecated since version {1} and marked for removal
+1411 = The method {1}({2}) from the type {0} has been deprecated since version {3} and marked for removal
+1412 = The constructor {0}({1}) has been deprecated since version {2} and marked for removal
+1413 = The field {0}.{1} has been deprecated since version {2} and marked for removal
+1414 = The method {0} overrides a method from {1} that has been deprecated since version {2} and marked for removal
+
1450 = The type {0} is not accessible
1451 = The field {1}.{0} is not accessible
1452 = The method {1}({2}) from the type {0} is not accessible
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
index 7f2272fdb..4cd9a8f35 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
@@ -759,6 +759,10 @@ public class ASTParser {
* {@link JavaCore#getJavaLikeExtensions() Java-like extensions}
* and match the name of the main (public) class or interface declared in the source.</p>
*
+ * <p>
+ * For compilation of a module-info.java file (since Java 9), the name of the compilation unit must be supplied.
+ * Otherwise, module-info.java will be compiled as an ordinary Java file resulting in compilation errors.</p>
+ *
* <p>This name must represent the full path of the unit inside the given project. For example, if the source
* declares a public class named "Foo" in a project "P" where the source folder is the project itself, the name
* of the compilation unit must be "/P/Foo.java".
@@ -810,6 +814,9 @@ public class ASTParser {
* A successful call to this method returns all settings to their
* default values so the object is ready to be reused.
* </p>
+ * <p>For identifying a module-info.java file as a special file instead of an ordinary
+ * Java file (Since Java 9), a call to this should be preceded by a call to
+ * {@link #setUnitName(String)} that sets the unit name as module-info.java</p>
*
* @param monitor the progress monitor used to report progress and request cancellation,
* or <code>null</code> if none
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
index fddd64a33..df01a5a66 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1350,7 +1350,11 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
* Next token is a left brace. Returns the offset after the brace. For incomplete code, return the start offset.
*/
private int getPosAfterLeftBrace(int pos) {
- return getPosAfterToken(pos, TerminalTokens.TokenNameLBRACE);
+ try {
+ return getPosAfterToken(pos, TerminalTokens.TokenNameLBRACE);
+ } catch (IllegalArgumentException e) {
+ return pos;
+ }
}
/*
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
index 7bdfffb78..a3302ed60 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
@@ -19,23 +19,23 @@
*******************************************************************************/
package org.eclipse.jdt.internal.formatter;
-import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameEOF;
-import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameNotAToken;
-import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_JAVADOC;
import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_BLOCK;
+import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_JAVADOC;
import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_LINE;
+import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameEOF;
+import static org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameNotAToken;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IModuleDescription;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.core.compiler.InvalidInputException;
import org.eclipse.jdt.core.dom.AST;
@@ -51,7 +51,8 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import org.eclipse.jdt.internal.compiler.parser.Scanner;
import org.eclipse.jdt.internal.compiler.util.Util;
-import org.eclipse.jdt.internal.core.PackageFragment;
+import org.eclipse.jdt.internal.core.JavaProject;
+import org.eclipse.jdt.internal.core.SourceModule;
import org.eclipse.jdt.internal.formatter.linewrap.CommentWrapExecutor;
import org.eclipse.jdt.internal.formatter.linewrap.WrapPreparator;
import org.eclipse.jface.text.IRegion;
@@ -339,16 +340,7 @@ public class DefaultCodeFormatter extends CodeFormatter {
ASTParser parser = ASTParser.newParser(AST.JLS9);
if (kind == K_MODULE_INFO) {
- Path fakeModuleInfoPath = new Path("project/" + TypeConstants.MODULE_INFO_FILE_NAME_STRING); //$NON-NLS-1$
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(fakeModuleInfoPath);
- ICompilationUnit unit = JavaCore.createCompilationUnitFrom(file);
- parser.setSource(new org.eclipse.jdt.internal.core.CompilationUnit((PackageFragment) unit.getParent(),
- unit.getElementName(), unit.getOwner()) {
- @Override
- public char[] getContents() {
- return DefaultCodeFormatter.this.sourceArray;
- }
- });
+ parser.setSource(createDummyModuleInfoCompilationUnit());
} else {
parser.setSource(this.sourceArray);
}
@@ -365,6 +357,32 @@ public class DefaultCodeFormatter extends CodeFormatter {
return parser;
}
+ private ICompilationUnit createDummyModuleInfoCompilationUnit() {
+ IJavaProject dummyProject = new JavaProject() {
+ @Override
+ public Map<String, String> getOptions(boolean inheritJavaCoreOptions) {
+ return new HashMap<>();
+ }
+
+ @Override
+ public IModuleDescription getModuleDescription() throws JavaModelException {
+ return new SourceModule(this, ""); //$NON-NLS-1$
+ }
+ };
+ return new org.eclipse.jdt.internal.core.CompilationUnit(null, TypeConstants.MODULE_INFO_FILE_NAME_STRING,
+ null) {
+ @Override
+ public char[] getContents() {
+ return DefaultCodeFormatter.this.sourceArray;
+ }
+
+ @Override
+ public IJavaProject getJavaProject() {
+ return dummyProject;
+ }
+ };
+ }
+
private boolean hasErrors(ASTNode astNode) {
CompilationUnit root = (CompilationUnit) astNode.getRoot();
for (IProblem problem : root.getProblems()) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.java
index 4b3f1494f..845c1c1cc 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/CompletionProposal.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2016 IBM Corporation and others.
+ * Copyright (c) 2004, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1241,7 +1241,7 @@ public class CompletionProposal {
}
/**
- * Returns the type signature or package name or module name (1.9) of the relevant
+ * Returns the type signature or package name or module name (9) of the relevant
* declaration in the context, or <code>null</code> if none.
* <p>
* This field is available for the following kinds of
@@ -1266,6 +1266,8 @@ public class CompletionProposal {
* <li><code>METHOD_DECLARATION</code> - type signature
* of the type that declares the method that is being
* implemented or overridden</li>
+ * <li><code>MODULE_DECLARATION</code> -
+ * possible name of the module that is being declared</li>
* <li><code>MODULE_REF</code> -
* name of the module that is referenced</li>
* <li><code>PACKAGE_REF</code> - dot-based package
@@ -1282,7 +1284,7 @@ public class CompletionProposal {
* returned.
* </p>
*
- * @return a type signature or a package name or module name (1.9) (depending
+ * @return a type signature or a package name or module name (9) (depending
* on the kind of completion), or <code>null</code> if none
* @see Signature
*/
@@ -1318,7 +1320,7 @@ public class CompletionProposal {
}
/**
- * Sets the type or package or module(1.9) signature of the relevant
+ * Sets the type or package signature or module name (9) of the relevant
* declaration in the context, or <code>null</code> if none.
* <p>
* If not set, defaults to none.
@@ -1328,7 +1330,7 @@ public class CompletionProposal {
* its properties; this method is not intended to be used by other clients.
* </p>
*
- * @param signature the type or package or module(1.9) signature, or
+ * @param signature the type or package signature or module name(9) , or
* <code>null</code> if none
*/
public void setDeclarationSignature(char[] signature) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java
index 19da276ad..628b34911 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IModuleDescription.java
@@ -24,6 +24,6 @@ package org.eclipse.jdt.core;
* @noimplement This interface is not intended to be implemented by clients.
* @since 3.14
*/
-public interface IModuleDescription extends IMember {
+public interface IModuleDescription extends IMember, IAnnotatable {
// empty block
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
index 9cfc46d1e..378bd0f4f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
@@ -573,6 +573,13 @@ private org.eclipse.jdt.internal.core.ModuleDescriptionInfo createModuleInfo(Mod
info.setFlags(modInfo.modifiers);
info.setNameSourceStart(modInfo.nameSourceStart);
info.setNameSourceEnd(modInfo.nameSourceEnd);
+ if (modInfo.annotations != null) {
+ int length = modInfo.annotations.length;
+ for (int i = 0; i < length; i++) {
+ org.eclipse.jdt.internal.compiler.ast.Annotation annotation = modInfo.annotations[i];
+ acceptAnnotation(annotation, info, handle);
+ }
+ }
this.newElements.put(handle, info);
return info;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleUpdater.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleUpdater.java
index 16947f99d..c9696d1da 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleUpdater.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleUpdater.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017 GK Software AG, and others.
+ * Copyright (c) 2017, 2018 GK Software AG, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -62,7 +62,7 @@ public class ModuleUpdater {
String modName = value.substring(0, slash);
char[] packName = value.substring(slash+1, equals).toCharArray();
char[][] targets = CharOperation.splitOn(',', value.substring(equals+1).toCharArray());
- addModuleUpdate(modName, m -> m.addExports(packName, targets), UpdateKind.PACKAGE);
+ addModuleUpdate(modName, new IUpdatableModule.AddExports(packName, targets), UpdateKind.PACKAGE);
} else {
Util.log(IStatus.WARNING, "Invalid argument to add-exports: "+value); //$NON-NLS-1$
}
@@ -73,7 +73,7 @@ public class ModuleUpdater {
if (equals != -1) {
String srcMod = value.substring(0, equals);
char[] targetMod = value.substring(equals+1).toCharArray();
- addModuleUpdate(srcMod, m -> m.addReads(targetMod), UpdateKind.MODULE);
+ addModuleUpdate(srcMod, new IUpdatableModule.AddReads(targetMod), UpdateKind.MODULE);
} else {
Util.log(IStatus.WARNING, "Invalid argument to add-reads: "+value); //$NON-NLS-1$
}
@@ -108,4 +108,7 @@ public class ModuleUpdater {
}
}
}
+ public UpdatesByKind getUpdates(String moduleName) {
+ return this.moduleUpdates.get(moduleName);
+ }
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.java
index 74f3332b7..a0ea9eb5b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -136,10 +136,10 @@ public boolean equals(Object o) {
if (this.accessRuleSet != dir.accessRuleSet)
if (this.accessRuleSet == null || !this.accessRuleSet.equals(dir.accessRuleSet))
return false;
- if (this.module != dir.module)
- if (this.module == null || !this.module.equals(dir.module))
- return false;
- return this.binaryFolder.equals(dir.binaryFolder);
+ if (this.isOnModulePath != dir.isOnModulePath)
+ return false;
+
+ return this.binaryFolder.equals(dir.binaryFolder) && areAllModuleOptionsEqual(dir);
}
public NameEnvironmentAnswer findClass(String binaryFileName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly) {
if (!doesFileExist(binaryFileName, qualifiedPackageName, qualifiedBinaryFileName)) return null; // most common case
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
index 210c43ce4..b433fc080 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -207,7 +207,8 @@ public boolean equals(Object o) {
return false;
return this.zipFilename.equals(jar.zipFilename)
&& lastModified() == jar.lastModified()
- && this.isOnModulePath == jar.isOnModulePath;
+ && this.isOnModulePath == jar.isOnModulePath
+ && areAllModuleOptionsEqual(jar);
}
public NameEnvironmentAnswer findClass(String binaryFileName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java
index 855525db7..e40883856 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016, 2017 IBM Corporation and others.
+ * Copyright (c) 2016, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -181,7 +181,8 @@ public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ClasspathJrt)) return false;
ClasspathJrt jar = (ClasspathJrt) o;
- return this.zipFilename.endsWith(jar.zipFilename);
+
+ return this.zipFilename.endsWith(jar.zipFilename) && areAllModuleOptionsEqual(jar);
}
@Override
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java
index 938151fd3..bdbe6e505 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,12 +12,18 @@
*******************************************************************************/
package org.eclipse.jdt.internal.core.builder;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Consumer;
+
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.internal.compiler.env.AccessRuleSet;
import org.eclipse.jdt.internal.compiler.env.IModule;
+import org.eclipse.jdt.internal.compiler.env.IUpdatableModule;
import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
+import org.eclipse.jdt.internal.compiler.env.IUpdatableModule.UpdateKind;
import org.eclipse.jdt.internal.compiler.lookup.ModuleBinding;
import org.eclipse.jdt.internal.compiler.util.Util;
@@ -25,6 +31,9 @@ public abstract class ClasspathLocation {
protected boolean isOnModulePath;
protected IModule module;
+ protected IUpdatableModule.UpdatesByKind updates;
+ protected Set<String> limitModuleNames = null;
+ protected String patchModuleName = null;
// In the following signatures, passing a null moduleName signals "don't care":
abstract public NameEnvironmentAnswer findClass(String typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName);
abstract public NameEnvironmentAnswer findClass(String typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly);
@@ -45,6 +54,62 @@ public abstract class ClasspathLocation {
public IModule getModule() {
return this.module;
}
+ protected boolean areAllModuleOptionsEqual(ClasspathLocation other) {
+ if (this.patchModuleName != null) {
+ if (other.patchModuleName == null)
+ return false;
+ if (!this.patchModuleName.equals(other.patchModuleName))
+ return false;
+ } else {
+ if (other.patchModuleName != null)
+ return false;
+ }
+ if (this.limitModuleNames != null) {
+ if (other.limitModuleNames == null)
+ return false;
+ if (other.limitModuleNames.size() != this.limitModuleNames.size())
+ return false;
+ if (!this.limitModuleNames.containsAll(other.limitModuleNames))
+ return false;
+ } else {
+ if (other.limitModuleNames != null)
+ return false;
+ }
+ if (this.updates != null) {
+ if (other.updates == null)
+ return false;
+ List<Consumer<IUpdatableModule>> packageUpdates = this.updates.getList(UpdateKind.PACKAGE, false);
+ List<Consumer<IUpdatableModule>> otherPackageUpdates = other.updates.getList(UpdateKind.PACKAGE, false);
+ if (packageUpdates != null) {
+ if (otherPackageUpdates == null)
+ return false;
+ if (packageUpdates.size() != otherPackageUpdates.size())
+ return false;
+ if (!packageUpdates.containsAll(otherPackageUpdates))
+ return false;
+ } else {
+ if (otherPackageUpdates != null)
+ return false;
+ }
+ List<Consumer<IUpdatableModule>> moduleUpdates = this.updates.getList(UpdateKind.MODULE, false);
+ List<Consumer<IUpdatableModule>> otherModuleUpdates = other.updates.getList(UpdateKind.MODULE, false);
+ if (moduleUpdates != null) {
+ if (otherModuleUpdates == null)
+ return false;
+ if (moduleUpdates.size() != otherModuleUpdates.size())
+ return false;
+ if (!moduleUpdates.containsAll(otherModuleUpdates))
+ return false;
+ } else {
+ if (otherModuleUpdates != null)
+ return false;
+ }
+ } else {
+ if (other.updates != null)
+ return false;
+ }
+ return true;
+ }
static ClasspathLocation forSourceFolder(IContainer sourceFolder, IContainer outputFolder,
char[][] inclusionPatterns, char[][] exclusionPatterns, boolean ignoreOptionalProblems) {
return new ClasspathMultiDirectory(sourceFolder, outputFolder, inclusionPatterns, exclusionPatterns,
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java
index bcf5f72c6..054b11c4b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NameEnvironment.java
@@ -23,6 +23,7 @@ import org.eclipse.jdt.core.*;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.env.*;
+import org.eclipse.jdt.internal.compiler.env.IUpdatableModule.UpdateKind;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
@@ -33,6 +34,7 @@ import org.eclipse.jdt.internal.core.*;
import java.io.*;
import java.util.*;
+import java.util.function.Consumer;
import java.util.stream.Collectors;
@SuppressWarnings({"rawtypes", "unchecked"})
@@ -162,6 +164,7 @@ private void computeClasspathLocations(
entry.ignoreOptionalProblems());
if (patchedModule != null) {
ModuleEntryProcessor.combinePatchIntoModuleEntry(sourceLocation, patchedModule, moduleEntries);
+ sourceLocation.patchModuleName = patchedModuleName;
}
sLocations.add(sourceLocation);
continue nextEntry;
@@ -221,6 +224,12 @@ private void computeClasspathLocations(
ModulePathEntry projectEntry = new ModulePathEntry(prereqJavaProject.getPath(), info,
projectLocations.toArray(new ClasspathLocation[projectLocations.size()]));
String moduleName = String.valueOf(info.name());
+ IUpdatableModule.UpdatesByKind updates = this.moduleUpdater.getUpdates(moduleName);
+ for (ClasspathLocation loc : projectLocations) {
+ loc.limitModuleNames = limitModules;
+ loc.updates = updates;
+ loc.patchModuleName = patchedModuleName;
+ }
if (limitModules == null || limitModules.contains(moduleName)) {
moduleEntries.put(moduleName, projectEntry);
if (moduleName.equals(patchedModuleName))
@@ -339,8 +348,28 @@ IModule collectModuleEntries(ClasspathLocation bLocation, IPath path, boolean is
String patchedModuleName, IModule patchedModule, Map<String, IModulePathEntry> moduleEntries) {
if (bLocation instanceof IMultiModuleEntry) {
IMultiModuleEntry binaryModulePathEntry = (IMultiModuleEntry) bLocation;
+ bLocation.limitModuleNames = limitModules;
+ bLocation.patchModuleName = patchedModuleName;
+ IUpdatableModule.UpdatesByKind updates = null;//new IUpdatableModule.UpdatesByKind();
+ IUpdatableModule.UpdatesByKind finalUpdates = new IUpdatableModule.UpdatesByKind();
+ List<Consumer<IUpdatableModule>> packageUpdates = null;
+ List<Consumer<IUpdatableModule>> moduleUpdates = null;
for (String moduleName : binaryModulePathEntry.getModuleNames(limitModules)) {
moduleEntries.put(moduleName, binaryModulePathEntry);
+ updates = this.moduleUpdater.getUpdates(moduleName);
+ if (updates != null) {
+ List<Consumer<IUpdatableModule>> pu = updates.getList(UpdateKind.PACKAGE, false);
+ if (pu != null) {
+ (packageUpdates = finalUpdates.getList(UpdateKind.PACKAGE, true)).addAll(pu);
+ }
+ List<Consumer<IUpdatableModule>> mu = updates.getList(UpdateKind.MODULE, false);
+ if (mu != null) {
+ (moduleUpdates = finalUpdates.getList(UpdateKind.MODULE, true)).addAll(mu);
+ }
+ }
+ }
+ if (packageUpdates != null || moduleUpdates != null) {
+ bLocation.updates = finalUpdates;
}
if (patchedModuleName != null) {
IModule module = binaryModulePathEntry.getModule(patchedModuleName.toCharArray());
@@ -353,6 +382,9 @@ IModule collectModuleEntries(ClasspathLocation bLocation, IPath path, boolean is
IModule module = binaryModulePathEntry.getModule();
if (module != null) {
String moduleName = String.valueOf(module.name());
+ bLocation.updates = this.moduleUpdater.getUpdates(moduleName);
+ bLocation.limitModuleNames = limitModules;
+ bLocation.patchModuleName = patchedModuleName;
if (limitModules == null || limitModules == ClasspathJrt.NO_LIMIT_MODULES || limitModules.contains(moduleName)) {
moduleEntries.put(moduleName, binaryModulePathEntry);
if (patchedModuleName != null) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java
index f005a8e0d..f082ec621 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/State.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,8 @@ import org.eclipse.core.runtime.*;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.internal.compiler.env.AccessRuleSet;
+import org.eclipse.jdt.internal.compiler.env.IUpdatableModule;
+import org.eclipse.jdt.internal.compiler.env.IUpdatableModule.*;
import org.eclipse.jdt.internal.compiler.env.AccessRule;
import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
import org.eclipse.jdt.internal.compiler.util.Util;
@@ -27,6 +29,8 @@ import org.eclipse.jdt.internal.core.JavaModelManager;
import java.io.*;
import java.util.*;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
@SuppressWarnings({"rawtypes", "unchecked"})
public class State {
@@ -283,6 +287,38 @@ static State read(IProject project, DataInputStream in) throws IOException {
newState.binaryLocations[i] = ClasspathLocation.forLibrary(root.getFile(new Path(in.readUTF())),
readRestriction(in), new Path(in.readUTF()), in.readBoolean());
}
+ ClasspathLocation loc = newState.binaryLocations[i];
+ char[] patchName = readName(in);
+ loc.patchModuleName = patchName.length > 0 ? new String(patchName) : null;
+ int limitSize = in.readInt();
+ if (limitSize != 0) {
+ loc.limitModuleNames = new HashSet<>(limitSize);
+ for (int j = 0; j < limitSize; j++) {
+ loc.limitModuleNames.add(in.readUTF());
+ }
+ } else {
+ loc.limitModuleNames = null;
+ }
+ IUpdatableModule.UpdatesByKind updates = new IUpdatableModule.UpdatesByKind();
+ List<Consumer<IUpdatableModule>> packageUpdates = null;
+ int packageUpdatesSize = in.readInt();
+ if (packageUpdatesSize != 0) {
+ packageUpdates = updates.getList(UpdateKind.PACKAGE, true);
+ for (int j = 0; j < packageUpdatesSize; j++) {
+ char[] pkgName = readName(in);
+ char[][] targets = readNames(in);
+ packageUpdates.add(new AddExports(pkgName, targets));
+ }
+ }
+ List<Consumer<IUpdatableModule>> moduleUpdates = null;
+ int moduleUpdatesSize = in.readInt();
+ if (moduleUpdatesSize != 0) {
+ moduleUpdates = updates.getList(UpdateKind.MODULE, true);
+ char[] modName = readName(in);
+ moduleUpdates.add(new AddReads(modName));
+ }
+ if (packageUpdates != null || moduleUpdates != null)
+ loc.updates = updates;
}
newState.structuralBuildTimes = new SimpleLookupTable(length = in.readInt());
@@ -445,14 +481,14 @@ void write(DataOutputStream out) throws IOException {
* String path(s)
*/
out.writeInt(length = this.binaryLocations.length);
- next : for (int i = 0; i < length; i++) {
+ for (int i = 0; i < length; i++) {
ClasspathLocation c = this.binaryLocations[i];
if (c instanceof ClasspathMultiDirectory) {
out.writeByte(SOURCE_FOLDER);
for (int j = 0, m = this.sourceLocations.length; j < m; j++) {
if (this.sourceLocations[j] == c) {
out.writeInt(j);
- continue next;
+ //continue next;
}
}
} else if (c instanceof ClasspathDirectory) {
@@ -484,6 +520,55 @@ void write(DataOutputStream out) throws IOException {
writeRestriction(null, out);
out.writeUTF(""); //$NON-NLS-1$
}
+ char[] patchName = c.patchModuleName == null ? CharOperation.NO_CHAR : c.patchModuleName.toCharArray();
+ writeName(patchName, out);
+ if (c.limitModuleNames != null) {
+ out.writeInt(c.limitModuleNames.size());
+ for (String name : c.limitModuleNames) {
+ out.writeUTF(name);
+ }
+ } else {
+ out.writeInt(0);
+ }
+ if (c.updates != null) {
+ List<Consumer<IUpdatableModule>> pu = c.updates.getList(UpdateKind.PACKAGE, false);
+ if (pu != null) {
+ Map<String, List<Consumer<IUpdatableModule>>> map = pu.stream().
+ collect(Collectors.groupingBy(
+ update -> CharOperation.charToString(((IUpdatableModule.AddExports)update).getName())));
+ out.writeInt(map.size());
+ map.entrySet().stream().forEach(entry -> {
+ String pkgName = entry.getKey();
+ try {
+ writeName(pkgName.toCharArray(), out);
+ char[][] targetModules = entry.getValue().stream()
+ .map(consumer -> ((IUpdatableModule.AddExports) consumer).getTargetModules())
+ .filter(targets -> targets != null)
+ .reduce((f,s) -> CharOperation.arrayConcat(f,s))
+ .orElse(null);
+ writeNames(targetModules, out);
+ } catch (IOException e) {
+ // ignore
+ }
+
+ });
+ } else {
+ out.writeInt(0);
+ }
+ List<Consumer<IUpdatableModule>> mu = c.updates.getList(UpdateKind.MODULE, false);
+ if (mu != null) {
+ out.writeInt(mu.size());
+ for (Consumer<IUpdatableModule> cons : mu) {
+ AddReads m = (AddReads) cons;
+ writeName(m.getTarget(), out);
+ }
+ } else {
+ out.writeInt(0);
+ }
+ } else {
+ out.writeInt(0);
+ out.writeInt(0);
+ }
}
/*
diff --git a/org.eclipse.jdt.core/pom.xml b/org.eclipse.jdt.core/pom.xml
index 2f4585675..937db4fc4 100644
--- a/org.eclipse.jdt.core/pom.xml
+++ b/org.eclipse.jdt.core/pom.xml
@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.jdt.core</artifactId>
<groupId>eclipse.jdt.core</groupId>
- <version>4.7.2-SNAPSHOT</version>
+ <version>4.7.3-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
- <version>3.13.100-SNAPSHOT</version>
+ <version>3.13.101-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<properties>
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
index d86e0a1c9..711f6afa8 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
@@ -3112,6 +3112,7 @@ protected void reportMatching(ModuleDeclaration module, IJavaElement parent, int
}
if (moduleDesc == null) // could theoretically happen if openable is ICompilationUnit, but logically having a module should prevent this from happening
return;
+ reportMatching(module.annotations, moduleDesc, null, module.binding, nodeSet, true, true);
if (accuracy > -1) { // report module declaration
SearchMatch match = this.patternLocator.newDeclarationMatch(module, moduleDesc, module.binding, accuracy, module.moduleName.length, this);
report(match);

Back to the top