eisop / checker-framework

Pluggable type-checking for Java
https://eisop.github.io/
Other
15 stars 16 forks source link

Only clean when the annotated type mirror is type variable #787

Open Ao-senXiong opened 2 weeks ago

Ao-senXiong commented 2 weeks ago

Fixes #786

Ao-senXiong commented 2 weeks ago

Can you add the test case from the issue? Can you make that test case self-contained, so that it doesn't depend on the CF classes?

Simplified version. Also updated in the issue.

import javax.lang.model.element.TypeElement;

public class Test {
    void test(TypeElement element) {
        element.asType();
    }
}
Ao-senXiong commented 2 weeks ago

Interesting. This crash does not happen under java 17 and happens under Java 8 and Java 11.

wmdietl commented 2 weeks ago

Simplified version. Also updated in the issue.

It would be nicer if you just had a class in the test case instead of depending on TypeElement#asType. Now to understand the test, one has to look at the annotated JDK and try to see what annotations are on that method.

wmdietl commented 2 weeks ago

Simplified version. Also updated in the issue.

It would be nicer if you just had a class in the test case instead of depending on TypeElement#asType. Now to understand the test, one has to look at the annotated JDK and try to see what annotations are on that method.

You only updated the test in the issue. You should add test cases to this PR to ensure the issue is actually fixed.

Ao-senXiong commented 2 weeks ago

Simplified version. Also updated in the issue.

It would be nicer if you just had a class in the test case instead of depending on TypeElement#asType. Now to understand the test, one has to look at the annotated JDK and try to see what annotations are on that method.

You only updated the test in the issue. You should add test cases to this PR to ensure the issue is actually fixed.

Okay, I will add it as I find the minial test case without TypeElement#asType dependency.