]> source.dussan.org Git - aspectj.git/commit
Regression test for #125: Bugs198Tests.testGitHub_125
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Wed, 23 Feb 2022 14:48:04 +0000 (21:48 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Wed, 23 Feb 2022 14:48:04 +0000 (21:48 +0700)
commit0fb70c99cfc6432ceb8357f211722ca0be2dc9c4
treef31833d8edd43ce50743ed047a3e8cc1b2763825
parent133685a5429967aca56f24ddf667e718d2f90097
Regression test for #125: Bugs198Tests.testGitHub_125

This test fails when run against AspectJ 1.9.8 with JDT Core 1.9.8.RC3.
It passes when using the latest JDT Core 1.9.9-SNAPSHOT. It sets system
property 'org.aspectj.weaver.openarchives=20', provoking open classpath
JAR file exhaustion when compiling a simple class with AJC, i.e. JARs
are being forcibly closed and automatically re-opened, as soon as they
are needed. Before the JDT Core bugfix, this test causes:

java.lang.NullPointerException
  at ....compiler.batch.ClasspathJmod.getModulesDeclaringPackage

With the bugfix incorporated into AspectJ Tools, the problem is gone.

Note: New test dependency 'io.github.bmuskalla:scoped-system-properties'
helps to test compilation with the temporarily changed global system
property in isolation, saving the environment in a thread-local
variable and later cleanly restoring the original values again. If we
ever switch to parallel test execution, this would otherwise influence
other tests and potentially cause weird side effects. Better safe than
sorry.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
tests/bugs198/github_125/Application.java [new file with mode: 0644]
tests/pom.xml
tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java
tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml