Exception checking error for anonymous class instance expressions

Issue #10 resolved
Jesper Öqvist created an issue

When compiling Junit 4.11 with JastAddJ 7.1.1-44-g4420934 Java SE 7 I get the following incorrect error message:

junit-r4.11/src/main/java/org/junit/experimental/max/MaxCore.java:116:
  Semantic Error: the exception org.junit.runners.model.InitializationError is not thrown in the body of the try statement

Here is a small test that reproduces the same kind of error:

import java.io.IOException;

public class Test {
        class Foo {
                Foo() throws IOException {
                        throw new IOException("oops");
                }
        }
        public void foo() {
                try {
                        new Foo() { };
                } catch (IOException e) {
                }
        }
}

Comments (4)

  1. Log in to comment