]> source.dussan.org Git - aspectj.git/log
aspectj.git
3 years agoBump maven-antrun-plugin from 1.6 to 3.0.0 39/head
Alexander Kriegisch [Mon, 29 Mar 2021 03:07:51 +0000 (10:07 +0700)]
Bump maven-antrun-plugin from 1.6 to 3.0.0

This is not strictly necessary, but probably does not hurt either. While
upgrading, '<tasks>' tags have been renamed to the new standard
'<target>'.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoInstall module org.eclipse.jdt.core in 'install' phase, not 'verify'
Alexander Kriegisch [Sun, 28 Mar 2021 05:45:48 +0000 (12:45 +0700)]
Install module org.eclipse.jdt.core in 'install' phase, not 'verify'

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoReformat org.eclipse.jdt.core POM
Alexander Kriegisch [Sun, 28 Mar 2021 02:07:48 +0000 (09:07 +0700)]
Reformat org.eclipse.jdt.core POM

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUnzip dependencies in phase 'prepare-package' before building assemblies
Alexander Kriegisch [Sun, 28 Mar 2021 02:02:08 +0000 (09:02 +0700)]
Unzip dependencies in phase 'prepare-package' before building assemblies

Before it was phase 'validate', which was way too early and somewhat
annoying and time-consuming when during development we just call
validate in order to check if the POMs are valid, as the name implies.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix JRockitAgentTest.testJrockitRecursionProtection for JVM 9+
Alexander Kriegisch [Sat, 27 Mar 2021 02:04:23 +0000 (09:04 +0700)]
Fix JRockitAgentTest.testJrockitRecursionProtection for JVM 9+

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd developer info + sample config about how to work with a RAM disk
Alexander Kriegisch [Thu, 25 Mar 2021 03:31:33 +0000 (10:31 +0700)]
Add developer info + sample config about how to work with a RAM disk

There are two files:
  - docs/developer/ram-disk/maven.config
  - docs/developer/ram-disk/settings-ramdisk.xml

The latter contains info about how to set up a development environment
inside a RAM disk. Both files are to be copied to the project's '.mvn'
folder in the root directory and adjusted according to the description.

Just in case, .gitignore ignores the files if they exist in '.mvn', so
they are not being staged and committed accidentally.

An additional screenshot shows how to configure the Windows Recycle Bin
to immediately delete files in order too save space on the RAM disk.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoTry to avoid 'HeadlessException: No X11 DISPLAY' on GitHub Actions
Alexander Kriegisch [Wed, 24 Mar 2021 07:46:23 +0000 (14:46 +0700)]
Try to avoid 'HeadlessException: No X11 DISPLAY' on GitHub Actions

We have 84 times this kind of exceptions in 'ajde' tests in our build
logs on GitHub, even though the tests seem to pass:

  HeadlessException: No X11 DISPLAY variable was set,
  but this program performed an operation which requires it.

I found this discussion:
https://github.com/juliangruber/browser-run/issues/147

And then this GitHub Action:
https://github.com/marketplace/actions/gabrielbb-xvfb-action

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMake all tests run on Java 16 via '-add-opens' JVM option java16-add-opens
Alexander Kriegisch [Tue, 23 Mar 2021 09:59:17 +0000 (16:59 +0700)]
Make all tests run on Java 16 via '-add-opens' JVM option

Due to JEP 260 (Encapsulate Most Internal APIs), aspect weaving on
Java 16 now requires '--add-opens java.base/java.lang=ALL-UNNAMED' on
the command line. Otherwise there will be illegal access exceptions for
some internal API calls AspectJ needs, most prominently when trying to
define classes in other packages or modules.

This had to be done on several levels:

  - Maven Surefire: running tests in a JVM directly forked by Surefire.
    In order to make this backwards compatible, I added two profiles
    with JDK-level-dependent auto-activation, one 8-15 and one 16+. In
    the latter a property containing the JVM parameter is defined, in
    the former it is empty, i.e. the JVM is started without the
    parameter. In Java 8 the parameter did not even exist, in Java 9+ we
    could use it, but we need to test how users use AspectJ.

  - RunSpec: Whenever an XML test is declared to use '<run>', we need to
    determine the current JVM version and again dynamically add the
    parameter when forking the target JVM.

  - AntSpec: Whenever an XML test is declared to use '<ant>', we need to
    determine the current JVM version dynamically add two properties
    usable from within Ant scripts: 'aj.addOpensKey' and
    'aj.addOpensValue'. Unfortunately, Ant needs to use two '<argLine>'
    parameters, because the two parts of the option are separated by a
    space character.

  - Ant scripts: When triggered by an AntSpec, each Ant target using LTW
    needs to manually set
      <jvmarg value="${aj.addOpensKey}"/>
      <jvmarg value="${aj.addOpensValue}"/>
    for each '<java>' task. It was quite tedious to find all(?) of them.

TODO: In the AspectJ 1.9.7 release notes we need to document that this
parameter is now needed for LTW.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix AtAjLTWTests::testLTWDumpProxy for Java 16
Alexander Kriegisch [Tue, 23 Mar 2021 05:55:48 +0000 (12:55 +0700)]
Fix AtAjLTWTests::testLTWDumpProxy for Java 16

Before Java 16, JDK proxies were given a virtual package name of
'com.sun.proxy'. Now the packages are numbered 'jdk.proxy[n]', i.e.
'jdk.proxy1', 'jdk.proxy2' etc. This makes the package-name-derived path
name here less predictable. In our simple runtime scenario, we can be
pretty sure than the counter starts at 1 because it is the first and
only proxy we create.

