Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] testing aspectJ master branch fails at testAddModulesJDK_gh145

Hi Uri.

This test checks a pretty exotic JMS corner case, trying to use a non-public JDK module via --add-modules, as the test name implies. It is difficult to find such modules and do something meaningful with them. References:

Actually, I know the error message you see when using ECJ to compile the demo class, but not when using Javac or AJC. The latter is used here, of course. Even though it forks ECJ, in all my previous tests it did not yield that error message. So I am wondering why you are experiencing it. Are you simply building the current main line (still historically called "master" in AspectJ, no racism implied), or did you change anything, e.g. upgrade dependencies? Which platform are you building on? Our CI tests on GitHub use Linux, the test also runs locally on my Windows box. Maybe the behaviour is different on MacOS - are you using that? It might be caused by a more recent JDK 17 version, but I would not expect anything like that. Can you check what happens if you compile UseJDKExtendedCharsets.java with the same compiler switches using Javac of the same JDK you use for compilation? I do not have much time to experiment with different JDKs, platforms etc. at the moment, so if you could pinpoint the problem further and explain why you are trying to conmpile AspectJ from scratch in the forst place, maybe I can help you more swiftly.

Last but not least, you can try to comment out https://github.com/eclipse/org.aspectj/blob/f66a4f9b083cf8cf59cce160a5109677d4ea6009/tests/src/test/java/org/aspectj/systemtest/ajc199/Bugs199Tests.java#L76-L78 and see if the rest of the build goes smoothly without org.aspectj.systemtest.ajc199.Bugs199Tests#testAddModulesJDK_gh145. But that is just a workaround, I am more interested in the problem's root cause.

Kind regards

--
Alexander Kriegisch
https://scrum-master.de 
 

Uri Simchoni schrieb am 01.07.2022 22:16 (GMT +02:00):

Hi,
 
I tried building aspectJ from source, did a './mvnw clean install' and am getting errors as below during the "tests" submodule. Can someone throw in a clue as to what is going on?
 
Thanks,
Uri.
 
[ERROR] Tests run: 3187, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 611.064 s <<< FAILURE! - in org.aspectj.tests.TestsModuleTests
[ERROR] testAddModulesJDK_gh145(org.aspectj.systemtest.ajc199.Bugs199Tests)  Time elapsed: 0.052 s  <<< FAILURE!
junit.framework.AssertionFailedError:
test "use --add-modules with non-public JDK module" failed'
test "use --add-modules with non-public JDK module" failed
Unexpected error messages:
        error invalid module name: jdk.charsets
        error at import sun.nio.cs.ext.ExtendedCharsets;
       ^^^^^^^^^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:2:0::0 The import sun.nio.cs.ext cannot be resolved
        error at static ExtendedCharsets charsets = new ExtendedCharsets();
       ^^^^^^^^^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:12:0::0 ExtendedCharsets cannot be resolved to a type
        error at static ExtendedCharsets charsets = new ExtendedCharsets();
                                       ^^^^^^^^^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:12:0::0 ExtendedCharsets cannot be resolved to a type
        error at static Charset iso2022jp = charsets.charsetForName("ISO-2022-JP");
                           ^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:13:0::0 ExtendedCharsets cannot be resolved to a type
        error at static Charset jis = charsets.charsetForName("jis");
                     ^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:14:0::0 ExtendedCharsets cannot be resolved to a type
        error at static Charset jis_encoding = charsets.charsetForName("jis_encoding");
                              ^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:15:0::0 ExtendedCharsets cannot be resolved to a type

Command: 'ajc -classpath /usr/lib/jvm/java-17-openjdk-17.0.3.0.7-2.fc36.x86_64/lib/jrt-fs.jar:/home/uri/aspectj/runtime/target/classes::../testing-client/target/classes:../runtime/target/classes:../bcel-builder/target/classes:/home/uri/.m2/repository/junit/junit/4.13.2/junit-4.13.2.jar:../bridge/target/classes:../loadtime/target/classes:../weaver/target/classes:../org.aspectj.matcher/target/classes:../bridge/target/classes:/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp -9 --add-modules jdk.charsets --add-exports jdk.charsets/sun.nio.cs.ext=ALL-UNNAMED /tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java -d /tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp
        at org.aspectj.systemtest.ajc199.Bugs199Tests.testAddModulesJDK_gh145(Bugs199Tests.java:77)

[ERROR] testAnnotationFieldBindingOptimization_356612(org.aspectj.systemtest.ajc1612.Ajc1612Tests)  Time elapsed: 0.125 s  <<< FAILURE!
junit.framework.AssertionFailedError: Exception thrown by AnnoBinding.main(String[]) :java.lang.RuntimeException: Accessing annotation via bound parameter should be faster than reflective access: bound = 53,454,826, reflective = 52,562,262
        at org.aspectj.systemtest.ajc1612.Ajc1612Tests.testAnnotationFieldBindingOptimization_356612(Ajc1612Tests.java:168)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   Ajc1612Tests.testAnnotationFieldBindingOptimization_356612:168->XMLBasedAjcTestCase.runTest:171->XMLBasedAjcTestCase.runTest:157->AjcTestCase.run:773 Exception thrown by AnnoBinding.main(String[]) :java.lang.RuntimeException: Accessing annotation via bound parameter should be faster than reflective access: bound = 53,454,826, reflective = 52,562,262
[ERROR]   Bugs199Tests.testAddModulesJDK_gh145:77->XMLBasedAjcTestCase.runTest:171->XMLBasedAjcTestCase.runTest:157->AjcTestCase.assertMessages:479 test "use --add-modules with non-public JDK module" failed'
test "use --add-modules with non-public JDK module" failed
Unexpected error messages:
        error invalid module name: jdk.charsets
        error at import sun.nio.cs.ext.ExtendedCharsets;
       ^^^^^^^^^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:2:0::0 The import sun.nio.cs.ext cannot be resolved
        error at static ExtendedCharsets charsets = new ExtendedCharsets();
       ^^^^^^^^^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:12:0::0 ExtendedCharsets cannot be resolved to a type
        error at static ExtendedCharsets charsets = new ExtendedCharsets();
                                       ^^^^^^^^^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:12:0::0 ExtendedCharsets cannot be resolved to a type
        error at static Charset iso2022jp = charsets.charsetForName("ISO-2022-JP");
                           ^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:13:0::0 ExtendedCharsets cannot be resolved to a type
        error at static Charset jis = charsets.charsetForName("jis");
                     ^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:14:0::0 ExtendedCharsets cannot be resolved to a type
        error at static Charset jis_encoding = charsets.charsetForName("jis_encoding");
                              ^^^^^
/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java:15:0::0 ExtendedCharsets cannot be resolved to a type

Command: 'ajc -classpath /usr/lib/jvm/java-17-openjdk-17.0.3.0.7-2.fc36.x86_64/lib/jrt-fs.jar:/home/uri/aspectj/runtime/target/classes::../testing-client/target/classes:../runtime/target/classes:../bcel-builder/target/classes:/home/uri/.m2/repository/junit/junit/4.13.2/junit-4.13.2.jar:../bridge/target/classes:../loadtime/target/classes:../weaver/target/classes:../org.aspectj.matcher/target/classes:../bridge/target/classes:/tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp -9 --add-modules jdk.charsets --add-exports jdk.charsets/sun.nio.cs.ext=ALL-UNNAMED /tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp/UseJDKExtendedCharsets.java -d /tmp/ajcSandbox/aspectj/ajcTest17578037576843902323.tmp

Back to the top