diff options
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); + } + } +} |