TODO: A better solution would be a recursive filtered search via
Files.walk, ideally added as a recursive search option for
CountingFilenameFilter.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoDeactivate test run in 'run-all-unit-tests' module by default
Alexander Kriegisch [Mon, 22 Mar 2021 19:22:08 +0000 (02:22 +0700)]
Deactivate test run in 'run-all-unit-tests' module by default

There is a new Maven profile 'repeat-all-unit-tests', and the name
already implies what a comment in the Maven module explains like this:
ATTENTION: This profile is inactive by default, because when active and
running a full reactor build, it makes almost all tests run 2x, doubling
the build time without any added value. This Maven module only exists
for convenience: As a developer, your IDE can detect and run
'RunTheseBeforeYouCommitTests'. That way, you do not have to use Maven
and get the test results reported within the IDE's JUnit user interface.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRevert "Remove module 'run-all-junit-tests' from root POM -> speed up the build"
Alexander Kriegisch [Mon, 22 Mar 2021 18:25:22 +0000 (01:25 +0700)]
Revert "Remove module 'run-all-junit-tests' from root POM -> speed up the build"

This reverts commit a1867b05ba6443d32abc4049c26b92fc226d6f78.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd link to JDK-8263924 bug ticket to POMs using maven-assembly-plugin
Alexander Kriegisch [Mon, 22 Mar 2021 07:41:58 +0000 (14:41 +0700)]
Add link to JDK-8263924 bug ticket to POMs using maven-assembly-plugin

This is a follow-up on commit @0b182d60. I have just received
confirmation from Oracle that my issue was accepted:

https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8263924
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd Java 16 Linux matcher variant to HtmlDecorator
Alexander Kriegisch [Sun, 21 Mar 2021 14:45:34 +0000 (21:45 +0700)]
Add Java 16 Linux matcher variant to HtmlDecorator

The Java 16 Javadoc generator has changed the HTML structure once again
even compared to Java 15. I adjusted the matching in HtmlDecorator and
also fixed CoverageTestCase. Most methods there I just made to work
quickly, but method 'testInnerAspect()' I actually refactored. Some
other methods could (probably should) be restructured in a similar
fashion, but for now I just wanted to understand what the test does and
see how much work it would be to refactor it. But finally, I just want
to get the GitHub CI build running on Java 16.

TODO: I did not check if the decorated HTML actually looks OK and am
unsure if the tests cover that sufficiently, I never reviewed the tests.
It would also be better to do regex matches instead of looking for
variants of fixed strings or maybe even to operate on a DOM. But I am
not in a mood to refactor that tonight.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd diagnostic output to HtmlDecorator if AJ-Doc generation fails
Alexander Kriegisch [Sun, 21 Mar 2021 13:58:20 +0000 (20:58 +0700)]
Add diagnostic output to HtmlDecorator if AJ-Doc generation fails

HtmlDecorator.decorateHTMLFile is where after Java version upgrades
(i.e. also new Javadoc generator version) usually tests fail for the
first time during builds because strings no longer match as expected.

There now is this log message on stdOut: "Something unexpected went
wrong in HtmlDecorator. Here is the full file causing the problem:"
After that, a full HTML page is logged. I hope this helps me identify
the new error on GitHub Linux Java 16, because the same test works on
Windows and I have no idea how to remote-debug a GitHub CI build.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMake BCEL classpath utility recognise Java 16-19, fixing many tests
Alexander Kriegisch [Sun, 21 Mar 2021 13:08:15 +0000 (20:08 +0700)]
Make BCEL classpath utility recognise Java 16-19, fixing many tests

This is a follow-up commit on @07af5d41:
Inside org.aspectj.apache.bcel.util.ClassPath.getClassPath(), some JVM
version matching occurs which previously did not include Java 16 (I also
added 17-19 to the regex matcher). This fixes test errors like:

java.lang.ClassCastException:
  class org.aspectj.weaver.MissingResolvedTypeWithKnownSignature
  cannot be cast to class
  org.aspectj.weaver.ReferenceType
  (org.aspectj.weaver.MissingResolvedTypeWithKnownSignature and
  org.aspectj.weaver.ReferenceType are in unnamed module
  of loader 'app')

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix AjcTaskTest regarding Ajc output
Alexander Kriegisch [Sun, 21 Mar 2021 12:57:55 +0000 (19:57 +0700)]
Fix AjcTaskTest regarding Ajc output

Another follow-up commit on @31b2d60b

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix OutjarTest regarding Ajc output (usage messages etc.)
Alexander Kriegisch [Sun, 21 Mar 2021 12:21:15 +0000 (19:21 +0700)]
Fix OutjarTest regarding Ajc output (usage messages etc.)

After Ajc usage text output is filtered into its own category
IMessage.USAGE now - see commit @31b2d60b - some tests in module
'org.aspectj.ajdt.core' were failing. I fixed and also improved them a
bit in @e4a2a5a5, but forgot to commit this one.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoSet explicit en_US locale for build timestamps in Build Helper Maven
Alexander Kriegisch [Sun, 21 Mar 2021 10:42:34 +0000 (17:42 +0700)]
Set explicit en_US locale for build timestamps in Build Helper Maven

There were warnings that builds were dependent on the system local
(de_DE in my case). In patterns like "EEEE MMM d, yyyy", parts like day
of week or month names would change otherwise.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix some deprecated Java and JUnit warnings by using newer API calls
Alexander Kriegisch [Sun, 21 Mar 2021 10:34:09 +0000 (17:34 +0700)]
Fix some deprecated Java and JUnit warnings by using newer API calls

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix + improve some tests regarding Ajc output (usage messages etc.)
Alexander Kriegisch [Sun, 21 Mar 2021 10:27:49 +0000 (17:27 +0700)]
Fix + improve some tests regarding Ajc output (usage messages etc.)

