You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Invoker.java 449B

123456789101112131415
  1. public class Invoker {
  2. public static void main(String[] args) throws Throwable {
  3. try {
  4. new C();
  5. }
  6. catch (Throwable t) {
  7. boolean failedCorrectly =
  8. t.toString().contains("Unresolved compilation problem") &&
  9. t.toString().contains("The method main cannot be declared static");
  10. if (failedCorrectly)
  11. return;
  12. throw new RuntimeException("Constructor call should have failed!", t);
  13. }
  14. }
  15. }