diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-03-22 18:25:56 +0100 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-03-23 20:22:39 +0100 |
commit | dcc2fd168c30a6d4293f3ceade2e95d822e67e36 (patch) | |
tree | 5377d8b90100fdf1330ff8e8fa7da40dc9b77415 /tests/bugs161/pr102733/Invoker.java | |
parent | 85b91b2f8427b654876b4511a16e9c5e2fa0e8a3 (diff) | |
download | aspectj-dcc2fd168c30a6d4293f3ceade2e95d822e67e36.tar.gz aspectj-dcc2fd168c30a6d4293f3ceade2e95d822e67e36.zip |
Adjust 1.6.1 'testRunningBrokenCode_pr102733*' tests ECJ Java 22
Initially, these tests made sure that an old AJC bug causing
incompatibility to ECJ when using `-proceedOnError` was fixed and there
were no regressions. See also:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=102733
Now with the Java 22 changes for JEP 463 "Implicitly Declared Classes
and Instance Main Methods (Second Preview)" in JDT Core, source code is
parsed into a significantly different AST structure than before, even
when using compiler targets < 22. See also https://openjdk.org/jeps/463.
One test has been temporarily adjusted to the byte code created by
ECJ/AJC now.
TODO: Revert/adjust after this upstream bug has been
fixed:
https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2205
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/bugs161/pr102733/Invoker.java')
-rw-r--r-- | tests/bugs161/pr102733/Invoker.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/tests/bugs161/pr102733/Invoker.java b/tests/bugs161/pr102733/Invoker.java index bfa162de5..bc84365cd 100644 --- a/tests/bugs161/pr102733/Invoker.java +++ b/tests/bugs161/pr102733/Invoker.java @@ -1,14 +1,15 @@ -import java.lang.reflect.Method; - public class Invoker { - public static void main(String[] args) throws Throwable { - try { - C.main(null); - } catch (Throwable t) { - boolean failedCorrectly = t.toString().indexOf("Unresolved compilation")!=-1; - if (failedCorrectly) return; - throw t; - } - throw new RuntimeException("Call to main should have failed!"); - } -}
\ No newline at end of file + public static void main(String[] args) throws Throwable { + try { + new C(); + } + catch (Throwable t) { + boolean failedCorrectly = + t.toString().contains("Unresolved compilation problem") && + t.toString().contains("The method main cannot be declared static"); + if (failedCorrectly) + return; + throw new RuntimeException("Constructor call should have failed!", t); + } + } +} |