diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/GroovyCompilerTestSuite.java b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/GroovyCompilerTestSuite.java index 393ca7cbe6..b12151d1c6 100644 --- a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/GroovyCompilerTestSuite.java +++ b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/GroovyCompilerTestSuite.java @@ -64,12 +64,12 @@ @RunWith(Parameterized.class) public abstract class GroovyCompilerTestSuite { - protected static final long JDK6 = ClassFileConstants.JDK1_6; protected static final long JDK7 = ClassFileConstants.JDK1_7; protected static final long JDK8 = ClassFileConstants.JDK1_8; protected static final long JDK9 = ClassFileConstants.JDK9 ; protected static final long JDK10 = ClassFileConstants.JDK10 ; - protected static final List<Long> JDKs = Collections.unmodifiableList(Arrays.asList(JDK6, JDK7, JDK8, JDK9, JDK10)); + protected static final long JDK11 = ClassFileConstants.JDK11 ; + protected static final List<Long> JDKs = Collections.unmodifiableList(Arrays.asList(JDK7, JDK8, JDK9, JDK10, JDK11)); @Parameters(name = "Java {1}") public static Iterable<Object[]> params() { diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/TraitsTests.java b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/TraitsTests.java index 293d736913..be13000545 100644 --- a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/TraitsTests.java +++ b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/TraitsTests.java @@ -16,7 +16,6 @@ package org.eclipse.jdt.groovy.core.tests.basic; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; import org.codehaus.groovy.ast.ClassNode; import org.codehaus.groovy.control.CompilationUnit; @@ -28,8 +27,6 @@ public final class TraitsTests extends GroovyCompilerTestSuite { @Before public void setUp() { - assumeTrue(isAtLeastJava(JDK6)); - if (Float.parseFloat(System.getProperty("java.specification.version")) > 8) { vmArguments = new String[] {"--add-modules=java.xml.bind"}; } diff --git a/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/core/util/JavaConstants.java b/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/core/util/JavaConstants.java index 57fe932a63..60707582f2 100644 --- a/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/core/util/JavaConstants.java +++ b/base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/core/util/JavaConstants.java @@ -20,5 +20,12 @@ public abstract class JavaConstants { /** Highest supported Java Language Specification (JLS) level. */ - public static final int AST_LEVEL = AST.JLS10; + public static int AST_LEVEL = AST.JLS10; + static { + try { + AST.class.getDeclaredField("JLS11"); + AST_LEVEL = 11; + } catch (NoSuchFieldException ignore) { + } + } } diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AbstractMethodTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AbstractMethodTests.java index 7d64f2219b..2610aa75d8 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AbstractMethodTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AbstractMethodTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AnnotationDependencyTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AnnotationDependencyTests.java index 21dcf7b03b..6455f2531f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AnnotationDependencyTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/AnnotationDependencyTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2009, 2014 Walter Harley and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Walter Harley (eclipse@cafewalter.com) - initial implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java index 738bc66138..89cb541d62 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug530366Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug530366Test.java index c5a4f8ebfa..32eb03ae7c 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug530366Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug530366Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2018 Simeon Andreev and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Simeon Andreev - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug531382Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug531382Test.java index eb58c3752d..2d9b9588a5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug531382Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug531382Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2018 Simeon Andreev and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Simeon Andreev - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java index 928c7254f8..277a08ab21 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java index b60fa4a25f..642f785b51 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/CopyResourceTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/CopyResourceTests.java index 7a7eb44dca..58d2a067f3 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/CopyResourceTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/CopyResourceTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/DependencyTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/DependencyTests.java index 0b0e9a400e..126c106ec0 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/DependencyTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/DependencyTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/EfficiencyCompilerRequestor.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/EfficiencyCompilerRequestor.java index 90c5dd6778..1a7db581b9 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/EfficiencyCompilerRequestor.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/EfficiencyCompilerRequestor.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/EfficiencyTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/EfficiencyTests.java index 874be1a796..02237c6eae 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/EfficiencyTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/EfficiencyTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ErrorsTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ErrorsTests.java index 81378702aa..6d698defc8 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ErrorsTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ErrorsTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ExecutionTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ExecutionTests.java index f2a3c7c1c3..0cc33c5ca5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ExecutionTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ExecutionTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/FriendDependencyTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/FriendDependencyTests.java index 6f18d8a23b..0bf8794963 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/FriendDependencyTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/FriendDependencyTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/GetResourcesTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/GetResourcesTests.java index 8e8c6d49b1..9ddf18f728 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/GetResourcesTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/GetResourcesTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java index 92e1569c43..67f061434c 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests18.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests18.java index d2dd9852f7..1dd42e9d83 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests18.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests18.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Java50Tests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Java50Tests.java index 164458f2d3..c5fc66ebc2 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Java50Tests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Java50Tests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2010 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java index ea93215875..73d5448c58 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiSourceFolderAndOutputFolderTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiSourceFolderAndOutputFolderTests.java index ae3ea34c2f..70a32574b9 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiSourceFolderAndOutputFolderTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiSourceFolderAndOutputFolderTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/OutputFolderTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/OutputFolderTests.java index 5f5c7d8513..fc8ed946c4 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/OutputFolderTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/OutputFolderTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2010 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageInfoTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageInfoTest.java index 0d7d5fe969..5a5e8a40ac 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageInfoTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageInfoTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageTests.java index cc490c3277..7be3f8b9eb 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/PackageTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2012 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java index 5a448b699b..93a90abd4a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Problem.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Problem.java index d6d178572c..f2f334876c 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Problem.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Problem.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/StaticFinalTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/StaticFinalTests.java index 5a05cd6d06..7a6f77556a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/StaticFinalTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/StaticFinalTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestAttributeBuilderTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestAttributeBuilderTests.java index e451d1def6..be6a032a9c 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestAttributeBuilderTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestAttributeBuilderTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017, 2018 Till Brychcy and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Till Brychcy - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestBuilderParticipant.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestBuilderParticipant.java index 1a321a4a91..92e5088e9e 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestBuilderParticipant.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestBuilderParticipant.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2007 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java index afc6aa1101..74c12d515d 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF index 01643bd0a6..557478223f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF @@ -21,7 +21,8 @@ Require-Bundle: org.junit;bundle-version="3.8.1", org.eclipse.test.performance;bundle-version="[3.10.0,4.0.0)", org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)", org.eclipse.jdt.annotation;bundle-version="[1.1.0,2.0.0)";resolution:=optional, - org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional + org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional, + javax.annotation Import-Package: org.eclipse.jdt.internal.compiler.apt.dispatch Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Eclipse-BundleShape: dir diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/Activator.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/Activator.java index eecc2f1d87..19fd680b98 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/Activator.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/Activator.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013 Stephan Herrmann and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractCompletionTest.java index f70a2e3bd6..055afb24e5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2011 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSelectionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSelectionTest.java index e4a9245450..94a796db91 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSelectionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSelectionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2011 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSyntaxTreeTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSyntaxTreeTest.java index b91ebe3c5d..e16d754f33 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSyntaxTreeTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSyntaxTreeTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2012, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AllocationExpressionCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AllocationExpressionCompletionTest.java index 110bb1b974..847f7721ef 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AllocationExpressionCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AllocationExpressionCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java index 681560cadd..8ace4d8e82 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java index 0ed289303c..cf908782d3 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationDietRecoveryTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationSelectionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationSelectionTest.java index 4cbc1bdb31..f2d45adae6 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationSelectionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationSelectionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ClassLiteralAccessCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ClassLiteralAccessCompletionTest.java index a3acc83288..b578b98a25 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ClassLiteralAccessCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ClassLiteralAccessCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java index 149acbd691..03eb21f59e 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2011 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java index 59f8068ba5..05db7fdb68 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest18.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java index 81700ccab1..0318fb79e5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2011 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTestKeyword.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTestKeyword.java index ac60f2c6ea..075c0773d5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTestKeyword.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTestKeyword.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2008 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionRecoveryTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionRecoveryTest.java index cfb6b33d88..e4efa645e5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionRecoveryTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionRecoveryTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java index 2820a8fafd..4fb966bd6b 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietCompletionTest.java index 04922d04a8..c2a2e01089 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java index 84d8c27548..445e78d5f3 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DocumentElementParserTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DocumentElementParserTest.java index d2956c2090..60294655a2 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DocumentElementParserTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DocumentElementParserTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DualParseSyntaxErrorTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DualParseSyntaxErrorTest.java index 4dce8a13aa..3da994b8cb 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DualParseSyntaxErrorTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DualParseSyntaxErrorTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2008 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumCompletionParserTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumCompletionParserTest.java index 5edf971df4..d4d5ca289c 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumCompletionParserTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumCompletionParserTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumDietRecoveryTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumDietRecoveryTest.java index 4d7110c677..1b0f77366a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumDietRecoveryTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumDietRecoveryTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumSelectionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumSelectionTest.java index 4309075270..be4c6169f1 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumSelectionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumSelectionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2011 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ExplicitConstructorInvocationCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ExplicitConstructorInvocationCompletionTest.java index 0830be9c11..9888414a15 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ExplicitConstructorInvocationCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ExplicitConstructorInvocationCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ExplicitConstructorInvocationSelectionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ExplicitConstructorInvocationSelectionTest.java index 6ea595b412..d9ec20d873 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ExplicitConstructorInvocationSelectionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ExplicitConstructorInvocationSelectionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java index 4780382549..7473602e94 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2011 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericDietRecoveryTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericDietRecoveryTest.java index 19543d15c7..b480931601 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericDietRecoveryTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericDietRecoveryTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java index b22cfb90ec..6c6cf281c0 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java index 00510d4564..f44654702b 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/GenericsSelectionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/InnerTypeCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/InnerTypeCompletionTest.java index f71cd59cde..63aebd3009 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/InnerTypeCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/InnerTypeCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java index 54ff76b0a3..677874c917 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LabelStatementCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LabelStatementCompletionTest.java index 81363f6134..b0abc73017 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LabelStatementCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LabelStatementCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LambdaExpressionSyntaxTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LambdaExpressionSyntaxTest.java index 40219852a2..8023400177 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LambdaExpressionSyntaxTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/LambdaExpressionSyntaxTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2009, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/MethodInvocationCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/MethodInvocationCompletionTest.java index 8436ec440f..9d847b6faf 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/MethodInvocationCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/MethodInvocationCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java index 8be449a3cb..dd40942cfb 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/NameReferenceCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/NameReferenceCompletionTest.java index 21a7a91e29..4f8cf5e86f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/NameReferenceCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/NameReferenceCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java index ab79702e9e..7048f31f84 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest1_7.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest1_7.java index ad35ad90b9..12a6a1dc7b 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest1_7.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest1_7.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceExpressionSyntaxTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceExpressionSyntaxTest.java index 5d30304b6d..c4f14db2f9 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceExpressionSyntaxTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceExpressionSyntaxTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2009, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java index a970296579..5c5634ad72 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2011 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/RunCompletionParserTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/RunCompletionParserTests.java index e42b622e44..94bc559024 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/RunCompletionParserTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/RunCompletionParserTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionJavadocTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionJavadocTest.java index e983cb8b49..51c0088c0b 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionJavadocTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionJavadocTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest10.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest10.java index 04b6998bbd..588ffadea2 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest10.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest10.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest18.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest18.java index 98d18e8b17..72fadde937 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest18.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest18.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest9.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest9.java index a80ada8c8c..c96f67973f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest9.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionParserTest9.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java index b74bfe83dd..39d934b0cd 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2012 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest2.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest2.java index 1705c4dfa6..e34e1f5136 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest2.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest2.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SingleCompletionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SingleCompletionTest.java index 494cf323c4..b503ee295b 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SingleCompletionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SingleCompletionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java index 5e65242b9a..51642aef5d 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceField.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceField.java index ad9416a5d3..c424c91e9a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceField.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceField.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceImport.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceImport.java index 33a2069ed2..8f0ec9e022 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceImport.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceImport.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceInitializer.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceInitializer.java index 8a8b590939..7afd022069 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceInitializer.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceInitializer.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceMethod.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceMethod.java index 0d6b60fa1d..35dfe32c42 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceMethod.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceMethod.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourcePackage.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourcePackage.java index 3e3b00863e..2027dbcf5b 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourcePackage.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourcePackage.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceType.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceType.java index 3d05395a13..0880c8b370 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceType.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceType.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2010 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java index fb718a7eed..a281f4e4b8 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2011 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest_1_5.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest_1_5.java index 378c62ab5b..c245ba5e40 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest_1_5.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/StatementRecoveryTest_1_5.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java index cfae73c168..65f9fe64ce 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2012 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java index 0f0eebe87e..65287abeb3 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestAll.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -160,6 +163,26 @@ public static TestSuite getTestSuite(boolean addComplianceDiagnoseTest) { TestCase.RUN_ONLY_ID = null; all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.JDK10, tests_10)); } + if ((possibleComplianceLevels & AbstractCompilerTest.F_11) != 0) { + ArrayList tests_11 = (ArrayList)testClasses.clone(); + tests_11.addAll(TEST_CLASSES_1_5); + tests_11.add(ParserTest1_7.class); + tests_11.add(LambdaExpressionSyntaxTest.class); + tests_11.add(ReferenceExpressionSyntaxTest.class); + tests_11.add(TypeAnnotationSyntaxTest.class); + tests_11.add(CompletionParserTest18.class); + tests_11.add(SelectionParserTest18.class); + tests_11.add(SelectionParserTest9.class); + tests_11.add(ModuleDeclarationSyntaxTest.class); + tests_11.add(JEP286ReservedWordTest.class); + // Reset forgotten subsets tests + TestCase.TESTS_PREFIX = null; + TestCase.TESTS_NAMES = null; + TestCase.TESTS_NUMBERS= null; + TestCase.TESTS_RANGE = null; + TestCase.RUN_ONLY_ID = null; + all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11), tests_11)); + } return all; } public static Test suite() { diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestSourceElementRequestor.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestSourceElementRequestor.java index 8e8a096c96..2cf55effa8 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestSourceElementRequestor.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestSourceElementRequestor.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2010 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java index 4856592634..26e13171c5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2009, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java index 27939a9f61..827e552bee 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2006, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java index b741ab0c42..369f090132 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java index 6150326182..313c8cc997 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractComparableTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -68,6 +71,7 @@ public class AbstractComparableTest extends AbstractRegressionTest { public static Test buildComparableTestSuite(Class evaluationTestClass) { Test suite = buildMinimalComplianceTestSuite(evaluationTestClass, F_1_5); TESTS_COUNTERS.put(evaluationTestClass.getName(), Integer.valueOf(suite.countTestCases())); + isJRE11Plus = isJRELevel(F_11); return suite; } diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractNullAnnotationTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractNullAnnotationTest.java index aec9f0f8f1..b8f128a485 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractNullAnnotationTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractNullAnnotationTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2010, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java index c462983259..2ba8cb1455 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -289,6 +292,8 @@ static String versionFromRawVersion(String rawVersion, String javacPathName) { return JavaCore.VERSION_9; } else if(rawVersion.startsWith("10")) { return JavaCore.VERSION_10; + } else if(rawVersion.startsWith("11")) { + return JavaCore.VERSION_11; } else { throw new RuntimeException("unknown javac version: " + rawVersion); } @@ -378,12 +383,26 @@ static int minorFromRawVersion (String version, String rawVersion) { } } if (version == JavaCore.VERSION_10) { - if ("10.0.0".equals(rawVersion)) { + if ("10".equals(rawVersion)) { return 0000; } if ("10.0.1".equals(rawVersion)) { return 0100; } + if ("10.0.2".equals(rawVersion)) { + return 0200; + } + } + if (version == JavaCore.VERSION_11) { + if ("11".equals(rawVersion)) { + return 0000; + } + if ("11.0.1".equals(rawVersion)) { + return 0100; + } + if ("11.0.2".equals(rawVersion)) { + return 0200; + } } throw new RuntimeException("unknown raw javac version: " + rawVersion); } @@ -1187,6 +1206,9 @@ protected void compileAndDeploy(String source, String directoryName, String clas buffer.append("\" -9 " + processAnnot); } else if (this.complianceLevel == ClassFileConstants.JDK10) { buffer.append("\" -10 " + processAnnot); + } else { + int major = (int)(this.complianceLevel>>16); + buffer.append("\" -" + (major - ClassFileConstants.MAJOR_VERSION_0)); } buffer .append(" -preserveAllLocals -proceedOnError -nowarn -g -classpath \"") @@ -1417,6 +1439,11 @@ protected Map<String, String> getCompilerOptions() { defaultOptions.put(CompilerOptions.OPTION_ReportDeadCode, CompilerOptions.WARNING); return defaultOptions; } + protected boolean isMinimumCompliant(long compliance) { + Map options = getCompilerOptions(); + CompilerOptions compOptions = new CompilerOptions(options); + return compOptions.complianceLevel >= compliance; + } protected void enableAllWarningsForIrritants(Map<String, String> options, IrritantSet irritants) { int[] bits = irritants.getBits(); diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest9.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest9.java index 3d05e3f68d..cc4962530f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest9.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest9.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java index 6c986664e7..d7df7487a3 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 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 + * Copyright (c) 2000, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -2736,7 +2739,8 @@ public void test051() { " ^\n" + "I is a raw type. References to generic type I<T> should be parameterized\n" + "----------\n" - : // in 1.8 bar(Z) is recognized as being more specific than bar(I<#RAW>) + : this.complianceLevel < ClassFileConstants.JDK11 ? + // in 1.8 bar(Z) is recognized as being more specific than bar(I<#RAW>) "----------\n" + "1. WARNING in X.java (at line 9)\n" + " bar(new Z());\n" + @@ -2747,7 +2751,14 @@ public void test051() { " private static final class Z implements I {\n" + " ^\n" + "I is a raw type. References to generic type I<T> should be parameterized\n" + - "----------\n")); + "----------\n" + : + "----------\n" + + "1. WARNING in X.java (at line 13)\n" + + " private static final class Z implements I {\n" + + " ^\n" + + "I is a raw type. References to generic type I<T> should be parameterized\n" + + "----------\n")); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=166355 // variant @@ -2810,7 +2821,8 @@ public void test053() { " ^\n" + "I is a raw type. References to generic type I<T> should be parameterized\n" + "----------\n" - : // in 1.8 bar(Z) is recognized as being more specific than bar(I<#RAW>) + : this.complianceLevel < ClassFileConstants.JDK11 ? + // in 1.8 bar(Z) is recognized as being more specific than bar(I<#RAW>) "----------\n" + "1. WARNING in X.java (at line 9)\n" + " bar(new Z(){});\n" + @@ -2821,7 +2833,13 @@ public void test053() { " private static class Z implements I {\n" + " ^\n" + "I is a raw type. References to generic type I<T> should be parameterized\n" + - "----------\n")); + "----------\n" : + "----------\n" + + "1. WARNING in X.java (at line 13)\n" + + " private static class Z implements I {\n" + + " ^\n" + + "I is a raw type. References to generic type I<T> should be parameterized\n" + + "----------\n")); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=166355 // variant diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java index 68d61a4c3c..51d8632e93 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -5213,10 +5216,7 @@ public void test163() { } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99009 public void test164() { - Map options = getCompilerOptions(); - options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.WARNING); - this.runNegativeTest( - new String[] { + String[] testFiles = new String[] { "X.java", "@SuppressWarnings({\"synthetic-access\", \"unused\"})\n" + "public class X {\n" + @@ -5233,7 +5233,15 @@ public void test164() { " new C().bar();\n" + " }\n" + "}" - }, + }; + Map options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.WARNING); + if (isMinimumCompliant(ClassFileConstants.JDK11)) { // no synthetic due to nestmate + this.runConformTest(testFiles); + return; + } + this.runNegativeTest( + testFiles, "", null, true, @@ -10267,6 +10275,8 @@ public void testBug365437a() { } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=365437 public void testBug365437b() { + if (isJRE11Plus) + return; Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.ERROR); customOptions.put(CompilerOptions.OPTION_AnnotationBasedNullAnalysis, CompilerOptions.ENABLED); @@ -10855,6 +10865,8 @@ public void _testBug386356_1() { // Bug 386356 - Type mismatch error with annotations and generics // test case from comment 6 public void testBug386356_2() { + if (isJRE11Plus) + return; INameEnvironment save = this.javaClassLib; try { if (isJRE9Plus) { @@ -11646,6 +11658,27 @@ public void testBug470665() throws Exception { return; // Enough to run in the last two levels! } boolean apt = this.enableAPT; + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. ERROR in A.java (at line 10)\n" + + " };\n" + + " ^\n" + + "Syntax error on token \"}\", delete this token\n" + + "----------\n" + + "----------\n" + : + "----------\n" + + "1. ERROR in A.java (at line 10)\n" + + " };\n" + + " ^\n" + + "Syntax error on token \"}\", delete this token\n" + + "----------\n" + + "----------\n" + + "1. WARNING in B.java (at line 12)\n" + + " X x = new X();\n" + + " ^^^^^^^\n" + + "Access to enclosing constructor B.X() is emulated by a synthetic accessor method\n" + + "----------\n"; String[] sources = new String[] { "A.java", "public final class A {\n" + @@ -11677,19 +11710,7 @@ public void testBug470665() throws Exception { }; try { this.enableAPT = true; - runNegativeTest(sources, - "----------\n" + - "1. ERROR in A.java (at line 10)\n" + - " };\n" + - " ^\n" + - "Syntax error on token \"}\", delete this token\n" + - "----------\n" + - "----------\n" + - "1. WARNING in B.java (at line 12)\n" + - " X x = new X();\n" + - " ^^^^^^^\n" + - "Access to enclosing constructor B.X() is emulated by a synthetic accessor method\n" + - "----------\n"); + runNegativeTest(sources, errMessage); } finally { this.enableAPT = apt; } diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest_9.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest_9.java index a2aff1917b..56cf9d3d57 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest_9.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest_9.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * *******************************************************************************/ package org.eclipse.jdt.core.tests.compiler.regression; diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java index 8303bd3670..383757b34a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java index 093c06a0fb..5f4e0e3fb1 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java index 357958eac9..c13757041a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_5.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_5.java index ae90b2d63a..730cba5767 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_5.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_5.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2009, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_7.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_7.java index be06cb4f48..a7f099c4ae 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_7.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest_1_7.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java index 7b697ab910..b1f37b7d81 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutomaticModuleNamingTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutomaticModuleNamingTest.java index 4693025d97..ccde5f7f52 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutomaticModuleNamingTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutomaticModuleNamingTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 Till Brychcy and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Till Brychcy - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java index 558b797976..ed378ffc75 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -1018,6 +1021,7 @@ public void test013() { " <option key=\"org.eclipse.jdt.core.compiler.groovy.buildGroovyFiles\" value=\"disabled\"/>\n" + " <option key=\"org.eclipse.jdt.core.compiler.maxProblemPerUnit\" value=\"100\"/>\n" + " <option key=\"org.eclipse.jdt.core.compiler.problem.APILeak\" value=\"warning\"/>\n" + + " <option key=\"org.eclipse.jdt.core.compiler.problem.EnablePreviews\" value=\"disabled\"/>\n" + " <option key=\"org.eclipse.jdt.core.compiler.problem.annotationSuperInterface\" value=\"warning\"/>\n" + " <option key=\"org.eclipse.jdt.core.compiler.problem.assertIdentifier\" value=\"warning\"/>\n" + " <option key=\"org.eclipse.jdt.core.compiler.problem.autoboxing\" value=\"ignore\"/>\n" + diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest2.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest2.java new file mode 100644 index 0000000000..4353188719 --- /dev/null +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest2.java @@ -0,0 +1,199 @@ +/******************************************************************************* + * Copyright (c) 2018 IBM Corporation. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.core.tests.compiler.regression; + +import java.io.File; + +import junit.framework.Test; + +@SuppressWarnings({ "rawtypes" }) +public class BatchCompilerTest2 extends AbstractBatchCompilerTest { + + static { +// TESTS_NAMES = new String[] { "test440477" }; +// TESTS_NUMBERS = new int[] { 306 }; +// TESTS_RANGE = new int[] { 298, -1 }; + } + + /** + * This test suite only needs to be run on one compliance. + * As it includes some specific 1.5 tests, it must be used with a least a 1.5 VM + * and not be duplicated in general test suite. + * @see TestAll + */ + public static Test suite() { + return buildMinimalComplianceTestSuite(testClass(), F_11); + } + public static Class testClass() { + return BatchCompilerTest2.class; + } + public BatchCompilerTest2(String name) { + super(name); + } + public void test001() { + this.runNegativeTest( + new String[] { + "X.java", + "import java.util.List;\n" + + "\n" + + "@SuppressWarnings(\"all\"//$NON-NLS-1$\n" + + ")\n" + + "public class X {\n" + + " public static void main(String[] args) {\n" + + " if (false) {\n" + + " ;\n" + + " } else {\n" + + " }\n" + + " Zork z;\n" + + " }\n" + + "}" + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -10 --enable-preview", + "", + "Preview of features is supported only at the latest source level\n", + true); +} +public void test002() throws Exception { + this.runNegativeTest( + new String[] { + "X.java", + "import java.util.List;\n" + + "\n" + + "@SuppressWarnings(\"all\"//$NON-NLS-1$\n" + + ")\n" + + "public class X {\n" + + " public static void main(String[] args) {\n" + + " if (false) {\n" + + " ;\n" + + " } else {\n" + + " }\n" + + " Zork z;\n" + + " }\n" + + "}" + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -11 --enable-preview", + "", + "----------\n" + + "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 11)\n" + + " Zork z;\n" + + " ^^^^\n" + + "Zork cannot be resolved to a type\n" + + "----------\n" + + "1 problem (1 error)\n", + true); +} +public void test003() { + this.runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void main(String [] args) {\n" + + " I lam = (Integer x, var y) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " lam.apply(20, 200);\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " public void apply(Integer k, Integer z);\n" + + "}\n" + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -11 --enable-preview", + "", + "----------\n" + + "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" + + " I lam = (Integer x, var y) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " ^\n" + + "\'var\' cannot be mixed with non-var parameters\n" + + "----------\n" + + "1 problem (1 error)\n", + true); +} +public void test004() throws Exception { + this.runConformTest( + new String[] { + "X.java", + "import java.util.List;\n" + + "\n" + + "@SuppressWarnings(\"all\"//$NON-NLS-1$\n" + + ")\n" + + "public class X {\n" + + " public static void main(String[] args) {\n" + + " if (false) {\n" + + " ;\n" + + " } else {\n" + + " }\n" + + " }\n" + + "}" + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -11 --enable-preview", + "", + "", + true); + String expectedOutput = "// Compiled from X.java (version 11 : 55.65535, super bit)"; + checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput); +} +public void test005() throws Exception { + this.runConformTest( + new String[] { + "X.java", + "import java.util.List;\n" + + "\n" + + "@SuppressWarnings(\"all\"//$NON-NLS-1$\n" + + ")\n" + + "public class X {\n" + + " public static void main(String[] args) {\n" + + " if (false) {\n" + + " ;\n" + + " } else {\n" + + " }\n" + + " }\n" + + "}" + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " --enable-preview -11 ", + "", + "", + true); + String expectedOutput = "// Compiled from X.java (version 11 : 55.65535, super bit)"; + checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput); +} +public void test006() throws Exception { + this.runConformTest( + new String[] { + "X.java", + "import java.util.List;\n" + + "\n" + + "@SuppressWarnings(\"all\"//$NON-NLS-1$\n" + + ")\n" + + "public class X {\n" + + " public static void main(String[] args) {\n" + + " if (false) {\n" + + " ;\n" + + " } else {\n" + + " }\n" + + " }\n" + + "}" + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -source 11", + "", + "", + true); + String expectedOutput = "// Compiled from X.java (version 11 : 55.0, super bit)"; + checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput); +} +} \ No newline at end of file diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BinaryLiteralTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BinaryLiteralTest.java index 28f05224f8..b5ee00f698 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BinaryLiteralTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BinaryLiteralTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BooleanTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BooleanTest.java index 1032155a62..c41989d72c 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BooleanTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BooleanTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BootstrapMethodAttributeTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BootstrapMethodAttributeTest.java index 0b29f96b73..07b44ee6ac 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BootstrapMethodAttributeTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BootstrapMethodAttributeTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java index 90298137fa..e723cdbad6 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2003, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CharOperationTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CharOperationTest.java index e3d0eede05..1d1b72628e 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CharOperationTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CharOperationTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileComparatorTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileComparatorTest.java index 04e66b7fe8..28bdc205c2 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileComparatorTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileComparatorTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_4.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_4.java index c7d5817caa..978347aca2 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_4.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_4.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java index eb61d46174..984d5ac295 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_8.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_8.java index 4fd33536b7..9bfdf85edd 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_8.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_8.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 2016 GoPivotal, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java index 5affd23a7c..f283987a19 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CollisionCase.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CollisionCase.java index 17ca1df836..df7a231a2e 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CollisionCase.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CollisionCase.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2003, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java index c330b30ae7..c59ead8ac2 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -111,12 +114,15 @@ public void test001_irritant_warning_token() { } } } + // Add one for "preview", which doesn't have any irritant at the moment + matcher.put("preview", "preview"); String [] allTokens = CompilerOptions.warningTokens; int length = allTokens.length; matcher.put("all", "all"); // all gets undetected in the From/To loop assertEquals(allTokens.length, matcher.size()); for (int i = 0; i < length; i++) { - assertNotNull(matcher.get(allTokens[i])); + Object object = matcher.get(allTokens[i]); + assertNotNull(object); } } @@ -1152,6 +1158,7 @@ class ProblemAttributes { expectedProblemAttributes.put("UsingTerminallyDeprecatedSinceVersionPackage", new ProblemAttributes(CategorizedProblem.CAT_MODULE)); expectedProblemAttributes.put("UsingTerminallyDeprecatedSinceVersionType", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); expectedProblemAttributes.put("UsingTerminallyDeprecatedSinceVersionType", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); + expectedProblemAttributes.put("VarCannotBeMixedWithNonVarParams", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); expectedProblemAttributes.put("VarIsNotAllowedHere", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); expectedProblemAttributes.put("VarIsReserved", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); expectedProblemAttributes.put("VarIsReservedInFuture", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); @@ -2085,6 +2092,7 @@ class ProblemAttributes { expectedProblemAttributes.put("IllegalArrayOfUnionType", SKIP); expectedProblemAttributes.put("IllegalArrayTypeInIntersectionCast", SKIP); expectedProblemAttributes.put("ProblemNotAnalysed", SKIP); + expectedProblemAttributes.put("VarCannotBeMixedWithNonVarParams", SKIP); expectedProblemAttributes.put("VarIsNotAllowedHere", SKIP); expectedProblemAttributes.put("VarIsReserved", SKIP); expectedProblemAttributes.put("VarIsReservedInFuture", SKIP); diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java index e8b8a7c959..265be84b23 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java index aff09bacf8..e0dd66dd11 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java index 0eb10ca77e..f086fcfa52 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_6.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_6.java index 58522bc1eb..3d83fced85 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_6.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_6.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2009, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_7.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_7.java index 42f87cec29..3dbb11f36a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_7.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_7.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_CLDC.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_CLDC.java index d7542bb28c..948277d608 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_CLDC.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_CLDC.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConcurrentBatchCompilerTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConcurrentBatchCompilerTest.java index 07841eb215..6cb58d015a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConcurrentBatchCompilerTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConcurrentBatchCompilerTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2012, 2014 IBM Corporation 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConditionalExpressionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConditionalExpressionTest.java index 883c63ec7b..d63e379288 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConditionalExpressionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConditionalExpressionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java index e970f56c28..693beeeeb0 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2003, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DebugAttributeTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DebugAttributeTest.java index 154b06f5e8..c969c22377 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DebugAttributeTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DebugAttributeTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2006, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DefaultJavaRuntimeEnvironment.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DefaultJavaRuntimeEnvironment.java index 831e1a1357..aefaf3a46a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DefaultJavaRuntimeEnvironment.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DefaultJavaRuntimeEnvironment.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2012 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java index 6c71f9e6d0..4abad628f3 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated15Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated18Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated18Test.java index b34ecd5faa..7068824a67 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated18Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated18Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java index e00c0a0834..f5828ae765 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017, 2018 GK Software SE, and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java index c75a8b5178..638249b805 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnclosingMethodAttributeTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnclosingMethodAttributeTest.java index 1a08ca8954..ab419627a1 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnclosingMethodAttributeTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnclosingMethodAttributeTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java index d3f2e1c939..95377b2a0f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExpressionContextTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExpressionContextTests.java index ef666d37ff..0eb14b7e51 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExpressionContextTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExpressionContextTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java index d73c35a192..413278c55c 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2003, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java index ec33f602f5..0b8cf38289 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2003, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FieldAccessTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FieldAccessTest.java index 6953309a9c..4efbaa8565 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FieldAccessTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FieldAccessTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java index cb67451438..5602566218 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java index 03e4a38f0d..2b04f667fd 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest8.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForStatementTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForStatementTest.java index 8c73523bf5..b1e9ebab86 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForStatementTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForStatementTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForeachStatementTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForeachStatementTest.java index 41d1132c74..435dfa2d7e 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForeachStatementTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ForeachStatementTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java index 0084fe6cc6..f557b387be 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java index db4ba3c422..10d7a54ce5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java @@ -1,9 +1,12 @@ /******************************************************************************* - * 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 + * Copyright (c) 2000, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -19697,6 +19700,40 @@ public void test0625() { } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=92037 public void test0626() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in X.java (at line 7)\n" + + " private static class B<A> {\n" + + " ^\n" + + "The type parameter A is hiding the type X.A\n" + + "----------\n" + + "2. ERROR in X.java (at line 21)\n" + + " System.out.println(b instanceof C);\n" + + " ^^^^^^^^^^^^^^\n" + + "Incompatible conditional operand types X.B<X.A> and X.C\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in X.java (at line 7)\n" + + " private static class B<A> {\n" + + " ^\n" + + "The type parameter A is hiding the type X.A\n" + + "----------\n" + + "2. WARNING in X.java (at line 11)\n" + + " private static class AA extends A {\n" + + " ^^\n" + + "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + + "----------\n" + + "3. WARNING in X.java (at line 15)\n" + + " private static class C extends B<AA> {\n" + + " ^\n" + + "Access to enclosing constructor X.B<A>() is emulated by a synthetic accessor method\n" + + "----------\n" + + "4. ERROR in X.java (at line 21)\n" + + " System.out.println(b instanceof C);\n" + + " ^^^^^^^^^^^^^^\n" + + "Incompatible conditional operand types X.B<X.A> and X.C\n" + + "----------\n"; this.runNegativeTest( new String[] { "X.java", @@ -19723,28 +19760,7 @@ public void test0626() { " System.out.println(b instanceof C);\n" + " }\n" + "}\n", - }, - "----------\n" + - "1. WARNING in X.java (at line 7)\n" + - " private static class B<A> {\n" + - " ^\n" + - "The type parameter A is hiding the type X.A\n" + - "----------\n" + - "2. WARNING in X.java (at line 11)\n" + - " private static class AA extends A {\n" + - " ^^\n" + - "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + - "----------\n" + - "3. WARNING in X.java (at line 15)\n" + - " private static class C extends B<AA> {\n" + - " ^\n" + - "Access to enclosing constructor X.B<A>() is emulated by a synthetic accessor method\n" + - "----------\n" + - "4. ERROR in X.java (at line 21)\n" + - " System.out.println(b instanceof C);\n" + - " ^^^^^^^^^^^^^^\n" + - "Incompatible conditional operand types X.B<X.A> and X.C\n" + - "----------\n"); + }, errMessage); } public void test0627() { @@ -27546,6 +27562,8 @@ public void test0841() { } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112500 public void test0842() { + String expectedError = isJRE11Plus ? intersection("Object","Serializable","Comparable<?>", "CharSequence") : + intersection("Object","Serializable","CharSequence"); this.runNegativeTest( new String[] { "X.java", // ================= @@ -27568,10 +27586,12 @@ public void test0842() { "1. ERROR in X.java (at line 12)\n" + " List<? extends String> result2 = merge(list1, list2);\n" + " ^^^^^^^^^^^^^^^^^^^\n" + - "Type mismatch: cannot convert from List<"+intersection("Object","Serializable","CharSequence")+"> to List<? extends String>\n" + + "Type mismatch: cannot convert from List<" + expectedError + "> to List<? extends String>\n" + "----------\n"); } public void test0843() { + String expectedError = isJRE11Plus ? intersection("Object","Serializable","Comparable<?>", "CharSequence") : + intersection("Object","Serializable","CharSequence"); this.runNegativeTest( new String[] { "X.java", // ================= @@ -27594,17 +27614,17 @@ public void test0843() { "1. WARNING in X.java (at line 11)\n" + " Object result3 = (List<? extends CharSequence>)merge(list1, list2);\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Unnecessary cast from List<"+intersection("Object","Serializable","CharSequence")+"> to List<? extends CharSequence>\n" + + "Unnecessary cast from List<" + expectedError + "> to List<? extends CharSequence>\n" + "----------\n" + "2. ERROR in X.java (at line 12)\n" + " Object result4 = (List<? extends String>)merge(list1, list2);\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Cannot cast from List<"+intersection("Object","Serializable","CharSequence")+"> to List<? extends String>\n" + + "Cannot cast from List<" + expectedError + "> to List<? extends String>\n" + "----------\n" + "3. WARNING in X.java (at line 12)\n" + " Object result4 = (List<? extends String>)merge(list1, list2);\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Unnecessary cast from List<"+intersection("Object","Serializable","CharSequence")+"> to List<? extends String>\n" + + "Unnecessary cast from List<" + expectedError + "> to List<? extends String>\n" + "----------\n"); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112595 @@ -38069,6 +38089,25 @@ public void _test1097() { } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=152961 public void test1098() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. ERROR in X.java (at line 9)\n" + + " class Y extends Zork {}\n" + + " ^^^^\n" + + "Zork cannot be resolved to a type\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in X.java (at line 5)\n" + + " private class Y<T> extends A {\n" + + " ^\n" + + "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. ERROR in X.java (at line 9)\n" + + " class Y extends Zork {}\n" + + " ^^^^\n" + + "Zork cannot be resolved to a type\n" + + "----------\n"; this.runNegativeTest(new String[] { "X.java", "public class X { \n" + @@ -38081,17 +38120,7 @@ public void test1098() { "}\n" + "class Y extends Zork {}\n" }, - "----------\n" + - "1. WARNING in X.java (at line 5)\n" + - " private class Y<T> extends A {\n" + - " ^\n" + - "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. ERROR in X.java (at line 9)\n" + - " class Y extends Zork {}\n" + - " ^^^^\n" + - "Zork cannot be resolved to a type\n" + - "----------\n"); + errMessage); } public void test1099() { runConformTest( @@ -38362,7 +38391,9 @@ public void test1107() throws Exception { " 25 invokevirtual java.util.HashMap.get(java.lang.Object) : java.lang.Object [34]\n" + " 28 checkcast java.util.Collection [38]\n" + " 31 aload 4 [call]\n" + - " 33 invokespecial X.externLocks(java.util.Collection, java.lang.Object) : java.util.List [40]\n" + + " 33 " + + (isMinimumCompliant(ClassFileConstants.JDK11) ? "invokevirtual" : "invokespecial") + + " X.externLocks(java.util.Collection, java.lang.Object) : java.util.List [40]\n" + " 36 astore 5\n" + " 38 aload_3 [iter]\n" + " 39 invokeinterface java.util.Iterator.hasNext() : boolean [44] [nargs: 1]\n" + @@ -38993,6 +39024,45 @@ public void test1123() { } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=182192 public void test1124() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in X.java (at line 13)\n" + + " public static class InnerClassThatShowsBug extends X {\n" + + " ^\n" + + "X is a raw type. References to generic type X<T> should be parameterized\n" + + "----------\n" + + "2. WARNING in X.java (at line 15)\n" + + " super(null);\n" + + " ^^^^^^^^^^^^\n" + + "Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" + + "----------\n" + + "3. ERROR in X.java (at line 19)\n" + + " for (Map.Entry<String, String> entry : myMap().entrySet()) {\n" + + " ^^^^^^^^^^^^^^^^^^\n" + + "Type mismatch: cannot convert from element type Object to Map.Entry<String,String>\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in X.java (at line 13)\n" + + " public static class InnerClassThatShowsBug extends X {\n" + + " ^\n" + + "X is a raw type. References to generic type X<T> should be parameterized\n" + + "----------\n" + + "2. WARNING in X.java (at line 15)\n" + + " super(null);\n" + + " ^^^^^^^^^^^^\n" + + "Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" + + "----------\n" + + "3. WARNING in X.java (at line 15)\n" + + " super(null);\n" + + " ^^^^^^^^^^^^\n" + + "Access to enclosing constructor X<T>(T) is emulated by a synthetic accessor method\n" + + "----------\n" + + "4. ERROR in X.java (at line 19)\n" + + " for (Map.Entry<String, String> entry : myMap().entrySet()) {\n" + + " ^^^^^^^^^^^^^^^^^^\n" + + "Type mismatch: cannot convert from element type Object to Map.Entry<String,String>\n" + + "----------\n"; this.runNegativeTest( new String[] { "X.java", @@ -39032,28 +39102,7 @@ public void test1124() { " return myMap;\n" + " }\n" + "}", // ================= - }, - "----------\n" + - "1. WARNING in X.java (at line 13)\n" + - " public static class InnerClassThatShowsBug extends X {\n" + - " ^\n" + - "X is a raw type. References to generic type X<T> should be parameterized\n" + - "----------\n" + - "2. WARNING in X.java (at line 15)\n" + - " super(null);\n" + - " ^^^^^^^^^^^^\n" + - "Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" + - "----------\n" + - "3. WARNING in X.java (at line 15)\n" + - " super(null);\n" + - " ^^^^^^^^^^^^\n" + - "Access to enclosing constructor X<T>(T) is emulated by a synthetic accessor method\n" + - "----------\n" + - "4. ERROR in X.java (at line 19)\n" + - " for (Map.Entry<String, String> entry : myMap().entrySet()) {\n" + - " ^^^^^^^^^^^^^^^^^^\n" + - "Type mismatch: cannot convert from element type Object to Map.Entry<String,String>\n" + - "----------\n"); + }, errMessage); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=183216 public void test1125() { @@ -40650,6 +40699,45 @@ public void test1162() { } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=203061 - variation public void test1163() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. ERROR in X.java (at line 5)\n" + + " Object o1 = mObj;\n" + + " ^^^^\n" + + "The blank final field mObj may not have been initialized\n" + + "----------\n" + + "2. ERROR in X.java (at line 7)\n" + + " Object o2 = mObj;\n" + + " ^^^^\n" + + "The blank final field mObj may not have been initialized\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in X.java (at line 5)\n" + + " Object o1 = mObj;\n" + + " ^^^^\n" + + "Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. ERROR in X.java (at line 5)\n" + + " Object o1 = mObj;\n" + + " ^^^^\n" + + "The blank final field mObj may not have been initialized\n" + + "----------\n" + + "3. WARNING in X.java (at line 7)\n" + + " Object o2 = mObj;\n" + + " ^^^^\n" + + "Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + + "----------\n" + + "4. ERROR in X.java (at line 7)\n" + + " Object o2 = mObj;\n" + + " ^^^^\n" + + "The blank final field mObj may not have been initialized\n" + + "----------\n" + + "5. WARNING in X.java (at line 9)\n" + + " Object o3 = mObj;\n" + + " ^^^^\n" + + "Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + + "----------\n"; this.runNegativeTest( new String[] { "X.java", @@ -40669,36 +40757,79 @@ public void test1163() { " }\n" + "}\n", // ================= }, - "----------\n" + - "1. WARNING in X.java (at line 5)\n" + - " Object o1 = mObj;\n" + - " ^^^^\n" + - "Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. ERROR in X.java (at line 5)\n" + - " Object o1 = mObj;\n" + - " ^^^^\n" + - "The blank final field mObj may not have been initialized\n" + - "----------\n" + - "3. WARNING in X.java (at line 7)\n" + - " Object o2 = mObj;\n" + - " ^^^^\n" + - "Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + - "----------\n" + - "4. ERROR in X.java (at line 7)\n" + - " Object o2 = mObj;\n" + - " ^^^^\n" + - "The blank final field mObj may not have been initialized\n" + - "----------\n" + - "5. WARNING in X.java (at line 9)\n" + - " Object o3 = mObj;\n" + - " ^^^^\n" + - "Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + - "----------\n"); + errMessage); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=203061 - variation public void test1164() { - this.runNegativeTest( + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. ERROR in X.java (at line 5)\n" + + " Object o1 = mObj;\n" + + " ^^^^\n" + + "The blank final field mObj may not have been initialized\n" + + "----------\n" + + "2. ERROR in X.java (at line 6)\n" + + " mObj = \"1\";\n" + + " ^^^^\n" + + "The final field X<T>.mObj cannot be assigned\n" + + "----------\n" + + "3. ERROR in X.java (at line 8)\n" + + " Object o2 = mObj = \"2\";\n" + + " ^^^^\n" + + "The final field X<T>.mObj cannot be assigned\n" + + "----------\n" + + "4. ERROR in X.java (at line 11)\n" + + " mObj = \"3\";\n" + + " ^^^^\n" + + "The final field X<T>.mObj cannot be assigned\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in X.java (at line 5)\n" + + " Object o1 = mObj;\n" + + " ^^^^\n" + + "Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. ERROR in X.java (at line 5)\n" + + " Object o1 = mObj;\n" + + " ^^^^\n" + + "The blank final field mObj may not have been initialized\n" + + "----------\n" + + "3. WARNING in X.java (at line 6)\n" + + " mObj = \"1\";\n" + + " ^^^^\n" + + "Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + + "----------\n" + + "4. ERROR in X.java (at line 6)\n" + + " mObj = \"1\";\n" + + " ^^^^\n" + + "The final field X<T>.mObj cannot be assigned\n" + + "----------\n" + + "5. WARNING in X.java (at line 8)\n" + + " Object o2 = mObj = \"2\";\n" + + " ^^^^\n" + + "Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + + "----------\n" + + "6. ERROR in X.java (at line 8)\n" + + " Object o2 = mObj = \"2\";\n" + + " ^^^^\n" + + "The final field X<T>.mObj cannot be assigned\n" + + "----------\n" + + "7. WARNING in X.java (at line 10)\n" + + " Object o3 = mObj;\n" + + " ^^^^\n" + + "Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + + "----------\n" + + "8. WARNING in X.java (at line 11)\n" + + " mObj = \"3\";\n" + + " ^^^^\n" + + "Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + + "----------\n" + + "9. ERROR in X.java (at line 11)\n" + + " mObj = \"3\";\n" + + " ^^^^\n" + + "The final field X<T>.mObj cannot be assigned\n" + + "----------\n"; this.runNegativeTest( new String[] { "X.java", "public final class X<T> {\n" + @@ -40718,53 +40849,7 @@ public void test1164() { " mObj = \"\";\n" + " }\n" + "}\n" - }, - "----------\n" + - "1. WARNING in X.java (at line 5)\n" + - " Object o1 = mObj;\n" + - " ^^^^\n" + - "Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. ERROR in X.java (at line 5)\n" + - " Object o1 = mObj;\n" + - " ^^^^\n" + - "The blank final field mObj may not have been initialized\n" + - "----------\n" + - "3. WARNING in X.java (at line 6)\n" + - " mObj = \"1\";\n" + - " ^^^^\n" + - "Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + - "----------\n" + - "4. ERROR in X.java (at line 6)\n" + - " mObj = \"1\";\n" + - " ^^^^\n" + - "The final field X<T>.mObj cannot be assigned\n" + - "----------\n" + - "5. WARNING in X.java (at line 8)\n" + - " Object o2 = mObj = \"2\";\n" + - " ^^^^\n" + - "Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + - "----------\n" + - "6. ERROR in X.java (at line 8)\n" + - " Object o2 = mObj = \"2\";\n" + - " ^^^^\n" + - "The final field X<T>.mObj cannot be assigned\n" + - "----------\n" + - "7. WARNING in X.java (at line 10)\n" + - " Object o3 = mObj;\n" + - " ^^^^\n" + - "Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + - "----------\n" + - "8. WARNING in X.java (at line 11)\n" + - " mObj = \"3\";\n" + - " ^^^^\n" + - "Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" + - "----------\n" + - "9. ERROR in X.java (at line 11)\n" + - " mObj = \"3\";\n" + - " ^^^^\n" + - "The final field X<T>.mObj cannot be assigned\n" + - "----------\n"); + }, errMessage); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=202404 - variation public void test1165() { @@ -42737,12 +42822,13 @@ public void test1216() { " ^^^^^^^^^\n" + "The type A.P is not visible\n" + "----------\n" + + (isMinimumCompliant(ClassFileConstants.JDK11) ? "" : "----------\n" + "1. WARNING in p\\A.java (at line 18)\n" + " this.box.set(new P());\n" + " ^^^^^^^\n" + "Access to enclosing constructor A.P() is emulated by a synthetic accessor method\n" + - "----------\n"); + "----------\n")); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 - variation public void test1217() { diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java index 2bb35cfa37..dce0bd85bc 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java index a9b72111ba..de2acc8891 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_7.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 2016 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java index 4882019996..2d67123fa6 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_9.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_9.java index dd574d6297..100c673f35 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_9.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_9.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016, 2018 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GrammarCoverageTests308.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GrammarCoverageTests308.java index ec0b940e40..585f42d122 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GrammarCoverageTests308.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GrammarCoverageTests308.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment.java index fdde305a7b..8f7020bf9e 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment9.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment9.java index 94b11260ac..c329fba5f7 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment9.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InMemoryNameEnvironment9.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InitializationTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InitializationTests.java index 9f3b36afe9..66feafc4cc 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InitializationTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InitializationTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2010, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java index c1d45d1132..af439033b2 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2010, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java index e4ab096fb9..d86e8828d3 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -140,6 +143,25 @@ public void test002() { * 1FZ2G7R: use of non static inner class in constuctor */ public void test003() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. ERROR in A.java (at line 8)\n" + + " super(getRunnable(), new B().toString()); \n" + + " ^^^^^^^\n" + + "No enclosing instance of type A is available due to some intermediate constructor invocation\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in A.java (at line 8)\n" + + " super(getRunnable(), new B().toString()); \n" + + " ^^^^^^^\n" + + "Access to enclosing constructor A.B() is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. ERROR in A.java (at line 8)\n" + + " super(getRunnable(), new B().toString()); \n" + + " ^^^^^^^\n" + + "No enclosing instance of type A is available due to some intermediate constructor invocation\n" + + "----------\n"; this.runNegativeTest( new String[] { /* A.java */ @@ -155,17 +177,7 @@ public void test003() { " } \n" + "} \n" }, - "----------\n" + - "1. WARNING in A.java (at line 8)\n" + - " super(getRunnable(), new B().toString()); \n" + - " ^^^^^^^\n" + - "Access to enclosing constructor A.B() is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. ERROR in A.java (at line 8)\n" + - " super(getRunnable(), new B().toString()); \n" + - " ^^^^^^^\n" + - "No enclosing instance of type A is available due to some intermediate constructor invocation\n" + - "----------\n"); + errMessage); } /** * 1F995V9: Walkback in innerclass emulation when mixing source and binaries @@ -1441,6 +1453,25 @@ public void test032() { * Missing implementation in the compiler compiling invalid code */ public void test033() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. ERROR in p1\\A2.java (at line 20)\n" + + " (new D.E(null, null, null, new F(get()) {}) {}).execute(); \n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in p1\\A2.java (at line 18)\n" + + " private class C extends B { \n" + + " ^\n" + + "Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. ERROR in p1\\A2.java (at line 20)\n" + + " (new D.E(null, null, null, new F(get()) {}) {}).execute(); \n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + + "----------\n"; this.runNegativeTest( new String[] { /* A2.java */ @@ -1469,17 +1500,7 @@ public void test033() { " } \n"+ "}\n" }, - "----------\n" + - "1. WARNING in p1\\A2.java (at line 18)\n" + - " private class C extends B { \n" + - " ^\n" + - "Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. ERROR in p1\\A2.java (at line 20)\n" + - " (new D.E(null, null, null, new F(get()) {}) {}).execute(); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + - "----------\n"); + errMessage); } /** * Missing implementation in the compiler compiling invalid code @@ -1524,8 +1545,26 @@ public void test034() { * Missing implementation in the compiler compiling invalid code */ public void test035() { - this.runNegativeTest( - new String[] { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. ERROR in p1\\A2.java (at line 20)\n" + + " (new D.E(null, null, null, new F(get()) {})).execute(); \n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in p1\\A2.java (at line 18)\n" + + " private class C extends B { \n" + + " ^\n" + + "Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. ERROR in p1\\A2.java (at line 20)\n" + + " (new D.E(null, null, null, new F(get()) {})).execute(); \n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + + "----------\n"; + this.runNegativeTest(new String[] { /* A2.java */ "p1/A2.java", "package p1; \n"+ @@ -1550,19 +1589,8 @@ public void test035() { " (new D.E(null, null, null, new F(get()) {})).execute(); \n"+ " } \n"+ " } \n"+ - "}\n" - }, - "----------\n" + - "1. WARNING in p1\\A2.java (at line 18)\n" + - " private class C extends B { \n" + - " ^\n" + - "Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. ERROR in p1\\A2.java (at line 20)\n" + - " (new D.E(null, null, null, new F(get()) {})).execute(); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + - "----------\n"); + "}\n"}, + errMessage); } /** * ClassCastException during inner class emulation @@ -4594,6 +4622,12 @@ public void test123() throws Exception { "}\n", }, "bar"); + String nestHost = ""; + CompilerOptions options = new CompilerOptions(getCompilerOptions()); + if (options.complianceLevel >= ClassFileConstants.JDK11) { + nestHost = "\n" + + "Nest Host: #32 X\n"; + } // ensure synthetic access method got generated for enclosing field String expectedOutput = " // Method descriptor #6 ()V\n" + @@ -4625,6 +4659,7 @@ public void test123() throws Exception { " Inner classes:\n" + " [inner class info: #1 X$Z, outer class info: #32 X\n" + " inner name: #34 Z, accessflags: 8 static]\n" + + nestHost + "}"; File f = new File(OUTPUT_DIR + File.separator + "X$Z.class"); @@ -4822,7 +4857,8 @@ public void test125() throws Exception { " \n" + " // Method descriptor #10 (LX;Ljava/lang/String;)V\n" + " // Stack: 2, Locals: 3\n" + - " X$1Local(X arg0, java.lang.String arg1);\n" + + (isMinimumCompliant(ClassFileConstants.JDK11) ? " private " :" ") + + "X$1Local(X arg0, java.lang.String arg1);\n" + " 0 aload_0 [this]\n" + " 1 aload_1 [arg0]\n" + " 2 putfield X$1Local.this$0 : X [12]\n" + @@ -4853,7 +4889,11 @@ public void test125() throws Exception { "\n" + " Inner classes:\n" + " [inner class info: #1 X$1Local, outer class info: #0\n" + - " inner name: #44 Local, accessflags: 0 default]\n"; + " inner name: #44 Local, accessflags: 0 default]\n" + + (isMinimumCompliant(ClassFileConstants.JDK11) ? + " Enclosing Method: #39 #41 X.foo(Ljava/lang/String;)V\n" + + "\n" + + "Nest Host: #39 X\n" : ""); File f = new File(OUTPUT_DIR + File.separator + (options.complianceLevel >= ClassFileConstants.JDK1_5 ? "X$1Local.class" : "X$1$Local.class")); byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f); @@ -5478,6 +5518,25 @@ public void test138() { } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=152961 - variation public void test139() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. ERROR in X.java (at line 9)\n" + + " class Y extends Zork {}\n" + + " ^^^^\n" + + "Zork cannot be resolved to a type\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in X.java (at line 5)\n" + + " private class Y extends A {\n" + + " ^\n" + + "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. ERROR in X.java (at line 9)\n" + + " class Y extends Zork {}\n" + + " ^^^^\n" + + "Zork cannot be resolved to a type\n" + + "----------\n"; this.runNegativeTest( new String[] { "X.java", @@ -5491,17 +5550,7 @@ public void test139() { "}\n" + "class Y extends Zork {}\n", // ================= }, - "----------\n" + - "1. WARNING in X.java (at line 5)\n" + - " private class Y extends A {\n" + - " ^\n" + - "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. ERROR in X.java (at line 9)\n" + - " class Y extends Zork {}\n" + - " ^^^^\n" + - "Zork cannot be resolved to a type\n" + - "----------\n"); + errMessage); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=171184 public void test140() throws Exception { @@ -6301,8 +6350,6 @@ public void test156() throws Exception { }, ""); String expectedOutput = - " // Method descriptor #33 (Lpackage2/C;)V\n" + - " // Stack: 1, Locals: 1\n" + " static synthetic void access$0(package2.C arg0);\n" + " 0 aload_0 [arg0]\n" + " 1 invokevirtual package2.C.outerMethod() : void"; @@ -6796,9 +6843,8 @@ public void test171() throws Exception { } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=197271 public void test172() throws Exception { - this.runNegativeTest( - new String[] { - "X.java",//======================= + String[] files = new String[] { + "X.java", "public class X {\n" + " void a() {}\n" + " private static void a(String s) {}\n" + @@ -6816,30 +6862,38 @@ public void test172() throws Exception { " c(null);\n" + " }\n" + " }\n" + + " public static void main(String[] args) {\n" + + " }\n" + "}\n", - }, - "----------\n" + - "1. WARNING in X.java (at line 8)\n" + - " a(null);\n" + - " ^^^^^^^\n" + - "Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. WARNING in X.java (at line 9)\n" + - " c(null);\n" + - " ^^^^^^^\n" + - "Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + - "----------\n" + - "3. WARNING in X.java (at line 14)\n" + - " a(null);\n" + - " ^^^^^^^\n" + - "Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + - "----------\n" + - "4. WARNING in X.java (at line 15)\n" + - " c(null);\n" + - " ^^^^^^^\n" + - "Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + - "----------\n" - ); + }; + if (this.complianceLevel < ClassFileConstants.JDK11) { + this.runNegativeTest( + files, + "----------\n" + + "1. WARNING in X.java (at line 8)\n" + + " a(null);\n" + + " ^^^^^^^\n" + + "Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. WARNING in X.java (at line 9)\n" + + " c(null);\n" + + " ^^^^^^^\n" + + "Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + + "----------\n" + + "3. WARNING in X.java (at line 14)\n" + + " a(null);\n" + + " ^^^^^^^\n" + + "Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + + "----------\n" + + "4. WARNING in X.java (at line 15)\n" + + " c(null);\n" + + " ^^^^^^^\n" + + "Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + + "----------\n" + ); + } else { + this.runConformTest(files, ""); + } } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=308245 public void test173() throws Exception { diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest_1_5.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest_1_5.java index 89bd3a40b3..3a18871c6a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest_1_5.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest_1_5.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2009, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InstanceofExpressionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InstanceofExpressionTest.java index 493e3ca2e8..c375427518 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InstanceofExpressionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InstanceofExpressionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java index 8024a3e835..750a0e40a4 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 2017 GK Software AG, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest_9.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest_9.java index 83f7300a89..c6da4bca41 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest_9.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InterfaceMethodsTest_9.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InternalHexFloatTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InternalHexFloatTest.java index b2dc6c745c..c3ba04082b 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InternalHexFloatTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InternalHexFloatTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InternalScannerTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InternalScannerTest.java index fb044a4185..21ebb1e467 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InternalScannerTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InternalScannerTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP181NestTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP181NestTest.java new file mode 100644 index 0000000000..d8bc54b2b9 --- /dev/null +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP181NestTest.java @@ -0,0 +1,1392 @@ +/******************************************************************************* + * Copyright (c) 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.core.tests.compiler.regression; + +import java.io.File; +import java.io.IOException; +import java.util.Map; + +import junit.framework.Test; + +import org.eclipse.jdt.core.ToolFactory; +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.ClassFormatException; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; + +@SuppressWarnings({ "rawtypes" }) +public class JEP181NestTest extends AbstractComparableTest { + + String versionString = null; + +public JEP181NestTest(String name) { + super(name); +} +// No need for a tearDown() +protected void setUp() throws Exception { + super.setUp(); + this.versionString = AbstractCompilerTest.getVersionString(this.complianceLevel); +} + +/* + * Toggle compiler in mode -11 + */ +// Static initializer to specify tests subset using TESTS_* static variables +// All specified tests which do not belong to the class are skipped... +static { +// TESTS_NAMES = new String[] { "test055" }; +// TESTS_NUMBERS = new int[] { 50, 51, 52, 53 }; +// TESTS_RANGE = new int[] { 34, 38 }; +} +private static final String[] source_classic = JEP181NestTest.getTestSeriesClassic(); + +public static Test suite() { + return buildMinimalComplianceTestSuite(testClass(), F_11); +} +private static String[] getTestSeriesClassic() { + return new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public class Y {\n" + + " class Z {}\n" + + " }\n" + + " public static class A {\n" + + " public static class B {}\n" + + " public class C {}\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " System.out.println(\"SUCCESS\");\n" + + " }\n" + + " public void foo() {\n" + + " System.out.println(\"foo\");\n" + + " }\n" + + "}\n", + }; +} +private void verifyClassFile(String expectedOutput, String classFileName, int mode, boolean positive) throws IOException, ClassFormatException { + String result = getClassFileContents(classFileName, mode); + verifyOutput(result, expectedOutput, positive); +} +private String getClassFileContents( String classFileName, int mode) throws IOException, +ClassFormatException { + File f = new File(OUTPUT_DIR + File.separator + classFileName); + byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f); + ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler(); + String result = disassembler.disassemble(classFileBytes, "\n", mode); + return result; +} +private void verifyOutputPositive(String result, String expectedOutput) { + verifyOutput(result, expectedOutput, true); +} +private void verifyOutputNegative(String result, String expectedOutput) { + verifyOutput(result, expectedOutput, false); +} +private void verifyOutput(String result, String expectedOutput, boolean positive) { + int index = result.indexOf(expectedOutput); + if (positive) { + if (index == -1 || expectedOutput.length() == 0) { + System.out.println(Util.displayString(result, 3)); + System.out.println("..."); + } + if (index == -1) { + assertEquals("Wrong contents", expectedOutput, result); + } + } else { + if (index != -1) { + assertEquals("Unexpected contents", "", result); + } + } +} +private void verifyClassFile(String expectedOutput, String classFileName, int mode) throws IOException, + ClassFormatException { + verifyClassFile(expectedOutput, classFileName, mode, true); +} +private void verifyNegativeClassFile(String unExpectedOutput, String classFileName, int mode) throws IOException, +ClassFormatException { + verifyClassFile(unExpectedOutput, classFileName, mode, false); +} +public void testBug535851_001() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + + this.runConformTest( + JEP181NestTest.source_classic, + "SUCCESS", + options + ); + + String expectedPartialOutput = + "Nest Members:\n" + + " #37 pack1/X$A,\n" + + " #44 pack1/X$A$B,\n" + + " #46 pack1/X$A$C,\n" + + " #40 pack1/X$Y,\n" + + " #48 pack1/X$Y$Z\n"; + verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); +} +public void testBug535851_002() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + + this.runConformTest( + JEP181NestTest.source_classic, + "SUCCESS", + options + ); + + String expectedPartialOutput = + "Nest Host: #17 pack1/X\n"; + verifyClassFile(expectedPartialOutput, "pack1/X$A.class", ClassFileBytesDisassembler.SYSTEM); +} +public void testBug535851_003() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + + this.runConformTest( + JEP181NestTest.source_classic, + "SUCCESS", + options + ); + + String unExpectedPartialOutput = + "NestMembers:"; + verifyNegativeClassFile(unExpectedPartialOutput, "pack1/X$A.class", ClassFileBytesDisassembler.SYSTEM); +} +public void testBug535851_004() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + + this.runConformTest( + JEP181NestTest.source_classic, + "SUCCESS", + options + ); + + String expectedPartialOutput = + "Nest Host: #24 pack1/X\n"; + verifyClassFile(expectedPartialOutput, "pack1/X$Y$Z.class", ClassFileBytesDisassembler.SYSTEM); +} +// vanilla anonymous declaration +public void testBug535851_005() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + String[] files = new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static void main(String[] args) {\n" + + " System.out.println(\"SUCCESS\");\n" + + " }\n" + + " public void foo() {\n" + + " Y y = new Y() {\n" + + " void bar() {}\n" + + " };\n" + + " System.out.println(y.toString());\n" + + " }\n" + + "}\n" + + "abstract class Y {\n" + + " abstract void bar();\n" + + "}\n", + }; + this.runConformTest( + files, + "SUCCESS", + options + ); + + String expectedPartialOutput = + "Nest Members:\n" + + " #33 pack1/X$1\n"; + verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + + expectedPartialOutput = "Nest Host: #23 pack1/X\n"; + verifyClassFile(expectedPartialOutput, "pack1/X$1.class", ClassFileBytesDisassembler.SYSTEM); + verifyNegativeClassFile(expectedPartialOutput, "pack1/Y.class", ClassFileBytesDisassembler.SYSTEM); +} +// anonymous declaration inside another anonymous declaration +public void testBug535851_006() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + String[] files = new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static void main(String[] args) {\n" + + " System.out.println(\"SUCCESS\");\n" + + " }\n" + + " public void foo() {\n" + + " Y y = new Y() {\n" + + " void bar() {\n" + + " Y y1 = new Y() {\n" + + " void bar() {}\n" + + " };\n" + + " System.out.println(y1.toString());\n" + + " }\n" + + " };\n" + + " System.out.println(y.toString());\n" + + " }\n" + + "}\n" + + "abstract class Y {\n" + + " abstract void bar();\n" + + "}\n", + }; + this.runConformTest( + files, + "SUCCESS", + options + ); + + String expectedPartialOutput = + "Nest Members:\n" + + " #33 pack1/X$1,\n" + + " #48 pack1/X$1$1\n"; + verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + + expectedPartialOutput = "Nest Host: #48 pack1/X\n"; + verifyClassFile(expectedPartialOutput, "pack1/X$1.class", ClassFileBytesDisassembler.SYSTEM); + expectedPartialOutput = "Nest Host: #28 pack1/X\n"; + verifyClassFile(expectedPartialOutput, "pack1/X$1$1.class", ClassFileBytesDisassembler.SYSTEM); + verifyNegativeClassFile(expectedPartialOutput, "pack1/Y.class", ClassFileBytesDisassembler.SYSTEM); +} + +// lambda with anonymous inside anonymous +public void testBug535851_007() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + String[] files = new String[] { + "pack1/X.java", + "package pack1;\n" + + "\n" + + "public class X {\n" + + " public static void main(String[] args) {\n" + + " System.out.println(\"SUCCESS\");\n" + + " }\n" + + " public void foo() {\n" + + " I i = ()->{\n" + + " Y y = new Y() { \n" + + " @Override\n" + + " void bar() {\n" + + " Y y1 = new Y() {\n" + + " @Override\n" + + " void bar() {}\n" + + " };\n" + + " System.out.println(y1);\n" + + " }\n" + + " };\n" + + " System.out.println(y.toString());\n" + + " };\n" + + " i.apply();\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " void apply();\n" + + "}\n" + + "abstract class Y {\n" + + " abstract void bar();\n" + + "}\n", + }; + this.runConformTest( + files, + "SUCCESS", + options + ); + + String expectedPartialOutput = + "Nest Members:\n" + + " #44 pack1/X$1,\n" + + " #77 pack1/X$1$1\n"; + verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + + expectedPartialOutput = "Nest Host: #42 pack1/X\n"; + verifyClassFile(expectedPartialOutput, "pack1/X$1.class", ClassFileBytesDisassembler.SYSTEM); + expectedPartialOutput = "Nest Host: #28 pack1/X\n"; + verifyClassFile(expectedPartialOutput, "pack1/X$1$1.class", ClassFileBytesDisassembler.SYSTEM); + verifyNegativeClassFile(expectedPartialOutput, "pack1/Y.class", ClassFileBytesDisassembler.SYSTEM); +} +// type declaration in method +public void testBug535851_008() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + String[] files = new String[] { + "pack1/X.java", + "package pack1;\n" + + "\n" + + "public class X {\n"+ + " public void foo() {\n"+ + " class Y {\n"+ + " // nothing\n"+ + " }\n"+ + " Y y = new Y();\n"+ + " System.out.println(\"SUCCESS\");\n"+ + " }\n"+ + " public static void main(String[] args) {\n"+ + " new X().foo();\n"+ + " }\n"+ + "}\n", + }; + this.runConformTest( + files, + "SUCCESS", + options + ); + + String expectedPartialOutput = + "Nest Members:\n" + + " #15 pack1/X$1Y\n"; + verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + + expectedPartialOutput = "Nest Host: #22 pack1/X\n"; + verifyClassFile(expectedPartialOutput, "pack1/X$1Y.class", ClassFileBytesDisassembler.SYSTEM); +} +// testing the inner private instance field access from enclosing type +public void testBug535918_001a() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y {\n" + + " private int priv_int = 100;\n" + + " public int pub_int = 200;\n" + + " \n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = foo();\n" + + " System.out.println(\"SUCCESS:\" + sum);\n" + + " }\n" + + " public static int foo() {\n" + + " Y y = new Y();\n" + + " int i = y.priv_int;\n" + + " int j = y.pub_int;\n" + + " return i + j;\n" + + " }\n" + + " public void bar() {\n" + + " System.out.println(\"bar\");\n" + + " }\n" + + "}\n", + }, + "SUCCESS:300", + options + ); + + String expectedPartialOutput = + "getfield pack1.X$Y.priv_in"; + verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String unExpectedPartialOutput = + "access$"; + verifyNegativeClassFile(unExpectedPartialOutput, "pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); +} +//testing the inner private static field access from enclosing type +public void testBug535918_001b() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y {\n" + + " private static int priv_int = 100;\n" + + " public int pub_int = 200;\n" + + " \n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = foo();\n" + + " System.out.println(\"SUCCESS:\" + sum);\n" + + " }\n" + + " public static int foo() {\n" + + " Y y = new Y();\n" + + " int i = y.priv_int;\n" + + " int j = y.pub_int;\n" + + " return i + j;\n" + + " }\n" + + " public void bar() {\n" + + " System.out.println(\"bar\");\n" + + " }\n" + + "}\n", + }, + "SUCCESS:300", + options + ); + + String expectedPartialOutput = "getstatic pack1.X$Y.priv_int"; + verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + expectedPartialOutput = "Nest Members:\n" + + " #50 pack1/X$Y\n"; + verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + expectedPartialOutput = "Nest Host: #25 pack1/X\n"; + verifyClassFile(expectedPartialOutput, "pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String unExpectedPartialOutput = "invokestatic pack1.X$Y.access$"; + verifyNegativeClassFile(unExpectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + unExpectedPartialOutput = "access$"; + verifyNegativeClassFile(unExpectedPartialOutput, "pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); +} +//testing the nested private field access from enclosing type +public void testBug535918_001c() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y {\n" + + " private int priv_int = 100;\n" + + " public int pub_int = 200;\n" + + " \n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = foo();\n" + + " System.out.println(\"SUCCESS:\" + sum);\n" + + " }\n" + + " public static int foo() {\n" + + " Y y = new Y();\n" + + " int i = y.priv_int;\n" + + " int j = y.pub_int;\n" + + " return i + j;\n" + + " }\n" + + " public void bar() {\n" + + " System.out.println(\"bar\");\n" + + " }\n" + + "}\n", + }, + "SUCCESS:300", + options + ); + + String unExpectedPartialOutput = + "access$"; + verifyNegativeClassFile(unExpectedPartialOutput, "pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); +} +//testing the nested private method access from same type (implicit nesting/nest host) +public void testBug535918_002() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " private int priv_non_static_method() {\n" + + " return 100;\n" + + " }\n" + + " public int pub_non_static_method() {\n" + + " return priv_non_static_method();\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " X x = new X();\n" + + " int result =x.pub_non_static_method();\n" + + " System.out.println(result);\n" + + " }\n" + + "}\n", + }, + "100", + options + ); + + String expectedPartialOutput = + "invokevirtual pack1.X.priv_non_static_method()"; + verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); +} + +// sibling access: private static field +public void testBug535918_003a() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y {\n" + + " private static int priv_int = 100;\n" + + " }\n" + + " public static class Z {\n" + + " public static int foo() {\n" + + " int i = Y.priv_int;\n" + + " return i;\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = Z.foo();\n" + + " System.out.println(\"SUCCESS:\"+sum);\n" + + " }\n" + + "}\n", + }, + "SUCCESS:100", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #55 pack1/X$Y,\n" + + " #17 pack1/X$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #22 pack1/X"); + verifyOutputPositive(XZFile, "Nest Host: #26 pack1/X"); + verifyOutputPositive(XZFile, "getstatic pack1.X$Y.priv_int"); + + verifyOutputNegative(XYFile, "access$"); + verifyOutputNegative(XZFile, "invokestatic pack1.X$Y.access$0"); +} +//sibling access: private instance field +public void testBug535918_003b() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y {\n" + + " private int priv_int = 100;\n" + + " }\n" + + " public static class Z {\n" + + " public static int foo() {\n" + + " Y y = new Y();\n" + + " int i = y.priv_int;\n" + + " return i;\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = Z.foo();\n" + + " System.out.println(\"SUCCESS:\"+sum);\n" + + " }\n" + + "}\n", + }, + "SUCCESS:100", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #55 pack1/X$Y,\n" + + " #17 pack1/X$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #21 pack1/X"); + verifyOutputPositive(XZFile, "Nest Host: #29 pack1/X"); + verifyOutputPositive(XZFile, "getfield pack1.X$Y.priv_int"); + + verifyOutputNegative(XYFile, "access$"); + verifyOutputNegative(XZFile, "invokestatic pack1.X$Y.access$0"); +} +//sibling access: private instance field via Allocation Expression Field reference +// note: internally this follows a different code path +public void testBug535918_003c() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y {\n" + + " private int priv_int = 100;\n" + + " }\n" + + " public static class Z {\n" + + " public static int foo() {\n" + + " int i = new Y().priv_int;\n" + + " return i;\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = Z.foo();\n" + + " System.out.println(\"SUCCESS:\"+sum);\n" + + " }\n" + + "}\n", + }, + "SUCCESS:100", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #55 pack1/X$Y,\n" + + " #17 pack1/X$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #21 pack1/X"); + verifyOutputPositive(XZFile, "Nest Host: #27 pack1/X"); + verifyOutputPositive(XZFile, "getfield pack1.X$Y.priv_int"); + + verifyOutputNegative(XYFile, "access$"); + verifyOutputNegative(XZFile, "invokestatic pack1.X$Y.access$0"); +} +//sibling and super: private static field access of a super-type is accessed from a sub-type with +//both super-type and sub-type being nestmates. +public void testBug535918_003d() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y {\n" + + " private static int priv_int = 100;\n" + + " }\n" + + " public static class Z extends Y {\n" + + " public static int foo() {\n" + + " int i = Y.priv_int;\n" + + " return i;\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = Z.foo();\n" + + " System.out.println(\"SUCCESS:\"+sum);\n" + + " }\n" + + "}\n", + }, + "SUCCESS:100", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #55 pack1/X$Y,\n" + + " #17 pack1/X$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #22 pack1/X"); + verifyOutputPositive(XZFile, "Nest Host: #24 pack1/X"); + verifyOutputPositive(XZFile, "getstatic pack1.X$Y.priv_int"); + + verifyOutputNegative(XYFile, "access$"); + verifyOutputNegative(XZFile, "invokestatic pack1.X$Y.access$0"); +} +//sibling and super: private instance field of a super-type is accessed from a sub-type with +//both super-type and sub-type being nestmates. +public void testBug535918_003e() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y{\n" + + " private int priv_int = 100;\n" + + " }\n" + + " public static class Z extends Y {\n" + + " public static int foo() {\n" + + " Y y = new Y();\n" + + " int i = y.priv_int;\n" + + " return i;\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = Z.foo();\n" + + " System.out.println(\"SUCCESS:\"+sum);\n" + + " }\n" + + "}\n", + }, + "SUCCESS:100", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #55 pack1/X$Y,\n" + + " #17 pack1/X$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #21 pack1/X"); + verifyOutputPositive(XZFile, "Nest Host: #26 pack1/X"); + verifyOutputPositive(XZFile, "getfield pack1.X$Y.priv_int"); + + verifyOutputNegative(XYFile, "access$"); + verifyOutputNegative(XZFile, "invokestatic pack1.X$Y.access$0"); +} +//sibling and super with super keyword: private instance field of a super-type is accessed from a sub-type +// user keyword super with both super-type and sub-type being nestmates. +public void testBug535918_003f() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y{\n" + + " private int priv_int = 100;\n" + + " }\n" + + " public static class Z extends Y {\n" + + " public int foo() {\n" + + " int i = super.priv_int;\n" + + " return i;\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = new Z().foo();\n" + + " System.out.println(\"SUCCESS:\"+sum);\n" + + " }\n" + + "}\n", + }, + "SUCCESS:100", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #56 pack1/X$Y,\n" + + " #16 pack1/X$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #21 pack1/X"); + verifyOutputPositive(XZFile, "Nest Host: #24 pack1/X"); + verifyOutputPositive(XZFile, "getfield pack1.X$Y.priv_int"); + + verifyOutputNegative(XYFile, "access$"); + verifyOutputNegative(XZFile, "invokestatic pack1.X$Y.access$0"); +} +//vanilla field access of enclosing type: private static field of enclosing type accessed in inner type +public void testBug535918_004a() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " private static int priv_int = 100;\n" + + " public static class Y {\n" + + " public static int foo() {\n" + + " return priv_int;\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = Y.foo();\n" + + " System.out.println(\"SUCCESS:\"+sum);\n" + + " }\n" + + "}\n", + }, + "SUCCESS:100", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #22 pack1/X$Y\n"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #17 pack1/X"); + verifyOutputPositive(XYFile, "getstatic pack1.X.priv_int"); + + verifyOutputNegative(XFile, "access$"); + verifyOutputNegative(XFile, "invokestatic pack1.X.access$0()"); + +} +//vanilla field access of enclosing type: private instance field of enclosing type accessed in inner type +public void testBug535918_004b() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " private int priv_int = 100;\n" + + " public class Y {\n" + + " public int foo() {\n" + + " return priv_int;\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = new X().new Y().foo();\n" + + " System.out.println(\"SUCCESS:\"+sum);\n" + + " }\n" + + "}\n", + }, + "SUCCESS:100", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #20 pack1/X$Y\n"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #22 pack1/X"); + verifyOutputPositive(XYFile, "getfield pack1.X.priv_int"); + + verifyOutputNegative(XFile, "access$"); + verifyOutputNegative(XYFile, "invokestatic pack1.X.access$0()"); + +} +//nestmate inner constructor call from outer - no synthetic and appropriate call site params +public void testBug535918_005a() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " class Y {\n" + + " class Z {\n" + + " private Z() {\n" + + " }\n" + + " }\n" + + " Z d;\n" + + " private Y() {\n" + + " this.d = new Z();\n" + + " }\n" + + " }\n" + + " @Override\n" + + " public String toString() {\n" + + " return \"SUCCESS\";\n" + + " }\n" + + " public static void main(String[] argv) {\n" + + " System.out.println(new X());\n" + + " }\n" + + "}\n", + }, + "SUCCESS", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XYZFile = getClassFileContents("pack1/X$Y$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #38 pack1/X$Y,\n" + + " #42 pack1/X$Y$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #31 pack1/X"); + verifyOutputPositive(XYZFile, "Nest Host: #24 pack1/X"); + verifyOutputPositive(XYFile, "invokespecial pack1.X$Y$Z(pack1.X$Y)"); //only one param + + verifyOutputNegative(XYZFile, "synthetic X$Y$Z"); + verifyOutputNegative(XYFile, "invokespecial pack1.X$Y$Z(pack1.X$Y, pack1.X$Y$Z)"); +} +//nestmate sibling constructor call - no synthetic and appropriate call site params +public void testBug535918_005b() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " class Z {\n" + + " private Z() {\n" + + " }\n" + + " }\n" + + " class Y {\n" + + " Z d;\n" + + " private Y() {\n" + + " this.d = new Z();\n" + + " }\n" + + " }\n" + + " @Override\n" + + " public String toString() {\n" + + " return \"SUCCESS\";\n" + + " }\n" + + " public static void main(String[] argv) {\n" + + " System.out.println(new X());\n" + + " }\n" + + "}\n", + }, + "SUCCESS", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #38 pack1/X$Y,\n" + + " #41 pack1/X$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #30 pack1/X"); + verifyOutputPositive(XZFile, "Nest Host: #22 pack1/X"); + verifyOutputPositive(XYFile, "invokespecial pack1.X$Z(pack1.X)"); //only one param + + verifyOutputNegative(XZFile, "synthetic X$Z"); + verifyOutputNegative(XYFile, "invokespecial pack1.X$Z(pack1.X$Y, pack1.X$Z)"); +} +//nestmate outer constructor call from inner - no synthetic and appropriate call site params +public void testBug535918_005c() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " class Y {\n" + + " private Y() {\n" + + " }\n" + + " class Z {\n" + + " Y y;\n" + + " private Z() {\n" + + " this.y = new Y();\n" + + " }\n" + + " }\n" + + " }\n" + + " @Override\n" + + " public String toString() {\n" + + " return \"SUCCESS\";\n" + + " }\n" + + " public static void main(String[] argv) {\n" + + " System.out.println(new X());\n" + + " }\n" + + "}\n", + }, + "SUCCESS", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XYZFile = getClassFileContents("pack1/X$Y$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #38 pack1/X$Y,\n" + + " #42 pack1/X$Y$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #24 pack1/X"); + verifyOutputPositive(XYZFile, "Nest Host: #34 pack1/X"); + verifyOutputPositive(XYZFile, "invokespecial pack1.X$Y(pack1.X)"); //only one param + + verifyOutputNegative(XYFile, "synthetic X$Y"); + verifyOutputNegative(XYZFile, "invokespecial pack1.X$Y(pack1.X, pack1.X$Y)"); +} +//nestmate super call to private constructor from sibling nestmate which is a subtype - no synthetic and appropriate call site params +public void testBug535918_005d() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " private class Y {\n" + + " private Y() {\n" + + " super();\n" + + " }\n" + + " }\n" + + " private class Z extends Y {\n" + + " private Z() {\n" + + " super();\n" + + " }\n" + + " }\n" + + " public static void main(String[] argv) {\n" + + " System.out.println(\"SUCCESS\");\n" + + " }\n" + + "}\n", + }, + "SUCCESS", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #35 pack1/X$Y,\n" + + " #38 pack1/X$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #22 pack1/X"); + verifyOutputPositive(XZFile, "Nest Host: #21 pack1/X"); + verifyOutputPositive(XZFile, "invokespecial pack1.X$Y(pack1.X)"); //only one param + + verifyOutputNegative(XYFile, "synthetic X$Y"); + verifyOutputNegative(XZFile, "invokespecial pack1.X$Y(pack1.X, pack1.X$Y)"); +} +// nestmate super call to private constructor from sibling nestmate which is a subtype +// super is a parameterized type +public void testBug535918_005e() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " private static class Y<T> implements AutoCloseable {\n" + + " private Y() {\n" + + " super();\n" + + " }\n" + + " public void close() {\n" + + " }\n" + + " }\n" + + " @SuppressWarnings(\"unused\")\n" + + "private static class Z extends Y<Object> {\n" + + " private Z() {\n" + + " super();\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " System.out.println(\"SUCCESS\");\n" + + " }\n" + + "}\n", + }, + "SUCCESS", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XZFile = getClassFileContents("pack1/X$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #35 pack1/X$Y,\n" + + " #38 pack1/X$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #24 pack1/X"); + verifyOutputPositive(XZFile, "Nest Host: #19 pack1/X"); + verifyOutputPositive(XZFile, "invokespecial pack1.X$Y()"); //only one param + + verifyOutputNegative(XYFile, "synthetic pack1.X$Y(pack1.X.Y arg0)"); + verifyOutputNegative(XZFile, "2 invokespecial pack1.X$Y(pack1.X$Y)"); +} +//nestmate constructor reference +public void testBug535918_005f() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "X.java", + "interface I {\n" + + " X makeX(int x);\n" + + "}\n" + + "public class X {\n" + + " void foo() {\n" + + " class Y {\n" + + " void f() {\n" + + " I i = X::new;\n" + + " i.makeX(123456);\n" + + " }\n" + + " }\n" + + " new Y().f();\n" + + " }\n" + + " private X(int x) {\n" + + " super();\n" + + " System.out.println(\"SUCCESS\");\n" + + " }\n" + + " X() {\n" + + " super();\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " new X().foo();\n" + + " }\n" + + "}\n", + }, + "SUCCESS", + options + ); + + String XFile = getClassFileContents("X.class", ClassFileBytesDisassembler.SYSTEM); + String X1YFile = getClassFileContents("X$1Y.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #8 X$1Y\n"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(X1YFile, "Nest Host: #33 X"); + + verifyOutputNegative(X1YFile, "synthetic X$Y(pack1.X.Y arg0)"); +} +//testing the nested private method access from enclosing type +public void testBug535918_005g() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y {\n" + + " private int priv_instance_method() {\n" + + " return 100;\n" + + " }\n" + + " public int pub_instance_method() {\n" + + " int pri = priv_instance_method();\n" + + " return 200 + pri;\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = foo();\n" + + " System.out.println(\"SUCCESS:\"+sum);\n" + + " }\n" + + " public static int foo() {\n" + + " Y y = new Y();\n" + + " int i = y.priv_instance_method();\n" + + " int j = y.pub_instance_method();\n" + + " return i + j;\n" + + " }\n" + + " public void bar() {\n" + + " System.out.println(\"bar\");\n" + + " }\n" + + "}\n", + }, + "SUCCESS:400", + options + ); + + String expectedPartialOutput = + "invokevirtual pack1.X$Y.priv_instance_method()"; + verifyClassFile(expectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); +} +//negative testing the nested private method access from enclosing type is not via invokespecial +public void testBug535918_005h() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y {\n" + + " private int priv_instance_method() {\n" + + " return 100;\n" + + " }\n" + + " public int pub_instance_method() {\n" + + " int pri = priv_instance_method();\n" + + " return 200 + pri;\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = foo();\n" + + " System.out.println(\"SUCCESS:\"+sum);\n" + + " }\n" + + " public static int foo() {\n" + + " Y y = new Y();\n" + + " int i = y.priv_instance_method();\n" + + " int j = y.pub_instance_method();\n" + + " return i + j;\n" + + " }\n" + + " public void bar() {\n" + + " System.out.println(\"bar\");\n" + + " }\n" + + "}\n", + }, + "SUCCESS:400", + options + ); + + String unExpectedPartialOutput = + "invokespecial pack1.X$Y.priv_instance_method()"; + verifyNegativeClassFile(unExpectedPartialOutput, "pack1/X.class", ClassFileBytesDisassembler.SYSTEM); +} +//negative testing the synthetic method - access - not present in nested class +public void testBug535918_005i() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "public class X {\n" + + " public static class Y {\n" + + " private int priv_instance_method() {\n" + + " return 100;\n" + + " }\n" + + " public int pub_instance_method() {\n" + + " int pri = priv_instance_method();\n" + + " return 200 + pri;\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " int sum = foo();\n" + + " System.out.println(\"SUCCESS:\"+sum);\n" + + " }\n" + + " public static int foo() {\n" + + " Y y = new Y();\n" + + " int i = y.priv_instance_method();\n" + + " int j = y.pub_instance_method();\n" + + " return i + j;\n" + + " }\n" + + " public void bar() {\n" + + " System.out.println(\"bar\");\n" + + " }\n" + + "}\n", + }, + "SUCCESS:400", + options + ); + + String unExpectedPartialOutput = + "access$"; + verifyNegativeClassFile(unExpectedPartialOutput, "pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); +} +//private interface method invoked from a method inside the same interface should be invokeinterface +public void testBug535918_005j() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "interface I {\n" + + " private void foo() {}\n" + + " public default void apply() {\n" + + " foo();\n" + + " }\n" + + "}\n" + + "public class X {\n" + + " public static void main(String[] args) {\n" + + " }\n" + + "}\n", + }, + "", + options + ); + + String IFile = getClassFileContents("pack1/I.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "invokeinterface pack1.I.foo"; + verifyOutputPositive(IFile, partialOutput); +} +//private interface method invoked from a nestmate interface should be invokeinterface +public void testBug535918_005k() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n" + + "interface I {" + + " private void foo() {}" + + " " + + " interface J {" + + " public default void apply() {" + + " I i = new X();" + + " i.foo();" + + " } " + + " }" + + "}" + + "public class X implements I{\n" + + "}\n", + }, + "", + options + ); + + String IFile = getClassFileContents("pack1/I$J.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "invokeinterface pack1.I.foo"; + verifyOutputPositive(IFile, partialOutput); +} +//test for SyntheticMethodBinding.SuperField*Access +public void testBug535918_0056a() throws Exception { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + + this.runConformTest( + new String[] { + "pack1/X.java", + "package pack1;\n"+ + "public class X {\n"+ + " private int priv_int;\n"+ + "\n"+ + " class Y extends X {\n"+ + " class Z extends Y {\n"+ + " public void foo() {\n"+ + " X.Y.super.priv_int = 0;\n"+ + " }\n"+ + " }\n"+ + " }\n"+ + "\n"+ + " public static void main(String[] args) {\n"+ + " new X().new Y().new Z().foo();\n"+ + " }\n"+ + "}\n", + }, + "", + options + ); + + String XFile = getClassFileContents("pack1/X.class", ClassFileBytesDisassembler.SYSTEM); + String XYFile = getClassFileContents("pack1/X$Y.class", ClassFileBytesDisassembler.SYSTEM); + String XYZFile = getClassFileContents("pack1/X$Y$Z.class", ClassFileBytesDisassembler.SYSTEM); + String partialOutput = "Nest Members:\n" + + " #20 pack1/X$Y,\n" + + " #18 pack1/X$Y$Z"; + verifyOutputPositive(XFile, partialOutput); + verifyOutputPositive(XYFile, "Nest Host: #3 pack1/X"); + verifyOutputPositive(XYZFile, "Nest Host: #22 pack1/X"); + verifyOutputPositive(XYZFile, "putfield pack1.X.priv_int"); //direct access + + verifyOutputNegative(XYFile, "synthetic X$Y"); + verifyOutputNegative(XYZFile, "invokestatic X.access$0(X, int)"); +} + +public static Class testClass() { + return JEP181NestTest.class; +} +} diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286ReservedWordTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286ReservedWordTest.java index 354723e13a..4ff3843f56 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286ReservedWordTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286ReservedWordTest.java @@ -1,13 +1,12 @@ /******************************************************************************* * Copyright (c) 2018 Jesper Steen Møller and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * This is an implementation of an early-draft specification developed under the Java - * Community Process (JCP) and is made available for testing and evaluation purposes - * only. The code is not compatible with any specification of the JCP. + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Jesper Steen Møller - initial API and implementation @@ -55,7 +54,7 @@ public void test0001_class_var_warning() throws IOException { "Syntax error on token \"+\", delete this token\n" + "----------\n"; - if (this.complianceLevel == ClassFileConstants.JDK10) { + if (Long.compare(this.complianceLevel, ClassFileConstants.JDK10) >= 0) { this.runNegativeTest( new String[] { "X.java", @@ -98,7 +97,7 @@ public void test0002_interface_var_warning() throws IOException { "Syntax error on token \"+\", delete this token\n" + "----------\n"; - if (this.complianceLevel == ClassFileConstants.JDK10) { + if (Long.compare(this.complianceLevel, ClassFileConstants.JDK10) >= 0) { this.runNegativeTest( new String[] { "X.java", @@ -131,7 +130,7 @@ public void testBug530920() throws IOException { "X.java", classX }, - this.complianceLevel == ClassFileConstants.JDK10 ? + Long.compare(this.complianceLevel, ClassFileConstants.JDK10) >= 0 ? "----------\n" + "1. ERROR in X.java (at line 1)\n" + " public class X<var extends Number> { }\n" + @@ -155,7 +154,7 @@ public void testBug530920a() throws IOException { " }\n" + "}" }, - this.complianceLevel == ClassFileConstants.JDK10 ? + Long.compare(this.complianceLevel, ClassFileConstants.JDK10) >= 0 ? "----------\n" + "1. ERROR in X.java (at line 2)\n" + " <var extends Number> var getNumber() {\n" + diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java index 10216e4398..d7c3fb22de 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP286Test.java @@ -1,13 +1,12 @@ /******************************************************************************* * Copyright (c) 2018 Jesper Steen Møller and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * This is an implementation of an early-draft specification developed under the Java - * Community Process (JCP) and is made available for testing and evaluation purposes - * only. The code is not compatible with any specification of the JCP. + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Jesper Steen Møller - initial API and implementation @@ -70,7 +69,7 @@ protected Map getCompilerOptions() { simpleTypeNames.put("ComparableAny", "Comparable<?>"); simpleTypeNames.put("CollectionExt_ComparableAny", "Collection<? extends Comparable<?>>"); simpleTypeNames.put("CollectionSuperComparableAny", "Collection<? super Comparable<?>>"); - simpleTypeNames.put("IntLongFloat", "java.lang.Number&Comparable<?>"); + simpleTypeNames.put("IntLongFloat", "java.lang.Number & Comparable<?>"); simpleTypeNames.put("ListTestAndSerializable", "List<? extends Z & java.io.Serializable>"); simpleTypeNames.put("TestAndSerializable", "Z & java.io.Serializable"); } diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP323VarLambdaParamsTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP323VarLambdaParamsTest.java new file mode 100644 index 0000000000..5bc4f6e811 --- /dev/null +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JEP323VarLambdaParamsTest.java @@ -0,0 +1,319 @@ +/******************************************************************************* + * Copyright (c) 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.core.tests.compiler.regression; + +import java.io.IOException; +import java.util.Map; + +import org.eclipse.jdt.core.tests.util.CompilerTestSetup; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; +import junit.framework.Test; + +@SuppressWarnings({ "unchecked", "rawtypes" }) +public class JEP323VarLambdaParamsTest extends AbstractRegressionTest { + +public static Class testClass() { + return JEP323VarLambdaParamsTest.class; +} +public void initialize(CompilerTestSetup setUp) { + super.initialize(setUp); +} +public static Test suite() { + return buildMinimalComplianceTestSuite(testClass(), F_11); +} + +public JEP323VarLambdaParamsTest(String testName){ + super(testName); +} +static { +// TESTS_NUMBERS = new int[] { 1 }; +// TESTS_RANGE = new int[] { 1, -1 }; +// TESTS_NAMES = new String[] { "testBug534787_positive_001" }; +} +protected Map getCompilerOptions() { + Map options = super.getCompilerOptions(); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + return options; +} + +public void testBug534787_positive_001() throws IOException { + this.runConformTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void main(String [] args) {\n" + + " I lam = (var x) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " lam.apply(20);\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " public void apply(Integer k);\n" + + "}\n" + }, + "SUCCESS 20"); +} +public void testBug534787_positive_002() throws IOException { + this.runConformTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void main(String [] args) {\n" + + " I lam = (var x, var y) -> {System.out.println(\"SUCCESS \" + (x+y));};\n" + + " lam.apply(20, 200);\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " public void apply(Integer k, Integer l);\n" + + "}\n" + }, + "SUCCESS 220"); +} +public void testBug534787_positive_003() throws IOException { + this.runConformTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void main(String [] args) {\n" + + " I lam = var -> {System.out.println(\"SUCCESS \" + var);};\n" + + " lam.apply(10);\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " public void apply(Integer k);\n" + + "}\n" + }, + "SUCCESS 10"); +} +public void testBug534787_positive_004() throws IOException { + this.runConformTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void main(String [] args) {\n" + + " I lam = (var var) -> {System.out.println(\"SUCCESS \" + var);};\n" + + " lam.apply(10);\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " public void apply(Integer k);\n" + + "}\n" + }, + "SUCCESS 10"); +} +public void testBug534787_negative_001() throws IOException { + this.runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void main(String [] args) {\n" + + " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " public void apply(Integer k, Integer z);\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " ^^^\n" + + "Syntax error on token \"var\", ( expected after this token\n" + + "----------\n" + + "2. ERROR in X.java (at line 3)\n" + + " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " ^\n" + + "Syntax error on token \")\", delete this token\n" + + "----------\n" + + "3. ERROR in X.java (at line 3)\n" + + " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " ^\n" + + "Syntax error, insert \")\" to complete Expression\n" + + "----------\n" + + "4. ERROR in X.java (at line 3)\n" + + " I lam = (var x, y) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " ^\n" + + "Syntax error, insert \")\" to complete Expression\n" + + "----------\n"); +} +public void testBug534787_negative_002() throws IOException { + this.runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void main(String [] args) {\n" + + " I lam = (var x, Integer y) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " lam.apply(20, 200);\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " public void apply(Integer k, Integer z);\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " I lam = (var x, Integer y) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " ^\n" + + "\'var\' cannot be mixed with non-var parameters\n" + + "----------\n"); +} +public void testBug534787_negative_003() throws IOException { + this.runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void main(String [] args) {\n" + + " I lam = (Integer x, var y) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " lam.apply(20, 200);\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " public void apply(Integer k, Integer z);\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " I lam = (Integer x, var y) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " ^\n" + + "'var' cannot be mixed with non-var parameters\n" + + "----------\n"); +} +public void testBug534787_negative_004() throws IOException { + this.runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void main(String [] args) {\n" + + " I lam = (var x, var y, var...s) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " lam.apply(20, 200, \"hello\");\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " public void apply(Integer k, Integer z, String s);\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " I lam = (var x, var y, var...s) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " ^\n" + + "'var' is not allowed as an element type of an array\n" + + "----------\n"); +} +public void testBug534787_negative_005() throws IOException { + this.runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void main(String [] args) {\n" + + " I lam = (var x, Integer y, var...s) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " lam.apply(20, 200, \"hello\");\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " public void apply(Integer k, Integer z, String s);\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " I lam = (var x, Integer y, var...s) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " ^\n" + + "'var' cannot be mixed with non-var parameters\n" + + "----------\n" + + "2. ERROR in X.java (at line 3)\n" + + " I lam = (var x, Integer y, var...s) -> {System.out.println(\"SUCCESS \" + x);};\n" + + " ^\n" + + "'var' is not allowed as an element type of an array\n" + + "----------\n"); +} + +public void testBug534787_negative_006() throws IOException { + this.runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void main(String [] args) {\n" + + " I lam = var x -> {System.out.println(\"SUCCESS \" + x);};\n" + + " }\n" + + "}\n" + + "interface I {\n" + + " public void apply(Integer k);\n" + + "}\n" + }, + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " I lam = var x -> {System.out.println(\"SUCCESS \" + x);};\n" + + " ^\n" + + "Syntax error on token \"x\", delete this token\n" + + "----------\n"); +} +public void testBug536159_01() throws IOException { + runConformTest(new String[] { + "X.java", + "public class X<T> {\n" + + "public static void main(String[] args) {\n" + + " FI x = (int i []) -> 5;\n" + + " }\n" + + "}\n" + + "interface FI {\n" + + " public int foo (int i []);\n" + + "}" + }); +} +public void testBug536159_02() throws IOException { + runConformTest(new String[] { + "X.java", + "public class X<T> {\n" + + "public static void main(String[] args) {\n" + + " FI x = (int[] i []) -> 5;\n" + + " }\n" + + "}\n" + + "interface FI {\n" + + " public int foo (int i [][]);\n" + + "}" + }); +} +public void testBug536159_03() throws IOException { + runConformTest(new String[] { + "X.java", + "public class X<T> {\n" + + "public static void main(String[] args) {\n" + + " FI x = (int i [][]) -> 5;\n" + + " }\n" + + "}\n" + + "interface FI {\n" + + " public int foo (int i [][]);\n" + + "}" + }); +} +public void testBug536159_04() throws IOException { + runNegativeTest(new String[] { + "X.java", + "public class X<T> {\n" + + "public static void main(String[] args) {\n" + + " FI x = (var i []) -> 5;\n" + + " }\n" + + "}\n" + + "interface FI {\n" + + " public int foo (int i []);\n" + + "}" + }, + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " FI x = (var i []) -> 5;\n" + + " ^\n" + + "\'var\' is not allowed as an element type of an array\n" + + "----------\n"); +} +} \ No newline at end of file diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java index fa34bd765f..43b93f041e 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR308SpecSnippetTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java index 48de8fc616..a5a229461c 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JSR335ClassFileTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Jesper Steen Moller - initial API and implementation @@ -18,6 +21,7 @@ import junit.framework.Test; import org.eclipse.jdt.core.ToolFactory; +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.ClassFormatException; @@ -35,9 +39,7 @@ public JSR335ClassFileTest(String name) { // No need for a tearDown() protected void setUp() throws Exception { super.setUp(); - this.versionString = (this.complianceLevel < ClassFileConstants.JDK9) - ? "version 1.8 : 52.0" - : (this.complianceLevel < ClassFileConstants.JDK10 ? "version 9 : 53.0" : "version 10 : 54.0"); + this.versionString = AbstractCompilerTest.getVersionString(this.complianceLevel); } /* @@ -2348,6 +2350,14 @@ public void test016() throws Exception { }, "Lambda"); + String nestConstant = ""; + String nestHost = ""; + CompilerOptions options = new CompilerOptions(getCompilerOptions()); + if (options.complianceLevel >= ClassFileConstants.JDK11) { + nestConstant = " constant #77 utf8: \"NestHost\"\n"; + nestHost = "\n" + + "Nest Host: #53 X\n"; + } String expectedOutput = "// Compiled from X.java (" + this.versionString + ", super bit)\n" + "class X$1Y {\n" + @@ -2428,6 +2438,7 @@ public void test016() throws Exception { " constant #74 class: #75 java/lang/invoke/MethodHandles\n" + " constant #75 utf8: \"java/lang/invoke/MethodHandles\"\n" + " constant #76 utf8: \"Lookup\"\n" + + nestConstant + " \n" + " // Field descriptor #6 LX;\n" + " final synthetic X this$0;\n" + @@ -2484,7 +2495,8 @@ public void test016() throws Exception { " inner name: #71 Y, accessflags: 0 default],\n" + " [inner class info: #72 java/lang/invoke/MethodHandles$Lookup, outer class info: #74 java/lang/invoke/MethodHandles\n" + " inner name: #76 Lookup, accessflags: 25 public static final]\n" + - " Enclosing Method: #53 #55 X.foo()V\n" + + " Enclosing Method: #53 #55 X.foo()V\n" + + nestHost + "Bootstrap methods:\n" + " 0 : # 64 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" + @@ -2525,6 +2537,14 @@ public void test017() throws Exception { }, "Lambda"); + String nestConstant = ""; + String nestHost = ""; + CompilerOptions options = new CompilerOptions(getCompilerOptions()); + if (options.complianceLevel >= ClassFileConstants.JDK11) { + nestConstant = " constant #77 utf8: \"NestHost\"\n"; + nestHost = "\n" + + "Nest Host: #53 X\n"; + } String expectedOutput = "// Compiled from X.java (" + this.versionString + ", super bit)\n" + "class X$1Y {\n" + @@ -2604,7 +2624,8 @@ public void test017() throws Exception { " constant #73 utf8: \"java/lang/invoke/MethodHandles$Lookup\"\n" + " constant #74 class: #75 java/lang/invoke/MethodHandles\n" + " constant #75 utf8: \"java/lang/invoke/MethodHandles\"\n" + - " constant #76 utf8: \"Lookup\"\n" + + " constant #76 utf8: \"Lookup\"\n" + + nestConstant + " \n" + " // Field descriptor #6 LX;\n" + " final synthetic X this$0;\n" + @@ -2661,7 +2682,8 @@ public void test017() throws Exception { " inner name: #71 Y, accessflags: 0 default],\n" + " [inner class info: #72 java/lang/invoke/MethodHandles$Lookup, outer class info: #74 java/lang/invoke/MethodHandles\n" + " inner name: #76 Lookup, accessflags: 25 public static final]\n" + - " Enclosing Method: #53 #55 X.foo()V\n" + + " Enclosing Method: #53 #55 X.foo()V\n" + + nestHost + "Bootstrap methods:\n" + " 0 : # 64 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" + diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java index 8b86b31bdb..8ff2565de5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java index c396105d9b..bf7f872374 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java index f38d35bc3d..058fa36efc 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java index 21b4c52175..bd0f7f111f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java index b01bc2787f..62c2a2fc1c 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java index 54e0f68b59..1d57c014c8 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java index e7cf7d7671..5b66909221 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestMixed.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestMixed.java index 80c9ecbe3a..d3d171e0d7 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestMixed.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestMixed.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestOptions.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestOptions.java index 6118519072..19c807c0aa 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestOptions.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestOptions.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java index 9d5093cf28..b7e700ae76 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java index 95f2150c43..0fd58a00b5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java index fa6d2d2d8d..04bc8efacc 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Jsr14Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Jsr14Test.java index 12b1cb7acd..1cbf2e79b2 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Jsr14Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Jsr14Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2010, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java index c8f889f00b..2ac9f09d44 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -36,7 +39,7 @@ public class LambdaExpressionsTest extends AbstractRegressionTest { static { -// TESTS_NAMES = new String[] { "testReferenceExpressionInference1"}; + TESTS_NAMES = new String[] { "test449063"}; // TESTS_NUMBERS = new int[] { 50 }; // TESTS_RANGE = new int[] { 11, -1 }; } diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java index 77069a30f7..7e265433b5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaRegressionTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java index 451b6e470b..a7309d52ef 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaShapeTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2015 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LineNumberAttributeTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LineNumberAttributeTest.java index 7557c0124c..07ae720954 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LineNumberAttributeTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LineNumberAttributeTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2007, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java index dffca1c249..cf2ad8afa8 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalVariableTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java index 02219e9101..615a63302e 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -668,6 +671,25 @@ public void test019() { * member class */ public void test020() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. ERROR in p1\\A.java (at line 13)\n" + + " System.out.println(foo.rating + bar.other); \n" + + " ^^^^^\n" + + "other cannot be resolved or is not a field\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in p1\\A.java (at line 6)\n" + + " sth.rating = \"m\"; \n" + + " ^^^^^^\n" + + "Write access to enclosing field A.rating is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. ERROR in p1\\A.java (at line 13)\n" + + " System.out.println(foo.rating + bar.other); \n" + + " ^^^^^\n" + + "other cannot be resolved or is not a field\n" + + "----------\n"; this.runNegativeTest( new String[] { /* p1.A */ @@ -688,17 +710,7 @@ public void test020() { " } \n"+ "}" }, - "----------\n" + - "1. WARNING in p1\\A.java (at line 6)\n" + - " sth.rating = \"m\"; \n" + - " ^^^^^^\n" + - "Write access to enclosing field A.rating is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. ERROR in p1\\A.java (at line 13)\n" + - " System.out.println(foo.rating + bar.other); \n" + - " ^^^^^\n" + - "other cannot be resolved or is not a field\n" + - "----------\n"); + errMessage); } /** * member class @@ -3139,6 +3151,45 @@ public void test096() { } // https://bugs.eclipse.org/bugs/show_bug.cgi?id= 317212 public void test097() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in B.java (at line 6)\n" + + " public class M {\n" + + " ^\n" + + "The type B.A.M is never used locally\n" + + "----------\n" + + "2. WARNING in B.java (at line 7)\n" + + " public M() {}\n" + + " ^^^\n" + + "The constructor B.A.M() is never used locally\n" + + "----------\n" + + "3. ERROR in B.java (at line 13)\n" + + " B.m().new M();\n" + + " ^^^^^\n" + + "The type B$A is not visible\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in B.java (at line 3)\n" + + " return new B().new A();\n" + + " ^^^^^^^^^^^^^^^\n" + + "Access to enclosing constructor B.A() is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. WARNING in B.java (at line 6)\n" + + " public class M {\n" + + " ^\n" + + "The type B.A.M is never used locally\n" + + "----------\n" + + "3. WARNING in B.java (at line 7)\n" + + " public M() {}\n" + + " ^^^\n" + + "The constructor B.A.M() is never used locally\n" + + "----------\n" + + "4. ERROR in B.java (at line 13)\n" + + " B.m().new M();\n" + + " ^^^^^\n" + + "The type B$A is not visible\n" + + "----------\n"; this.runNegativeTest( new String[] { "B.java",//------------------------------ @@ -3158,27 +3209,7 @@ public void test097() { " }\n" + "}\n", }, - "----------\n" + - "1. WARNING in B.java (at line 3)\n" + - " return new B().new A();\n" + - " ^^^^^^^^^^^^^^^\n" + - "Access to enclosing constructor B.A() is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. WARNING in B.java (at line 6)\n" + - " public class M {\n" + - " ^\n" + - "The type B.A.M is never used locally\n" + - "----------\n" + - "3. WARNING in B.java (at line 7)\n" + - " public M() {}\n" + - " ^^^\n" + - "The constructor B.A.M() is never used locally\n" + - "----------\n" + - "4. ERROR in B.java (at line 13)\n" + - " B.m().new M();\n" + - " ^^^^^\n" + - "The type B$A is not visible\n" + - "----------\n"); + errMessage); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=317858 public void test098() { @@ -3320,8 +3351,66 @@ public void test103() { Map options = getCompilerOptions(); CompilerOptions compOptions = new CompilerOptions(options); if (compOptions.complianceLevel < ClassFileConstants.JDK1_4) return; - Runner runner = new Runner(); - runner.testFiles = + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in A.java (at line 2)\n" + + " private int x;\n" + + " ^\n" + + "The value of the field A.x is not used\n" + + "----------\n" + + "2. WARNING in A.java (at line 4)\n" + + " private int x;\n" + + " ^\n" + + "The value of the field A.B.x is not used\n" + + "----------\n" + + "3. WARNING in A.java (at line 5)\n" + + " private C c = new C() {\n" + + " ^\n" + + "The value of the field A.B.c is not used\n" + + "----------\n" + + "4. WARNING in A.java (at line 6)\n" + + " void foo() {\n" + + " ^^^^^\n" + + "The method foo() from the type new A.C(){} is never used locally\n" + + "----------\n" + + "5. WARNING in A.java (at line 12)\n" + + " private int x;\n" + + " ^\n" + + "The value of the field A.C.x is not used\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in A.java (at line 2)\n" + + " private int x;\n" + + " ^\n" + + "The value of the field A.x is not used\n" + + "----------\n" + + "2. WARNING in A.java (at line 4)\n" + + " private int x;\n" + + " ^\n" + + "The value of the field A.B.x is not used\n" + + "----------\n" + + "3. WARNING in A.java (at line 5)\n" + + " private C c = new C() {\n" + + " ^\n" + + "The value of the field A.B.c is not used\n" + + "----------\n" + + "4. WARNING in A.java (at line 6)\n" + + " void foo() {\n" + + " ^^^^^\n" + + "The method foo() from the type new A.C(){} is never used locally\n" + + "----------\n" + + "5. WARNING in A.java (at line 7)\n" + + " x = 3;\n" + + " ^\n" + + "Write access to enclosing field A.B.x is emulated by a synthetic accessor method\n" + + "----------\n" + + "6. WARNING in A.java (at line 12)\n" + + " private int x;\n" + + " ^\n" + + "The value of the field A.C.x is not used\n" + + "----------\n"; + this.runNegativeTest( new String[] { "A.java",//------------------------------ "public class A {\n" + @@ -3338,41 +3427,8 @@ public void test103() { " private int x;\n" + " }\n" + " }\n", - }; - runner.expectedCompilerLog = - "----------\n" + - "1. WARNING in A.java (at line 2)\n" + - " private int x;\n" + - " ^\n" + - "The value of the field A.x is not used\n" + - "----------\n" + - "2. WARNING in A.java (at line 4)\n" + - " private int x;\n" + - " ^\n" + - "The value of the field A.B.x is not used\n" + - "----------\n" + - "3. WARNING in A.java (at line 5)\n" + - " private C c = new C() {\n" + - " ^\n" + - "The value of the field A.B.c is not used\n" + - "----------\n" + - "4. WARNING in A.java (at line 6)\n" + - " void foo() {\n" + - " ^^^^^\n" + - "The method foo() from the type new A.C(){} is never used locally\n" + - "----------\n" + - "5. WARNING in A.java (at line 7)\n" + - " x = 3;\n" + - " ^\n" + - "Write access to enclosing field A.B.x is emulated by a synthetic accessor method\n" + - "----------\n" + - "6. WARNING in A.java (at line 12)\n" + - " private int x;\n" + - " ^\n" + - "The value of the field A.C.x is not used\n" + - "----------\n"; - runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; - runner.runWarningTest(); + }, + errMessage); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=316956 public void test104() { @@ -3428,8 +3484,57 @@ public void test105() { Map options = getCompilerOptions(); CompilerOptions compOptions = new CompilerOptions(options); if (compOptions.complianceLevel < ClassFileConstants.JDK1_4) return; - Runner runner = new Runner(); - runner.testFiles = + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in A.java (at line 2)\n" + + " private int x;\n" + + " ^\n" + + "The value of the field A.x is not used\n" + + "----------\n" + + "2. WARNING in A.java (at line 3)\n" + + " private C c = new C() {\n" + + " ^\n" + + "The value of the field A.c is not used\n" + + "----------\n" + + "3. WARNING in A.java (at line 4)\n" + + " void foo() {\n" + + " ^^^^^\n" + + "The method foo() from the type new A.C(){} is never used locally\n" + + "----------\n" + + "4. WARNING in A.java (at line 9)\n" + + " private int x;\n" + + " ^\n" + + "The value of the field A.C.x is not used\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in A.java (at line 2)\n" + + " private int x;\n" + + " ^\n" + + "The value of the field A.x is not used\n" + + "----------\n" + + "2. WARNING in A.java (at line 3)\n" + + " private C c = new C() {\n" + + " ^\n" + + "The value of the field A.c is not used\n" + + "----------\n" + + "3. WARNING in A.java (at line 4)\n" + + " void foo() {\n" + + " ^^^^^\n" + + "The method foo() from the type new A.C(){} is never used locally\n" + + "----------\n" + + "4. WARNING in A.java (at line 5)\n" + + " x = 3;\n" + + " ^\n" + + "Write access to enclosing field A.x is emulated by a synthetic accessor method\n" + + "----------\n" + + "5. WARNING in A.java (at line 9)\n" + + " private int x;\n" + + " ^\n" + + "The value of the field A.C.x is not used\n" + + "----------\n"; + + this.runNegativeTest( new String[] { "A.java",//------------------------------ "public class A {\n" + @@ -3443,36 +3548,8 @@ public void test105() { " private int x;\n" + " }\n" + " }\n", - }; - runner.expectedCompilerLog = - "----------\n" + - "1. WARNING in A.java (at line 2)\n" + - " private int x;\n" + - " ^\n" + - "The value of the field A.x is not used\n" + - "----------\n" + - "2. WARNING in A.java (at line 3)\n" + - " private C c = new C() {\n" + - " ^\n" + - "The value of the field A.c is not used\n" + - "----------\n" + - "3. WARNING in A.java (at line 4)\n" + - " void foo() {\n" + - " ^^^^^\n" + - "The method foo() from the type new A.C(){} is never used locally\n" + - "----------\n" + - "4. WARNING in A.java (at line 5)\n" + - " x = 3;\n" + - " ^\n" + - "Write access to enclosing field A.x is emulated by a synthetic accessor method\n" + - "----------\n" + - "5. WARNING in A.java (at line 9)\n" + - " private int x;\n" + - " ^\n" + - "The value of the field A.C.x is not used\n" + - "----------\n"; - runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; - runner.runWarningTest(); + }, + errMessage); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=350738 public void test106() { diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ManifestAnalyzerTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ManifestAnalyzerTest.java index 133431bd3c..ee44a24480 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ManifestAnalyzerTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ManifestAnalyzerTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2009, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Fabrice Matrat - initial contribution diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodHandleTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodHandleTest.java index 6392628b3c..45c6d0b790 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodHandleTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodHandleTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodParametersAttributeTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodParametersAttributeTest.java index e4a4a6a6e4..a6af85455a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodParametersAttributeTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodParametersAttributeTest.java @@ -1,10 +1,13 @@ /******************************************************************************* - * Copyright (c) 2013, 2017 Jesper Steen Moeller and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * Copyright (c) 2013, 2018 Jesper Steen Moeller and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * * Contributors: * Jesper Steen Moeller - initial API and implementation * bug 527554 - [18.3] Compiler support for JEP 286 Local-Variable Type @@ -19,6 +22,7 @@ import junit.framework.Test; import org.eclipse.jdt.core.ToolFactory; +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.internal.compiler.classfmt.ClassFileConstants; @@ -35,9 +39,7 @@ public MethodParametersAttributeTest(String name) { // No need for a tearDown() protected void setUp() throws Exception { super.setUp(); - this.versionString = (this.complianceLevel < ClassFileConstants.JDK9) - ? "version 1.8 : 52.0" - : (this.complianceLevel < ClassFileConstants.JDK10 ? "version 9 : 53.0" : "version 10 : 54.0"); + this.versionString = AbstractCompilerTest.getVersionString(this.complianceLevel); } @SuppressWarnings("rawtypes") public static Class testClass() { @@ -385,7 +387,15 @@ public void test007() throws Exception { classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED); - + + String nestMembers = ""; + CompilerOptions options = new CompilerOptions(getCompilerOptions()); + if (options.complianceLevel >= ClassFileConstants.JDK11) { + nestMembers = "\n" + + "Nest Members:\n" + + " #20 ParameterNames$1,\n" + + " #29 ParameterNames$1Local\n"; + } String expectedOutput = "// Compiled from ParameterNames.java (" + this.versionString + ", super bit)\n" + "public class ParameterNames {\n" + @@ -450,7 +460,8 @@ public void test007() throws Exception { " [inner class info: #20 ParameterNames$1, outer class info: #0\n" + " inner name: #0, accessflags: 0 default],\n" + " [inner class info: #29 ParameterNames$1Local, outer class info: #0\n" + - " inner name: #41 Local, accessflags: 0 default]\n" + + " inner name: #41 Local, accessflags: 0 default]\n" + + nestMembers + "}"; assertSubstring(actualOutput, expectedOutput); @@ -472,6 +483,12 @@ public void test008() throws Exception { "\n", ClassFileBytesDisassembler.DETAILED); + String nestHost = ""; + CompilerOptions options = new CompilerOptions(getCompilerOptions()); + if (options.complianceLevel >= ClassFileConstants.JDK11) { + nestHost = "\n" + + "Nest Host: #36 ParameterNames\n"; + } String expectedOutput = "// Compiled from ParameterNames.java (" + this.versionString + ", super bit)\n" + "// Signature: Ljava/lang/Object;Ljava/util/concurrent/Callable<Ljava/lang/String;>;\n" + @@ -522,7 +539,8 @@ public void test008() throws Exception { " Inner classes:\n" + " [inner class info: #1 ParameterNames$1, outer class info: #0\n" + " inner name: #0, accessflags: 0 default]\n" + - " Enclosing Method: #36 #38 ParameterNames.makeInnerWithCapture(Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable;\n" + + " Enclosing Method: #36 #38 ParameterNames.makeInnerWithCapture(Ljava/lang/String;Ljava/lang/String;)Ljava/util/concurrent/Callable;\n" + + nestHost + "}" ; assertSubstring(actualOutput, expectedOutput); diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java index ce7b60cdf3..d45a695c40 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleAttributeTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleAttributeTests.java index 5ff356fcf7..95f24040fd 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleAttributeTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleAttributeTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017, 2018 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java index 7cd6195b9d..e6746496fe 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -4024,7 +4027,7 @@ public void testReleaseOption6() throws Exception { "\"" + OUTPUT_DIR + File.separator + "X.java\"" + " --release 5 -d \"" + OUTPUT_DIR + "\"", "", - "release version 5 is not supported\n", + "release 5 is not found in the system\n", true); } public void testReleaseOption7() throws Exception { @@ -4293,7 +4296,7 @@ public void testReleaseOption17() { " --release 60 \"" + OUTPUT_DIR + File.separator + "foo" + File.separator + "Module.java\" " + "\"" + OUTPUT_DIR + File.separator + "foo" + File.separator + "X.java\" ", "", - "release 60 is not found in the system\n", + "release version 60 is not supported\n", true, /*not tested with javac*/""); } diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java index cff7d2b767..99e4545791 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeLambdaExpressionsTest.java @@ -1,10 +1,13 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * * Contributors: * IBM Corporation - initial API and implementation * Jesper S Moller - Contributions for @@ -6637,6 +6640,25 @@ public void test406773() { Map compilerOptions = getCompilerOptions(); compilerOptions.put(CompilerOptions.OPTION_ReportMethodCanBeStatic, CompilerOptions.ERROR); compilerOptions.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.ERROR); + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. ERROR in X.java (at line 5)\n" + + " void foo() {\n" + + " ^^^^^\n" + + "The method foo() from the type X can potentially be declared as static\n" + + "----------\n" + : + "----------\n" + + "1. ERROR in X.java (at line 5)\n" + + " void foo() {\n" + + " ^^^^^\n" + + "The method foo() from the type X can potentially be declared as static\n" + + "----------\n" + + "2. WARNING in X.java (at line 10)\n" + + " I i = X::new;\n" + + " ^^^^^^\n" + + "Access to enclosing constructor X(int) is emulated by a synthetic accessor method\n" + + "----------\n"; this.runNegativeTest( false, JavacTestOptions.SKIP, /* skip, because we are using custom error settings here */ @@ -6679,17 +6701,7 @@ public void test406773() { " }\n" + "}\n" }, - "----------\n" + - "1. ERROR in X.java (at line 5)\n" + - " void foo() {\n" + - " ^^^^^\n" + - "The method foo() from the type X can potentially be declared as static\n" + - "----------\n" + - "2. WARNING in X.java (at line 10)\n" + - " I i = X::new;\n" + - " ^^^^^^\n" + - "Access to enclosing constructor X(int) is emulated by a synthetic accessor method\n" + - "----------\n", + errMessage, null /* no extra class libraries */, true /* flush output directory */, compilerOptions /* custom options */ @@ -9419,6 +9431,50 @@ public void test433458a() { } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=433588, [1.8][compiler] ECJ compiles an ambiguous call in the presence of an unrelated unused method. public void test433588() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in X.java (at line 15)\n" + + " public final @SafeVarargs void forEachOrdered(Consumer<? super T> action, Consumer<? super T>... actions) throws E {}\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "The method forEachOrdered(Consumer<? super T>, Consumer<? super T>...) from the type X.AbstractStream<T,E,STREAM,SELF,CONSUMER> is never used locally\n" + + "----------\n" + + "2. ERROR in X.java (at line 29)\n" + + " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" + + " ^^^^^^^^^^^^^^\n" + + "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + + "----------\n" + + "3. ERROR in X.java (at line 30)\n" + + " lines1.forEachOrdered(s -> System.out.println(s));\n" + + " ^^^^^^^^^^^^^^\n" + + "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in X.java (at line 15)\n" + + " public final @SafeVarargs void forEachOrdered(Consumer<? super T> action, Consumer<? super T>... actions) throws E {}\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "The method forEachOrdered(Consumer<? super T>, Consumer<? super T>...) from the type X.AbstractStream<T,E,STREAM,SELF,CONSUMER> is never used locally\n" + + "----------\n" + + "2. WARNING in X.java (at line 17)\n" + + " private static class UnStream<T> extends AbstractStream<T, RuntimeException, Stream<T>, UnStream<T>, Consumer<? super T>> {}\n" + + " ^^^^^^^^\n" + + "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" + + "----------\n" + + "3. WARNING in X.java (at line 18)\n" + + " private static class IOStream<T> extends AbstractStream<T, IOException, Stream<T>, IOStream<T>, IOConsumer<? super T>> {}\n" + + " ^^^^^^^^\n" + + "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" + + "----------\n" + + "4. ERROR in X.java (at line 29)\n" + + " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" + + " ^^^^^^^^^^^^^^\n" + + "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + + "----------\n" + + "5. ERROR in X.java (at line 30)\n" + + " lines1.forEachOrdered(s -> System.out.println(s));\n" + + " ^^^^^^^^^^^^^^\n" + + "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + + "----------\n"; this.runNegativeTest( new String[] { "X.java", @@ -9458,35 +9514,44 @@ public void test433588() { " }\n" + "}\n" }, - "----------\n" + - "1. WARNING in X.java (at line 15)\n" + - " public final @SafeVarargs void forEachOrdered(Consumer<? super T> action, Consumer<? super T>... actions) throws E {}\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "The method forEachOrdered(Consumer<? super T>, Consumer<? super T>...) from the type X.AbstractStream<T,E,STREAM,SELF,CONSUMER> is never used locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 17)\n" + - " private static class UnStream<T> extends AbstractStream<T, RuntimeException, Stream<T>, UnStream<T>, Consumer<? super T>> {}\n" + - " ^^^^^^^^\n" + - "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" + - "----------\n" + - "3. WARNING in X.java (at line 18)\n" + - " private static class IOStream<T> extends AbstractStream<T, IOException, Stream<T>, IOStream<T>, IOConsumer<? super T>> {}\n" + - " ^^^^^^^^\n" + - "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" + - "----------\n" + - "4. ERROR in X.java (at line 29)\n" + - " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" + - " ^^^^^^^^^^^^^^\n" + - "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + - "----------\n" + - "5. ERROR in X.java (at line 30)\n" + - " lines1.forEachOrdered(s -> System.out.println(s));\n" + - " ^^^^^^^^^^^^^^\n" + - "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + - "----------\n"); + errMessage); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=433588, [1.8][compiler] ECJ compiles an ambiguous call in the presence of an unrelated unused method. public void test433588a() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. ERROR in X.java (at line 29)\n" + + " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" + + " ^^^^^^^^^^^^^^\n" + + "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + + "----------\n" + + "2. ERROR in X.java (at line 30)\n" + + " lines1.forEachOrdered(s -> System.out.println(s));\n" + + " ^^^^^^^^^^^^^^\n" + + "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in X.java (at line 17)\n" + + " private static class UnStream<T> extends AbstractStream<T, RuntimeException, Stream<T>, UnStream<T>, Consumer<? super T>> {}\n" + + " ^^^^^^^^\n" + + "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. WARNING in X.java (at line 18)\n" + + " private static class IOStream<T> extends AbstractStream<T, IOException, Stream<T>, IOStream<T>, IOConsumer<? super T>> {}\n" + + " ^^^^^^^^\n" + + "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" + + "----------\n" + + "3. ERROR in X.java (at line 29)\n" + + " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" + + " ^^^^^^^^^^^^^^\n" + + "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + + "----------\n" + + "4. ERROR in X.java (at line 30)\n" + + " lines1.forEachOrdered(s -> System.out.println(s));\n" + + " ^^^^^^^^^^^^^^\n" + + "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + + "----------\n"; this.runNegativeTest( new String[] { "X.java", @@ -9526,27 +9591,7 @@ public void test433588a() { " }\n" + "}\n" }, - "----------\n" + - "1. WARNING in X.java (at line 17)\n" + - " private static class UnStream<T> extends AbstractStream<T, RuntimeException, Stream<T>, UnStream<T>, Consumer<? super T>> {}\n" + - " ^^^^^^^^\n" + - "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. WARNING in X.java (at line 18)\n" + - " private static class IOStream<T> extends AbstractStream<T, IOException, Stream<T>, IOStream<T>, IOConsumer<? super T>> {}\n" + - " ^^^^^^^^\n" + - "Access to enclosing constructor X.AbstractStream<T,E,STREAM,SELF,CONSUMER>() is emulated by a synthetic accessor method\n" + - "----------\n" + - "3. ERROR in X.java (at line 29)\n" + - " lines1.forEachOrdered(s -> Files.isHidden(Paths.get(s)));\n" + - " ^^^^^^^^^^^^^^\n" + - "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + - "----------\n" + - "4. ERROR in X.java (at line 30)\n" + - " lines1.forEachOrdered(s -> System.out.println(s));\n" + - " ^^^^^^^^^^^^^^\n" + - "The method forEachOrdered(X.IOConsumer<? super String>) is ambiguous for the type X.IOStream<String>\n" + - "----------\n"); + errMessage); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=433735, [1.8] Discrepancy with javac when dealing with local classes in lambda expressions public void test433735() { diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeTypeAnnotationTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeTypeAnnotationTest.java index df35ae633a..44d19d7af9 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeTypeAnnotationTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NegativeTypeAnnotationTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NonFatalErrorTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NonFatalErrorTest.java index 6af278ef60..a230a29426 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NonFatalErrorTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NonFatalErrorTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationBatchCompilerTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationBatchCompilerTest.java index 0134d306ad..d2d84330bb 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationBatchCompilerTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationBatchCompilerTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java index 6fced2e83d..57ce8de4d6 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2010, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java index 49f2c69819..deabd1537a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTests9.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTests.java index 13c9feed87..9bef28ef64 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTransformations.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTransformations.java index 882ac45818..8755db2a34 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTransformations.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTransformations.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java index 5e322c6dfc..60f05cc089 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java index 1c4a152c52..44d1ff47e1 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTestAsserts.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java index 0fbf758c24..b4bf845c42 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2012, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NumericTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NumericTest.java index 4d93871757..f5b5277364 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NumericTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NumericTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java index dd28486e12..a3ef6e4fcf 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/OverloadResolutionTest8.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PackageBindingTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PackageBindingTest.java index 2198965772..ce83b15bde 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PackageBindingTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PackageBindingTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016, 2017 Sven Strohschein and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * Contributors: * Sven Strohschein - initial API and implementation *******************************************************************************/ diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PolymorphicSignatureTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PolymorphicSignatureTest.java index 78253c4542..689147d103 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PolymorphicSignatureTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PolymorphicSignatureTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 2014 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemConstructorTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemConstructorTest.java index 0a5d63098d..e0acede438 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemConstructorTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemConstructorTest.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 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 + * Copyright (c) 2000, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -203,30 +206,53 @@ public void test004() { // error since its base class does not have a no-arg constructor for the synthesized default constructor // to invoke. public void test005() { - this.runNegativeTest( - new String[] { + String[] testFiles = new String[] { "A.java", "public class A {\n" + - " public A(String s) {\n" + - " B.test();\n" + - " }\n" + - "\n" + - " private static class B extends A {\n" + - " public B () { super(\"\"); }\n" + - " private static void test() {};\n" + - " }\n" + + " public A(String s) {\n" + + " B.test();\n" + + " }\n" + + "\n" + + " private static class B extends A {\n" + + " public B () { super(\"\"); }\n" + + " private static void test() {};\n" + + " }\n" + "}\n" - }, - "----------\n" + - "1. WARNING in A.java (at line 3)\n" + - " B.test();\n" + - " ^^^^^^^^\n" + - "Access to enclosing method test() from the type A.B is emulated by a synthetic accessor method\n" + - "----------\n"); + }; + if (!isMinimumCompliant(ClassFileConstants.JDK11)) { + this.runNegativeTest(testFiles, + "----------\n" + + "1. WARNING in A.java (at line 3)\n" + + " B.test();\n" + + " ^^^^^^^^\n" + + "Access to enclosing method test() from the type A.B is emulated by a synthetic accessor method\n" + + "----------\n"); + } else { + this.runConformTest(testFiles); + } } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=265142, wrong unused warning reported. Test to ensure that //we DO complain about the constructor of B not being used when its base class has a no-arg constructor public void test006() { + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in A.java (at line 8)\n" + + " public B () { super(\"\"); }\n" + + " ^^^^\n" + + "The constructor A.B() is never used locally\n" + + "----------\n" + : + "----------\n" + + "1. WARNING in A.java (at line 3)\n" + + " B.test();\n" + + " ^^^^^^^^\n" + + "Access to enclosing method test() from the type A.B is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. WARNING in A.java (at line 8)\n" + + " public B () { super(\"\"); }\n" + + " ^^^^\n" + + "The constructor A.B() is never used locally\n" + + "----------\n"; this.runNegativeTest( new String[] { "A.java", @@ -242,17 +268,7 @@ public void test006() { " }\n" + "}\n" }, - "----------\n" + - "1. WARNING in A.java (at line 3)\n" + - " B.test();\n" + - " ^^^^^^^^\n" + - "Access to enclosing method test() from the type A.B is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. WARNING in A.java (at line 8)\n" + - " public B () { super(\"\"); }\n" + - " ^^^^\n" + - "The constructor A.B() is never used locally\n" + - "----------\n"); + errMessage); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=265142, wrong unused warning reported. Test to ensure that //we can compile the program successfully after deleting the unused constructor. diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java index e521e18bac..bbceb78446 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 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 + * Copyright (c) 2000, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -5039,7 +5042,44 @@ public void test098() { " }\n" + "}\n" }; - runner.expectedCompilerLog = + runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in X.java (at line 3)\n" + + " public void foo(int a) {\n" + + " ^^^^^^^^^^\n" + + "The method foo(int) from the type X.A is never used locally\n" + + "----------\n" + + "2. WARNING in X.java (at line 6)\n" + + " public void foo(float a) {\n" + + " ^^^^^^^^^^^^\n" + + "The method foo(float) from the type X.A is never used locally\n" + + "----------\n" + + "3. WARNING in X.java (at line 9)\n" + + " public void foo(boolean a) {\n" + + " ^^^^^^^^^^^^^^\n" + + "The method foo(boolean) from the type X.A is never used locally\n" + + "----------\n" + + "4. WARNING in X.java (at line 12)\n" + + " public void foo(Integer a) {\n" + + " ^^^^^^^^^^^^^^\n" + + "The method foo(Integer) from the type X.A is never used locally\n" + + "----------\n" + + "5. WARNING in X.java (at line 16)\n" + + " private class B extends A {\n" + + " ^\n" + + "The type X.B is never used locally\n" + + "----------\n" + + "6. WARNING in X.java (at line 23)\n" + + " public void foo(double a) {\n" + + " ^^^^^^^^^^^^^\n" + + "The method foo(double) from the type X.B is never used locally\n" + + "----------\n" + + "7. WARNING in X.java (at line 26)\n" + + " public void foo(char a) {\n" + + " ^^^^^^^^^^^\n" + + "The method foo(char) from the type X.B is never used locally\n" + + "----------\n" + : "----------\n" + "1. WARNING in X.java (at line 3)\n" + " public void foo(int a) {\n" + @@ -5136,7 +5176,29 @@ public void test099() { " }\n" + "}\n" }; - runner.expectedCompilerLog = + runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in X.java (at line 3)\n" + + " public void foo(int a) {\n" + + " ^^^^^^^^^^\n" + + "The method foo(int) from the type X.A is never used locally\n" + + "----------\n" + + "2. WARNING in X.java (at line 6)\n" + + " public void foo(float a) {\n" + + " ^^^^^^^^^^^^\n" + + "The method foo(float) from the type X.A is never used locally\n" + + "----------\n" + + "3. WARNING in X.java (at line 9)\n" + + " public void foo(boolean a) {\n" + + " ^^^^^^^^^^^^^^\n" + + "The method foo(boolean) from the type X.A is never used locally\n" + + "----------\n" + + "4. WARNING in X.java (at line 23)\n" + + " public void foo(double a) {\n" + + " ^^^^^^^^^^^^^\n" + + "The method foo(double) from the type X.B is never used locally\n" + + "----------\n" + : "----------\n" + "1. WARNING in X.java (at line 3)\n" + " public void foo(int a) {\n" + @@ -5224,7 +5286,29 @@ public void test099a() { " }\n" + "}\n" }; - runner.expectedCompilerLog = + runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in X.java (at line 23)\n" + + " public void foo(double a) {\n" + + " ^^^^^^^^^^^^^\n" + + "The method foo(double) from the type X.B is never used locally\n" + + "----------\n" + + "2. WARNING in X.java (at line 31)\n" + + " public void foo(int a) {\n" + + " ^^^^^^^^^^\n" + + "The method foo(int) from the type X.A is never used locally\n" + + "----------\n" + + "3. WARNING in X.java (at line 34)\n" + + " public void foo(float a) {\n" + + " ^^^^^^^^^^^^\n" + + "The method foo(float) from the type X.A is never used locally\n" + + "----------\n" + + "4. WARNING in X.java (at line 37)\n" + + " public void foo(boolean a) {\n" + + " ^^^^^^^^^^^^^^\n" + + "The method foo(boolean) from the type X.A is never used locally\n" + + "----------\n" + : "----------\n" + "1. WARNING in X.java (at line 2)\n" + " public class C extends B {\n" + @@ -5312,21 +5396,24 @@ public void test099b() { " }\n" + "}\n" }; - runner.expectedCompilerLog = - "----------\n" + - "1. WARNING in X.java (at line 16)\n" + - " private class B extends A {\n" + - " ^\n" + - "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + - "----------\n" + - "2. WARNING in X.java (at line 30)\n" + - " public class C extends B {\n" + - " ^\n" + - "Access to enclosing constructor X.B() is emulated by a synthetic accessor method\n" + - "----------\n"; - runner.javacTestOptions = - JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; - runner.runWarningTest(); + if (!isMinimumCompliant(ClassFileConstants.JDK11)) { + runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; + runner.expectedCompilerLog = + "----------\n" + + "1. WARNING in X.java (at line 16)\n" + + " private class B extends A {\n" + + " ^\n" + + "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + + "----------\n" + + "2. WARNING in X.java (at line 30)\n" + + " public class C extends B {\n" + + " ^\n" + + "Access to enclosing constructor X.B() is emulated by a synthetic accessor method\n" + + "----------\n"; + runner.runWarningTest(); + } else { + runner.runConformTest(); + } } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=296660 public void test100() { @@ -5341,16 +5428,20 @@ public void test100() { " public class B extends A {}\n" + "}" }; - runner.expectedCompilerLog = - "----------\n" + - "1. WARNING in X.java (at line 5)\n" + - " public class B extends A {}\n" + - " ^\n" + - "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + - "----------\n"; - runner.javacTestOptions = - JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; - runner.runWarningTest(); + if (!isMinimumCompliant(ClassFileConstants.JDK11)) { + + runner.expectedCompilerLog = + "----------\n" + + "1. WARNING in X.java (at line 5)\n" + + " public class B extends A {}\n" + + " ^\n" + + "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + + "----------\n"; + runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; + runner.runWarningTest(); + } else { + runner.runConformTest(); + } } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=296660 public void test101() { @@ -5366,16 +5457,19 @@ public void test101() { " public class B extends A {}\n" + "}" }; - runner.expectedCompilerLog = - "----------\n" + - "1. WARNING in X.java (at line 6)\n" + - " public class B extends A {}\n" + - " ^\n" + - "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + - "----------\n"; - runner.javacTestOptions = - JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; - runner.runWarningTest(); + if (!isMinimumCompliant(ClassFileConstants.JDK11)) { + runner.expectedCompilerLog = + "----------\n" + + "1. WARNING in X.java (at line 6)\n" + + " public class B extends A {}\n" + + " ^\n" + + "Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" + + "----------\n"; + runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; + runner.runWarningTest(); + } else { + runner.runConformTest(); + } } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=296660 public void test102() { @@ -5391,7 +5485,19 @@ public void test102() { " public class B extends A {}\n" + "}" }; - runner.expectedCompilerLog = + runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in X.java (at line 3)\n" + + " private void foo() {}\n" + + " ^^^^^\n" + + "The method foo() from the type X.A is never used locally\n" + + "----------\n" + + "2. WARNING in X.java (at line 4)\n" + + " private void foo(int a) {}\n" + + " ^^^^^^^^^^\n" + + "The method foo(int) from the type X.A is never used locally\n" + + "----------\n" + : "----------\n" + "1. WARNING in X.java (at line 3)\n" + " private void foo() {}\n" + @@ -5426,7 +5532,24 @@ public void test103() { " private class B extends A {}\n" + "}" }; - runner.expectedCompilerLog = + runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in X.java (at line 3)\n" + + " public void foo() {}\n" + + " ^^^^^\n" + + "The method foo() from the type X.A is never used locally\n" + + "----------\n" + + "2. WARNING in X.java (at line 4)\n" + + " public void foo(int a) {}\n" + + " ^^^^^^^^^^\n" + + "The method foo(int) from the type X.A is never used locally\n" + + "----------\n" + + "3. WARNING in X.java (at line 6)\n" + + " private class B extends A {}\n" + + " ^\n" + + "The type X.B is never used locally\n" + + "----------\n" + : "----------\n" + "1. WARNING in X.java (at line 3)\n" + " public void foo() {}\n" + @@ -5597,7 +5720,38 @@ public void test107() { } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=321414 public void test108() { - if (this.complianceLevel <= ClassFileConstants.JDK1_4) return; + if (this.complianceLevel <= ClassFileConstants.JDK1_4) return; + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in SyntheticConstructorTooManyArgs.java (at line 23)\n" + + " @SuppressWarnings(\"synthetic-access\")\n" + + " ^^^^^^^^^^^^^^^^^^\n" + + "Unnecessary @SuppressWarnings(\"synthetic-access\")\n" + + "----------\n" + : + "----------\n" + + "1. ERROR in SyntheticConstructorTooManyArgs.java (at line 4)\n" + + " private A(\n" + + " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" + + " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" + + " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" + + " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" + + " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" + + " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" + + " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" + + " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" + + " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" + + " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" + + " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" + + " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" + + " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" + + " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" + + " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" + + " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe\n" + + " ) {}\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "The synthetic method created to access A(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) of type SyntheticConstructorTooManyArgs.A has too many parameters\n" + + "----------\n"; this.runNegativeTest( new String[] { "SyntheticConstructorTooManyArgs.java", //----------------------------------------------------------------------- @@ -5661,29 +5815,7 @@ public void test108() { " }\n" + "}", }, - "----------\n" + - "1. ERROR in SyntheticConstructorTooManyArgs.java (at line 4)\n" + - " private A(\n" + - " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" + - " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" + - " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" + - " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" + - " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" + - " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" + - " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" + - " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" + - " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" + - " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" + - " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" + - " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" + - " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" + - " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" + - " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" + - " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd, int pfe\n" + - " ) {}\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "The synthetic method created to access A(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) of type SyntheticConstructorTooManyArgs.A has too many parameters\n" + - "----------\n"); + errMessage); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=321414 public void test109() { @@ -5853,7 +5985,38 @@ public void test110() { } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=321414 public void test111() { - if (this.complianceLevel <= ClassFileConstants.JDK1_4) return; + if (this.complianceLevel <= ClassFileConstants.JDK1_4) return; + String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in SyntheticConstructorTooManyArgs.java (at line 23)\n" + + " @SuppressWarnings(\"synthetic-access\")\n" + + " ^^^^^^^^^^^^^^^^^^\n" + + "Unnecessary @SuppressWarnings(\"synthetic-access\")\n" + + "----------\n" + : + "----------\n" + + "1. ERROR in SyntheticConstructorTooManyArgs.java (at line 4)\n" + + " private A(\n" + + " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" + + " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" + + " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" + + " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" + + " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" + + " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" + + " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" + + " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" + + " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" + + " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" + + " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" + + " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" + + " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" + + " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" + + " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" + + " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd\n" + + " ) {}\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "The synthetic method created to access A(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) of type SyntheticConstructorTooManyArgs.A has too many parameters\n" + + "----------\n"; this.runNegativeTest( new String[] { "SyntheticConstructorTooManyArgs.java", //----------------------------------------------------------------------- @@ -5917,29 +6080,7 @@ public void test111() { " }\n" + "}", }, - "----------\n" + - "1. ERROR in SyntheticConstructorTooManyArgs.java (at line 4)\n" + - " private A(\n" + - " /*this,*/int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p0a, int p0b, int p0c, int p0d, int p0e, int p0f, \n" + - " int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p1a, int p1b, int p1c, int p1d, int p1e, int p1f, \n" + - " int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p2a, int p2b, int p2c, int p2d, int p2e, int p2f, \n" + - " int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p3a, int p3b, int p3c, int p3d, int p3e, int p3f, \n" + - " int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p4a, int p4b, int p4c, int p4d, int p4e, int p4f, \n" + - " int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p5a, int p5b, int p5c, int p5d, int p5e, int p5f, \n" + - " int p60, int p61, int p62, int p63, int p64, int p65, int p66, int p67, int p68, int p69, int p6a, int p6b, int p6c, int p6d, int p6e, int p6f, \n" + - " int p70, int p71, int p72, int p73, int p74, int p75, int p76, int p77, int p78, int p79, int p7a, int p7b, int p7c, int p7d, int p7e, int p7f, \n" + - " int p80, int p81, int p82, int p83, int p84, int p85, int p86, int p87, int p88, int p89, int p8a, int p8b, int p8c, int p8d, int p8e, int p8f, \n" + - " int p90, int p91, int p92, int p93, int p94, int p95, int p96, int p97, int p98, int p99, int p9a, int p9b, int p9c, int p9d, int p9e, int p9f, \n" + - " int pa0, int pa1, int pa2, int pa3, int pa4, int pa5, int pa6, int pa7, int pa8, int pa9, int paa, int pab, int pac, int pad, int pae, int paf, \n" + - " int pb0, int pb1, int pb2, int pb3, int pb4, int pb5, int pb6, int pb7, int pb8, int pb9, int pba, int pbb, int pbc, int pbd, int pbe, int pbf, \n" + - " int pc0, int pc1, int pc2, int pc3, int pc4, int pc5, int pc6, int pc7, int pc8, int pc9, int pca, int pcb, int pcc, int pcd, int pce, int pcf, \n" + - " int pd0, int pd1, int pd2, int pd3, int pd4, int pd5, int pd6, int pd7, int pd8, int pd9, int pda, int pdb, int pdc, int pdd, int pde, int pdf, \n" + - " int pe0, int pe1, int pe2, int pe3, int pe4, int pe5, int pe6, int pe7, int pe8, int pe9, int pea, int peb, int pec, int ped, int pee, int pef, \n" + - " int pf0, int pf1, int pf2, int pf3, int pf4, int pf5, int pf6, int pf7, int pf8, int pf9, int pfa, int pfb, int pfc, int pfd\n" + - " ) {}\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "The synthetic method created to access A(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) of type SyntheticConstructorTooManyArgs.A has too many parameters\n" + - "----------\n"); + errMessage); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=321414 public void test112() { @@ -8023,7 +8164,14 @@ public void test376550_11() { " }\n" + "}" }; - runner.expectedCompilerLog = + runner.expectedCompilerLog = isMinimumCompliant(ClassFileConstants.JDK11) ? + "----------\n" + + "1. WARNING in X.java (at line 6)\n" + + " return new ArrayList<Object>() {\n" + + " ^^^^^^^^^^^^^^^^^^^\n" + + "The serializable class does not declare a static final serialVersionUID field of type long\n" + + "----------\n" + : "----------\n" + "1. WARNING in X.java (at line 6)\n" + " return new ArrayList<Object>() {\n" + diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProgrammingProblemsTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProgrammingProblemsTest.java index 29ed4e81c4..3901990a9a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProgrammingProblemsTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProgrammingProblemsTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2001, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RegressionTestSetup.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RegressionTestSetup.java index 32097a9054..06ba385c87 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RegressionTestSetup.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RegressionTestSetup.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2008 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java index e50c8f4918..d31d6f7ebd 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RepeatableAnnotationTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2013, 2016 Jesper S Moller and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Jesper S Moller - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Requestor.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Requestor.java index b1b8bf70ca..5388cfcb40 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Requestor.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Requestor.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java index 86227b5750..59f8347905 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RunComparableTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RunComparableTests.java index 424cc02eea..11da6f7037 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RunComparableTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RunComparableTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RuntimeTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RuntimeTests.java index 1547adf9dc..978be89ba6 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RuntimeTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RuntimeTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2006, 2010 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java index 197375a266..5959d4bff8 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java index 03143e1bda..a9b708a5ca 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2006, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java index e608cf8f80..c93c05e9df 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SerializableLambdaTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2017 GoPivotal, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java index 2e7081a7c9..408c28b801 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -6178,7 +6181,9 @@ public void test040() throws Exception { " // Stack: 1, Locals: 2\n" + " private java.lang.Object bar();\n" + " 0 aload_0 [this]\n" + - " 1 invokespecial X.bar2() : java.lang.Object [25]\n" + + " 1 " + + (isMinimumCompliant(ClassFileConstants.JDK11) ? "invokevirtual" : "invokespecial") + + " X.bar2() : java.lang.Object [25]\n" + " 4 astore_1 [o]\n" + " 5 aload_1 [o]\n" + " 6 ifnull 14\n" + @@ -6244,7 +6249,9 @@ public void test041() throws Exception { " // Stack: 1, Locals: 2\n" + " private java.lang.Object bar();\n" + " 0 aload_0 [this]\n" + - " 1 invokespecial X.bar2() : java.lang.Object [31]\n" + + " 1 " + + (isMinimumCompliant(ClassFileConstants.JDK11) ? "invokevirtual" : "invokespecial") + + " X.bar2() : java.lang.Object [31]\n" + " 4 astore_1 [o]\n" + " 5 aload_1 [o]\n" + " 6 ifnull 14\n" + @@ -7678,6 +7685,8 @@ public void testBug380313() throws Exception { "\n", ClassFileBytesDisassembler.DETAILED); + String xBarCall = isMinimumCompliant(ClassFileConstants.JDK11) ? + "invokevirtual X.bar() : int [18]\n" : "invokespecial X.bar() : int [18]\n"; String expectedOutput = " // Method descriptor #6 ()V\n" + " // Stack: 2, Locals: 4\n" + @@ -7688,13 +7697,13 @@ public void testBug380313() throws Exception { " 3 iconst_1\n" + " 4 if_icmpne 24\n" + " 7 aload_0 [this]\n" + - " 8 invokespecial X.bar() : int [18]\n" + + " 8 " + xBarCall + " 11 istore_2 [n]\n" + " 12 iload_2 [n]\n" + " 13 bipush 35\n" + " 15 if_icmpne 32\n" + " 18 aload_0 [this]\n" + - " 19 invokespecial X.bar() : int [18]\n" + + " 19 " + xBarCall + " 22 pop\n" + " 23 return\n" + " 24 new java.lang.Exception [16]\n" + @@ -7704,17 +7713,17 @@ public void testBug380313() throws Exception { " 32 iload_1 [i]\n" + " 33 ifne 50\n" + " 36 aload_0 [this]\n" + - " 37 invokespecial X.bar() : int [18]\n" + + " 37 " + xBarCall + " 40 pop\n" + " 41 return\n" + " 42 astore_3\n" + " 43 aload_0 [this]\n" + - " 44 invokespecial X.bar() : int [18]\n" + + " 44 " + xBarCall + " 47 pop\n" + " 48 aload_3\n" + " 49 athrow\n" + " 50 aload_0 [this]\n" + - " 51 invokespecial X.bar() : int [18]\n" + + " 51 " + xBarCall + " 54 pop\n" + " 55 return\n" + " Exception Table:\n" + @@ -7799,6 +7808,8 @@ public void testBug380313b() throws Exception { "\n", ClassFileBytesDisassembler.DETAILED); + String xBarCall = (isMinimumCompliant(ClassFileConstants.JDK11) ? + "invokevirtual" : "invokespecial") + " X.bar() : int [28]\n"; String expectedOutput = " // Method descriptor #6 ()V\n" + " // Stack: 3, Locals: 6\n" + @@ -7822,7 +7833,7 @@ public void testBug380313b() throws Exception { " 27 aload 4 [fis]\n" + " 29 invokevirtual java.io.FileInputStream.close() : void [25]\n" + " 32 aload_0 [this]\n" + // return 1 - " 33 invokespecial X.bar() : int [28]\n" + + " 33 " + xBarCall + " 36 pop\n" + " 37 return\n" + " 38 aload 4 [fis]\n" + @@ -7855,25 +7866,25 @@ public void testBug380313b() throws Exception { " 87 bipush 35\n" + " 89 if_icmpne 122\n" + " 92 aload_0 [this]\n" + // return 2 - " 93 invokespecial X.bar() : int [28]\n" + + " 93 " + xBarCall + " 96 pop\n" + " 97 return\n" + " 98 astore_2 [e]\n" + " 99 aload_0 [this]\n" + - " 100 invokespecial X.bar() : int [28]\n" + + " 100 " + xBarCall + " 103 pop\n" + " 104 aload_0 [this]\n" + - " 105 invokespecial X.bar() : int [28]\n" + + " 105 " + xBarCall + " 108 pop\n" + " 109 goto 127\n" + " 112 astore 5\n" + " 114 aload_0 [this]\n" + - " 115 invokespecial X.bar() : int [28]\n" + + " 115 " + xBarCall + " 118 pop\n" + " 119 aload 5\n" + " 121 athrow\n" + " 122 aload_0 [this]\n" + - " 123 invokespecial X.bar() : int [28]\n" + + " 123 " + xBarCall + " 126 pop\n" + " 127 return\n" + " Exception Table:\n" + diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java index 38b12d4973..a77e21c7b7 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperTypeTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperTypeTest.java index 36525946e6..3aa4f96a13 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperTypeTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperTypeTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2006, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java index 9854659aed..751faf0133 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java index b7d17f5a38..87c46165e9 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -169,6 +172,11 @@ public static Test suite() { ArrayList since_10 = new ArrayList(); since_10.add(JEP286Test.class); + // add 11 specific test here (check duplicates) + ArrayList since_11 = new ArrayList(); + since_11.add(JEP323VarLambdaParamsTest.class); + since_11.add(JEP181NestTest.class); + // Build final test suite TestSuite all = new TestSuite(TestAll.class.getName()); all.addTest(new TestSuite(StandAloneASTParserTest.class)); @@ -253,6 +261,19 @@ public static Test suite() { TestCase.resetForgottenFilters(tests_10); all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.JDK10, tests_10)); } + if ((possibleComplianceLevels & AbstractCompilerTest.F_11) != 0) { + ArrayList tests_11 = (ArrayList)standardTests.clone(); + tests_11.addAll(since_1_4); + tests_11.addAll(since_1_5); + tests_11.addAll(since_1_6); + tests_11.addAll(since_1_7); + tests_11.addAll(since_1_8); + tests_11.addAll(since_9); + tests_11.addAll(since_10); + tests_11.addAll(since_11); + TestCase.resetForgottenFilters(tests_11); + all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11), tests_11)); + } all.addTest(new TestSuite(Jsr14Test.class)); return all; } diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement17Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement17Test.java index e0ce657102..7e3a22a963 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement17Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement17Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2003, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement9Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement9Test.java index e28b664145..f73b28f385 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement9Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatement9Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java index cc6e33638e..16d4edd633 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2003, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java index 497fc2f831..83620d722b 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryWithResourcesStatementTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java index 350f8e135b..2e55ecc38b 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnderscoresInLiteralsTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnderscoresInLiteralsTest.java index 32474c13ce..41127d9a88 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnderscoresInLiteralsTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnderscoresInLiteralsTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2011, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode10Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode10Test.java new file mode 100644 index 0000000000..19badb2bed --- /dev/null +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode10Test.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.core.tests.compiler.regression; + +import java.util.Map; + +import junit.framework.Test; + +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; + +public class Unicode10Test extends AbstractRegressionTest { +public Unicode10Test(String name) { + super(name); +} +public static Test suite() { + return buildMinimalComplianceTestSuite(testClass(), F_11); +} +public void test1() { + Map<String, String> options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + this.runConformTest( + new String[] { + "X.java", + "public class X {\n" + + " public int a\u0860; // new unicode character in unicode 10.0 \n" + + "}", + }, + "", + options); +} +public static Class<Unicode10Test> testClass() { + return Unicode10Test.class; +} +} diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode18Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode18Test.java index 4090e8bcf2..a315405193 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode18Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode18Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2014, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode9Test.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode9Test.java index 2e1f463db2..a77892c4cb 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode9Test.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Unicode9Test.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2015, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnnamedModuleTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnnamedModuleTest.java index e434e98692..0374092e13 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnnamedModuleTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnnamedModuleTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2017 Till Brychcy and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Till Brychcy - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java index 721367011e..fd0d024e60 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java index 66ff0f6140..d0e2f2824d 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java index 0e939017d8..3d8fcadfde 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/XLargeTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java index e92a37be44..caca176995 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/dom/StandAloneASTParserTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2010, 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -58,7 +61,7 @@ public StandAloneASTParserTest(String name) { super(name); } - private static final int AST_JLS_LATEST = AST.JLS10; + private static final int AST_JLS_LATEST = AST.JLS11; public ASTNode runConversion( int astLevel, @@ -1585,7 +1588,7 @@ public void acceptAST(String sourceFilePath, CompilationUnit ast) { super.acceptAST(sourceFilePath, ast); } }; - ASTParser parser = ASTParser.newParser(AST.JLS10); + ASTParser parser = ASTParser.newParser(AST.JLS11); parser.setResolveBindings(true); parser.setStatementsRecovery(true); parser.setBindingsRecovery(true); @@ -1616,7 +1619,7 @@ public void testBug530299_001() { " for (var i = 0; i < 10; ++i) {}\n" + " }\n" + "}"; - ASTParser parser = ASTParser.newParser(AST.JLS10); + ASTParser parser = ASTParser.newParser(AST.JLS11); parser.setSource(contents.toCharArray()); parser.setStatementsRecovery(true); parser.setBindingsRecovery(true); diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/CodeSnippetTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/CodeSnippetTest.java index 07a0527c0a..3d9af2cd4f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/CodeSnippetTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/CodeSnippetTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationSetup.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationSetup.java index c0bfbfb973..0bbdda14e7 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationSetup.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationSetup.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java index 2e326d2f41..75cdc67535 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationSetup.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationSetup.java index 12882d6572..1be53244ba 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationSetup.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationSetup.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationTest.java index 63c9477a87..2f9a68add9 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/JDIStackFrame.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/JDIStackFrame.java index 6f5e438241..62b4a01644 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/JDIStackFrame.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/JDIStackFrame.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/NegativeCodeSnippetTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/NegativeCodeSnippetTest.java index a5c9d05f70..5853639ec4 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/NegativeCodeSnippetTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/NegativeCodeSnippetTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/NegativeVariableTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/NegativeVariableTest.java index 4eb934ae52..867330e1e1 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/NegativeVariableTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/NegativeVariableTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SanityTestEvaluationContext.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SanityTestEvaluationContext.java index 6555cd7f1e..90ae3ad9d3 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SanityTestEvaluationContext.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SanityTestEvaluationContext.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SanityTestEvaluationResult.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SanityTestEvaluationResult.java index 352b289e00..482f04ac83 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SanityTestEvaluationResult.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SanityTestEvaluationResult.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleCodeSnippetTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleCodeSnippetTest.java index 10581496bc..aaaa4062ae 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleCodeSnippetTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleCodeSnippetTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleTest.java index 8763eb180f..fc734cc133 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleVariableTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleVariableTest.java index 80b80824fa..6748a7b946 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleVariableTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleVariableTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2006 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/TestAll.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/TestAll.java index 4994dcff35..2e655b1ea6 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/TestAll.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/TestAll.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/VariableTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/VariableTest.java index 6c851600a3..b415fb937a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/VariableTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/VariableTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetClassLoader.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetClassLoader.java index 979ec3cffb..5492f8404a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetClassLoader.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetClassLoader.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetRunner.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetRunner.java index 068970c5fc..0c762a3c35 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetRunner.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetRunner.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/IDEInterface.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/IDEInterface.java index dac44cfdb9..f4be47dc0e 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/IDEInterface.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/IDEInterface.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/PerformanceTestSuite.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/PerformanceTestSuite.java index 0b45c025a7..14e51e207e 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/PerformanceTestSuite.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/PerformanceTestSuite.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2004, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/StopableTestCase.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/StopableTestCase.java index 690dea22d8..ff7eeab758 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/StopableTestCase.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/StopableTestCase.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2006 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java index e7d191b914..e1dad678ad 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java @@ -1,14 +1,13 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * This is an implementation of an early-draft specification developed under the Java - * Community Process (JCP) and is made available for testing and evaluation purposes - * only. The code is not compatible with any specification of the JCP. + * https://www.eclipse.org/legal/epl-2.0/ * + * SPDX-License-Identifier: EPL-2.0 + * * Contributors: * IBM Corporation - initial API and implementation * Jesper S Moller <jesper@selskabet.org> - Contributions for diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestListener.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestListener.java index e2eecbb6d3..86cb4cf7eb 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestListener.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestListener.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestResult.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestResult.java index 10b8c63cca..753db3a028 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestResult.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestResult.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/AbstractReader.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/AbstractReader.java index 831b892e43..f463af4b29 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/AbstractReader.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/AbstractReader.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java index b8b7e7f878..5ae5fbb543 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/J9VMLauncher.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/J9VMLauncher.java index 2963561a9d..53943731aa 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/J9VMLauncher.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/J9VMLauncher.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/J9VirtualMachine.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/J9VirtualMachine.java index dde7817105..25a5f0016a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/J9VirtualMachine.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/J9VirtualMachine.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2008 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/JRockitVMLauncher.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/JRockitVMLauncher.java index 9caf8c75b8..b532e98fff 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/JRockitVMLauncher.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/JRockitVMLauncher.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2006, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java index 363e6cd1bd..647f93cda1 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVirtualMachine.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVirtualMachine.java index feb99f6ab0..d46a60779f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVirtualMachine.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVirtualMachine.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2008 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/MacVMLauncher.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/MacVMLauncher.java index 92ae40ee02..5ec9e15688 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/MacVMLauncher.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/MacVMLauncher.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/NullConsoleReader.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/NullConsoleReader.java index a25c8c7f9a..cb8811a094 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/NullConsoleReader.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/NullConsoleReader.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2006 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/ProxyConsoleReader.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/ProxyConsoleReader.java index 9c23cbddb9..92b9c599e1 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/ProxyConsoleReader.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/ProxyConsoleReader.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2006 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/RuntimeConstants.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/RuntimeConstants.java index 4c8ea76a9f..0335ec60d1 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/RuntimeConstants.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/RuntimeConstants.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2006 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/SideCarJ9VMLauncher.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/SideCarJ9VMLauncher.java index c4fa50335f..2a60bebcf4 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/SideCarJ9VMLauncher.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/SideCarJ9VMLauncher.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/SideCarVMLauncher.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/SideCarVMLauncher.java index a6477dec42..4cb2311859 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/SideCarVMLauncher.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/SideCarVMLauncher.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java index fb536cabfe..80eecdce87 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/TargetException.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/TargetException.java index f05174d16f..3a0b67ed6b 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/TargetException.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/TargetException.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/TargetInterface.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/TargetInterface.java index 3f8a69cd20..242e05dfc5 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/TargetInterface.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/TargetInterface.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/VMInputStream.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/VMInputStream.java index 2183e0c739..4dfcb17843 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/VMInputStream.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/VMInputStream.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2009 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java index fd6ba16390..f5d60a46c0 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -39,6 +42,7 @@ public class AbstractCompilerTest extends TestCase { public static final int F_1_8 = 0x20; public static final int F_9 = 0x40; public static final int F_10 = 0x80; + public static final int F_11 = 0x100; public static final boolean RUN_JAVAC = CompilerOptions.ENABLED.equals(System.getProperty("run.javac")); private static final int UNINITIALIZED = -1; @@ -48,6 +52,7 @@ public class AbstractCompilerTest extends TestCase { protected long complianceLevel; protected boolean enableAPT = false; protected static boolean isJRE9Plus = false; // Stop gap, so tests need not be run at 9, but some tests can be adjusted for JRE 9 + protected static boolean isJRE11Plus = false; protected static boolean reflectNestedClassUseDollar; /** @@ -89,6 +94,9 @@ public static void buildAllCompliancesTestSuite(TestSuite suite, Class evaluatio if ((complianceLevels & AbstractCompilerTest.F_10) != 0) { suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, ClassFileConstants.JDK10)); } + if ((complianceLevels & AbstractCompilerTest.F_11) != 0) { + suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11))); + } } /** @@ -128,6 +136,9 @@ public static Test buildAllCompliancesTestSuite(Class testSuiteClass, Class setu if ((complianceLevels & AbstractCompilerTest.F_10) != 0) { suite.addTest(buildComplianceTestSuite(testClasses, setupClass, ClassFileConstants.JDK10)); } + if ((complianceLevels & AbstractCompilerTest.F_11) != 0) { + suite.addTest(buildComplianceTestSuite(testClasses, setupClass, ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11))); + } return suite; } @@ -135,6 +146,7 @@ public static void setpossibleComplianceLevels(int complianceLevel) { possibleComplianceLevels = complianceLevel; int lessthan9 = F_1_3 | F_1_4 | F_1_5 | F_1_6 | F_1_7 | F_1_8; isJRE9Plus = !isJRELevel(lessthan9); + isJRE11Plus = isJRELevel(F_11); } /** @@ -269,6 +281,14 @@ public static Test buildMinimalComplianceTestSuite(Class evaluationTestClass, in suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, ClassFileConstants.JDK10)); } } + int level11 = complianceLevels & AbstractCompilerTest.F_11; + if (level11 != 0) { + if (level11 < minimalCompliance) { + System.err.println("Cannot run "+evaluationTestClass.getName()+" at compliance 11!"); + } else { + suite.addTest(buildUniqueComplianceTestSuite(evaluationTestClass, ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11))); + } + } return suite; } @@ -301,8 +321,16 @@ else if (highestLevel == ClassFileConstants.JDK1_4) complianceString = "1.4"; else if (highestLevel == ClassFileConstants.JDK1_3) complianceString = "1.3"; - else - complianceString = "unknown"; + else { + highestLevel = ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11); + if (highestLevel > 0) { + complianceString = CompilerOptions.versionFromJdkLevel(highestLevel); + } else { + complianceString = "unknown"; + } + + } + System.err.println("Cannot run "+evaluationTestClass.getName()+" at compliance "+complianceString+"!"); return new TestSuite(); } @@ -319,6 +347,9 @@ else if (highestLevel == ClassFileConstants.JDK1_3) */ public static long highestComplianceLevels() { int complianceLevels = AbstractCompilerTest.getPossibleComplianceLevels(); + if ((complianceLevels & AbstractCompilerTest.F_11) != 0) { + return ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11); + } if ((complianceLevels & AbstractCompilerTest.F_10) != 0) { return ClassFileConstants.JDK10; } @@ -365,41 +396,44 @@ static void initReflectionVersion() { public static int getPossibleComplianceLevels() { if (possibleComplianceLevels == UNINITIALIZED) { String specVersion = System.getProperty("java.specification.version"); - isJRE9Plus = CompilerOptions.VERSION_9.equals(specVersion) || CompilerOptions.VERSION_10.equals(specVersion); + isJRE9Plus = CompilerOptions.VERSION_9.equals(specVersion) + || CompilerOptions.VERSION_10.equals(specVersion) + || CompilerOptions.VERSION_11.equals(specVersion); + isJRE11Plus = CompilerOptions.VERSION_11.equals(specVersion); initReflectionVersion(); - String compliances = System.getProperty("compliance"); - if (compliances != null) { - possibleComplianceLevels = 0; - for (String compliance : compliances.split(",")) { - if (CompilerOptions.VERSION_1_3.equals(compliance)) { - possibleComplianceLevels |= RUN_JAVAC ? NONE : F_1_3; - } else if (CompilerOptions.VERSION_1_4.equals(compliance)) { - possibleComplianceLevels |= RUN_JAVAC ? NONE : F_1_4; - } else if (CompilerOptions.VERSION_1_5.equals(compliance)) { - possibleComplianceLevels |= F_1_5; - } else if (CompilerOptions.VERSION_1_6.equals(compliance)) { - possibleComplianceLevels |= F_1_6; - } else if (CompilerOptions.VERSION_1_7.equals(compliance)) { - possibleComplianceLevels |= F_1_7; - } else if (CompilerOptions.VERSION_1_8.equals(compliance)) { - possibleComplianceLevels |= F_1_8; - } else if (CompilerOptions.VERSION_9.equals(compliance)) { - possibleComplianceLevels |= F_9; - } else if (CompilerOptions.VERSION_10.equals(compliance)) { - possibleComplianceLevels |= F_10; - } else { - System.out.println("Ignoring invalid compliance (" + compliance + ")"); - System.out.print("Use one of "); - System.out.print(CompilerOptions.VERSION_1_3 + ", "); - System.out.print(CompilerOptions.VERSION_1_4 + ", "); - System.out.print(CompilerOptions.VERSION_1_5 + ", "); - System.out.print(CompilerOptions.VERSION_1_6 + ", "); - System.out.print(CompilerOptions.VERSION_1_7 + ", "); - System.out.print(CompilerOptions.VERSION_1_8 + ", "); - System.out.print(CompilerOptions.VERSION_1_8 + ", "); - System.out.print(CompilerOptions.VERSION_9 + ", "); - System.out.println(CompilerOptions.VERSION_10); - } + String compliance = System.getProperty("compliance"); + if (compliance != null) { + if (CompilerOptions.VERSION_1_3.equals(compliance)) { + possibleComplianceLevels = RUN_JAVAC ? NONE : F_1_3; + } else if (CompilerOptions.VERSION_1_4.equals(compliance)) { + possibleComplianceLevels = RUN_JAVAC ? NONE : F_1_4; + } else if (CompilerOptions.VERSION_1_5.equals(compliance)) { + possibleComplianceLevels = F_1_5; + } else if (CompilerOptions.VERSION_1_6.equals(compliance)) { + possibleComplianceLevels = F_1_6; + } else if (CompilerOptions.VERSION_1_7.equals(compliance)) { + possibleComplianceLevels = F_1_7; + } else if (CompilerOptions.VERSION_1_8.equals(compliance)) { + possibleComplianceLevels = F_1_8; + } else if (CompilerOptions.VERSION_9.equals(compliance)) { + possibleComplianceLevels = F_9; + } else if (CompilerOptions.VERSION_10.equals(compliance)) { + possibleComplianceLevels = F_10; + } else if (CompilerOptions.VERSION_11.equals(compliance)) { + possibleComplianceLevels = F_11; + } else { + System.out.println("Invalid compliance specified (" + compliance + ")"); + System.out.print("Use one of "); + System.out.print(CompilerOptions.VERSION_1_3 + ", "); + System.out.print(CompilerOptions.VERSION_1_4 + ", "); + System.out.print(CompilerOptions.VERSION_1_5 + ", "); + System.out.print(CompilerOptions.VERSION_1_6 + ", "); + System.out.print(CompilerOptions.VERSION_1_7 + ", "); + System.out.print(CompilerOptions.VERSION_1_8 + ", "); + System.out.print(CompilerOptions.VERSION_1_8 + ", "); + System.out.print(CompilerOptions.VERSION_9 + ", "); + System.out.print(CompilerOptions.VERSION_10 + ", "); + System.out.println(CompilerOptions.VERSION_11); } if (possibleComplianceLevels == 0) { System.out.println("Defaulting to all possible compliances"); @@ -440,6 +474,10 @@ public static int getPossibleComplianceLevels() { if (canRun10) { possibleComplianceLevels |= F_10; } + boolean canRun11 = canRun10 && !CompilerOptions.VERSION_10.equals(specVersion); + if (canRun11) { + possibleComplianceLevels |= F_11; + } } else if ("1.0".equals(specVersion) || CompilerOptions.VERSION_1_1.equals(specVersion) || CompilerOptions.VERSION_1_2.equals(specVersion) @@ -458,6 +496,9 @@ public static int getPossibleComplianceLevels() { possibleComplianceLevels |= F_9; if (!CompilerOptions.VERSION_9.equals(specVersion)) { possibleComplianceLevels |= F_10; + if (!CompilerOptions.VERSION_10.equals(specVersion)) { + possibleComplianceLevels |= F_11; + } } } } @@ -611,6 +652,11 @@ protected Map getCompilerOptions() { options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_10); options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_10); options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_10); + } else { + String ver = CompilerOptions.versionFromJdkLevel(this.complianceLevel); + options.put(CompilerOptions.OPTION_Compliance, ver); + options.put(CompilerOptions.OPTION_Source, ver); + options.put(CompilerOptions.OPTION_TargetPlatform, ver); } return options; } @@ -623,6 +669,15 @@ public String getName() { return name; } + protected static String getVersionString(long compliance) { + String version = "version 11 : 55.0"; + if (compliance < ClassFileConstants.JDK9) return "version 1.8 : 52.0"; + if (compliance == ClassFileConstants.JDK9) return "version 9 : 53.0"; + if (compliance == ClassFileConstants.JDK10) return "version 10 : 54.0"; + if (compliance >= ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11)) return version; // keep this stmt for search for next bump up + return version; + } + public void initialize(CompilerTestSetup setUp) { this.complianceLevel = setUp.complianceLevel; this.enableAPT = System.getProperty("enableAPT") != null; diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/CompilerTestSetup.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/CompilerTestSetup.java index 3dc9512be2..d0da5697ff 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/CompilerTestSetup.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/CompilerTestSetup.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2014 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java index 2566e84e78..a6b899f065 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2012 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java index 174f52a959..c26434e76a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -805,8 +808,13 @@ public static int getFreePort() { */ public static String[] getJavaClassLibs() { String javaVersion = System.getProperty("java.version"); - if (javaVersion.length() > 3) { - javaVersion = javaVersion.substring(0, 3); + int index = javaVersion.indexOf('.'); + if (index != -1) { + javaVersion = javaVersion.substring(0, index); + } else { + index = javaVersion.indexOf('-'); + if (index != -1) + javaVersion = javaVersion.substring(0, index); } long jdkLevel = CompilerOptions.versionToJdkLevel(javaVersion); if (jdkLevel >= ClassFileConstants.JDK9) { diff --git a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/VerifyTests.java b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/VerifyTests.java index 4adc9ae724..779092ba9d 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/VerifyTests.java +++ b/jdt-patch/e49/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/VerifyTests.java @@ -1,9 +1,12 @@ /******************************************************************************* * 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 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/jdt-patch/e49/org.eclipse.jdt.core/.settings/.api_filters b/jdt-patch/e49/org.eclipse.jdt.core/.settings/.api_filters new file mode 100644 index 0000000000..e67e798741 --- /dev/null +++ b/jdt-patch/e49/org.eclipse.jdt.core/.settings/.api_filters @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<component id="org.eclipse.jdt.core" version="2"> + <resource path="model/org/eclipse/jdt/core/util/IClassFileReader.java" type="org.eclipse.jdt.core.util.IClassFileReader"> + <filter comment="default method added for getting nest members" id="404000815"> + <message_arguments> + <message_argument value="org.eclipse.jdt.core.util.IClassFileReader"/> + <message_argument value="getNestMembersAttribute()"/> + </message_arguments> + </filter> + </resource> +</component> diff --git a/jdt-patch/e49/org.eclipse.jdt.core/META-INF/MANIFEST.MF b/jdt-patch/e49/org.eclipse.jdt.core/META-INF/MANIFEST.MF index aa779719a5..ffe8d67d35 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/META-INF/MANIFEST.MF +++ b/jdt-patch/e49/org.eclipse.jdt.core/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Main-Class: org.eclipse.jdt.internal.compiler.batch.Main Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.jdt.core; singleton:=true -Bundle-Version: 3.15.0.qualifier +Bundle-Version: 3.15.100.qualifier Bundle-Activator: org.eclipse.jdt.core.JavaCore Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247.java b/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247.java index 42647fd90c..7a39271115 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2018 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ package org.eclipse.jdt.internal.compiler.batch; import java.io.File; @@ -96,7 +106,7 @@ public void initialize() throws IOException { if (this.compliance == null) { return; } - this.releaseInHex = Integer.toHexString(Integer.parseInt(this.compliance)); + this.releaseInHex = Integer.toHexString(Integer.parseInt(this.compliance)).toUpperCase(); Path filePath = this.jdkHome.toPath().resolve("lib").resolve("ct.sym"); //$NON-NLS-1$ //$NON-NLS-2$ URI t = filePath.toUri(); if (!Files.exists(filePath)) { diff --git a/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java b/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java index 495ec559d1..ec65ba9ef4 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java @@ -1386,6 +1386,7 @@ public static synchronized ResourceBundle getBundle(Locale locale) { // == Main.NONE: absorbent element, do not output class files; // else: use as the path of the directory into which class files must // be written. + protected boolean enablePreview; protected String releaseVersion; private boolean didSpecifySource; private boolean didSpecifyTarget; @@ -1705,6 +1706,10 @@ public String bind(String id, String[] arguments) { * <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_5</code></li> * <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_6</code></li> * <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_7</code></li> + * <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_8</code></li> + * <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK9</code></li> + * <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK10</code></li> + * <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK11</code></li> * </ul> * @param minimalSupportedVersion the given minimal version * @return true if and only if the running VM supports the given minimal version, false otherwise @@ -1728,30 +1733,7 @@ private boolean checkVMVersion(long minimalSupportedVersion) { // by default we don't support a class file version we cannot recognize return false; } - switch(majorVersion) { - case ClassFileConstants.MAJOR_VERSION_1_1 : // 1.0 and 1.1 - return ClassFileConstants.JDK1_1 >= minimalSupportedVersion; - case ClassFileConstants.MAJOR_VERSION_1_2 : // 1.2 - return ClassFileConstants.JDK1_2 >= minimalSupportedVersion; - case ClassFileConstants.MAJOR_VERSION_1_3 : // 1.3 - return ClassFileConstants.JDK1_3 >= minimalSupportedVersion; - case ClassFileConstants.MAJOR_VERSION_1_4 : // 1.4 - return ClassFileConstants.JDK1_4 >= minimalSupportedVersion; - case ClassFileConstants.MAJOR_VERSION_1_5 : // 1.5 - return ClassFileConstants.JDK1_5 >= minimalSupportedVersion; - case ClassFileConstants.MAJOR_VERSION_1_6 : // 1.6 - return ClassFileConstants.JDK1_6 >= minimalSupportedVersion; - case ClassFileConstants.MAJOR_VERSION_1_7 : // 1.7 - return ClassFileConstants.JDK1_7 >= minimalSupportedVersion; - case ClassFileConstants.MAJOR_VERSION_1_8: // 1.8 - return ClassFileConstants.JDK1_8 >= minimalSupportedVersion; - case ClassFileConstants.MAJOR_VERSION_9: // 9 - return ClassFileConstants.JDK9 >= minimalSupportedVersion; - case ClassFileConstants.MAJOR_VERSION_10: // 9 - return ClassFileConstants.JDK10 >= minimalSupportedVersion; - } - // unknown version - return false; + return ClassFileConstants.getComplianceLevelForJavaVersion(majorVersion) >=minimalSupportedVersion; } /* * Low-level API performing the actual compilation @@ -2206,6 +2188,16 @@ public void configure(String[] argv) { mode = DEFAULT; continue; } + if (currentArg.equals("-11") || currentArg.equals("-11.0")) { //$NON-NLS-1$ //$NON-NLS-2$ + if (didSpecifyCompliance) { + throw new IllegalArgumentException( + this.bind("configure.duplicateCompliance", currentArg)); //$NON-NLS-1$ + } + didSpecifyCompliance = true; + this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); + mode = DEFAULT; + continue; + } if (currentArg.equals("-d")) { //$NON-NLS-1$ if (this.destinationPath != null) { StringBuffer errorMessage = new StringBuffer(); @@ -2239,6 +2231,11 @@ public void configure(String[] argv) { mode = INSIDE_BOOTCLASSPATH_start; continue; } + if (currentArg.equals("--enable-preview")) { //$NON-NLS-1$ + this.enablePreview = true; + mode = DEFAULT; + continue; + } if (currentArg.equals("--system")) { //$NON-NLS-1$ mode = INSIDE_SYSTEM; continue; @@ -2746,6 +2743,8 @@ public void configure(String[] argv) { this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_9); } else if (currentArg.equals("10") || currentArg.equals("10.0")) { //$NON-NLS-1$//$NON-NLS-2$ this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_10); + } else if (currentArg.equals("11") || currentArg.equals("11.0")) { //$NON-NLS-1$//$NON-NLS-2$ + this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); } else if (currentArg.equals("jsr14")) { //$NON-NLS-1$ this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_JSR14); @@ -2792,7 +2791,7 @@ else if (currentArg.equals("jsr14")) { //$NON-NLS-1$ // If release >= 9, the following are disallowed // --system and --upgrade-module-path - // -source and -target are diasllowed for any --release + // -source and -target are disallowed for any --release this.releaseVersion = currentArg; long releaseToJDKLevel = CompilerOptions.releaseToJDKLevel(currentArg); if (releaseToJDKLevel == 0) { @@ -2833,6 +2832,8 @@ else if (currentArg.equals("jsr14")) { //$NON-NLS-1$ this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_9); } else if (currentArg.equals("10") || currentArg.equals("10.0")) { //$NON-NLS-1$//$NON-NLS-2$ this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_10); + } else if (currentArg.equals("11") || currentArg.equals("11.0")) { //$NON-NLS-1$//$NON-NLS-2$ + this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); } else { throw new IllegalArgumentException(this.bind("configure.source", currentArg)); //$NON-NLS-1$ } @@ -3107,6 +3108,11 @@ else if (currentArg.equals("jsr14")) { //$NON-NLS-1$ mode = DEFAULT; continue; } + if (this.enablePreview) { + this.options.put( + CompilerOptions.OPTION_EnablePreviews, + CompilerOptions.ENABLED); + } // set DocCommentSupport, with appropriate side effects on defaults if // javadoc is not enabled @@ -5436,10 +5442,31 @@ protected void validateOptions(boolean didSpecifyCompliance) { this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_10); if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_10); } + } else { + if (!this.didSpecifyTarget) { + if (this.didSpecifySource) { + String source = this.options.get(CompilerOptions.OPTION_Source); + if (CompilerOptions.VERSION_1_3.equals(source) + || CompilerOptions.VERSION_1_4.equals(source)) { + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); + } else if (CompilerOptions.VERSION_1_5.equals(source) + || CompilerOptions.VERSION_1_6.equals(source)) { + this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); + } else { + if (CompilerOptions.versionToJdkLevel(source) > 0) + this.options.put(CompilerOptions.OPTION_TargetPlatform, source); + } + } else { + if (CompilerOptions.versionToJdkLevel(version) > 0) { + this.options.put(CompilerOptions.OPTION_Source, version); + this.options.put(CompilerOptions.OPTION_TargetPlatform, version); + } + } + } } } else if (this.didSpecifySource) { - Object version = this.options.get(CompilerOptions.OPTION_Source); + String version = this.options.get(CompilerOptions.OPTION_Source); // default is source 1.3 target 1.2 and compliance 1.4 if (CompilerOptions.VERSION_1_4.equals(version)) { if (!didSpecifyCompliance) this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4); @@ -5462,6 +5489,11 @@ protected void validateOptions(boolean didSpecifyCompliance) { } else if (CompilerOptions.VERSION_10.equals(version)) { if (!didSpecifyCompliance) this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_10); if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_10); + } else { + if (CompilerOptions.versionToJdkLevel(version) > 0) { + if (!didSpecifyCompliance) this.options.put(CompilerOptions.OPTION_Compliance, version); + if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, version); + } } } @@ -5498,6 +5530,13 @@ protected void validateOptions(boolean didSpecifyCompliance) { && this.complianceLevel < ClassFileConstants.JDK1_4) { // compliance must be 1.4 if source is 1.4 throw new IllegalArgumentException(this.bind("configure.incompatibleComplianceForSource", this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_4)); //$NON-NLS-1$ + } else { + long ver = CompilerOptions.versionToJdkLevel(sourceVersion); + if(this.complianceLevel < ver) + throw new IllegalArgumentException(this.bind("configure.incompatibleComplianceForSource", this.options.get(CompilerOptions.OPTION_Compliance), sourceVersion)); //$NON-NLS-1$ + } + if (this.enablePreview && this.complianceLevel != ClassFileConstants.getLatestJDKLevel()) { + throw new IllegalArgumentException(this.bind("configure.unsupportedPreview")); //$NON-NLS-1$ } // check and set compliance/source/target compatibilities diff --git a/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties b/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties index 7d288563a6..c02926b66d 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties +++ b/jdt-patch/e49/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties @@ -91,6 +91,7 @@ configure.incompatibleComplianceForTarget = Compliance level ''{0}'' is incompat configure.repetition = repetition must be a positive integer: {0} configure.maxProblems = max problems must be a positive integer: {0} configure.invalidNowarnOption = invalid syntax for nowarn option: {0} +configure.unsupportedPreview = Preview of features is supported only at the latest source level configure.invalidErrorConfiguration = invalid error configuration: ''{0}'' configure.invalidError = invalid error token: ''{0}''. Ignoring this error token and compiling diff --git a/jdt-patch/e49/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java b/jdt-patch/e49/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java index deaee44d86..5976850032 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java @@ -57,6 +57,7 @@ import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies; import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; +import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration; import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; @@ -1477,6 +1478,13 @@ public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) { return true; } @Override + public boolean visit( + Argument argument, BlockScope scope) { + if (argument.type instanceof SingleTypeReference && ((SingleTypeReference)argument.type).token == assistIdentifier) + throw new SelectionNodeFound(argument.binding.type); + return true; // do nothing by default, keep traversing + } + @Override public boolean visit(TypeDeclaration typeDeclaration, CompilationUnitScope scope) { if (typeDeclaration.name == assistIdentifier) { throw new SelectionNodeFound(typeDeclaration.binding); diff --git a/jdt-patch/e49/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/jdt-patch/e49/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java index aa1e237189..fdca4e3158 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java @@ -4880,6 +4880,9 @@ && topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER) == SWITCH) { keywords[count++]= Keywords.VAR; } } else if(kind != K_BETWEEN_CASE_AND_COLON && kind != K_BETWEEN_DEFAULT_AND_COLON) { + if (kind == K_LOCAL_INITIALIZER_DELIMITER && this.options.complianceLevel >= ClassFileConstants.JDK11) { + keywords[count++]= Keywords.VAR; + } keywords[count++]= Keywords.TRUE; keywords[count++]= Keywords.FALSE; keywords[count++]= Keywords.NULL; diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java index 3e6375ce83..c0ca3fbddb 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java @@ -2074,5 +2074,7 @@ public interface IProblem { int VarIsReservedInFuture = Syntax + 1510; // ''var'' should not be used as an type name, since it is a reserved word from source level 10 on /** @since 3.14 */ int VarIsNotAllowedHere = Syntax + 1511; // ''var'' is not allowed here + /** @since 3.15 */ + int VarCannotBeMixedWithNonVarParams = Syntax + 1512; // ''var'' cannot be mixed with explicit or implicit parameters } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java index d6eb5419e5..3641ca2fad 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java @@ -174,6 +174,7 @@ public class ClassFile implements TypeConstants, TypeIds { public static final int INITIAL_CONTENTS_SIZE = 400; public static final int INITIAL_HEADER_SIZE = 1500; public static final int INNER_CLASSES_SIZE = 5; + public static final int NESTED_MEMBER_SIZE = 5; /** * INTERNAL USE-ONLY @@ -449,6 +450,10 @@ public int compare(Object o1, Object o2) { attributesNumber += generateTypeAnnotationAttributeForTypeDeclaration(); + if (this.targetJDK >= ClassFileConstants.JDK11) { + // add nestMember and nestHost attributes + attributesNumber += generateNestAttributes(); + } // update the number of attributes if (attributeOffset + 2 >= this.contents.length) { resizeContents(2); @@ -2657,6 +2662,69 @@ private int generateDeprecatedAttribute() { this.contentsOffset = localContentsOffset; return 1; } + private int generateNestHostAttribute() { + SourceTypeBinding nestHost = this.referenceBinding.getNestHost(); + if (nestHost == null) + return 0; + int localContentsOffset = this.contentsOffset; + if (localContentsOffset + 10 >= this.contents.length) { + resizeContents(10); + } + int nestHostAttributeNameIndex = + this.constantPool.literalIndex(AttributeNamesConstants.NestHost); + this.contents[localContentsOffset++] = (byte) (nestHostAttributeNameIndex >> 8); + this.contents[localContentsOffset++] = (byte) nestHostAttributeNameIndex; + + // The value of the attribute_length item must be two. + this.contents[localContentsOffset++] = 0; + this.contents[localContentsOffset++] = 0; + this.contents[localContentsOffset++] = 0; + this.contents[localContentsOffset++] = 2; + + int nestHostIndex = this.constantPool.literalIndexForType(nestHost.constantPoolName()); + this.contents[localContentsOffset++] = (byte) (nestHostIndex >> 8); + this.contents[localContentsOffset++] = (byte) nestHostIndex; + this.contentsOffset = localContentsOffset; + return 1; + } + private int generateNestMembersAttribute() { + + int localContentsOffset = this.contentsOffset; + List<String> nestedMembers = this.referenceBinding.getNestMembers(); + int numberOfNestedMembers = nestedMembers != null ? nestedMembers.size() : 0; + if (numberOfNestedMembers == 0) // JVMS 11 4.7.29 says "at most one" NestMembers attribute - return if none. + return 0; + + int exSize = 8 + 2 * numberOfNestedMembers; + if (exSize + localContentsOffset >= this.contents.length) { + resizeContents(exSize); + } + int attributeNameIndex = + this.constantPool.literalIndex(AttributeNamesConstants.NestMembers); + this.contents[localContentsOffset++] = (byte) (attributeNameIndex >> 8); + this.contents[localContentsOffset++] = (byte) attributeNameIndex; + int value = (numberOfNestedMembers << 1) + 2; + this.contents[localContentsOffset++] = (byte) (value >> 24); + this.contents[localContentsOffset++] = (byte) (value >> 16); + this.contents[localContentsOffset++] = (byte) (value >> 8); + this.contents[localContentsOffset++] = (byte) value; + this.contents[localContentsOffset++] = (byte) (numberOfNestedMembers >> 8); + this.contents[localContentsOffset++] = (byte) numberOfNestedMembers; + + for (int i = 0; i < numberOfNestedMembers; i++) { + char[] nestMemberName = nestedMembers.get(i).toCharArray(); + int nestedMemberIndex = this.constantPool.literalIndexForType(nestMemberName); + this.contents[localContentsOffset++] = (byte) (nestedMemberIndex >> 8); + this.contents[localContentsOffset++] = (byte) nestedMemberIndex; + } + this.contentsOffset = localContentsOffset; + return 1; + } + private int generateNestAttributes() { + int nAttrs = generateNestMembersAttribute(); //either member or host will exist 4.7.29 + nAttrs += generateNestHostAttribute(); + return nAttrs; + } private int generateModuleAttribute(ModuleDeclaration module) { ModuleBinding binding = module.binding; int localContentsOffset = this.contentsOffset; diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java index 5c3c0c347c..d15bd8dc94 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java @@ -1,13 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2018 IBM Corporation and others. - * - * This program and the accompanying materials + * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation * Stephan Herrmann - Contributions for @@ -297,7 +296,9 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f MethodBinding codegenBinding = this.binding.original(); ReferenceBinding declaringClass; - if (codegenBinding.isPrivate() && TypeBinding.notEquals(currentScope.enclosingSourceType(), (declaringClass = codegenBinding.declaringClass))) { + if (codegenBinding.isPrivate() && + !currentScope.enclosingSourceType().isNestmateOf(this.binding.declaringClass) && + TypeBinding.notEquals(currentScope.enclosingSourceType(), (declaringClass = codegenBinding.declaringClass))) { // from 1.4 on, local type constructor can lose their private flag to ease emulation if ((declaringClass.tagBits & TagBits.IsLocalType) != 0 && currentScope.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4) { diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java index 68fde662ed..9efacdedb4 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java @@ -1,5 +1,7 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 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 * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -253,7 +255,9 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f MethodBinding codegenBinding = this.binding.original(); // perform some emulation work in case there is some and we are inside a local type only - if (this.binding.isPrivate() && this.accessMode != ExplicitConstructorCall.This) { + if (this.binding.isPrivate() && + !currentScope.enclosingSourceType().isNestmateOf(this.binding.declaringClass) && + this.accessMode != ExplicitConstructorCall.This) { ReferenceBinding declaringClass = codegenBinding.declaringClass; // from 1.4 on, local type constructor can lose their private flag to ease emulation if ((declaringClass.tagBits & TagBits.IsLocalType) != 0 && currentScope.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4) { diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java index e560fdbaa2..51f10252c3 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java @@ -548,7 +548,8 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f // if field from parameterized type got found, use the original field at codegen time FieldBinding codegenBinding = this.binding.original(); if (this.binding.isPrivate()) { - if ((TypeBinding.notEquals(currentScope.enclosingSourceType(), codegenBinding.declaringClass)) + if (!currentScope.enclosingSourceType().isNestmateOf(codegenBinding.declaringClass) && + (TypeBinding.notEquals(currentScope.enclosingSourceType(), codegenBinding.declaringClass)) && this.binding.constant(currentScope) == Constant.NotAConstant) { if (this.syntheticAccessors == null) this.syntheticAccessors = new MethodBinding[2]; diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java index 6d75cb481f..4d6b5d56e9 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java @@ -247,6 +247,7 @@ public boolean kosherDescriptor(Scope currentScope, MethodBinding sam, boolean s public TypeBinding resolveType(BlockScope blockScope, boolean skipKosherCheck) { boolean argumentsTypeElided = argumentsTypeElided(); + boolean argumentsTypeVar = argumentsTypeVar(blockScope); int argumentsLength = this.arguments == null ? 0 : this.arguments.length; if (this.constant != Constant.NotAConstant) { @@ -255,7 +256,7 @@ public TypeBinding resolveType(BlockScope blockScope, boolean skipKosherCheck) { if (this.original == this) this.ordinal = recordFunctionalType(blockScope); - if (!argumentsTypeElided) { + if (!argumentsTypeElided && !argumentsTypeVar) { for (int i = 0; i < argumentsLength; i++) this.argumentTypes[i] = this.arguments[i].type.resolveType(blockScope, true /* check bounds*/); } @@ -288,7 +289,7 @@ public TypeBinding resolveType(BlockScope blockScope, boolean skipKosherCheck) { int parametersLength = this.descriptor.parameters.length; if (parametersLength != argumentsLength) { this.scope.problemReporter().lambdaSignatureMismatched(this); - if (argumentsTypeElided || this.original != this) // no interest in continuing to error check copy. + if (argumentsTypeElided || argumentsTypeVar || this.original != this) // no interest in continuing to error check copy. return this.resolvedType = null; // FUBAR, bail out ... else { this.resolvedType = null; // continue to type check. @@ -313,7 +314,7 @@ public TypeBinding resolveType(BlockScope blockScope, boolean skipKosherCheck) { TypeBinding argumentType; final TypeBinding expectedParameterType = haveDescriptor && i < this.descriptor.parameters.length ? this.descriptor.parameters[i] : null; - argumentType = argumentsTypeElided ? expectedParameterType : this.argumentTypes[i]; + argumentType = (argumentsTypeElided || argumentsTypeVar) ? expectedParameterType : this.argumentTypes[i]; if (argumentType == null) { argumentsHaveErrors = true; } else if (argumentType == TypeBinding.VOID) { @@ -328,7 +329,7 @@ public TypeBinding resolveType(BlockScope blockScope, boolean skipKosherCheck) { } } } - if (!argumentsTypeElided && !argumentsHaveErrors) { + if (!argumentsTypeElided && !argumentsTypeVar && !argumentsHaveErrors) { ReferenceBinding groundType = null; ReferenceBinding expectedSAMType = null; if (this.expectedType instanceof IntersectionTypeBinding18) @@ -359,11 +360,13 @@ else if (this.expectedType instanceof ReferenceBinding) } boolean parametersHaveErrors = false; boolean genericSignatureNeeded = this.requiresGenericSignature || blockScope.compilerOptions().generateGenericSignatureForLambdaExpressions; + TypeBinding[] expectedParameterTypes = new TypeBinding[argumentsLength]; for (int i = 0; i < argumentsLength; i++) { Argument argument = this.arguments[i]; TypeBinding argumentType; final TypeBinding expectedParameterType = haveDescriptor && i < this.descriptor.parameters.length ? this.descriptor.parameters[i] : null; - argumentType = argumentsTypeElided ? expectedParameterType : this.argumentTypes[i]; + argumentType = (argumentsTypeElided || argumentsTypeVar) ? expectedParameterType : this.argumentTypes[i]; + expectedParameterTypes[i] = expectedParameterType; if (argumentType != null && argumentType != TypeBinding.VOID) { if (haveDescriptor && expectedParameterType != null && argumentType.isValidBinding() && TypeBinding.notEquals(argumentType, expectedParameterType)) { if (expectedParameterType.isProperType(true)) { @@ -393,6 +396,11 @@ else if (this.expectedType instanceof ReferenceBinding) } } } + if (argumentsTypeVar) { + for (int i = 0; i < argumentsLength; ++i) { + this.arguments[i].type.resolvedType = expectedParameterTypes[i]; + } + } // only assign parameters if no problems are found if (!argumentsHaveErrors) { this.binding.parameters = newParameters; @@ -400,7 +408,7 @@ else if (this.expectedType instanceof ReferenceBinding) this.binding.setParameterAnnotations(parameterAnnotations); } - if (!argumentsTypeElided && !argumentsHaveErrors && this.binding.isVarargs()) { + if (!argumentsTypeElided && !argumentsTypeVar && !argumentsHaveErrors && this.binding.isVarargs()) { if (!this.binding.parameters[this.binding.parameters.length - 1].isReifiable()) { this.scope.problemReporter().possibleHeapPollutionFromVararg(this.arguments[this.arguments.length - 1]); } @@ -430,7 +438,7 @@ else if (this.expectedType instanceof ReferenceBinding) } // TODO (stephan): else? (can that happen?) if (haveDescriptor && !argumentsHaveErrors && blockScope.compilerOptions().isAnnotationBasedNullAnalysisEnabled) { - if (!argumentsTypeElided) { + if (!argumentsTypeElided && !argumentsTypeVar) { AbstractMethodDeclaration.createArgumentBindings(this.arguments, this.binding, this.scope); // includes validation // no application of null-ness default, hence also no warning regarding redundant null annotation mergeParameterNullAnnotations(blockScope); @@ -528,6 +536,27 @@ public boolean argumentsTypeElided() { return this.arguments.length > 0 && this.arguments[0].hasElidedType(); } + private boolean argumentsTypeVar(BlockScope blockScope) { + if (blockScope.compilerOptions().complianceLevel < ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11)) return false; + boolean retval = false, isVar = false, mixReported = false; + Argument[] args = this.arguments; + for (int i = 0, l = args.length; i < l; ++i) { + Argument arg = args[i]; + TypeReference type = arg.type; + if (type == null) continue; + boolean prev = isVar; + retval |= isVar = type.isTypeNameVar(blockScope); + if (i > 0 && prev != isVar && !mixReported) { // report only once per list + blockScope.problemReporter().varCannotBeMixedWithNonVarParams(isVar ? arg : args[i - 1]); + mixReported = true; + } + if (isVar && (type.dimensions() > 0 || type.extraDimensions() > 0)) { + blockScope.problemReporter().varLocalCannotBeArray(arg); + } + } + return retval; + } + private void analyzeExceptions() { ExceptionHandlingFlowContext ehfc; CompilerOptions compilerOptions = this.scope.compilerOptions(); diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java index 09682893b3..a345d90afe 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -493,7 +492,8 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenBinding, this.actualReceiverType, this.receiver.isImplicitThis()); if (isStatic){ codeStream.invoke(Opcodes.OPC_invokestatic, codegenBinding, constantPoolDeclaringClass, this.typeArguments); - } else if((this.receiver.isSuper()) || codegenBinding.isPrivate()){ + } else if((this.receiver.isSuper()) || + (!currentScope.enclosingSourceType().isNestmateOf(this.binding.declaringClass) && codegenBinding.isPrivate())){ codeStream.invoke(Opcodes.OPC_invokespecial, codegenBinding, constantPoolDeclaringClass, this.typeArguments); } else if (constantPoolDeclaringClass.isInterface()) { // interface or annotation type codeStream.invoke(Opcodes.OPC_invokeinterface, codegenBinding, constantPoolDeclaringClass, this.typeArguments); @@ -550,7 +550,8 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f if (this.binding.isPrivate()){ // depth is set for both implicit and explicit access (see MethodBinding#canBeSeenBy) - if (TypeBinding.notEquals(currentScope.enclosingSourceType(), codegenBinding.declaringClass)){ + if (!currentScope.enclosingSourceType().isNestmateOf(codegenBinding.declaringClass) && + TypeBinding.notEquals(currentScope.enclosingSourceType(), codegenBinding.declaringClass)){ this.syntheticAccessor = ((SourceTypeBinding)codegenBinding.declaringClass).addSyntheticMethod(codegenBinding, false /* not super access there */); currentScope.problemReporter().needToEmulateMethodAccess(codegenBinding, this); return; diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java index eb62701838..e9d9103f26 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java @@ -904,7 +904,8 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FieldBindi if (fieldBinding.isPrivate()) { // private access FieldBinding codegenField = getCodegenBinding(index < 0 ? (this.otherBindings == null ? 0 : this.otherBindings.length) : index); ReferenceBinding declaringClass = codegenField.declaringClass; - if (TypeBinding.notEquals(declaringClass, currentScope.enclosingSourceType())) { + if (!currentScope.enclosingSourceType().isNestmateOf(declaringClass) && + TypeBinding.notEquals(declaringClass, currentScope.enclosingSourceType())) { setSyntheticAccessor(fieldBinding, index, ((SourceTypeBinding) declaringClass).addSyntheticMethod(codegenField, index >= 0 /*read-access?*/, false /*not super access*/)); currentScope.problemReporter().needToEmulateFieldAccess(codegenField, this, index >= 0 /*read-access?*/); return; diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java index 3a725ab3eb..c7e4eb8909 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java @@ -440,10 +440,15 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f if (this.isConstructorReference()) { ReferenceBinding allocatedType = codegenBinding.declaringClass; - if (codegenBinding.isPrivate() && TypeBinding.notEquals(enclosingSourceType, (allocatedType = codegenBinding.declaringClass))) { + if (codegenBinding.isPrivate() && + TypeBinding.notEquals(enclosingSourceType, (allocatedType = codegenBinding.declaringClass))) { if ((allocatedType.tagBits & TagBits.IsLocalType) != 0) { codegenBinding.tagBits |= TagBits.ClearPrivateModifier; } else { + if (currentScope.enclosingSourceType().isNestmateOf(this.binding.declaringClass)) { + this.syntheticAccessor = codegenBinding; + return; + } this.syntheticAccessor = ((SourceTypeBinding) allocatedType).addSyntheticMethod(codegenBinding, false); currentScope.problemReporter().needToEmulateMethodAccess(codegenBinding, this); } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java index b211bf1489..35967ab8fd 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java @@ -928,7 +928,8 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f FieldBinding fieldBinding = (FieldBinding) this.binding; FieldBinding codegenField = fieldBinding.original(); if (((this.bits & ASTNode.DepthMASK) != 0) - && (codegenField.isPrivate() // private access + && ((codegenField.isPrivate() // private access + && !currentScope.enclosingSourceType().isNestmateOf(codegenField.declaringClass) ) || (codegenField.isProtected() // implicit protected access && codegenField.declaringClass.getPackage() != currentScope.enclosingSourceType().getPackage()))) { if (this.syntheticAccessors == null) diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java index 8c30470e28..e401e018fa 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java @@ -1249,6 +1249,7 @@ public void resolve() { reporter.javadocMissing(this.sourceStart, this.sourceEnd, severity, javadocModifiers); } } + updateNestInfo(); FieldDeclaration[] fieldsDecls = this.fields; if (fieldsDecls != null) { for (FieldDeclaration fieldDeclaration : fieldsDecls) @@ -1554,6 +1555,20 @@ void updateMaxFieldCount() { } } +private SourceTypeBinding findNestHost() { + ClassScope classScope = this.scope.enclosingTopMostClassScope(); + return classScope != null ? classScope.referenceContext.binding : null; +} + +void updateNestInfo() { + if (this.binding == null) + return; + SourceTypeBinding nestHost = findNestHost(); + if (nestHost != null && !this.binding.equals(nestHost)) {// member + this.binding.setNestHost(nestHost); + nestHost.addNestMember(this.binding); + } +} public boolean isPackageInfo() { return CharOperation.equals(this.name, TypeConstants.PACKAGE_INFO_NAME); } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java index b5296362ab..89780fdbdb 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -83,6 +82,7 @@ public interface ClassFileConstants { int NameAndTypeTag = 12; int MethodHandleTag = 15; int MethodTypeTag = 16; + int DynamicTag = 17; int InvokeDynamicTag = 18; int ModuleTag = 19; int PackageTag = 20; @@ -100,6 +100,7 @@ public interface ClassFileConstants { int ConstantNameAndTypeFixedSize = 5; int ConstantMethodHandleFixedSize = 4; int ConstantMethodTypeFixedSize = 3; + int ConstantDynamicFixedSize = 5; int ConstantInvokeDynamicFixedSize = 5; int ConstantModuleFixedSize = 3; int ConstantPackageFixedSize = 3; @@ -125,12 +126,17 @@ public interface ClassFileConstants { int MAJOR_VERSION_1_8 = 52; int MAJOR_VERSION_9 = 53; int MAJOR_VERSION_10 = 54; + int MAJOR_VERSION_11 = 55; + + int MAJOR_VERSION_0 = 44; + int MAJOR_LATEST_VERSION = MAJOR_VERSION_11; int MINOR_VERSION_0 = 0; int MINOR_VERSION_1 = 1; int MINOR_VERSION_2 = 2; int MINOR_VERSION_3 = 3; int MINOR_VERSION_4 = 4; + int MINOR_VERSION_PREVIEW = 0xffff; // JDK 1.1 -> 9, comparable value allowing to check both major/minor version at once 1.4.1 > 1.4.0 // 16 unsigned bits for major, then 16 bits for minor @@ -144,7 +150,29 @@ public interface ClassFileConstants { long JDK1_8 = ((long)ClassFileConstants.MAJOR_VERSION_1_8 << 16) + ClassFileConstants.MINOR_VERSION_0; long JDK9 = ((long)ClassFileConstants.MAJOR_VERSION_9 << 16) + ClassFileConstants.MINOR_VERSION_0; long JDK10 = ((long)ClassFileConstants.MAJOR_VERSION_10 << 16) + ClassFileConstants.MINOR_VERSION_0; + long JDK11 = ((long)ClassFileConstants.MAJOR_VERSION_11 << 16) + ClassFileConstants.MINOR_VERSION_0; + + public static long getLatestJDKLevel() { + return ((long)ClassFileConstants.MAJOR_LATEST_VERSION << 16) + ClassFileConstants.MINOR_VERSION_0; + } + /** + * As we move away from declaring every compliance level explicitly (such as JDK11, JDK12 etc.), + * this method can be used to compute the compliance level on the fly for a given Java major version. + * + * @param major Java major version + * @return the compliance level for the given Java version + */ + public static long getComplianceLevelForJavaVersion(int major) { + switch(major) { + case ClassFileConstants.MAJOR_VERSION_1_1: + return ((long)ClassFileConstants.MAJOR_VERSION_1_1 << 16) + ClassFileConstants.MINOR_VERSION_3; + default: + if (major <= MAJOR_LATEST_VERSION) + return ((long)major << 16) + ClassFileConstants.MINOR_VERSION_0; + } + return 0; + } /* * cldc1.1 is 45.3, but we modify it to be different from JDK1_1. * In the code gen, we will generate the same target value as JDK1_1 diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java index 4a3882142d..64902f4a4f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java @@ -78,6 +78,9 @@ public class ClassFileReader extends ClassFileStruct implements IBinaryType { private char[][][] missingTypeNames; private int enclosingNameAndTypeIndex; private char[] enclosingMethod; + private char[] nestHost; + private int nestMembersCount; + private char[][] nestMembers; private static String printTypeModifiers(int modifiers) { java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream(); @@ -259,6 +262,10 @@ public ClassFileReader(byte[] classFileBytes, char[] fileName, boolean fullyInit this.constantPoolOffsets[i] = readOffset; readOffset += ClassFileConstants.ConstantMethodTypeFixedSize; break; + case ClassFileConstants.DynamicTag : + this.constantPoolOffsets[i] = readOffset; + readOffset += ClassFileConstants.ConstantDynamicFixedSize; + break; case ClassFileConstants.InvokeDynamicTag : this.constantPoolOffsets[i] = readOffset; readOffset += ClassFileConstants.ConstantInvokeDynamicFixedSize; @@ -433,6 +440,27 @@ public ClassFileReader(byte[] classFileBytes, char[] fileName, boolean fullyInit this.moduleDeclaration = ModuleInfo.createModule(this.reference, this.constantPoolOffsets, readOffset); this.moduleName = this.moduleDeclaration.name(); } + break; + case 'N' : + if (CharOperation.equals(attributeName, AttributeNamesConstants.NestHost)) { + utf8Offset = + this.constantPoolOffsets[u2At(this.constantPoolOffsets[u2At(readOffset + 6)] + 1)]; + this.nestHost = utf8At(utf8Offset + 3, u2At(utf8Offset + 1)); + } else if (CharOperation.equals(attributeName, AttributeNamesConstants.NestMembers)) { + int offset = readOffset + 6; + this.nestMembersCount = u2At(offset); + if (this.nestMembersCount != 0) { + offset += 2; + this.nestMembers = new char[this.nestMembersCount][]; + for (int j = 0; j < this.nestMembersCount; j++) { + utf8Offset = + this.constantPoolOffsets[u2At(this.constantPoolOffsets[u2At(offset)] + 1)]; + this.nestMembers[j] = utf8At(utf8Offset + 3, u2At(utf8Offset + 1)); + offset += 2; + } + } + } + break; } readOffset += (6 + u4At(readOffset + 2)); } @@ -453,6 +481,10 @@ public ClassFileReader(byte[] classFileBytes, char[] fileName, boolean fullyInit } } +public char[] getNestHost() { + return this.nestHost; +} + @Override public ExternalAnnotationStatus getExternalAnnotationStatus() { return ExternalAnnotationStatus.NOT_EEA_CONFIGURED; diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java index fa3e8c55d8..5426cbc9fd 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java @@ -50,4 +50,7 @@ public interface AttributeNamesConstants { final char[] RuntimeInvisibleTypeAnnotationsName = "RuntimeInvisibleTypeAnnotations".toCharArray(); //$NON-NLS-1$ // jep118 final char[] MethodParametersName = "MethodParameters".toCharArray(); //$NON-NLS-1$ + // jep181 + final char[] NestHost = "NestHost".toCharArray(); //$NON-NLS-1$ + final char[] NestMembers = "NestMembers".toCharArray(); //$NON-NLS-1$ } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java index 0423de45d4..276c999ed2 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java @@ -895,7 +895,7 @@ public int literalIndexForMethodType(char[] descriptor) { return index; } - public int literalIndexForInvokeDynamic(int bootStrapIndex, char[] selector, char[] descriptor) { + private int literalIndexForInvokeAndConstantDynamic(int bootStrapIndex, char[] selector, char[] descriptor, int tag) { int index; if ((index = putInDynamicCacheIfAbsent(bootStrapIndex, selector, descriptor, this.currentIndex)) < 0) { this.currentIndex++; @@ -909,7 +909,7 @@ public int literalIndexForInvokeDynamic(int bootStrapIndex, char[] selector, cha } this.offsets[index] = this.currentOffset; - writeU1(InvokeDynamicTag); + writeU1(tag); int classIndexOffset = this.currentOffset; if (this.currentOffset + 4 >= this.poolContent.length) { resizePoolContents(4); @@ -925,6 +925,13 @@ public int literalIndexForInvokeDynamic(int bootStrapIndex, char[] selector, cha } return index; } + // CONSTANT_Dynamic_info JVMS 4.4.10 /jep 309 + public int literalIndexForDynamic(int bootStrapIndex, char[] selector, char[] descriptor) { + return literalIndexForInvokeAndConstantDynamic(bootStrapIndex, selector, descriptor, DynamicTag); + } + public int literalIndexForInvokeDynamic(int bootStrapIndex, char[] selector, char[] descriptor) { + return literalIndexForInvokeAndConstantDynamic(bootStrapIndex, selector, descriptor, InvokeDynamicTag); + } public int literalIndexForField(char[] declaringClass, char[] name, char[] signature) { int index; if ((index = putInCacheIfAbsent(declaringClass, name, signature, this.currentIndex)) < 0) { diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ISourceModule.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ISourceModule.java index afd754dfa2..3991a32148 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ISourceModule.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/ISourceModule.java @@ -8,10 +8,6 @@ * * SPDX-License-Identifier: EPL-2.0 * - * This is an implementation of an early-draft specification developed under the Java - * Community Process (JCP) and is made available for testing and evaluation purposes - * only. The code is not compatible with any specification of the JCP. - * * Contributors: * Stephan Herrmann - initial API and implementation *******************************************************************************/ diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java index b5ba20933d..0397578194 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java @@ -203,6 +203,8 @@ public class CompilerOptions { public static final String OPTION_ReportAPILeak = "org.eclipse.jdt.core.compiler.problem.APILeak"; //$NON-NLS-1$ public static final String OPTION_ReportUnstableAutoModuleName = "org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName"; //$NON-NLS-1$ + public static final String OPTION_EnablePreviews = "org.eclipse.jdt.core.compiler.problem.EnablePreviews"; //$NON-NLS-1$ + // GROOVY add // This first one is the MASTER OPTION and if null, rather than ENABLED or DISABLED then the compiler will abort // FIXASC (M3) aborting is just a short term action to enable us to ensure the right paths into the compiler configure it @@ -232,6 +234,7 @@ public class CompilerOptions { public static final String VERSION_1_8 = "1.8"; //$NON-NLS-1$ public static final String VERSION_9 = "9"; //$NON-NLS-1$ public static final String VERSION_10 = "10"; //$NON-NLS-1$ + public static final String VERSION_11 = "11"; //$NON-NLS-1$ public static final String ERROR = "error"; //$NON-NLS-1$ public static final String WARNING = "warning"; //$NON-NLS-1$ public static final String INFO = "info"; //$NON-NLS-1$ @@ -534,6 +537,9 @@ public class CompilerOptions { /** Not directly configurable, derived from other options by LookupEnvironment.usesNullTypeAnnotations() */ public Boolean useNullTypeAnnotations = null; + /** Master flag to enabled/disable all preview features */ + public boolean enablePreviewFeatures; + // keep in sync with warningTokenToIrritant and warningTokenFromIrritant public final static String[] warningTokens = { "all", //$NON-NLS-1$ @@ -564,6 +570,7 @@ public class CompilerOptions { "unlikely-arg-type", //$NON-NLS-1$ "unqualified-field-access", //$NON-NLS-1$ "unused", //$NON-NLS-1$ + "preview", //$NON-NLS-1$ }; /** @@ -773,7 +780,8 @@ public static String optionKeyFromIrritant(int irritant) { } public static String versionFromJdkLevel(long jdkLevel) { - switch ((int)(jdkLevel>>16)) { + int major = (int)(jdkLevel>>16); + switch (major) { case ClassFileConstants.MAJOR_VERSION_1_1 : if (jdkLevel == ClassFileConstants.JDK1_1) return VERSION_1_1; @@ -814,28 +822,22 @@ public static String versionFromJdkLevel(long jdkLevel) { if (jdkLevel == ClassFileConstants.JDK10) return VERSION_10; break; + default: + if(major > ClassFileConstants.MAJOR_VERSION_10) { + return "" + (major - ClassFileConstants.MAJOR_VERSION_0); //$NON-NLS-1$ + } + return Util.EMPTY_STRING; // unknown version + } return Util.EMPTY_STRING; // unknown version } public static long releaseToJDKLevel(String release) { if (release != null && release.length() > 0) { - switch(release.charAt(0)) { - case '6': - return ClassFileConstants.JDK1_6; - case '7': - return ClassFileConstants.JDK1_7; - case '8': - return ClassFileConstants.JDK1_8; - case '9': - return ClassFileConstants.JDK9; - case '1': - if (release.length() > 1 && release.charAt(1) == '0') - return ClassFileConstants.JDK10; - else - return 0; - default: - return 0; // unknown + int major = Integer.parseInt(release) + ClassFileConstants.MAJOR_VERSION_0; + if (major <= ClassFileConstants.MAJOR_LATEST_VERSION) { + long jdkLevel = ((long) major << 16) + ClassFileConstants.MINOR_VERSION_0; + return jdkLevel; } } return 0; @@ -866,19 +868,22 @@ public static long versionToJdkLevel(String versionID) { return 0; // unknown } } else { - switch (version.charAt(0)) { - case '9': - return ClassFileConstants.JDK9; - case '1': - if (version.length() > 1 && version.charAt(1) == '0') { - return ClassFileConstants.JDK10; // Level for JDK 10 - } else { - int versionAfterTen = Integer.parseInt("" + version.charAt(1)); //$NON-NLS-1$ - int majorVersion = ClassFileConstants.MAJOR_VERSION_10 + versionAfterTen; - long jdkLevel = ((long)majorVersion << 16) + ClassFileConstants.MINOR_VERSION_0; - return jdkLevel; - } - // No default - let it go through the remaining checks. + try { + int index = version.indexOf('.'); + if (index != -1) { + version = version.substring(0, index); + } else { + index = version.indexOf('-'); + if (index != -1) + version = version.substring(0, index); + } + int major = Integer.parseInt(version) + ClassFileConstants.MAJOR_VERSION_0; + if (major <= ClassFileConstants.MAJOR_LATEST_VERSION) { + long jdkLevel = ((long) major << 16) + ClassFileConstants.MINOR_VERSION_0; + return jdkLevel; + } + } catch (NumberFormatException e) { + // do nothing and return 0 at the end } } } @@ -1163,6 +1168,11 @@ public static IrritantSet warningTokenToIrritants(String warningToken) { if ("null".equals(warningToken)) //$NON-NLS-1$ return IrritantSet.NULL; break; + case 'p' : + if ("preview".equals(warningToken)) { //$NON-NLS-1$ + return IrritantSet.PREVIEW; + } + break; case 'r' : if ("rawtypes".equals(warningToken)) //$NON-NLS-1$ return IrritantSet.RAW; @@ -1349,6 +1359,7 @@ public Map<String, String> getMap() { optionsMap.put(OPTION_ReportUnlikelyEqualsArgumentType, getSeverityString(UnlikelyEqualsArgumentType)); optionsMap.put(OPTION_ReportAPILeak, getSeverityString(APILeak)); optionsMap.put(OPTION_ReportUnstableAutoModuleName, getSeverityString(UnstableAutoModuleName)); + optionsMap.put(OPTION_EnablePreviews, this.enablePreviewFeatures ? ENABLED : DISABLED); return optionsMap; } @@ -1547,6 +1558,7 @@ protected void resetDefaults() { this.reportMissingEnumCaseDespiteDefault = false; this.complainOnUninternedIdentityComparison = false; + this.enablePreviewFeatures = false; } public void set(Map<String, String> optionsMap) { @@ -1625,6 +1637,9 @@ public void set(Map<String, String> optionsMap) { if ((optionValue = optionsMap.get(OPTION_TargetPlatform)) != null) { long level = versionToJdkLevel(optionValue); if (level != 0) { + if (this.enablePreviewFeatures) { + level |= ClassFileConstants.MINOR_VERSION_PREVIEW; + } this.targetJDK = level; } if (this.targetJDK >= ClassFileConstants.JDK1_5) this.inlineJsrBytecode = true; // forced from 1.5 mode on @@ -2055,6 +2070,15 @@ && getSeverity(ExplicitlyClosedAutoCloseable) == ProblemSeverities.Ignore) { this.complainOnUninternedIdentityComparison = false; } } + if ((optionValue = optionsMap.get(OPTION_EnablePreviews)) != null) { + if (ENABLED.equals(optionValue)) { + this.enablePreviewFeatures = true; + if (this.targetJDK != 0) + this.targetJDK |= ClassFileConstants.MINOR_VERSION_PREVIEW; + } else if (DISABLED.equals(optionValue)) { + this.enablePreviewFeatures = false; + } + } // GROOVY add if ((optionValue = optionsMap.get(OPTIONG_BuildGroovyFiles)) != null) { if (ENABLED.equals(optionValue)) { diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java index b919ed94ac..735f553600 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java @@ -77,6 +77,7 @@ public class IrritantSet { public static final IrritantSet MODULE = new IrritantSet(CompilerOptions.UnstableAutoModuleName); public static final IrritantSet JAVADOC = new IrritantSet(CompilerOptions.InvalidJavadoc); + public static final IrritantSet PREVIEW = new IrritantSet(0); public static final IrritantSet COMPILER_DEFAULT_ERRORS = new IrritantSet(0); // no optional error by default public static final IrritantSet COMPILER_DEFAULT_WARNINGS = new IrritantSet(0); // see static initializer below public static final IrritantSet COMPILER_DEFAULT_INFOS = new IrritantSet(0); // As of now, no default values @@ -189,9 +190,10 @@ public class IrritantSet { UNLIKELY_ARGUMENT_TYPE .set(CompilerOptions.UnlikelyEqualsArgumentType); + //PREVIEW.set(CompilerOptions.DummyPreviewFeatureWarning); } - // Internal state + private int[] bits = new int[GROUP_MAX]; /** diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java index 53385612d1..fc792e82f4 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java @@ -1283,6 +1283,23 @@ public boolean isClass() { return (this.modifiers & (ClassFileConstants.AccInterface | ClassFileConstants.AccAnnotation | ClassFileConstants.AccEnum)) == 0; } +private static SourceTypeBinding getSourceTypeBinding(ReferenceBinding ref) { + if (ref instanceof SourceTypeBinding) + return (SourceTypeBinding) ref; + if (ref instanceof ParameterizedTypeBinding) { + ParameterizedTypeBinding ptb = (ParameterizedTypeBinding) ref; + return ptb.type instanceof SourceTypeBinding ? (SourceTypeBinding) ptb.type : null; + } + return null; +} +public boolean isNestmateOf(ReferenceBinding other) { + SourceTypeBinding s1 = getSourceTypeBinding(this); + SourceTypeBinding s2 = getSourceTypeBinding(other); + if (s1 == null || s2 == null) return false; + + return s1.isNestmateOf(s2); +} + @Override public boolean isProperType(boolean admitCapture18) { ReferenceBinding outer = enclosingType(); diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java index a5ad1ee65b..43b49d1917 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java @@ -1139,6 +1139,15 @@ public final ClassScope enclosingClassScope() { return null; // may answer null if no type around } + public final ClassScope enclosingTopMostClassScope() { + Scope scope = this; + while (scope != null) { + Scope t = scope.parent; + if (t instanceof CompilationUnitScope) break; + scope = t; + } + return scope instanceof ClassScope ? ((ClassScope) scope) : null; + } public final MethodScope enclosingMethodScope() { Scope scope = this; while ((scope = scope.parent) != null) { diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java index 4e995bf04c..ce3f3047aa 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java @@ -54,7 +54,10 @@ import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; @@ -114,6 +117,9 @@ public class SourceTypeBinding extends ReferenceBinding { public ExternalAnnotationProvider externalAnnotationProvider; + private SourceTypeBinding nestHost; + public HashSet<SourceTypeBinding> nestMembers; + public SourceTypeBinding(char[][] compoundName, PackageBinding fPackage, ClassScope scope) { this.compoundName = compoundName; this.fPackage = fPackage; @@ -2645,4 +2651,42 @@ public ModuleBinding module() { return this.prototype.module; return this.module; } + +public SourceTypeBinding getNestHost() { + return this.nestHost; +} + +public void setNestHost(SourceTypeBinding nestHost) { + this.nestHost = nestHost; } + +public boolean isNestmateOf(SourceTypeBinding other) { + + CompilerOptions options = this.scope.compilerOptions(); + if (options.targetJDK < ClassFileConstants.JDK11 || + options.complianceLevel < ClassFileConstants.JDK11) + return false; // default false if level less than 11 + + SourceTypeBinding otherHost = other.getNestHost(); + return TypeBinding.equalsEquals(this, other) || + TypeBinding.equalsEquals(this.nestHost == null ? this : this.nestHost, + otherHost == null ? other : otherHost); +} +public void addNestMember(SourceTypeBinding member) { + if (this.nestMembers == null) { + this.nestMembers = new HashSet<>(); + } + this.nestMembers.add(member); +} +public List<String> getNestMembers() { + if (this.nestMembers == null) + return null; + List<String> list = this.nestMembers + .stream() + .map(s -> new String(s.constantPoolName())) + .sorted() + .collect(Collectors.toList()); + return list; +} + +} \ No newline at end of file diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java index 0e73d30908..ae16fc808f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -155,6 +154,8 @@ public interface JavadocTagConstants { // since 9 {}, // since 10 + {}, + // since 11 {} }; public static final char[][][] INLINE_TAGS = { @@ -179,6 +180,8 @@ public interface JavadocTagConstants { // since 9 {}, // since 10 + {}, + // since 11 {} }; public final static int INLINE_TAGS_LENGTH = INLINE_TAGS.length; diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java index 3a5b7af4e8..1e10ccc570 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 IBM Corporation and others. - * - * This program and the accompanying materials + * Copyright (c) 2005, 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -46,6 +45,7 @@ public class ScannerHelper { private static long[][][] Tables7; private static long[][][] Tables8; private static long[][][] Tables9; + private static long[][][] Tables11; public final static int MAX_OBVIOUS = 128; public final static int[] OBVIOUS_IDENT_CHAR_NATURES = new int[MAX_OBVIOUS]; @@ -147,95 +147,84 @@ static void initializeTable18() { static void initializeTable19() { Tables9 = initializeTables("unicode8"); //$NON-NLS-1$ } +static void initializeTableJava11() { + Tables11 = initializeTables("unicode10"); //$NON-NLS-1$ +} static long[][][] initializeTables(String unicode_path) { long[][][] tempTable = new long[2][][]; tempTable[START_INDEX] = new long[3][]; tempTable[PART_INDEX] = new long[4][]; - try { - DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/start0.rsc"))); //$NON-NLS-1$ + try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/start0.rsc")))) { //$NON-NLS-1$ long[] readValues = new long[1024]; for (int i = 0; i < 1024; i++) { readValues[i] = inputStream.readLong(); } - inputStream.close(); tempTable[START_INDEX][0] = readValues; } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } - try { - DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/start1.rsc"))); //$NON-NLS-1$ + try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/start1.rsc")))) { //$NON-NLS-1$ long[] readValues = new long[1024]; for (int i = 0; i < 1024; i++) { readValues[i] = inputStream.readLong(); } - inputStream.close(); tempTable[START_INDEX][1] = readValues; } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } - try { - DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/start2.rsc"))); //$NON-NLS-1$ + try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/start2.rsc")))) { //$NON-NLS-1$ long[] readValues = new long[1024]; for (int i = 0; i < 1024; i++) { readValues[i] = inputStream.readLong(); } - inputStream.close(); tempTable[START_INDEX][2] = readValues; } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } - try { - DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part0.rsc"))); //$NON-NLS-1$ + try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part0.rsc")))) { //$NON-NLS-1$ long[] readValues = new long[1024]; for (int i = 0; i < 1024; i++) { readValues[i] = inputStream.readLong(); } - inputStream.close(); tempTable[PART_INDEX][0] = readValues; } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } - try { - DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part1.rsc"))); //$NON-NLS-1$ + try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part1.rsc")))) { //$NON-NLS-1$ long[] readValues = new long[1024]; for (int i = 0; i < 1024; i++) { readValues[i] = inputStream.readLong(); } - inputStream.close(); tempTable[PART_INDEX][1] = readValues; } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } - try { - DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part2.rsc"))); //$NON-NLS-1$ + try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part2.rsc")))) { //$NON-NLS-1$ long[] readValues = new long[1024]; for (int i = 0; i < 1024; i++) { readValues[i] = inputStream.readLong(); } - inputStream.close(); tempTable[PART_INDEX][2] = readValues; } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } - try { - DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part14.rsc"))); //$NON-NLS-1$ + try (DataInputStream inputStream = new DataInputStream(new BufferedInputStream(ScannerHelper.class.getResourceAsStream(unicode_path + "/part14.rsc")))) { //$NON-NLS-1$ long[] readValues = new long[1024]; for (int i = 0; i < 1024; i++) { readValues[i] = inputStream.readLong(); } - inputStream.close(); tempTable[PART_INDEX][3] = readValues; } catch (FileNotFoundException e) { e.printStackTrace(); @@ -263,68 +252,50 @@ public static boolean isJavaIdentifierPart(long complianceLevel, char c) { } return isJavaIdentifierPart(complianceLevel, (int) c); } +private static boolean isJavaIdentifierPart0(int codePoint, long[][][] tables) { + switch((codePoint & 0x1F0000) >> 16) { + case 0 : + return isBitSet(tables[PART_INDEX][0], codePoint & 0xFFFF); + case 1 : + return isBitSet(tables[PART_INDEX][1], codePoint & 0xFFFF); + case 2 : + return isBitSet(tables[PART_INDEX][2], codePoint & 0xFFFF); + case 14 : + return isBitSet(tables[PART_INDEX][3], codePoint & 0xFFFF); + } + return false; +} public static boolean isJavaIdentifierPart(long complianceLevel, int codePoint) { if (complianceLevel <= ClassFileConstants.JDK1_6) { if (Tables == null) { initializeTable(); } - switch((codePoint & 0x1F0000) >> 16) { - case 0 : - return isBitSet(Tables[PART_INDEX][0], codePoint & 0xFFFF); - case 1 : - return isBitSet(Tables[PART_INDEX][1], codePoint & 0xFFFF); - case 2 : - return isBitSet(Tables[PART_INDEX][2], codePoint & 0xFFFF); - case 14 : - return isBitSet(Tables[PART_INDEX][3], codePoint & 0xFFFF); - } + return isJavaIdentifierPart0(codePoint, Tables); } else if (complianceLevel <= ClassFileConstants.JDK1_7) { // java 7 supports Unicode 6 if (Tables7 == null) { initializeTable17(); } - switch((codePoint & 0x1F0000) >> 16) { - case 0 : - return isBitSet(Tables7[PART_INDEX][0], codePoint & 0xFFFF); - case 1 : - return isBitSet(Tables7[PART_INDEX][1], codePoint & 0xFFFF); - case 2 : - return isBitSet(Tables7[PART_INDEX][2], codePoint & 0xFFFF); - case 14 : - return isBitSet(Tables7[PART_INDEX][3], codePoint & 0xFFFF); - } + return isJavaIdentifierPart0(codePoint, Tables7); } else if (complianceLevel <= ClassFileConstants.JDK1_8) { // java 8 supports Unicode 6.2 if (Tables8 == null) { initializeTable18(); } - switch((codePoint & 0x1F0000) >> 16) { - case 0 : - return isBitSet(Tables8[PART_INDEX][0], codePoint & 0xFFFF); - case 1 : - return isBitSet(Tables8[PART_INDEX][1], codePoint & 0xFFFF); - case 2 : - return isBitSet(Tables8[PART_INDEX][2], codePoint & 0xFFFF); - case 14 : - return isBitSet(Tables8[PART_INDEX][3], codePoint & 0xFFFF); - } - } else { - // java 9 supports Unicode 8 + return isJavaIdentifierPart0(codePoint, Tables8); + } else if (complianceLevel <= ClassFileConstants.JDK10) { + // java 9/10 supports Unicode 8 if (Tables9 == null) { initializeTable19(); } - switch((codePoint & 0x1F0000) >> 16) { - case 0 : - return isBitSet(Tables9[PART_INDEX][0], codePoint & 0xFFFF); - case 1 : - return isBitSet(Tables9[PART_INDEX][1], codePoint & 0xFFFF); - case 2 : - return isBitSet(Tables9[PART_INDEX][2], codePoint & 0xFFFF); - case 14 : - return isBitSet(Tables9[PART_INDEX][3], codePoint & 0xFFFF); + return isJavaIdentifierPart0(codePoint, Tables9); + } else { + // java 11 supports Unicode 10 + if (Tables11 == null) { + initializeTableJava11(); } + return isJavaIdentifierPart0(codePoint, Tables11); } - return false; } public static boolean isJavaIdentifierPart(long complianceLevel, char high, char low) { return isJavaIdentifierPart(complianceLevel, toCodePoint(high, low)); @@ -344,60 +315,48 @@ public static boolean isJavaIdentifierStart(long complianceLevel, char c) { public static boolean isJavaIdentifierStart(long complianceLevel, char high, char low) { return isJavaIdentifierStart(complianceLevel, toCodePoint(high, low)); } +private static boolean isJavaIdentifierStart0(int codePoint, long[][][] tables) { + switch((codePoint & 0x1F0000) >> 16) { + case 0 : + return isBitSet(tables[START_INDEX][0], codePoint & 0xFFFF); + case 1 : + return isBitSet(tables[START_INDEX][1], codePoint & 0xFFFF); + case 2 : + return isBitSet(tables[START_INDEX][2], codePoint & 0xFFFF); + } + return false; +} public static boolean isJavaIdentifierStart(long complianceLevel, int codePoint) { if (complianceLevel <= ClassFileConstants.JDK1_6) { if (Tables == null) { initializeTable(); } - switch((codePoint & 0x1F0000) >> 16) { - case 0 : - return isBitSet(Tables[START_INDEX][0], codePoint & 0xFFFF); - case 1 : - return isBitSet(Tables[START_INDEX][1], codePoint & 0xFFFF); - case 2 : - return isBitSet(Tables[START_INDEX][2], codePoint & 0xFFFF); - } + return isJavaIdentifierStart0(codePoint, Tables); } else if (complianceLevel <= ClassFileConstants.JDK1_7) { // java 7 supports Unicode 6 if (Tables7 == null) { initializeTable17(); } - switch((codePoint & 0x1F0000) >> 16) { - case 0 : - return isBitSet(Tables7[START_INDEX][0], codePoint & 0xFFFF); - case 1 : - return isBitSet(Tables7[START_INDEX][1], codePoint & 0xFFFF); - case 2 : - return isBitSet(Tables7[START_INDEX][2], codePoint & 0xFFFF); - } + return isJavaIdentifierStart0(codePoint, Tables7); } else if (complianceLevel <= ClassFileConstants.JDK1_8) { - // java 7 supports Unicode 6 + // java 8 supports Unicode 6.2 if (Tables8 == null) { initializeTable18(); } - switch((codePoint & 0x1F0000) >> 16) { - case 0 : - return isBitSet(Tables8[START_INDEX][0], codePoint & 0xFFFF); - case 1 : - return isBitSet(Tables8[START_INDEX][1], codePoint & 0xFFFF); - case 2 : - return isBitSet(Tables8[START_INDEX][2], codePoint & 0xFFFF); - } - } else { - // java 9 supports Unicode 7 + return isJavaIdentifierStart0(codePoint, Tables8); + } else if (complianceLevel <= ClassFileConstants.JDK10) { + // java 9/10 supports Unicode 8 if (Tables9 == null) { initializeTable19(); } - switch((codePoint & 0x1F0000) >> 16) { - case 0 : - return isBitSet(Tables9[START_INDEX][0], codePoint & 0xFFFF); - case 1 : - return isBitSet(Tables9[START_INDEX][1], codePoint & 0xFFFF); - case 2 : - return isBitSet(Tables9[START_INDEX][2], codePoint & 0xFFFF); + return isJavaIdentifierStart0(codePoint, Tables9); + } else { + // java 11 supports Unicode 10 + if (Tables11 == null) { + initializeTableJava11(); } + return isJavaIdentifierStart0(codePoint, Tables11); } - return false; } private static int toCodePoint(char high, char low) { return (high - Scanner.HIGH_SURROGATE_MIN_VALUE) * 0x400 + (low - Scanner.LOW_SURROGATE_MIN_VALUE) + 0x10000; diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part0.rsc b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part0.rsc new file mode 100644 index 0000000000..c2a638fda6 Binary files /dev/null and b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part0.rsc differ diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part1.rsc b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part1.rsc new file mode 100644 index 0000000000..87cad854ec Binary files /dev/null and b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part1.rsc differ diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part14.rsc b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part14.rsc new file mode 100644 index 0000000000..c8241e80d5 Binary files /dev/null and b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part14.rsc differ diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part2.rsc b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part2.rsc new file mode 100644 index 0000000000..ab6b33ed48 Binary files /dev/null and b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/part2.rsc differ diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/start0.rsc b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/start0.rsc new file mode 100644 index 0000000000..a41623669e Binary files /dev/null and b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/start0.rsc differ diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/start1.rsc b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/start1.rsc new file mode 100644 index 0000000000..5856a2aadd Binary files /dev/null and b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/start1.rsc differ diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/start2.rsc b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/start2.rsc new file mode 100644 index 0000000000..ab6b33ed48 Binary files /dev/null and b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/unicode10/start2.rsc differ diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java index 054a639864..975461d0e9 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java @@ -8,7 +8,7 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation * Benjamin Muskalla - Contribution for bug 239066 @@ -9528,6 +9528,14 @@ public void varIsNotAllowedHere(ASTNode astNode) { astNode.sourceStart, astNode.sourceEnd); } +public void varCannotBeMixedWithNonVarParams(ASTNode astNode) { + this.handle( + IProblem.VarCannotBeMixedWithNonVarParams, + NoArgument, + NoArgument, + astNode.sourceStart, + astNode.sourceEnd); +} public void variableTypeCannotBeVoidArray(AbstractVariableDeclaration varDecl) { this.handle( IProblem.CannotAllocateVoidArray, diff --git a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties index bc10d230c4..59acc731cf 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties +++ b/jdt-patch/e49/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties @@ -964,6 +964,7 @@ 1509 = 'var' is not a valid type name 1510 = 'var' should not be used as an type name, since it is a reserved word from source level 10 on 1511 = 'var' is not allowed here +1512 = 'var' cannot be mixed with non-var parameters ### ELABORATIONS ## Access restrictions diff --git a/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java b/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java index de74c5638b..fc90c89fda 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java @@ -237,6 +237,7 @@ public final class AST { * </p> * * @since 3.14 + * @deprecated Clients should use the {@link #JLS11} AST API instead. */ public static final int JLS10 = 10; @@ -247,6 +248,29 @@ public final class AST { */ /*package*/ static final int JLS10_INTERNAL = JLS10; + /** + * Constant for indicating the AST API that handles JLS11. + * <p> + * This API is capable of handling all constructs in the + * Java language as described in the Java Language + * Specification, Java SE 11 Edition (JLS11). + * JLS11 is a superset of all earlier versions of the + * Java language, and the JLS11 API can be used to manipulate + * programs written in all versions of the Java language + * up to and including Java SE 11 (aka JDK 11). + * </p> + * + * @since 3.15 + */ + public static final int JLS11 = 11; + + /** + * Internal synonym for {@link #JLS11}. Use to alleviate + * deprecation warnings once JLS11 is deprecated + * @since 3.14 + */ + /*package*/ static final int JLS11_INTERNAL = JLS11; + /* * Must not collide with a value for ICompilationUnit constants */ @@ -813,6 +837,20 @@ private AST(int level) { null/*taskPriorities*/, true/*taskCaseSensitive*/); break; + case JLS11_INTERNAL : + this.apiLevel = level; + // initialize a scanner + long compliance = ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_11); + this.scanner = new Scanner( + true /*comment*/, + true /*whitespace*/, + false /*nls*/, + compliance /*sourceLevel*/, + compliance /*complianceLevel*/, + null/*taskTag*/, + null/*taskPriorities*/, + true/*taskCaseSensitive*/); + break; default: throw new IllegalArgumentException("Unsupported JLS level"); //$NON-NLS-1$ } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java b/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java index cffd5d0b9c..ac6d7103a7 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java @@ -2057,6 +2057,21 @@ final void unsupportedBelow10() { } } /** + * Checks that this AST operation is not used when + * building JLS2, JLS3, JLS4, JLS8, JLS9 or JLS10 level ASTs. + * <p> + * Use this method to prevent access to new properties that have been added in JLS11 + * </p> + * + * @exception UnsupportedOperationException if this operation is used below JLS11 + * @since 3.14 + */ + final void unsupportedBelow11() { + if (this.ast.apiLevel < AST.JLS11_INTERNAL) { + throw new UnsupportedOperationException("Operation only supported in ASTs with level JLS11 and above"); //$NON-NLS-1$ + } + } + /** * Checks that this AST operation is only used when * building JLS2 level ASTs. * <p> diff --git a/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java b/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java index 23a3c56c22..c202eb295a 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java @@ -233,6 +233,7 @@ public static ASTParser newParser(int level) { case AST.JLS8_INTERNAL: case AST.JLS9_INTERNAL: case AST.JLS10_INTERNAL: + case AST.JLS11_INTERNAL: break; default: throw new IllegalArgumentException(); diff --git a/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java b/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java index 2a80d49c37..1e01c1214f 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java @@ -1315,7 +1315,7 @@ public final TextEdit rewriteImports(IProgressMonitor monitor) throws CoreExcept CompilationUnit usedAstRoot= this.astRoot; if (usedAstRoot == null) { - ASTParser parser= ASTParser.newParser(AST.JLS10); + ASTParser parser= ASTParser.newParser(AST.JLS11); parser.setSource(this.compilationUnit); parser.setFocalPosition(0); // reduced AST parser.setResolveBindings(false); diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java index c4127512a0..1d99daf822 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java @@ -340,7 +340,7 @@ public final class JavaCore extends Plugin { * <p><code>"cldc1.1"</code> requires the source version to be <code>"1.3"</code> and the compliance version to be <code>"1.4"</code> or lower.</p> * <dl> * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.codegen.targetPlatform"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "1.1", "cldc1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "9", "10" }</code></dd> + * <dt>Possible values:</dt><dd><code>{ "1.1", "cldc1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "9", "10", "11" }</code></dd> * <dt>Default:</dt><dd><code>"1.2"</code></dd> * </dl> * @category CompilerOptionID @@ -2060,7 +2060,7 @@ public final class JavaCore extends Plugin { * set to the same version as the source level.</p> * <dl> * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.source"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "10" }</code></dd> + * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "9", "10", "11" }</code></dd> * <dt>Default:</dt><dd><code>"1.3"</code></dd> * </dl> * @since 2.0 @@ -2078,7 +2078,7 @@ public final class JavaCore extends Plugin { * should match the compliance setting.</p> * <dl> * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.compliance"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "9", "10" }</code></dd> + * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "9", "10", "11" }</code></dd> * <dt>Default:</dt><dd><code>"1.4"</code></dd> * </dl> * @since 2.0 @@ -3005,22 +3005,30 @@ public final class JavaCore extends Plugin { * @category OptionValue */ public static final String VERSION_10 = "10"; //$NON-NLS-1$ + /** + * Configurable option value: {@value}. + * @since 3.15 + * @category OptionValue + */ + public static final String VERSION_11 = "11"; //$NON-NLS-1$ /** * Configurable option value: {@value}. * @since 3.4 * @category OptionValue */ public static final String VERSION_CLDC_1_1 = "cldc1.1"; //$NON-NLS-1$ + private static List<String> allVersions = Arrays.asList(VERSION_CLDC_1_1, VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5, + VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9, VERSION_10, VERSION_11); /** - * Returns all {@link JavaCore}{@code #VERSION_*} levels. + * Returns all {@link JavaCore}{@code #VERSION_*} levels in the order of their + * introduction. For e.g., {@link JavaCore#VERSION_1_8} appears before {@link JavaCore#VERSION_10} * * @return all available versions * @since 3.14 */ public static List<String> getAllVersions() { - return Arrays.asList(VERSION_CLDC_1_1, VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4, VERSION_1_5, - VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9, VERSION_10); + return allVersions; } /** @@ -5926,7 +5934,9 @@ public static void setClasspathVariables( * @since 3.3 */ public static void setComplianceOptions(String compliance, Map options) { - switch((int) (CompilerOptions.versionToJdkLevel(compliance) >>> 16)) { + long jdkLevel = CompilerOptions.versionToJdkLevel(compliance); + int major = (int) (jdkLevel >>> 16); + switch(major) { case ClassFileConstants.MAJOR_VERSION_1_3: options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_3); options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_3); @@ -5991,6 +6001,18 @@ public static void setComplianceOptions(String compliance, Map options) { options.put(JavaCore.COMPILER_CODEGEN_INLINE_JSR_BYTECODE, JavaCore.ENABLED); options.put(JavaCore.COMPILER_RELEASE, JavaCore.ENABLED); break; + default: + if(major > ClassFileConstants.MAJOR_VERSION_10) { + String version = CompilerOptions.versionFromJdkLevel(jdkLevel); + options.put(JavaCore.COMPILER_COMPLIANCE, version); + options.put(JavaCore.COMPILER_SOURCE, version); + options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, version); + options.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR); + options.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR); + options.put(JavaCore.COMPILER_CODEGEN_INLINE_JSR_BYTECODE, JavaCore.ENABLED); + options.put(JavaCore.COMPILER_RELEASE, JavaCore.ENABLED); + } + break; } } @@ -6017,6 +6039,16 @@ public static void setOptions(Hashtable<String, String> newOptions) { JavaModelManager.getJavaModelManager().setOptions(newOptions); } + /** + * Returns the latest version of Java supported by the Java Model. This is usually the last entry + * from {@link JavaCore#getAllVersions()}. + * + * @since 3.15 + * @return the latest Java version support by Java Model + */ + public static String latestSupportedJavaVersion() { + return allVersions.get(allVersions.size() - 1); + } /** * Compares two given versions of the Java platform. The versions being compared must both be * one of the supported values mentioned in diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IAttributeNamesConstants.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IAttributeNamesConstants.java index 600d6b1013..e7ebf35478 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IAttributeNamesConstants.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IAttributeNamesConstants.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -190,4 +189,17 @@ public interface IAttributeNamesConstants { * @since 3.14 */ char[] MODULE_MAIN_CLASS = "ModuleMainClass".toCharArray(); //$NON-NLS-1$ + + /** + * "NestHost" attribute (JVMS 11). + * @since 3.15 + */ + char[] NEST_HOST = "NestHost".toCharArray(); //$NON-NLS-1$ + + /** + * "NestMembers" attribute (JVMS 11). + * @since 3.15 + */ + char[] NEST_MEMBERS = "NestMembers".toCharArray(); //$NON-NLS-1$ + } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IClassFileReader.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IClassFileReader.java index ea19a8ab19..c81e064767 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IClassFileReader.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IClassFileReader.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -116,6 +115,16 @@ public interface IClassFileReader { */ IInnerClassesAttribute getInnerClassesAttribute(); + /** + * Answer back the nest members attribute of this .class file, null if none. + * + * @return the nest members attribute of this .class file, null if none + * @since 3.15 + */ + default INestMembersAttribute getNestMembersAttribute() { + return null; + } + /** * Answer back the array of method infos of this .class file, * an empty array if none. diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPool.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPool.java index 6ee992ed0e..8c332c0462 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPool.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPool.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -42,7 +41,9 @@ public interface IConstantPool { * * <p>The return value can be an instance of {@link IConstantPoolEntry2} if the value returned * by {@link #getEntryKind(int)} is either {@link IConstantPoolConstant#CONSTANT_MethodHandle}, - * {@link IConstantPoolConstant#CONSTANT_MethodType} or {@link IConstantPoolConstant#CONSTANT_InvokeDynamic}.</p> + * {@link IConstantPoolConstant#CONSTANT_MethodType}, + * {@link IConstantPoolConstant#CONSTANT_InvokeDynamic}, + * {@link IConstantPoolConstant#CONSTANT_Dynamic}.</p> * * <p>The return value can be an instance of {@link IConstantPoolEntry3} if the value returned * by {@link #getEntryKind(int)} is either {@link IConstantPoolConstant#CONSTANT_Module} diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolConstant.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolConstant.java index 60d85201a8..d288dc7305 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolConstant.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolConstant.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -44,7 +43,12 @@ public interface IConstantPoolConstant { * @since 3.8 */ int CONSTANT_InvokeDynamic = 18; - + /** + * proposed new name in JVMLS11 + * @since 3.15 + */ + int CONSTANT_DynamicCallSite = CONSTANT_InvokeDynamic; + /** * @since 3.14 */ @@ -53,6 +57,11 @@ public interface IConstantPoolConstant { * @since 3.14 */ int CONSTANT_Package = 20; + /** + * For the proposed section of JVMLS11 4.4.13 The CONSTANT_Dynamic_info Structure + * @since 3.15 + */ + int CONSTANT_Dynamic = 17; int CONSTANT_Methodref_SIZE = 5; int CONSTANT_Class_SIZE = 3; @@ -78,6 +87,10 @@ public interface IConstantPoolConstant { */ int CONSTANT_InvokeDynamic_SIZE = 5; + /** + * @since 3.15 + */ + int CONSTANT_Dynamic_SIZE = 5; /** * @since 3.14 */ diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry.java index e38aa0a491..b5cdb04e41 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -68,6 +67,7 @@ public interface IConstantPoolEntry { * @see IConstantPoolConstant#CONSTANT_Methodref * @see IConstantPoolConstant#CONSTANT_InterfaceMethodref * @see IConstantPoolConstant#CONSTANT_InvokeDynamic + * @see IConstantPoolConstant#CONSTANT_Dynamic */ int getNameAndTypeIndex(); @@ -184,6 +184,7 @@ public interface IConstantPoolEntry { * @see IConstantPoolConstant#CONSTANT_Methodref * @see IConstantPoolConstant#CONSTANT_InterfaceMethodref * @see IConstantPoolConstant#CONSTANT_InvokeDynamic + * @see IConstantPoolConstant#CONSTANT_Dynamic */ char[] getMethodName(); @@ -215,6 +216,7 @@ public interface IConstantPoolEntry { * @see IConstantPoolConstant#CONSTANT_InterfaceMethodref * @see IConstantPoolConstant#CONSTANT_MethodType * @see IConstantPoolConstant#CONSTANT_InvokeDynamic + * @see IConstantPoolConstant#CONSTANT_Dynamic */ char[] getMethodDescriptor(); diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry2.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry2.java index 29ee75dc02..b126fda256 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry2.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IConstantPoolEntry2.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2011 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -57,6 +56,7 @@ public interface IConstantPoolEntry2 extends IConstantPoolEntry { * * @return the reference kind. This value is set only when decoding a MethodHandle entry. * @see IConstantPoolConstant#CONSTANT_InvokeDynamic + * @see IConstantPoolConstant#CONSTANT_Dynamic */ int getBootstrapMethodAttributeIndex(); } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestHostAttribute.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestHostAttribute.java new file mode 100644 index 0000000000..9f67a811ba --- /dev/null +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestHostAttribute.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * 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.util; + +/** + * Description of a nest host attribute as described in the JVM + * specifications. + * @since 3.15 + */ +public interface INestHostAttribute { + /** + * Answer back the class name as specified + * in the JVM specifications. + * + * @return the class name as specified + * in the JVM specifications + */ + char[] getNestHostName(); + + /** + * Answer back the class name index. + * + * @return the class name index + */ + int getNestHostIndex(); +} diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMemberAttributeEntry.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMemberAttributeEntry.java new file mode 100644 index 0000000000..fe68ac5823 --- /dev/null +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMemberAttributeEntry.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * 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.util; + +/** + * Description of a nest host attribute as described in the JVM + * specifications. + * @since 3.15 + */ +public interface INestMemberAttributeEntry { + + /** + * Answer back the nest member name as specified + * in the JVM specifications. + * + * @return the nest member name as specified + * in the JVM specifications + */ + char[] getNestMemberName(); + + /** + * Answer back the nest member name index. + * + * @return the nest memeber name index + */ + int getNestMemberIndex(); +} diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMembersAttribute.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMembersAttribute.java new file mode 100644 index 0000000000..f13ddd818c --- /dev/null +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/INestMembersAttribute.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * 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.util; + +/** + * Description of nest members attribute as described in the JVM + * specifications. + * + * @since 3.15 + */ +public interface INestMembersAttribute extends IClassFileAttribute { + + /** + * Answer back the number of nest members as specified in + * the JVM specifications. + * + * @return the number of nest members as specified in + * the JVM specifications + */ + int getNumberOfNestMembers(); + + /** + * Answer back the array of nest member attribute entries as specified in + * the JVM specifications, or an empty array if none. + * + * @return the array of nest member attribute entries as specified in + * the JVM specifications, or an empty array if none + */ + INestMemberAttributeEntry[] getNestMemberAttributesEntries(); +} diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java index 221c1b88a6..312128064c 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java @@ -92,7 +92,7 @@ public CopyResourceElementsOperation(IJavaElement[] resourcesToCopy, IJavaElemen initializeASTParser(); } private void initializeASTParser() { - this.parser = ASTParser.newParser(AST.JLS10); + this.parser = ASTParser.newParser(AST.JLS11); } /** * Returns the children of <code>source</code> which are affected by this operation. diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateElementInCUOperation.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateElementInCUOperation.java index acf58b0475..02de1a2244 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateElementInCUOperation.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateElementInCUOperation.java @@ -267,7 +267,7 @@ protected CompilationUnit parse(ICompilationUnit cu) throws JavaModelException { // ensure cu is consistent (noop if already consistent) cu.makeConsistent(this.progressMonitor); // create an AST for the compilation unit - ASTParser parser = ASTParser.newParser(AST.JLS10); + ASTParser parser = ASTParser.newParser(AST.JLS11); parser.setSource(cu); return (CompilationUnit) parser.createAST(this.progressMonitor); } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java index b8ee1d7620..40b2454030 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java @@ -83,7 +83,7 @@ protected StructuralPropertyDescriptor getChildPropertyDescriptor(ASTNode parent protected ASTNode generateElementAST(ASTRewrite rewriter, ICompilationUnit cu) throws JavaModelException { if (this.createdNode == null) { this.source = removeIndentAndNewLines(this.source, cu); - ASTParser parser = ASTParser.newParser(AST.JLS10); + ASTParser parser = ASTParser.newParser(AST.JLS11); parser.setSource(this.source.toCharArray()); parser.setProject(getCompilationUnit().getJavaProject()); parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS); @@ -170,7 +170,7 @@ protected String generateSyntaxIncorrectAST() { buff.append(lineSeparator + " public class A {" + lineSeparator); //$NON-NLS-1$ buff.append(this.source); buff.append(lineSeparator).append('}'); - ASTParser parser = ASTParser.newParser(AST.JLS10); + ASTParser parser = ASTParser.newParser(AST.JLS11); parser.setSource(buff.toString().toCharArray()); CompilationUnit compilationUnit = (CompilationUnit) parser.createAST(null); TypeDeclaration typeDeclaration = (TypeDeclaration) compilationUnit.types().iterator().next(); diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java index d2d4d6188e..78fc71d275 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java @@ -84,7 +84,7 @@ private void deleteElement(IJavaElement elementToRemove, ICompilationUnit cu) th } private void initASTParser() { - this.parser = ASTParser.newParser(AST.JLS10); + this.parser = ASTParser.newParser(AST.JLS11); } /** diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java index 55bc57e462..09474a4a2d 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java @@ -434,7 +434,7 @@ public void setCache(IPath path, ZipFile zipFile) { public static class CompilationParticipants { - private final static int MAX_SOURCE_LEVEL = 10 ; // 1.1 to 1.8 and 9, 10 + private final static int MAX_SOURCE_LEVEL = 11 ; // 1.1 to 1.8 and 9, 10 /* * The registered compilation participants (a table from int (source level) to Object[]) @@ -569,29 +569,11 @@ else if (TRUE.equals(configElement.getAttribute("createsProblems"))) //$NON-NLS- private int indexForSourceLevel(String sourceLevel) { if (sourceLevel == null) return 0; int majVersion = (int) (CompilerOptions.versionToJdkLevel(sourceLevel) >>> 16); - switch (majVersion) { - case ClassFileConstants.MAJOR_VERSION_1_2: - return 1; - case ClassFileConstants.MAJOR_VERSION_1_3: - return 2; - case ClassFileConstants.MAJOR_VERSION_1_4: - return 3; - case ClassFileConstants.MAJOR_VERSION_1_5: - return 4; - case ClassFileConstants.MAJOR_VERSION_1_6: - return 5; - case ClassFileConstants.MAJOR_VERSION_1_7: - return 6; - case ClassFileConstants.MAJOR_VERSION_1_8: - return 7; - case ClassFileConstants.MAJOR_VERSION_9: - return 8; - case ClassFileConstants.MAJOR_VERSION_10: - return 9; - default: - // all other cases including ClassFileConstants.MAJOR_VERSION_1_1 - return 0; + if (majVersion > ClassFileConstants.MAJOR_VERSION_1_2) { + return (majVersion - ClassFileConstants.MAJOR_VERSION_1_1); } + // all other cases including ClassFileConstants.MAJOR_VERSION_1_1 + return 0; } private int sortParticipants(ArrayList<IConfigurationElement> group, IConfigurationElement[] configElements, int index) { diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java index 811a2c698d..34ab941c95 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java @@ -179,7 +179,7 @@ public void initialize() { return; } this.release = getReleaseOptionFromCompliance(this.release); - this.releaseInHex = Integer.toHexString(Integer.parseInt(this.release)); + this.releaseInHex = Integer.toHexString(Integer.parseInt(this.release)).toUpperCase(); Path lib = Paths.get(this.zipFilename).getParent(); Path filePath = Paths.get(lib.toString(), "ct.sym"); //$NON-NLS-1$ URI t = filePath.toUri(); diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java index 2af8c8ca9d..d501e436cf 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java @@ -152,8 +152,9 @@ public static ClasspathLocation forLibrary(String libraryPathname, AccessRuleSet static ClasspathLocation forLibrary(IFile library, AccessRuleSet accessRuleSet, IPath annotationsPath, boolean autoModule, String compliance) { - return compliance == null ? new ClasspathJar(library, accessRuleSet, annotationsPath, autoModule) : - new ClasspathMultiReleaseJar(library, accessRuleSet, annotationsPath, autoModule, compliance); + return (CompilerOptions.versionToJdkLevel(compliance) < ClassFileConstants.JDK9) ? + new ClasspathJar(library, accessRuleSet, annotationsPath, autoModule) : + new ClasspathMultiReleaseJar(library, accessRuleSet, annotationsPath, autoModule, compliance); } public static ClasspathLocation forLibrary(ZipFile zipFile, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath, String compliance) { return (CompilerOptions.versionToJdkLevel(compliance) < ClassFileConstants.JDK9) ? diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathMultiReleaseJar.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathMultiReleaseJar.java index 9b03ee6e02..25d07df967 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathMultiReleaseJar.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathMultiReleaseJar.java @@ -2,6 +2,7 @@ import java.io.IOException; import java.net.URI; +import java.nio.file.FileSystemAlreadyExistsException; import java.nio.file.FileSystemNotFoundException; import java.nio.file.FileSystems; import java.nio.file.FileVisitResult; @@ -31,25 +32,26 @@ import org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.ExternalAnnotationStatus; import org.eclipse.jdt.internal.compiler.util.SimpleSet; import org.eclipse.jdt.internal.compiler.util.SuffixConstants; +import org.eclipse.jdt.internal.core.util.Util; public class ClasspathMultiReleaseJar extends ClasspathJar { - private java.nio.file.FileSystem fs = null; - Path releasePath = null; - Path rootPath = null; + private java.nio.file.FileSystem fs; + Path releasePath; + Path rootPath; Path[] supportedVersions; ClasspathMultiReleaseJar(IFile resource, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath, String compliance) { super(resource, accessRuleSet, externalAnnotationPath, isOnModulePath); this.compliance = compliance; - initializeVersions(); + initializeVersions(this); } ClasspathMultiReleaseJar(String zipFilename, long lastModified, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath, String compliance) { super(zipFilename, lastModified, accessRuleSet, externalAnnotationPath, isOnModulePath); this.compliance = compliance; - initializeVersions(); + initializeVersions(this); } public ClasspathMultiReleaseJar(ZipFile zipFile, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, @@ -62,26 +64,26 @@ public ClasspathMultiReleaseJar(ZipFile zipFile, AccessRuleSet accessRuleSet, IP public ClasspathMultiReleaseJar(String fileName, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath, String compliance) { this(fileName, 0, accessRuleSet, externalAnnotationPath, isOnModulePath, compliance); - if (externalAnnotationPath != null) + if (externalAnnotationPath != null) { this.externalAnnotationPath = externalAnnotationPath.toString(); + } } @Override IModule initializeModule() { IModule mod = null; - ZipFile file = null; - try { - file = new ZipFile(this.zipFilename); + try (ZipFile file = new ZipFile(this.zipFilename)){ ClassFileReader classfile = null; try { for (Path path : this.supportedVersions) { classfile = ClassFileReader.read(file, path.toString() + '/' + IModule.MODULE_INFO_CLASS); - if (classfile != null) + if (classfile != null) { break; + } } } catch (Exception e) { - e.printStackTrace(); + Util.log(e, "Failed to initialize module for: " + this); //$NON-NLS-1$ // move on to the default } if (classfile == null) { @@ -91,54 +93,51 @@ IModule initializeModule() { mod = classfile.getModuleDeclaration(); } } catch (ClassFormatException | IOException e) { - // do nothing - } finally { - try { - if (file != null) - file.close(); - } catch (IOException e) { - // do nothing - } + Util.log(e, "Failed to initialize module for: " + this); //$NON-NLS-1$ } return mod; } - private void initializeVersions() { - Path filePath = Paths.get(this.zipFilename); - if (Files.exists(filePath)) { - URI uri = URI.create("jar:" + filePath.toUri()); //$NON-NLS-1$ - try { + private static synchronized void initializeVersions(ClasspathMultiReleaseJar jar) { + Path filePath = Paths.get(jar.zipFilename); + try { + if (Files.exists(filePath)) { + URI uri = URI.create("jar:" + filePath.toUri()); //$NON-NLS-1$ try { - this.fs = FileSystems.getFileSystem(uri); - } catch (FileSystemNotFoundException e) { - // move on + try { + jar.fs = FileSystems.getFileSystem(uri); + } catch (FileSystemNotFoundException e) { + // move on + } + if (jar.fs == null) { + jar.fs = FileSystems.newFileSystem(uri, new HashMap<>()); + } + } catch (IllegalArgumentException | FileSystemNotFoundException | ProviderNotFoundException + | FileSystemAlreadyExistsException | IOException | SecurityException e) { + Util.log(e, "Failed to initialize versions for: " + jar); //$NON-NLS-1$ + jar.supportedVersions = new Path[0]; } - if (this.fs == null) { - HashMap<String, ?> env = new HashMap<>(); - this.fs = FileSystems.newFileSystem(uri, env); + if (jar.fs == null) { + return; } - } catch (FileSystemNotFoundException | ProviderNotFoundException e) { - // move on - } catch (IOException e) { - // move on - } - if (this.fs == null) - return; - this.rootPath = this.fs.getPath("/"); //$NON-NLS-1$ - int earliestJavaVersion = ClassFileConstants.MAJOR_VERSION_9; - long latestJDK = CompilerOptions.releaseToJDKLevel(this.compliance); - int latestJavaVer = (int) (latestJDK >> 16); - List<Path> versions = new ArrayList<>(); - for (int i = latestJavaVer; i >= earliestJavaVersion; i--) { - Path path = this.fs.getPath("/", "META-INF", "versions", "" + (i - 44)); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - if (Files.exists(path)) { - versions.add(this.rootPath.relativize(path)); + jar.rootPath = jar.fs.getPath("/"); //$NON-NLS-1$ + int earliestJavaVersion = ClassFileConstants.MAJOR_VERSION_9; + long latestJDK = CompilerOptions.versionToJdkLevel(jar.compliance); + int latestJavaVer = (int) (latestJDK >> 16); + List<Path> versions = new ArrayList<>(); + for (int i = latestJavaVer; i >= earliestJavaVersion; i--) { + Path path = jar.fs.getPath("/", "META-INF", "versions", "" + (i - 44)); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + if (Files.exists(path)) { + versions.add(jar.rootPath.relativize(path)); + } } + jar.supportedVersions = versions.toArray(new Path[versions.size()]); } - this.supportedVersions = versions.toArray(new Path[versions.size()]); - if (this.supportedVersions.length <= 0) { + } finally { + if ((jar.supportedVersions == null || jar.supportedVersions.length <= 0) + && (jar.fs != null && jar.fs.isOpen())) { try { - this.fs.close(); + jar.fs.close(); } catch (IOException e) { // ignore } @@ -153,20 +152,21 @@ protected String readJarContent(final SimpleSet packageSet) { try { for (Path path : this.supportedVersions) { Path relativePath = this.rootPath.resolve(path); - Files.walkFileTree(path, new FileVisitor<java.nio.file.Path>() { + Files.walkFileTree(path, new FileVisitor<Path>() { @Override - public FileVisitResult preVisitDirectory(java.nio.file.Path dir, BasicFileAttributes attrs) + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { return FileVisitResult.CONTINUE; } @Override - public FileVisitResult visitFile(java.nio.file.Path file, BasicFileAttributes attrs) + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { Path p = relativePath.relativize(file); addToPackageSet(packageSet, p.toString(), false); if (modInfo[0] == null) { - if (p.getFileName().toString().equalsIgnoreCase(IModule.MODULE_INFO_CLASS)) { + Path fileName = p.getFileName(); + if (fileName != null && fileName.toString().equalsIgnoreCase(IModule.MODULE_INFO_CLASS)) { modInfo[0] = relativePath.relativize(file).toString(); } } @@ -174,20 +174,20 @@ public FileVisitResult visitFile(java.nio.file.Path file, BasicFileAttributes at } @Override - public FileVisitResult visitFileFailed(java.nio.file.Path file, IOException exc) + public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { return FileVisitResult.CONTINUE; } @Override - public FileVisitResult postVisitDirectory(java.nio.file.Path dir, IOException exc) + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { return FileVisitResult.CONTINUE; } }); } } catch (Exception e) { - // move on; + Util.log(e, "Failed to read jar content for: " + packageSet + " in: " + this); //$NON-NLS-1$ //$NON-NLS-2$ } return modInfo[0]; } @@ -195,14 +195,17 @@ public FileVisitResult postVisitDirectory(java.nio.file.Path dir, IOException ex @Override public NameEnvironmentAnswer findClass(String binaryFileName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly, Predicate<String> moduleNameFilter) { - if (!isPackage(qualifiedPackageName, moduleName)) + if (!isPackage(qualifiedPackageName, moduleName)) { return null; // most common case + } for (Path path : this.supportedVersions) { Path relativePath = this.rootPath.resolve(path); + Path p = null; try { - Path p = relativePath.resolve(qualifiedPackageName).resolve(binaryFileName); - if (!Files.exists(p)) + p = relativePath.resolve(qualifiedPackageName).resolve(binaryFileName); + if (!Files.exists(p)) { continue; + } byte[] content = Files.readAllBytes(p); IBinaryType reader = null; if (content != null) { @@ -212,10 +215,11 @@ public NameEnvironmentAnswer findClass(String binaryFileName, String qualifiedPa char[] modName = this.module == null ? null : this.module.name(); if (reader instanceof ClassFileReader) { ClassFileReader classReader = (ClassFileReader) reader; - if (classReader.moduleName == null) + if (classReader.moduleName == null) { classReader.moduleName = modName; - else + } else { modName = classReader.moduleName; + } } String fileNameWithoutExtension = qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length() - SuffixConstants.SUFFIX_CLASS.length); @@ -236,17 +240,30 @@ public NameEnvironmentAnswer findClass(String binaryFileName, String qualifiedPa reader = new ExternalAnnotationDecorator(reader, null); } } - if (this.accessRuleSet == null) + if (this.accessRuleSet == null) { return new NameEnvironmentAnswer(reader, null, modName); + } return new NameEnvironmentAnswer(reader, this.accessRuleSet.getViolatedRestriction(fileNameWithoutExtension.toCharArray()), modName); } } catch (IOException | ClassFormatException e) { - e.printStackTrace(); + Util.log(e, "Failed to find class for: " + p + " in: " + this); //$NON-NLS-1$ //$NON-NLS-2$ // treat as if class file is missing } } return super.findClass(binaryFileName, qualifiedPackageName, moduleName, qualifiedBinaryFileName, asBinaryOnly, moduleNameFilter); } + + @Override + public void cleanup() { + if (this.fs != null && this.fs.isOpen()) { + try { + this.fs.close(); + } catch (IOException e) { + // probably already closed, race condition may be? + } + } + super.cleanup(); + } } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ClassFileReader.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ClassFileReader.java index 8c533b759e..60d2fed5b9 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ClassFileReader.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ClassFileReader.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2000, 2011, 2017 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -29,6 +28,7 @@ import org.eclipse.jdt.core.util.IInnerClassesAttribute; import org.eclipse.jdt.core.util.IMethodInfo; import org.eclipse.jdt.core.util.IModifierConstants; +import org.eclipse.jdt.core.util.INestMembersAttribute; import org.eclipse.jdt.core.util.ISourceAttribute; import org.eclipse.jdt.internal.compiler.util.Util; @@ -46,6 +46,7 @@ public class ClassFileReader extends ClassFileStruct implements IClassFileReader private IFieldInfo[] fields; private int fieldsCount; private IInnerClassesAttribute innerClassesAttribute; + private INestMembersAttribute nestMembersAttribute; private int[] interfaceIndexes; private char[][] interfaceNames; private int interfacesCount; @@ -157,6 +158,10 @@ public ClassFileReader(byte[] classFileBytes, int decodingFlags) throws ClassFor constantPoolOffsets[i] = readOffset; readOffset += IConstantPoolConstant.CONSTANT_InvokeDynamic_SIZE; break; + case IConstantPoolConstant.CONSTANT_Dynamic : + constantPoolOffsets[i] = readOffset; + readOffset += IConstantPoolConstant.CONSTANT_Dynamic_SIZE; + break; case IConstantPoolConstant.CONSTANT_Module: constantPoolOffsets[i] = readOffset; readOffset += IConstantPoolConstant.CONSTANT_Module_SIZE; @@ -298,10 +303,16 @@ public ClassFileReader(byte[] classFileBytes, int decodingFlags) throws ClassFor this.attributes[attributesIndex++] = new ModulePackagesAttribute(classFileBytes, this.constantPool, readOffset); } else if (equals(attributeName, IAttributeNamesConstants.MODULE_MAIN_CLASS)) { this.attributes[attributesIndex++] = new ModuleMainClassAttribute(classFileBytes, this.constantPool, readOffset); + } else if (equals(attributeName, IAttributeNamesConstants.NEST_HOST)) { + this.attributes[attributesIndex++] = new NestHostAttribute(classFileBytes, this.constantPool, readOffset); + } else if (equals(attributeName, IAttributeNamesConstants.NEST_MEMBERS)) { + this.nestMembersAttribute = new NestMembersAttribute(classFileBytes, this.constantPool, readOffset); + this.attributes[attributesIndex++] = this.nestMembersAttribute; } else { this.attributes[attributesIndex++] = new ClassFileAttribute(classFileBytes, this.constantPool, readOffset); } - readOffset += (6 + u4At(classFileBytes, readOffset + 2, 0)); + long tmp = u4At(classFileBytes, readOffset + 2, 0); + readOffset += (6 + tmp); } } else { for (int i = 0; i < this.attributesCount; i++) { @@ -395,6 +406,11 @@ public IInnerClassesAttribute getInnerClassesAttribute() { return this.innerClassesAttribute; } + @Override + public INestMembersAttribute getNestMembersAttribute() { + return this.nestMembersAttribute; + } + /** * @see IClassFileReader#getInterfaceIndexes() */ diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CodeAttribute.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CodeAttribute.java index 69928ca1a5..e6a980c085 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CodeAttribute.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CodeAttribute.java @@ -270,28 +270,14 @@ public void traverse(IBytecodeVisitor visitor) throws ClassFormatException { case IOpcodeMnemonics.LDC : index = u1At(this.classFileBytes, 1, pc); constantPoolEntry = this.constantPool.decodeEntry(index); - if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Float - && constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Integer - && constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_String - && constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class - && constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_MethodType - && constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_MethodHandle) { - throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY); - } + checkConstantAndThrow(constantPoolEntry.getKind()); visitor._ldc(pc - this.codeOffset, index, constantPoolEntry); pc+=2; break; case IOpcodeMnemonics.LDC_W : index = u2At(this.classFileBytes, 1, pc); constantPoolEntry = this.constantPool.decodeEntry(index); - if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Float - && constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Integer - && constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_String - && constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class - && constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_MethodType - && constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_MethodHandle) { - throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY); - } + checkConstantAndThrow(constantPoolEntry.getKind()); visitor._ldc_w(pc - this.codeOffset, index, constantPoolEntry); pc+=3; break; @@ -1204,4 +1190,9 @@ public void traverse(IBytecodeVisitor visitor) throws ClassFormatException { } } } + private void checkConstantAndThrow(int kind) throws ClassFormatException { + if (kind == IConstantPoolConstant.CONSTANT_Long || kind == IConstantPoolConstant.CONSTANT_Double) { + throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY); + } + } } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ConstantPool.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ConstantPool.java index 858cf7ae27..bc548fc0f4 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ConstantPool.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ConstantPool.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -155,6 +154,19 @@ public IConstantPoolEntry decodeEntry(int index) { constantPoolEntry2.setMethodDescriptor(getUtf8ValueAt(methodDescriptorIndex)); constantPoolEntry = constantPoolEntry2; break; + case IConstantPoolConstant.CONSTANT_Dynamic : + constantPoolEntry2 = new ConstantPoolEntry2(); + constantPoolEntry2.reset(); + constantPoolEntry2.setKind(kind); + constantPoolEntry2.setBootstrapMethodAttributeIndex(u2At(this.classFileBytes, 1, this.constantPoolOffset[index])); + int nameAndTypeIndex2 = u2At(this.classFileBytes, 3, this.constantPoolOffset[index]); + constantPoolEntry2.setNameAndTypeIndex(nameAndTypeIndex2); + fieldNameIndex = u2At(this.classFileBytes, 1, this.constantPoolOffset[nameAndTypeIndex2]); + fieldDescriptorIndex = u2At(this.classFileBytes, 3, this.constantPoolOffset[nameAndTypeIndex2]); + constantPoolEntry2.setFieldName(getUtf8ValueAt(fieldNameIndex)); + constantPoolEntry2.setFieldDescriptor(getUtf8ValueAt(fieldDescriptorIndex)); + constantPoolEntry = constantPoolEntry2; + break; case IConstantPoolConstant.CONSTANT_Module : constantPoolEntry2 = new ConstantPoolEntry2(); constantPoolEntry2.reset(); diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java index 3bb41e033f..f8ff04aca9 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java @@ -2099,6 +2099,10 @@ public void _ldc(int pc, int index, IConstantPoolEntry constantPoolEntry) { appendConstantMethodHandle(this.buffer, Messages.classformat_ldc_w_methodhandle, IOpcodeMnemonics.LDC, index, constantPoolEntry); break; + case IConstantPoolConstant.CONSTANT_Dynamic : + appendConstantDynamic(this.buffer, Messages.classformat_ldc_w_dynamic, + IOpcodeMnemonics.LDC, index, constantPoolEntry); + break; } writeNewLine(); } @@ -2121,6 +2125,16 @@ private StringBuffer appendConstantMethodHandle(StringBuffer s, String messageKi Integer.toString(((IConstantPoolEntry2) constantPoolEntry).getReferenceIndex()) })); } + private StringBuffer appendConstantDynamic(StringBuffer s, String messageKind, int opcode, + int index, IConstantPoolEntry entry) { + return s.append(Messages.bind(messageKind, new String[] { + OpcodeStringValues.BYTECODE_NAMES[opcode], + Integer.toString(index), + Integer.toString(((IConstantPoolEntry2) entry).getBootstrapMethodAttributeIndex()), + new String(entry.getFieldName()), + returnClassName(Signature.toCharArray(entry.getFieldDescriptor())) + })); + } /** * @see IBytecodeVisitor#_ldc2_w(int, int, IConstantPoolEntry) */ @@ -2141,6 +2155,19 @@ public void _ldc2_w(int pc, int index, IConstantPoolEntry constantPoolEntry) { Integer.toString(index), Double.toString(constantPoolEntry.getDoubleValue()) })); + break; + case IConstantPoolConstant.CONSTANT_MethodType : + appendConstantMethodType(this.buffer, Messages.classformat_ldc_w_methodhandle, + IOpcodeMnemonics.LDC2_W, index, constantPoolEntry); + break; + case IConstantPoolConstant.CONSTANT_MethodHandle : + appendConstantMethodHandle(this.buffer, Messages.classformat_ldc_w_methodhandle, + IOpcodeMnemonics.LDC2_W, index, constantPoolEntry); + break; + case IConstantPoolConstant.CONSTANT_Dynamic : + appendConstantDynamic(this.buffer, Messages.classformat_ldc_w_dynamic, + IOpcodeMnemonics.LDC2_W, index, constantPoolEntry); + break; } writeNewLine(); } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java index ed9f7edc1b..d407b32c74 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java @@ -1,7 +1,6 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * - * This program and the accompanying materials + * 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 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ @@ -22,6 +21,7 @@ import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.core.util.*; import org.eclipse.jdt.internal.compiler.codegen.AttributeNamesConstants; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; /** @@ -989,24 +989,10 @@ public String disassemble(IClassFileReader classFileReader, String lineSeparator String versionNumber = VERSION_UNKNOWN; if (minorVersion == 3 && majorVersion == 45) { versionNumber = JavaCore.VERSION_1_1; - } else if (minorVersion == 0 && majorVersion == 46) { - versionNumber = JavaCore.VERSION_1_2; - } else if (minorVersion == 0 && majorVersion == 47) { - versionNumber = JavaCore.VERSION_1_3; - } else if (minorVersion == 0 && majorVersion == 48) { - versionNumber = JavaCore.VERSION_1_4; - } else if (minorVersion == 0 && majorVersion == 49) { - versionNumber = JavaCore.VERSION_1_5; - } else if (minorVersion == 0 && majorVersion == 50) { - versionNumber = JavaCore.VERSION_1_6; - } else if (minorVersion == 0 && majorVersion == 51) { - versionNumber = JavaCore.VERSION_1_7; - } else if (minorVersion == 0 && majorVersion == 52) { - versionNumber = JavaCore.VERSION_1_8; - } else if (minorVersion == 0 && majorVersion == 53) { - versionNumber = JavaCore.VERSION_9; - } else if (minorVersion == 0 && majorVersion == 54) { - versionNumber = JavaCore.VERSION_10; + } else { + versionNumber = CompilerOptions.versionFromJdkLevel((majorVersion << 16) + minorVersion); + if (versionNumber.length() == 0) + versionNumber = VERSION_UNKNOWN; } buffer.append( Messages.bind(Messages.classfileformat_versiondetails, @@ -1035,6 +1021,7 @@ public String disassemble(IClassFileReader classFileReader, String lineSeparator writeNewLine(buffer, lineSeparator, 0); } + INestMembersAttribute nestMembersAttribute = classFileReader.getNestMembersAttribute(); IInnerClassesAttribute innerClassesAttribute = classFileReader.getInnerClassesAttribute(); IClassFileAttribute runtimeVisibleAnnotationsAttribute = Util.getAttribute(classFileReader, IAttributeNamesConstants.RUNTIME_VISIBLE_ANNOTATIONS); IClassFileAttribute runtimeInvisibleAnnotationsAttribute = Util.getAttribute(classFileReader, IAttributeNamesConstants.RUNTIME_INVISIBLE_ANNOTATIONS); @@ -1164,6 +1151,7 @@ public String disassemble(IClassFileReader classFileReader, String lineSeparator IClassFileAttribute[] attributes = classFileReader.getAttributes(); int length = attributes.length; IEnclosingMethodAttribute enclosingMethodAttribute = (IEnclosingMethodAttribute) Util.getAttribute(classFileReader, IAttributeNamesConstants.ENCLOSING_METHOD); + INestHostAttribute nestHostAttribute = (INestHostAttribute) Util.getAttribute(classFileReader, IAttributeNamesConstants.NEST_HOST); int remainingAttributesLength = length; if (innerClassesAttribute != null) { remainingAttributesLength--; @@ -1183,8 +1171,16 @@ public String disassemble(IClassFileReader classFileReader, String lineSeparator if (moduleAttribute != null) { remainingAttributesLength--; } + if (nestHostAttribute != null) { + remainingAttributesLength--; + } + if (nestMembersAttribute != null) { + remainingAttributesLength--; + } if (innerClassesAttribute != null || enclosingMethodAttribute != null + || nestHostAttribute != null + || nestMembersAttribute != null || bootstrapMethods != null || moduleAttribute != null || remainingAttributesLength != 0) { @@ -1199,6 +1195,12 @@ public String disassemble(IClassFileReader classFileReader, String lineSeparator if (enclosingMethodAttribute != null) { disassemble(enclosingMethodAttribute, buffer, lineSeparator, 0); } + if (nestHostAttribute != null) { + disassemble(nestHostAttribute, buffer, lineSeparator, 0); + } + if (nestMembersAttribute != null) { + disassemble(nestMembersAttribute, buffer, lineSeparator, 0); + } if (bootstrapMethods != null) { disassemble((IBootstrapMethodsAttribute) bootstrapMethods, buffer, lineSeparator, 0, classFileReader.getConstantPool()); } @@ -1219,6 +1221,8 @@ public String disassemble(IClassFileReader classFileReader, String lineSeparator for (int i = 0; i < length; i++) { IClassFileAttribute attribute = attributes[i]; if (attribute != innerClassesAttribute + && attribute != nestHostAttribute + && attribute != nestMembersAttribute && attribute != sourceAttribute && attribute != signatureAttribute && attribute != enclosingMethodAttribute @@ -1337,6 +1341,43 @@ private void disassemble(IProvidesInfo iProvidesInfo, StringBuffer buffer, Strin buffer.append(';'); } + private void disassemble(INestHostAttribute nestHostAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) { + writeNewLine(buffer, lineSeparator, tabNumber); + writeNewLine(buffer, lineSeparator, tabNumber); // additional line + buffer.append(Messages.disassembler_nesthost); + buffer + .append(Messages.disassembler_constantpoolindex) + .append(nestHostAttribute.getNestHostIndex()) + .append(" ")//$NON-NLS-1$ + .append(nestHostAttribute.getNestHostName()); + } + + private void disassemble(INestMembersAttribute nestMembersAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) { + writeNewLine(buffer, lineSeparator, tabNumber); + writeNewLine(buffer, lineSeparator, tabNumber); // additional line + buffer.append(Messages.disassembler_nestmembers); + writeNewLine(buffer, lineSeparator, tabNumber + 1); + INestMemberAttributeEntry[] entries = nestMembersAttribute.getNestMemberAttributesEntries(); + int length = entries.length; + int nestMemberIndex; + INestMemberAttributeEntry entry; + for (int i = 0; i < length; i++) { + if (i != 0) { + buffer.append(Messages.disassembler_comma); + writeNewLine(buffer, lineSeparator, tabNumber + 1); + } + entry = entries[i]; + nestMemberIndex = entry.getNestMemberIndex(); + buffer + .append(Messages.disassembler_constantpoolindex) + .append(nestMemberIndex); + if (nestMemberIndex != 0) { + buffer + .append(Messages.disassembler_space) + .append(entry.getNestMemberName()); + } + } + } private void disassemble(IPackageVisibilityInfo iPackageVisibilityInfo, StringBuffer buffer, String lineSeparator, int tabNumber, boolean isExports) { buffer.append(isExports ? "exports" : "opens"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -1796,7 +1837,8 @@ private void disassemble(IConstantPool constantPool, StringBuffer buffer, String } IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(i); String[] methodDescription; - switch (constantPool.getEntryKind(i)) { + int kind = constantPool.getEntryKind(i); + switch (kind) { case IConstantPoolConstant.CONSTANT_Class : buffer.append( Messages.bind(Messages.disassembler_constantpool_class, @@ -1927,6 +1969,19 @@ private void disassemble(IConstantPool constantPool, StringBuffer buffer, String new String(constantPoolEntry.getMethodName()), new String(constantPoolEntry.getMethodDescriptor()) })); + break; + case IConstantPoolConstant.CONSTANT_Dynamic : + entry2 = (IConstantPoolEntry2) constantPoolEntry; + buffer.append( + Messages.bind(Messages.disassembler_constantpool_dynamic, + new String[] { + Integer.toString(i), + Integer.toString(entry2.getBootstrapMethodAttributeIndex()), + Integer.toString(entry2.getNameAndTypeIndex()), + new String(constantPoolEntry.getFieldName()), + new String(constantPoolEntry.getFieldDescriptor()) + })); + break; } } } diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java index 00784ea500..82e9c02430 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java @@ -277,6 +277,8 @@ private Messages() { public static String disassembler_outer_class_info_name; public static String disassembler_inner_name; public static String disassembler_inner_accessflags; + public static String disassembler_nesthost; + public static String disassembler_nestmembers; public static String disassembler_genericattributeheader; public static String disassembler_signatureattributeheader; public static String disassembler_bootstrapmethodattributesheader; @@ -304,6 +306,7 @@ private Messages() { public static String disassembler_constantpool_methodhandle; public static String disassembler_constantpool_methodtype; public static String disassembler_constantpool_invokedynamic; + public static String disassembler_constantpool_dynamic; public static String disassembler_annotationdefaultheader; public static String disassembler_annotationdefaultvalue; public static String disassembler_annotationenumvalue; @@ -365,6 +368,7 @@ private Messages() { public static String classformat_ldc_w_class; public static String classformat_ldc_w_methodtype; public static String classformat_ldc_w_methodhandle; + public static String classformat_ldc_w_dynamic; public static String classformat_ldc_w_float; public static String classformat_ldc_w_integer; public static String classformat_ldc_w_string; diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestHostAttribute.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestHostAttribute.java new file mode 100644 index 0000000000..864b0e9743 --- /dev/null +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestHostAttribute.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * 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.internal.core.util; + +import org.eclipse.jdt.core.util.ClassFormatException; +import org.eclipse.jdt.core.util.IConstantPool; +import org.eclipse.jdt.core.util.IConstantPoolConstant; +import org.eclipse.jdt.core.util.IConstantPoolEntry; +import org.eclipse.jdt.core.util.INestHostAttribute; + +public class NestHostAttribute extends ClassFileAttribute implements INestHostAttribute { + + private int hostIndex; + private char[] hostName; + + public NestHostAttribute(byte[] classFileBytes, IConstantPool constantPool, int offset) + throws ClassFormatException { + super(classFileBytes, constantPool, offset); + int index = u2At(classFileBytes, 6, offset); + this.hostIndex = index; + IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index); + if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) { + throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY); + } + this.hostName = constantPoolEntry.getClassInfoName(); + } + + @Override + public char[] getNestHostName() { + return this.hostName; + } + + @Override + public int getNestHostIndex() { + return this.hostIndex; + } + @Override + public String toString() { + return new String(this.hostName); + } +} \ No newline at end of file diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestMembersAttribute.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestMembersAttribute.java new file mode 100644 index 0000000000..020187c6a6 --- /dev/null +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestMembersAttribute.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * 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.internal.core.util; + +import org.eclipse.jdt.core.util.ClassFormatException; +import org.eclipse.jdt.core.util.IConstantPool; +import org.eclipse.jdt.core.util.INestMemberAttributeEntry; +import org.eclipse.jdt.core.util.INestMembersAttribute; + +/** + * Default implementation of INestMembersAttribute. + */ +public class NestMembersAttribute extends ClassFileAttribute implements INestMembersAttribute { + private static final INestMemberAttributeEntry[] NO_ENTRIES = new INestMemberAttributeEntry[0]; + + private int nestMembers; + private INestMemberAttributeEntry[] entries; + + /** + * Constructor for NestMembersAttribute. + * @param classFileBytes + * @param constantPool + * @param offset + * @throws ClassFormatException + */ + public NestMembersAttribute( + byte[] classFileBytes, + IConstantPool constantPool, + int offset) + throws ClassFormatException { + super(classFileBytes, constantPool, offset); + this.nestMembers = u2At(classFileBytes, 6, offset); + final int length = this.nestMembers; + if (length != 0) { + int readOffset = 8; + this.entries = new INestMemberAttributeEntry[length]; + for (int i = 0; i < length; i++) { + this.entries[i] = new NestMembersAttributeEntry(classFileBytes, constantPool, offset + readOffset); + readOffset += 2; + } + } else { + this.entries = NO_ENTRIES; + } + } + + @Override + public int getNumberOfNestMembers() { + return this.nestMembers; + } + + @Override + public INestMemberAttributeEntry[] getNestMemberAttributesEntries() { + return this.entries; + } + +} diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestMembersAttributeEntry.java b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestMembersAttributeEntry.java new file mode 100644 index 0000000000..5456c78f8c --- /dev/null +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/NestMembersAttributeEntry.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * 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.internal.core.util; + +import org.eclipse.jdt.core.util.ClassFormatException; +import org.eclipse.jdt.core.util.IConstantPool; +import org.eclipse.jdt.core.util.IConstantPoolConstant; +import org.eclipse.jdt.core.util.IConstantPoolEntry; +import org.eclipse.jdt.core.util.INestMemberAttributeEntry; + +public class NestMembersAttributeEntry extends ClassFileStruct implements INestMemberAttributeEntry { + + private int memberClassNameIndex; + private char[] memberClassName; + + public NestMembersAttributeEntry(byte[] classFileBytes, IConstantPool constantPool, int offset) + throws ClassFormatException { + this.memberClassNameIndex = u2At(classFileBytes, 0, offset); + if (this.memberClassNameIndex != 0) { + IConstantPoolEntry constantPoolEntry; + constantPoolEntry = constantPool.decodeEntry(this.memberClassNameIndex); + if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) { + throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY); + } + this.memberClassName = constantPoolEntry.getClassInfoName(); + } + } + + @Override + public char[] getNestMemberName() { + return this.memberClassName; + } + + @Override + public int getNestMemberIndex() { + return this.memberClassNameIndex; + } + + @Override + public String toString() { + return new String(this.memberClassName); + } +} + diff --git a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties index 7c64d8498f..7d00a513bd 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties +++ b/jdt-patch/e49/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties @@ -297,6 +297,8 @@ disassembler_methodparametersheader = Method Parameters: disassembler_localvariabletableattributeheader = Local variable table: disassembler_localvariabletypetableattributeheader = Local variable type table: disassembler_arraydimensions = [] +disassembler_nesthost = Nest Host: +disassembler_nestmembers = Nest Members: disassembler_innerattributesheader = Inner classes: disassembler_inner_class_info_name = inner class info: disassembler_outer_class_info_name = outer class info: @@ -331,6 +333,7 @@ disassembler_constantpool_utf8 = constant #{0} utf8: "{1}" disassembler_constantpool_methodhandle = constant #{0} method handle: {1} #{2} disassembler_constantpool_methodtype = constant #{0} method type: #{1} {2} disassembler_constantpool_invokedynamic = constant #{0} invoke dynamic: #{1} #{2} {3} {4} +disassembler_constantpool_dynamic = constant #{0} dynamic: #{1} #{2} {3} {4} disassembler_annotationdefaultheader = Annotation Default:\ disassembler_annotationdefaultvalue= {0} (constant type) disassembler_annotationenumvalue = {2}.{3}(enum type #{0}.#{1}) @@ -414,6 +417,7 @@ classformat_checkcast = {0} {2} [{1}] classformat_instanceof = {0} {2} [{1}] classformat_ldc_w_methodtype = {0} <MethodType {2}> [{1}] classformat_ldc_w_methodhandle = {0} <MethodHandle {2} {3}> [{1}] +classformat_ldc_w_dynamic = {0} <Dynamic> {2} {3} {4} [{1}] classformat_ldc_w_class = {0} <Class {2}> [{1}] classformat_ldc_w_float = {0} <Float {2}> [{1}] classformat_ldc_w_integer = {0} <Integer {2}> [{1}] diff --git a/jdt-patch/e49/org.eclipse.jdt.core/pom.xml b/jdt-patch/e49/org.eclipse.jdt.core/pom.xml index fbf64bcd03..99418c2408 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/pom.xml +++ b/jdt-patch/e49/org.eclipse.jdt.core/pom.xml @@ -20,7 +20,7 @@ </parent> <groupId>org.codehaus.groovy.eclipse</groupId> <artifactId>org.eclipse.jdt.core</artifactId> - <version>3.15.0-SNAPSHOT</version> + <version>3.15.100-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> <properties> diff --git a/jdt-patch/e49/org.eclipse.jdt.core/readme.txt b/jdt-patch/e49/org.eclipse.jdt.core/readme.txt index 36b4b81d2b..b92291ee03 100644 --- a/jdt-patch/e49/org.eclipse.jdt.core/readme.txt +++ b/jdt-patch/e49/org.eclipse.jdt.core/readme.txt @@ -2,3 +2,4 @@ 2018-08-24: 88a2114 (2018-09 M3) 2018-09-02: 987e180 (2018-09 RC1) 2018-09-07: 449e1c5 (2018-09 RC2) +2018-09-26: 926d18c (P20180926-0920)