degraph icon indicating copy to clipboard operation
degraph copied to clipboard

Testfailures for Java 8 annotations

Open schauder opened this issue 7 years ago • 0 comments

Given the following class:

public class ClassWithTypeAnnotations<T> // implements clause: implements @TypeAnno1 ClassWithTypeParam<@TypeAnno2 T> {

//    Class instance creation expression:
private Object x = new @TypeAnno3 Object();

private @TypeAnno6 Object str = "Hallo";

//    Type cast:
public String myString = (@TypeAnno4 String) str;

//    Thrown exception declaration:
public void throwsAnnotatedException() throws @TypeAnno5 SQLException {
}

@Override
public @TypeAnno2 T doSomething() {
    try{
        @TypeAnno8 String local = new String();

    } catch (@TypeAnno7 RuntimeException re){

    }

    return null;
}

}

there should be dependencies from ClassWithTypeAnnotations to TypeAnno8 and TypeAnno7 but there aren't. So annotations on local variables and on catch blocks don't get found properly.

schauder avatar Jun 02 '18 13:06 schauder