diff options
7 files changed, 110 insertions, 81 deletions
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java index 96fdfdf6f..fbf88ae88 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java @@ -92,6 +92,12 @@ public interface Constants { short MINOR_13 = 0; short MAJOR_14 = 58; short MINOR_14 = 0; + short MAJOR_15 = 59; + short MINOR_15 = 0; +// short MAJOR_16 = 60; +// short MINOR_16 = 0; +// short MAJOR_17 = 61; +// short MINOR_17 = 0; int PREVIEW_MINOR_VERSION = 65535; diff --git a/org.aspectj.ajdt.core/src/main/resources/org/aspectj/ajdt/ajc/messages.properties b/org.aspectj.ajdt.core/src/main/resources/org/aspectj/ajdt/ajc/messages.properties index 8506a18c9..50e388af9 100644 --- a/org.aspectj.ajdt.core/src/main/resources/org/aspectj/ajdt/ajc/messages.properties +++ b/org.aspectj.ajdt.core/src/main/resources/org/aspectj/ajdt/ajc/messages.properties @@ -1,16 +1,23 @@ -#-Xlint:ignore,error,warning will set the level for all Xlint warnings. -Xlint, alone, is an abbreviation for - -Xlint:warning. +# -Xlint:ignore,error,warning will set the level for all Xlint warnings. -Xlint, alone, is an abbreviation for +# -Xlint:warning. +# +# The -Xlintfile:lint.properties allows fine-grained control. In tools.jar, see +# org/aspectj/weaver/XlintDefault.properties for the default behavior and a template to copy. - The -Xlintfile:lint.properties allows fine-grained control. In tools.jar, see - org/aspectj/weaver/XlintDefault.properties for the default behavior and a template to copy. -### AspectJ-specific messages +# TODO: This file contains many duplicates overwriting each other (last defined one supersedes previously defined ones, +# e.g. 'configure.source' where the shorter message wins against the longer one explaining more) and generally looks +# chaotic. Hence, duplicates should be removed and always the more desirable message chosen. Caveat: Tests might expect +# compiler messages, parsing Ajc output. So do not break them or fix them after changes. Also consider that build +# plugins for Maven, Gradle etc. and users in their own projects might parse the output too. + +### AspectJ-specific messages compiler.name = AspectJ Compiler -compiler.version = Eclipse Compiler 48c3f7668a46f2 (22Apr2020) - Java14 -compiler.copyright = +compiler.version = Eclipse Compiler 3caefb8021d710 (09Mar2021) - Java15 +compiler.copyright = ## this next one superceded by above... -## configure.version = AspectJ Compiler 1.1 +## configure.version = AspectJ Compiler 1.1 configure.directoryNotExist = invalid option: {0} @@ -45,7 +52,7 @@ configure.duplicateTarget = duplicate target compliance setting specification: { configure.unsupportedReleaseOption = option --release is supported only when run with JDK 9 or above configure.unsupportedWithRelease = option {0} is not supported when --release is used configure.unsupportedReleaseVersion = release version {0} is not supported -configure.source = source level should be in ''1.1''...''1.8'',''9''...''14'' (or ''5.0''..''14.0''): {0} +configure.source = source level should be in ''1.1''...''1.8'',''9''...''15'' (or ''5.0''..''15.0''): {0} configure.invalidSystem = invalid location for system libraries: {0} configure.unsupportedOption = option {0} not supported at compliance level 9 and above configure.duplicateOutputPath = duplicate output path specification: {0} @@ -62,7 +69,7 @@ configure.invalidDebugOption = invalid debug option: {0} configure.invalidWarningConfiguration = invalid warning configuration: ''{0}'' configure.invalidWarning = invalid warning token: ''{0}''. Ignoring warning and compiling configure.invalidWarningOption = invalid warning option: ''{0}''. Must specify a warning token -configure.targetJDK = target level should be in ''1.1''...''1.8'',''9''...''14'': {0} +configure.targetJDK = target level should be in ''1.1''...''1.8'',''9''...''15'': {0} configure.incompatibleTargetForSource = Target level ''{0}'' is incompatible with source level ''{1}''. A target level ''{1}'' or better is required configure.incompatibleTargetForGenericSource = Target level ''{0}'' is incompatible with source level ''{1}''. A source level ''1.5'' or better is required configure.incompatibleComplianceForSource = Compliance level ''{0}'' is incompatible with source level ''{1}''. A compliance level ''{1}'' or better is required @@ -203,9 +210,10 @@ Standard Eclipse compiler options:\n\ \ -11 for Java 11 (-source 11 -target 11)\n\ \ -12 for Java 12 (-source 12 -target 12)\n\ \ -13 for Java 13 (-source 13 -target 13)\n\ -\ -14 for Java 14 (-source 14 -target 14)\n\ -\ -source <version> set source level: 1.3 to 14 \n\ -\ -target <version> set classfile target: 1.1 to 14\n\ +\ -14 for Java 14 (-source 14 -target 14)\n\ +\ -15 for Java 14 (-source 15 -target 15)\n\ +\ -source <version> set source level: 1.3 to 15 \n\ +\ -target <version> set classfile target: 1.1 to 15\n\ \ \n\ \ Warning options:\n\ \ -deprecation + deprecation outside deprecated code (equivalent to\n\ @@ -253,9 +261,9 @@ Standard Eclipse compiler options:\n\ \ invalidJavadocTag validate javadoc tag arguments\n\ \ invalidJavadocTagDep validate deprecated references in javadoc tag args\n\ \ invalidJavadocTagNotVisible validate non-visible references in javadoc\n\ -\ tag args\n\ +\ tag args\n\ \ invalidJavadocVisibility(<visibility>) specify visibility modifier\n\ -\ for malformed javadoc tag warnings\n\ +\ for malformed javadoc tag warnings\n\ \ javadoc invalid javadoc\n\ \ localHiding local variable hiding another variable\n\ \ maskedCatchBlock + hidden catch block\n\ @@ -263,30 +271,30 @@ Standard Eclipse compiler options:\n\ \ missingJavadocTagsOverriding missing Javadoc tags in overriding methods\n\ \ missingJavadocTagsMethod missing Javadoc tags for method type parameter\n\ \ missingJavadocTagsVisibility(<visibility>) specify visibility modifier\n\ -\ for missing javadoc tags warnings\n\ +\ for missing javadoc tags warnings\n\ \ missingJavadocComments missing Javadoc comments\n\ \ missingJavadocCommentsOverriding missing Javadoc tags in overriding\n\ -\ methods\n\ +\ methods\n\ \ missingJavadocCommentsVisibility(<visibility>) specify visibility\n\ -\ modifier for missing javadoc comments warnings\n\ +\ modifier for missing javadoc comments warnings\n\ \ nls string literal lacking non-nls tag //$NON-NLS-<n>$\n\ \ noEffectAssign + assignment without effect\n\ \ null potential missing or redundant null check\n\ \ nullAnnot(<annot. names separated by |>) annotation based null analysis,\n\ \ nullable|nonnull|nonnullbydefault annotation types\n\ \ optionally specified using fully qualified names.\n\ -\ Enabling this option enables all null-annotation\n\ -\ related sub-options. These can be individually\n\ -\ controlled using options listed below.\n\ +\ Enabling this option enables all null-annotation\n\ +\ related sub-options. These can be individually\n\ +\ controlled using options listed below.\n\ \ nullAnnotConflict conflict between null annotation specified\n\ -\ and nullness inferred. Is effective only with\n\ -\ nullAnnot option enabled.\n\ +\ and nullness inferred. Is effective only with\n\ +\ nullAnnot option enabled.\n\ \ nullAnnotRedundant redundant specification of null annotation. Is\n\ -\ effective only with nullAnnot option enabled.\n\ +\ effective only with nullAnnot option enabled.\n\ \ nullDereference + missing null check\n\ -\ nullUncheckedConversion unchecked conversion from non-annotated type\n\ -\ to @NonNull type. Is effective only with\n\ -\ nullAnnot option enabled.\n\ +\ nullUncheckedConversion unchecked conversion from non-annotated type\n\ +\ to @NonNull type. Is effective only with\n\ +\ nullAnnot option enabled.\n\ \ over-ann missing @Override annotation (superclass)\n\ \ paramAssign assignment to a parameter\n\ \ pkgDefaultMethod + attempt to override package-default method\n\ @@ -309,7 +317,7 @@ Standard Eclipse compiler options:\n\ \ tasks(<tags separated by |>) tasks identified by tags inside comments\n\ \ typeHiding + type parameter hiding another type\n\ \ unavoidableGenericProblems + ignore unavoidable type safety problems\n\ -\ due to raw APIs\n\ +\ due to raw APIs\n\ \ unchecked + unchecked type operation\n\ \ unlikelyCollectionMethodArgumentType\n\ \ + unlikely argument type for collection method\n\ @@ -318,27 +326,27 @@ Standard Eclipse compiler options:\n\ \ unnecessaryElse unnecessary else clause\n\ \ unqualifiedField unqualified reference to field\n\ \ unused macro for unusedAllocation, unusedArgument,\n\ -\ unusedImport, unusedLabel, unusedLocal,\n\ -\ unusedPrivate, unusedThrown, and unusedTypeArgs,\n\ -\ unusedExceptionParam\n\ +\ unusedImport, unusedLabel, unusedLocal,\n\ +\ unusedPrivate, unusedThrown, and unusedTypeArgs,\n\ +\ unusedExceptionParam\n\ \ unusedAllocation allocating an object that is not used\n\ \ unusedArgument unread method parameter\n\ \ unusedExceptionParam unread exception parameter\n\ \ unusedImport + unused import declaration\n\ \ unusedLabel + unused label\n\ \ unusedLocal + unread local variable\n\ -\ unusedParam unused parameter\n\ +\ unusedParam unused parameter\n\ \ unusedParamOverriding unused parameter for overriding method\n\ \ unusedParamImplementing unused parameter for implementing method\n\ \ unusedParamIncludeDoc unused parameter documented in comment tag\n\ \ unusedPrivate + unused private member declaration\n\ \ unusedThrown unused declared thrown exception\n\ \ unusedThrownWhenOverriding unused declared thrown exception in \n\ -\ overriding method\n\ +\ overriding method\n\ \ unusedThrownIncludeDocComment unused declared thrown exception,\n\ -\ documented in a comment tag\n\ +\ documented in a comment tag\n\ \ unusedThrownExemptExceptionThrowable unused declared thrown exception,\n\ -\ exempt Exception and Throwable\n\ +\ exempt Exception and Throwable\n\ \ unusedTypeArgs + unused type arguments for method and constructor\n\ \ uselessTypeCheck unnecessary cast/instanceof operation\n\ \ varargsCast + varargs argument need explicit cast\n\ @@ -392,17 +400,17 @@ xoption.usage = {0} non-standard options:\n\ ############################################################################### # Copyright (c) 2000, 2004 IBM Corporation and others. -# All rights reserved. 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 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 ############################################################################### ### JavaBatchCompiler messages. -### compiler +### compiler #compiler.name = Eclipse Java Compiler #compiler.version = 0.396 #compiler.copyright = Copyright IBM Corp 2000, 2003. All rights reserved. @@ -452,7 +460,7 @@ configure.invalidDebugOption = invalid debug option: {0} configure.invalidWarningConfiguration = invalid warning configuration: {0} configure.invalidWarning = invalid warning: {0} configure.invalidWarningOption = invalid warning option: {0} -configure.targetJDK = target level should be in ''1.1''...''1.8'',''9''...''14'': {0} +configure.targetJDK = target level should be in ''1.1''...''1.8'',''9''...''15'': {0} configure.incompatibleTargetForSource14 = ''1.4'' source mode requires ''-target 1.4'' : {0} configure.incompatibleComplianceForSource14 = ''1.4'' source mode requires ''-1.4'' compliance mode: {0} configure.incompatibleComplianceForTarget14 = ''1.4'' target mode requires ''-1.4'' compliance mode: {0} diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java index ac91f498e..a48769ecb 100644 --- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java +++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java @@ -250,9 +250,9 @@ public class AjcTask extends MatchingTask { public static final String COMMAND_EDITOR_NAME = AjcTask.class.getName() + ".COMMAND_EDITOR"; - static final String[] TARGET_INPUTS = new String[] { "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "9", "10", "11", "12", "13", "14" }; - static final String[] SOURCE_INPUTS = new String[] { "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "9", "10", "11", "12", "13", "14" }; - static final String[] COMPLIANCE_INPUTS = new String[] { "-1.3", "-1.4", "-1.5", "-1.6", "-1.7", "-1.8", "-1.9", "-9", "-10", "-11", "-12", "-13", "-14" }; + static final String[] TARGET_INPUTS = new String[] { "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "9", "10", "11", "12", "13", "14", "15" }; + static final String[] SOURCE_INPUTS = new String[] { "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "9", "10", "11", "12", "13", "14", "15" }; + static final String[] COMPLIANCE_INPUTS = new String[] { "-1.3", "-1.4", "-1.5", "-1.6", "-1.7", "-1.8", "-1.9", "-9", "-10", "-11", "-12", "-13", "-14", "15" }; private static final ICommandEditor COMMAND_EDITOR; diff --git a/testing-util/src/main/java/org/aspectj/testing/util/TestUtil.java b/testing-util/src/main/java/org/aspectj/testing/util/TestUtil.java index 508f71550..e6587c4ee 100644 --- a/testing-util/src/main/java/org/aspectj/testing/util/TestUtil.java +++ b/testing-util/src/main/java/org/aspectj/testing/util/TestUtil.java @@ -412,8 +412,8 @@ public final class TestUtil { } /** - * Checks that two multi-line strings have the same value. Each line is trimmed before comparision Produces an error on the - * particular line of conflict + * Checks that two multi-line strings have the same value. Each line is trimmed before comparison. + * Produces an error on the particular line of conflict. */ public static void assertMultiLineStringEquals(String message, String s1, String s2) { try { diff --git a/testing/src/test/java/org/aspectj/testing/AjcTest.java b/testing/src/test/java/org/aspectj/testing/AjcTest.java index 5f39368a6..ee0349c81 100644 --- a/testing/src/test/java/org/aspectj/testing/AjcTest.java +++ b/testing/src/test/java/org/aspectj/testing/AjcTest.java @@ -20,32 +20,19 @@ import org.aspectj.util.LangUtil; */ public class AjcTest { - // private static boolean is13VMOrGreater = true; + // private static boolean is1dot3VMOrGreater = true; private static boolean is1dot4VMOrGreater = true; - private static boolean is15VMOrGreater = false; - private static boolean is16VMOrGreater = false; - private static boolean is17VMOrGreater = false; - private static boolean is18VMOrGreater = false; - private static boolean is19VMOrGreater = false; - private static boolean is10VMOrGreater = false; - private static boolean is11VMOrGreater = false; - private static boolean is12VMOrGreater = false; - private static boolean is13VMOrGreater = false; - private static boolean is14VMOrGreater = false; - - static { // matching logic is also in org.aspectj.util.LangUtil - is1dot4VMOrGreater = true; - is15VMOrGreater = true; - is16VMOrGreater = true; - is17VMOrGreater = true; - is18VMOrGreater = true; - is19VMOrGreater = LangUtil.is9VMOrGreater(); - is10VMOrGreater = LangUtil.is10VMOrGreater(); - is11VMOrGreater = LangUtil.is11VMOrGreater(); - is12VMOrGreater = LangUtil.is12VMOrGreater(); - is13VMOrGreater = LangUtil.is13VMOrGreater(); - is14VMOrGreater = LangUtil.is14VMOrGreater(); - } + private static boolean is1dot5VMOrGreater = true; + private static boolean is1dot6VMOrGreater = true; + private static boolean is1dot7VMOrGreater = true; + private static boolean is1dot8VMOrGreater = true; + private static boolean is9VMOrGreater = LangUtil.is9VMOrGreater(); + private static boolean is10VMOrGreater = LangUtil.is10VMOrGreater(); + private static boolean is11VMOrGreater = LangUtil.is11VMOrGreater(); + private static boolean is12VMOrGreater = LangUtil.is12VMOrGreater(); + private static boolean is13VMOrGreater = LangUtil.is13VMOrGreater(); + private static boolean is14VMOrGreater = LangUtil.is14VMOrGreater(); + private static boolean is15VMOrGreater = LangUtil.is15VMOrGreater(); private List<ITestStep> testSteps = new ArrayList<>(); @@ -83,11 +70,11 @@ public class AjcTest { if (vmLevel.equals("1.3")) return true; boolean canRun = true; if (vmLevel.equals("1.4")) canRun = is1dot4VMOrGreater; - if (vmLevel.equals("1.5")) canRun = is15VMOrGreater; - if (vmLevel.equals("1.6")) canRun = is16VMOrGreater; - if (vmLevel.equals("1.7")) canRun = is17VMOrGreater; - if (vmLevel.equals("1.8")) canRun = is18VMOrGreater; - if (vmLevel.equals("1.9")) canRun = is19VMOrGreater; + if (vmLevel.equals("1.5")) canRun = is1dot5VMOrGreater; + if (vmLevel.equals("1.6")) canRun = is1dot6VMOrGreater; + if (vmLevel.equals("1.7")) canRun = is1dot7VMOrGreater; + if (vmLevel.equals("1.8")) canRun = is1dot8VMOrGreater; + if (vmLevel.equals("1.9")) canRun = is9VMOrGreater; if (vmLevel.equals("10")) canRun = is10VMOrGreater; if (vmLevel.equals("11")) canRun = is11VMOrGreater; if (vmLevel.equals("12")) canRun = is12VMOrGreater; diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava15OrLater.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava15OrLater.java new file mode 100644 index 000000000..90b7feda1 --- /dev/null +++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCaseForJava15OrLater.java @@ -0,0 +1,28 @@ +/* ******************************************************************* + * Copyright (c) 2020 Contributors + * 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 + * ******************************************************************/ +package org.aspectj.testing; + +import org.aspectj.util.LangUtil; + +/** + * Makes sure tests are running on the right level of JDK. + * + * @author Andy Clement + */ +public abstract class XMLBasedAjcTestCaseForJava15OrLater extends XMLBasedAjcTestCase { + + @Override + public void runTest(String title) { + if (!LangUtil.is15VMOrGreater()) { + throw new IllegalStateException("These tests should be run on Java 15 or later"); + } + super.runTest(title); + } + +} diff --git a/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.java b/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.java index 0db381439..b8d9ecbd8 100644 --- a/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * 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://eclipse.org/legal/epl-v10.html - * - * Contributors: + * 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://eclipse.org/legal/epl-v10.html + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.weaver; |