After Ajc usage text output is filtered into its own category
IMessage.USAGE now - see commit @31b2d60b - some tests in module
'org.aspectj.ajdt.core' were failing. I fixed and also improved them a
bit.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoJava 16 fix: ParseUtil.fileToEncodedURL(File) causes IllegalAccessError
Alexander Kriegisch [Sun, 21 Mar 2021 10:12:48 +0000 (17:12 +0700)]
Java 16 fix: ParseUtil.fileToEncodedURL(File) causes IllegalAccessError

Migrate 'ParseUtil.fileToEncodedURL(f)' to 'f.toURI().toURL()'.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUpgrade GitHub CI workflow from Java (8, 11, 15) to (8, 11, 16)
Alexander Kriegisch [Sat, 20 Mar 2021 19:19:57 +0000 (02:19 +0700)]
Upgrade GitHub CI workflow from Java (8, 11, 15) to (8, 11, 16)

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd Java 16 test suite for AspectJ 1.9.7 + test refactorings
Alexander Kriegisch [Sat, 20 Mar 2021 19:16:20 +0000 (02:16 +0700)]
Add Java 16 test suite for AspectJ 1.9.7 + test refactorings

- Test all features which were preview in 14+15 and are now final in 16,
  compiling them with language level 16.
- For Java 15 we only have sanity tests (and of course the Java <14
  tests), compiling Java 16 features to target 15 does not seem to work.
- Test remaining Java 16 preview feature (sealed classes).
- Instead of overriding runTest(String) in several base classes like
  XMLBasedAjcTestCaseForJava*Only or XMLBasedAjcTestCaseForJava*OrLater,
  we now override setUp() from JUnit's TestCase base class. This will
  run before runTest(String) and make the tests fail much faster, if a
  user tries to run them on the wrong VM.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove module 'run-all-junit-tests' from root POM -> speed up the build
Alexander Kriegisch [Sat, 20 Mar 2021 11:37:22 +0000 (18:37 +0700)]
Remove module 'run-all-junit-tests' from root POM -> speed up the build

This module must be a relic from a test runner module once existing
during the Ant build era, but transferred and kept alive in the Maven
build. Actually, it almost doubles build time by running virtually all
tests in all modules again when doing 'mvn test' from the project root.

For now I only removed the module from the root POM, leaving behind
comments there, in the module POM and in the now @Deprecated class
RunTheseBeforeYouCommitTests.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix MultiProjectIncrementalTests.testInvalidAspectpath_pr121395
Alexander Kriegisch [Sat, 20 Mar 2021 09:11:12 +0000 (16:11 +0700)]
Fix MultiProjectIncrementalTests.testInvalidAspectpath_pr121395

It failed with "RuntimeException: I never heard about what kind of build
it was!!" on my (@kriegaex) Windows machine, mostly because in case of a
failing full build the corresponding status is never set.

TODO: Ensure that 'MyStateListener.informedAboutKindOfBuild' is set for
failed builds, too.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix tests not finding project base directory 'org.aspectj'
Alexander Kriegisch [Sat, 20 Mar 2021 07:45:51 +0000 (14:45 +0700)]
Fix tests not finding project base directory 'org.aspectj'

Several LTW tests using class TestServer failed on my machine because
there was a hard-coded project base directory name 'org.aspectj' in the
class. This class has several other problems, but my quick fix for now -
I did not want to rename my project base directory - was to match on a
regex '(?i)(org[.])?aspectj' now. That also works for my root directory
'AspectJ'.

I also moved the code determining the project dir into a protected
(hence testable) method and added a sanity test case checking if the
directory can be determined. If not, the test will fail with a rather
lengthy warning to developers about the need to have a matching project
root folder.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix tests expecting usage texts as failure outputs
Alexander Kriegisch [Sat, 20 Mar 2021 07:37:13 +0000 (14:37 +0700)]
Fix tests expecting usage texts as failure outputs

This is a follow-up on commit @31b2d60b. Some tests were actually
expecting usage texts as failure outputs. Because that was fixed, the
tests no longer see those failures, hence they should no longer expect
them.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix test relying on JVM warning being stripped from output
Alexander Kriegisch [Sat, 20 Mar 2021 07:25:39 +0000 (14:25 +0700)]
Fix test relying on JVM warning being stripped from output

The line in which warnings like "Archived non-system classes are
disabled because the java.system.class.loader property is specified"
appears can start with e.g."OpenJDK 64-Bit Server VM" or "Java
HotSpot(TM) 64-Bit Server VM". Therefore, an exact match on the former
worked on Linux, but not on Windows, or maybe the difference is
generally between Oracle and OpenJDK. anyway, I use Oracle on Windows
and my build failed. Now it is fixed because I made the match more
generic using a regex.

I also removed a now obsolete check for the occurrence of the stripped
line in test "JDK14 LTW with XML".

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoImprove usage text, error and warning output in batch compiler
Alexander Kriegisch [Sat, 20 Mar 2021 03:24:57 +0000 (10:24 +0700)]
Improve usage text, error and warning output in batch compiler

- Usage texts are now printed to stdOut, no longer stdErr.
- 'java ...Main -?' no longer prints usage text twice (once to stdOut
  and then again to stdErr).
