aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs161/pr102733/Invoker.java
blob: bc84365cd850ee5237cefd29ede8f53ece3a4867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public class Invoker {
  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);
    }
  }
}