riy / degraph

Test and Visualize and Manage Dependencies of classes and packages in JVM Byte Code (think Scala and Java)
http://riy.github.io/degraph/
Other
311 stars 36 forks source link

Testfailures for Java 8 annotations #91

Open schauder opened 6 years ago

schauder commented 6 years ago

Given the following class:

public class ClassWithTypeAnnotations // 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.