- AjdtCommand.inferKind: Usage texts are no longer mis-identified as
  warnings or errors just because they contain substrings "warning" or
  "error". Matching is now more precise, looking for "[warning]" and
  "[error]". But in that case the method would not be called anyway
  because errors and warnings are identified in other ways already. As a
  fall-back, the categories IMessage.ERROR and IMessage.WARNING still
  exist in the method.
- In case of compile errors, no usage message is printed anymore,
  because previously the user had to scroll up a lot in order to see the
  actual messages. This is also in line with ECJ. The same is true for
  warnings, but it was like this in Ajc already.
- AjdtCommand.inferKind: There is a new category IMessage.USAGE
  especially for AspectJ usage texts, which will be identified by string
  matching and then correctly handled (i.e. printed to stdOut, not
  stdErr).
- Usage text printing is no longer done in AspectJ but in the AspectJ
  "shadows" fork of JDT. This helps to get rid of some now obsolete code
  here.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoImprove batch compiler usage messages
Alexander Kriegisch [Sat, 20 Mar 2021 03:07:12 +0000 (10:07 +0700)]
Improve batch compiler usage messages

- Use spaces instead of tabs for indentation.
- Document parameters bound in Eclipse JDT, e.g. {0} is not the compiler
  name there but the system's path separator ';' or ':'. So if we want
  to display the compiler name, we need {1}.
- For both normal usage and '-X' usage, compiler name + version are
  printed now.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix invalid manifests leading to "Could not find or load main class"
Alexander Kriegisch [Fri, 19 Mar 2021 15:00:09 +0000 (22:00 +0700)]
Fix invalid manifests leading to "Could not find or load main class"

WARNING: Please avoid line breaks in manifest values! They are passed on
like this: Assembly Plugin -> Plexus Archiver -> JRE java.util.jar
.Manifest.write(OutputStream).

The JRE Manifest class inserts hard line breaks always after 72
characters, no matter if those 72 characters contain line feeds, tabs or
spaces. Hence, it can happen that unwanted blank lines end up in the
middle of a manifest section, making the manifest invalid. Calls like
e.g. 'java -cp aspectjtools.jar org.aspectj.tools.ajc.Main' can then
fail with the absolutely unexpected error 'Could not find or load main
class org.aspectj.tools.ajc.Main'.

In IntelliJ IDEA you can deactivate wrapping text inside XML tags like
this: "File | Settings | Editor | Code Style | XML | Wrap text -> off"

The problem occurs in Maven Assembly in versions higher than 2.2. More
exactly, it occurs in Plexus Archiver after in more recent versions it
switched to using the JRE Manifest class.

TODO 1: Either add a test step in phase 'verify' doing something like
this:

new Manifest(new FileInputStream("MANIFEST.MF"));

This would lead to "IOException: invalid header field (line xy)" in case
of an invalid manifest file.

TODO 2: Or file a JRE bug at Oracle or OpenJDK, wherever appropriate.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoStrip down compiler messages to AspectJ-specific ones
Alexander Kriegisch [Fri, 19 Mar 2021 06:37:54 +0000 (13:37 +0700)]
Strip down compiler messages to AspectJ-specific ones

Delete all properties from messages_aspectj.properties which were just
copied from Eclipse and basically the same. This not only gets rid of
duplicates but also eliminates differences found between upstream and
AspectJ strings which were just cause by errors or oversights during
manual upgrade.

TODO:
  - Find a way to print the '-X' options as info instead of yielding
    'abort', making it seem as if compilation failed and print the usage
    message to stdErr instead of stdOut.
  - Eclipse also has misc.usage.warn, not just misc.usage, i.e. usage
    info specifically for warning options. Make sure that AspectJ uses
    it consistently.
  - Find a way to merge AspectJ-specific options into the standard
    Eclipse usage text instead of completely replacing it, further
    reducing the need to merge and copy upstream content.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoBegin migration to 'aspectj' locale for compiler messages
Alexander Kriegisch [Fri, 19 Mar 2021 04:08:35 +0000 (11:08 +0700)]
Begin migration to 'aspectj' locale for compiler messages

Renamed messages.properties to messages_aspectj.properties and moved to
a path identical with the Eclipse original resource file. Therefore, it
is now just treated as a localised version of it.

The new jdtcore-for-aspectj.jar already contains logic to use the new
locale. Hence, BuildArgParser no longer needs the static block to
initialise its own resource bundle, Eclipse JDT will automatically pick
it up.

The version string was also updated to the new Eclipse merge commit
hash + date + "Java16".

TODO: Strip down properties file in order to only contain delta to
Eclipse.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd Java 15 / AspectJ 1.9.7 test suite 36/head 38/head
Alexander Kriegisch [Wed, 17 Mar 2021 16:38:08 +0000 (23:38 +0700)]
Add Java 15 / AspectJ 1.9.7 test suite

Also fix some minor details in Java 14 suite

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd 'yield' usage to Java 12/13 switch expressions tests
Alexander Kriegisch [Wed, 17 Mar 2021 09:42:32 +0000 (16:42 +0700)]
Add 'yield' usage to Java 12/13 switch expressions tests

So far this was a slight oversight, no test using 'yield' existed in the
'features193' test suite. Better late than never.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoDo not run tests using Java 14 preview features on this Java 15 compiler
Alexander Kriegisch [Wed, 17 Mar 2021 07:55:51 +0000 (14:55 +0700)]
Do not run tests using Java 14 preview features on this Java 15 compiler

These tests need a Java 14 level AspectJ compiler, because they use
version-specific preview features. This compiler has been upgraded
to a Java 15 compliant JDT Core already, i.e. it does not support
preview features of a previous version anymore.

An error message similar to the above explanation will appear when
trying to run any XMLBasedAjcTestCaseForJava14Only subclass, such as
Ajc196PreviewFeaturesTests (currently the only one).

When running AllTestsAspectJ196, Ajc196PreviewFeaturesTests will not be
added to the test suite anymore.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRestructure Java 14 / AJ 1.9.6 tests
Alexander Kriegisch [Wed, 17 Mar 2021 06:51:59 +0000 (13:51 +0700)]
Restructure Java 14 / AJ 1.9.6 tests

- Java 14 feature sample classes moved from 'bugs' to 'features'
- One test case using a Java 14 preview feature was moved to the
  Java 14-only tests

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUse static import for HtmlDecorator.TYPE_NAME_LABEL
Alexander Kriegisch [Sun, 14 Mar 2021 16:41:11 +0000 (23:41 +0700)]
Use static import for HtmlDecorator.TYPE_NAME_LABEL

Mini refactoring, making the code a bit less verbose

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd Java 15 class vile version to BCEL constants, adjust test tools etc.
Alexander Kriegisch [Sat, 13 Mar 2021 06:54:45 +0000 (13:54 +0700)]
Add Java 15 class vile version to BCEL constants, adjust test tools etc.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUpgrade to ASM 9.1, delete obsolete ASM binaries
Alexander Kriegisch [Sat, 13 Mar 2021 03:42:05 +0000 (10:42 +0700)]
Upgrade to ASM 9.1, delete obsolete ASM binaries

Keep only ASM 2.0 binary because it is still used in UnweavableTest
which uses an old ASM API, e.g. with a ClassWriter constructor which no
longer exists.

Also add JarJar 1.3 library because it is needed by an Ant task in
lib/asm/build.xml.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUpgrade JDT Core to @3caefb80 (4.20 snapshot, date 2021-03-09)
Alexander Kriegisch [Thu, 11 Mar 2021 00:58:41 +0000 (07:58 +0700)]
Upgrade JDT Core to @3caefb80 (4.20 snapshot, date 2021-03-09)

Add methods isRecord() and getRecordComponents() to class
CompactTypeStructureRepresentation

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMerge pull request #35 from kriegaex/make-aj196-tests-run-on-java15
Andy Clement [Mon, 15 Mar 2021 15:48:05 +0000 (08:48 -0700)]
Merge pull request #35 from kriegaex/make-aj196-tests-run-on-java15

Fix all tests for Java 15 runtime

3 years agoSimplify execution of PureJavaTests and KnownLimitationsTests 35/head
Alexander Kriegisch [Sun, 14 Mar 2021 15:09:02 +0000 (22:09 +0700)]
Simplify execution of PureJavaTests and KnownLimitationsTests

Getting rid of XML includes and two superfluous files, merging them with
their respective including counterparts. As far as I can see, the two
test suites are not part of the automatic build process, but can be
started manually as easily as any other test (suite) now.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix outdated ajcTestSuite.dtd and lots of XML problems
Alexander Kriegisch [Sun, 14 Mar 2021 13:56:15 +0000 (20:56 +0700)]
Fix outdated ajcTestSuite.dtd and lots of XML problems

Now there should be no more inspection warnings when working with XML
test definitions. Only the strangely looking XML files used by
PureJavaTests and KnownLimitationsTests are left to be analysed and
fixed.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix OutputSpec corner case (test empty output) from @052bd66f
Alexander Kriegisch [Sun, 14 Mar 2021 07:44:14 +0000 (14:44 +0700)]
Fix OutputSpec corner case (test empty output) from @052bd66f

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMake sure Java 14-only tests using preview are not executed on JVM 15+
Alexander Kriegisch [Sun, 14 Mar 2021 06:58:37 +0000 (13:58 +0700)]
Make sure Java 14-only tests using preview are not executed on JVM 15+

Some Ajc196 tests are using preview features (see .../ajc196.xml), i.e.
they will fail on Java 15+ because code compiled with '--enable-preview'
can only run on the same JVM version, not on a more recent one. Hence,
the preview-using tests are now being excluded in order to make the
build run on Java 15, even though no Java 15 features are present in the
current 1.9.7 snapshot.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAllow year 2021 in Checklics.License
Alexander Kriegisch [Sun, 14 Mar 2021 06:51:16 +0000 (13:51 +0700)]
Allow year 2021 in Checklics.License

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMove documentation generation into Maven profile 'create-docs'
Alexander Kriegisch [Sun, 14 Mar 2021 06:16:21 +0000 (13:16 +0700)]
Move documentation generation into Maven profile 'create-docs'

The profile is active by default, but can be deactivated via
'-P !create-docs' on the Maven command line. This helps to speed up
'mvn install', maybe in combination with skipping tests, if we just want
to create a new set of AspectJ binaries.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoImprove text matching in OutputSpec, fixing some failing Windows tests
Alexander Kriegisch [Sun, 14 Mar 2021 03:19:21 +0000 (10:19 +0700)]
Improve text matching in OutputSpec, fixing some failing Windows tests

Some Java 14 text block tests failed on Windows because a
StringTokenizer was used to split by LF, but the Windows line
separator is CR+LF. Because a multi-line string ending with CR+LF is
printed via 'System.out.println' in the test code, another CR+LF is
added to the output, resulting in trailing CR+LF+CR+LF. Hence, between
the two LFs, the tokenizer actually found an additional line consisting
of CR (only on Windows, of course). Despite each line token actually
containing a trailing CR token, that did not matter much because
'String.trim' was used everywhere before comparing values.

Anyway, the improved OutputSpec uses text.trim().split("\\s*\n\\s*"),
which takes care of leading/trailing whitespace both around the whole
output and for each separate line.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix 'ajdoc' tests for Java 15 build
Alexander Kriegisch [Sat, 13 Mar 2021 17:09:02 +0000 (00:09 +0700)]
Fix 'ajdoc' tests for Java 15 build

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMake MoveInstructionsWeaveTestCase.testFancyHello pass when run twice
Alexander Kriegisch [Sat, 13 Mar 2021 08:07:07 +0000 (15:07 +0700)]
Make MoveInstructionsWeaveTestCase.testFancyHello pass when run twice

Reset counter, just in case this test runs multiple times in one JVM.
This can happen e.g. due to "run all tests" in IntelliJ IDEA, which
directly runs this test class and als WeaverModuleTests, both of which
implement junit.framework.TestCase. In that case, during the second run
the counter would start at a higher base count, making the 2nd test run
fail.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMake BCEL classpath utility recognise Java 15, fixing many tests
Alexander Kriegisch [Sat, 13 Mar 2021 07:16:30 +0000 (14:16 +0700)]
Make BCEL classpath utility recognise Java 15, fixing many tests

Inside org.aspectj.apache.bcel.util.ClassPath.getClassPath(), some JVM
version matching occurs which previously did not include Java 15.
Technically, AspectJ 1.9.6 does not support Java 15, but on GitHub
Actions there is a build job running on a JVM 15. This change should at
least make the weaver tests pass, making that test job more meaningful.

This fixes test errors like

java.lang.ClassCastException:
  class org.aspectj.weaver.MissingResolvedTypeWithKnownSignature
  cannot be cast to class
  org.aspectj.weaver.ReferenceType
  (org.aspectj.weaver.MissingResolvedTypeWithKnownSignature and
  org.aspectj.weaver.ReferenceType are in unnamed module
  of loader 'app')

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMerge pull request #34 from kriegaex/test-fixes-kriegaex-20210312
Andy Clement [Fri, 12 Mar 2021 18:22:14 +0000 (10:22 -0800)]
Merge pull request #34 from kriegaex/test-fixes-kriegaex-20210312

Test fixes kriegaex 20210312

3 years agoFix: WeaveSpec no longer ignores the '-Xlintfile' parameter 34/head
Alexander Kriegisch [Fri, 12 Mar 2021 03:16:36 +0000 (10:16 +0700)]
Fix: WeaveSpec no longer ignores the '-Xlintfile' parameter

Some tests in ajc150.xml and ajc190_from150.xml contain '<weave ...>'
build steps with 'xlintfile="..."' parameters. Those parameters were
passed through to Java and aspect code building steps, but not to the
final weaving step, sometimes leading to spurious "type not exposed to
weaver" warnings which occurred for some local and CI builds, but not
always. Very strange indeed. Anyway, by making method
WeaveSpec.buildWeaveArgs() pass on this parameter, the tests seem to run
reliably now.

TODO: Why does Ajc report that warning if the application JAR is on the
inpath and the aspect JAR is on the aspectpath? Is it because a marker
annotation is defined within the aspect JAR? But actually, that should
not matter, especially not work once and fail at other times. I guess
there is a class loading order problem or similar involved.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd missing '-options' values -1.5, -1.9 to ajc{150,190_from150}.xml
Alexander Kriegisch [Fri, 12 Mar 2021 03:05:07 +0000 (10:05 +0700)]
Add missing '-options' values -1.5, -1.9 to ajc{150,190_from150}.xml

When trying to find out why ajc150.xml and ajc190_from150.xml look
almost identical, I found out that only in many cases the 190 version
has '-option="1.9"' set where in the 150 version it was '-option="1.9"'.

Unfortunately, in both files source/target versions are not set at all
in many places, which looks unintentional. I tried to search & replace
all relevant '<compile ...>' commands for 190 first, then ported back to
150. Only cases in which clearly compiling to an older version like 1.3
or 1.4 is necessary were left like before.

I am expecting missing or false Java target versions in many other of
the legacy XML test suites. For now, I am just committing these two.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMerge pull request #33 from kriegaex/test-fixes-kriegaex-20210311
Andy Clement [Thu, 11 Mar 2021 17:04:51 +0000 (09:04 -0800)]
Merge pull request #33 from kriegaex/test-fixes-kriegaex-20210311

Test fixes kriegaex 20210311

3 years agoSet maven-assembly-plugin version 3.1.1 explicitly for each POM module 33/head
Alexander Kriegisch [Thu, 11 Mar 2021 16:13:06 +0000 (23:13 +0700)]
Set maven-assembly-plugin version 3.1.1 explicitly for each POM module

Background: There are CI tests failing because the version is not taken
from the parent POM, even if set in the 'pluginManagement' section.
Instead, it is resolved via the Maven Super POM, e.g. 2.2-beta-5, see:
https://maven.apache.org/ref/3.6.3/maven-model-builder/super-pom.html
That assembly plugin version in turn requires plexus-archiver
1.0-alpha-12. The latter cannot be downloaded from Maven Central,
leading to the problems seen during builds.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoReplace path separators ';' by ',' in XML test specs
Alexander Kriegisch [Thu, 11 Mar 2021 12:12:58 +0000 (19:12 +0700)]
Replace path separators ';' by ',' in XML test specs

The goal is for them to be canonicalised to platform standard during
test execution. I am not sure if that will fix any tests, but at least I
hope it will not break any.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUnify classpath handling in CompileSpec & RunSpec
Alexander Kriegisch [Thu, 11 Mar 2021 11:32:56 +0000 (18:32 +0700)]
Unify classpath handling in CompileSpec & RunSpec

Replace directory separator '/' and surrogate path separator ',' by
platform-specific separators File.separatorChar and
File.pathSeparatorChar, respectively. Also make sure that replacement
occurs during write access, not read access. This was handled
differently in both sibling classes.

I am not sure if that helps to fix any Linux CI tests, but it is worth a
try.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix MultiProjectIncrementalTests.testAspectPath_pr265693, 2nd try
Alexander Kriegisch [Thu, 11 Mar 2021 10:57:58 +0000 (17:57 +0700)]
Fix MultiProjectIncrementalTests.testAspectPath_pr265693, 2nd try

Do not assume a certain element order for tree nodes if there can be
more than one.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoTry to fix MultiProjectIncrementalTests.testAspectPath_pr265693
Alexander Kriegisch [Thu, 11 Mar 2021 08:57:23 +0000 (15:57 +0700)]
Try to fix MultiProjectIncrementalTests.testAspectPath_pr265693

Check if path vs. package name discrepancy makes test fail on Linux. On
Windows it passes. So let's find out if file p/Asp.java vs. pkg.Asp
causes the problems.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAjcTestCase cosmetics: surround command in failure report by quotes
Alexander Kriegisch [Thu, 11 Mar 2021 01:16:28 +0000 (08:16 +0700)]
AjcTestCase cosmetics: surround command in failure report by quotes

This is the same for successful tests in class CompilationResult.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix resource leak in FileUtil
Alexander Kriegisch [Thu, 11 Mar 2021 06:23:29 +0000 (13:23 +0700)]
Fix resource leak in FileUtil

This made ModuleTests.testBuildModuleAndApplyAspectsFromAspectPath fail
because a file delete job for a module JAR failed after a previous
compile job had called FileUtil.isZipFile(File) in which the opened zip
file was never closed. A try with resources fixes that.

Maybe the corresponding test worked on Linux before, I did not try. I
just know that Linux is more forgiving about deleting open files while
on Windows they are being locked, which makes Windows the better system
to search for open file leaks.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAjBuildManager: use try with resources in 2 places
Alexander Kriegisch [Thu, 11 Mar 2021 06:16:46 +0000 (13:16 +0700)]
AjBuildManager: use try with resources in 2 places

I was debugging something in ModuleTests, trying to find out if there
are resource leaks. They were not in this class but in FileUtil - see
next commit. However, the little refactoring here does not hurt either.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix path separators in ajc190.xml, make tests run on Windows
Alexander Kriegisch [Thu, 11 Mar 2021 06:13:11 +0000 (13:13 +0700)]
Fix path separators in ajc190.xml, make tests run on Windows

Replace ':' by ";" which will be replaced to the platform
separator automatically. A fixed value of ':' does not work on Windows.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMerge pull request #32 from kriegaex/installer-windows_10-windows_server
Andy Clement [Fri, 5 Mar 2021 20:59:48 +0000 (12:59 -0800)]
Merge pull request #32 from kriegaex/installer-windows_10-windows_server

Support Windows 10 and Windows Server 2016/2019 in installer

3 years agoSupport Windows 10 and Windows Server 2016/2019 in installer 32/head
Alexander Kriegisch [Thu, 4 Mar 2021 09:43:15 +0000 (16:43 +0700)]
Support Windows 10 and Windows Server 2016/2019 in installer

Those versions were not detected until now, which lead to bogus Windows
batch files forwarding only 9 Ajc parameters to the Java process via
"%1 %2 %3 %4 %5 %6 %7 %8 %9" instead of "%*".

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMerge pull request #29 from ebourg/patch-1
Andy Clement [Fri, 8 Jan 2021 00:16:27 +0000 (16:16 -0800)]
Merge pull request #29 from ebourg/patch-1

Update the URL of BCEL

3 years agoUpdate the URL of BCEL 29/head
Emmanuel Bourg [Thu, 7 Jan 2021 14:03:26 +0000 (15:03 +0100)]
Update the URL of BCEL

3 years agoMerge pull request #23 from larsgrefer/feature/java15
Andy Clement [Wed, 2 Dec 2020 23:31:40 +0000 (15:31 -0800)]
Merge pull request #23 from larsgrefer/feature/java15

Update GitHub Actions from Java 14 to 15

3 years agoMerge pull request #27 from capgen628/patch-1
Andy Clement [Wed, 2 Dec 2020 23:31:15 +0000 (15:31 -0800)]
Merge pull request #27 from capgen628/patch-1

Remove call to System.out

3 years agoRemove call to System.out 27/head
Anuj Dodhia [Wed, 2 Dec 2020 22:27:26 +0000 (22:27 +0000)]
Remove call to System.out

4 years agoUpdate GitHub Action from Java 14 to 15 23/head
Lars Grefer [Sun, 20 Sep 2020 19:00:11 +0000 (21:00 +0200)]
Update GitHub Action from Java 14 to 15

Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
4 years agoMerge pull request #22 from jamesjer/master
Andy Clement [Wed, 16 Sep 2020 17:50:55 +0000 (10:50 -0700)]
Merge pull request #22 from jamesjer/master

Fix apostrophe in the license

4 years agoFix apostrophe in the license 22/head
Jerry James [Tue, 15 Sep 2020 22:10:30 +0000 (16:10 -0600)]
Fix apostrophe in the license

4 years agoMerge pull request #21 from jamesjer/master
Andy Clement [Mon, 14 Sep 2020 16:42:04 +0000 (09:42 -0700)]
Merge pull request #21 from jamesjer/master

Fix javadoc errors

4 years agoTypo fixes 21/head
Jerry James [Mon, 14 Sep 2020 14:29:53 +0000 (08:29 -0600)]
Typo fixes

4 years agoFix javadoc references to nonexistent fields, classes, or packages
Jerry James [Mon, 14 Sep 2020 14:28:28 +0000 (08:28 -0600)]
Fix javadoc references to nonexistent fields, classes, or packages

4 years agoFix misplaced or incorrect javadoc tags
Jerry James [Mon, 14 Sep 2020 14:27:01 +0000 (08:27 -0600)]
Fix misplaced or incorrect javadoc tags

4 years agoFix misplaced or incorrectly nested HTML tags
Jerry James [Mon, 14 Sep 2020 14:25:20 +0000 (08:25 -0600)]
Fix misplaced or incorrectly nested HTML tags

4 years agoFix incorrect HTML entities in javadoc comments
Jerry James [Mon, 14 Sep 2020 14:23:26 +0000 (08:23 -0600)]
Fix incorrect HTML entities in javadoc comments

4 years agoMerge pull request #19 from jamesjer/master
Andy Clement [Wed, 9 Sep 2020 21:38:15 +0000 (14:38 -0700)]
Merge pull request #19 from jamesjer/master

Give docbook IDs unique names

4 years agoGive docbook IDs unique names 19/head
Jerry James [Wed, 9 Sep 2020 19:50:13 +0000 (13:50 -0600)]
Give docbook IDs unique names

4 years agoRevert to 1.9.7.BUILD-SNAPSHOT
Andy Clement [Fri, 21 Aug 2020 19:40:34 +0000 (12:40 -0700)]
Revert to 1.9.7.BUILD-SNAPSHOT

4 years ago1.9.7 milestone 1 published
Andy Clement [Fri, 21 Aug 2020 19:16:30 +0000 (12:16 -0700)]
1.9.7 milestone 1 published

4 years agoMerge pull request #18 from larsgrefer/feature/github-actions V1_9_7M1
Andy Clement [Mon, 17 Aug 2020 04:41:46 +0000 (21:41 -0700)]
Merge pull request #18 from larsgrefer/feature/github-actions

Split tests in a separate step on GitHub Actions

4 years agoSplit tests in a separate step on GitHub Actions 18/head
Lars Grefer [Mon, 17 Aug 2020 01:17:14 +0000 (03:17 +0200)]
Split tests in a separate step on GitHub Actions

Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
4 years agodebug for test failure under github action
Andy Clement [Mon, 17 Aug 2020 00:27:48 +0000 (17:27 -0700)]
debug for test failure under github action

4 years agoUpdate to JUnit Jupiter 5.6.2
Lars Grefer [Sun, 16 Aug 2020 23:48:58 +0000 (01:48 +0200)]
Update to JUnit Jupiter 5.6.2

The "old" JUnit-3-style tests will be executed by the vintage-engine

Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
4 years agoMerge pull request #16 from larsgrefer/cleanup/modifiers
Andy Clement [Mon, 17 Aug 2020 00:03:37 +0000 (17:03 -0700)]
Merge pull request #16 from larsgrefer/cleanup/modifiers

Cleanup unnecessary modifiers

4 years agodebug for test failure under github action
Andy Clement [Sun, 16 Aug 2020 23:43:41 +0000 (16:43 -0700)]
debug for test failure under github action

4 years agoRemove unnecessary interface modifiers 16/head
Lars Grefer [Sun, 16 Aug 2020 23:19:52 +0000 (01:19 +0200)]
Remove unnecessary interface modifiers

Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
4 years agoRemove unnecessary enum modifiers
Lars Grefer [Sun, 16 Aug 2020 23:08:18 +0000 (01:08 +0200)]
Remove unnecessary enum modifiers

Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
4 years agodebug for test failure under github action
Andy Clement [Sun, 16 Aug 2020 20:45:32 +0000 (13:45 -0700)]
debug for test failure under github action

4 years agopolish
Andy Clement [Sun, 16 Aug 2020 18:31:18 +0000 (11:31 -0700)]
polish

4 years agoMerge pull request #10 from larsgrefer/cleanup/pom
Andy Clement [Sun, 16 Aug 2020 18:14:43 +0000 (11:14 -0700)]
Merge pull request #10 from larsgrefer/cleanup/pom

Cleanup the Maven pom.xml files

4 years agoReduce test output for incremental comp tests
Andy Clement [Sun, 16 Aug 2020 06:08:40 +0000 (23:08 -0700)]
Reduce test output for incremental comp tests

4 years agoMerge pull request #13 from larsgrefer/feature/collection-performance
Andy Clement [Sun, 16 Aug 2020 05:39:09 +0000 (22:39 -0700)]
Merge pull request #13 from larsgrefer/feature/collection-performance

Improve performance and readability of collection handling

4 years agoMerge branch 'master' into feature/collection-performance 13/head
Andy Clement [Sun, 16 Aug 2020 05:38:51 +0000 (22:38 -0700)]
Merge branch 'master' into feature/collection-performance

4 years agoMerge pull request #15 from larsgrefer/update/maven/3.6.3
Andy Clement [Sun, 16 Aug 2020 05:30:45 +0000 (22:30 -0700)]
Merge pull request #15 from larsgrefer/update/maven/3.6.3

Update to Maven 3.6.3