diff --git a/pom.xml b/pom.xml index 2ee8a78..7952fbf 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ 1.10.0-SNAPSHOT 1.10.0-SNAPSHOT - 8.0 + 9.1 java-plugin @@ -173,4 +173,4 @@ - \ No newline at end of file + diff --git a/src/main/asciidoc/scanner.adoc b/src/main/asciidoc/scanner.adoc index c6ae0b3..c1ab513 100644 --- a/src/main/asciidoc/scanner.adoc +++ b/src/main/asciidoc/scanner.adoc @@ -102,16 +102,18 @@ A Java type. Can be qualified by either `:Class`, `:Interface`, `:Enum` or `:Ann .Relations of `:Java:Type` [options="header"] |==== -| Name | Target label(s) | Cardinality | Description -| DECLARES | <<:Java:Type>> | 0..n | Declares an inner type of the type -| DECLARES | <<:Java:Method>> | 0..n | Declares a method of the type -| DECLARES | <<:Java:Field>> | 0..n | Declares a field of the type -| EXTENDS | <<:Java:Type>> | 0..1 | References a type this type extends from -| EXTENDS_GENERIC | <<:Java:Bound>> | 0..1 | References a generic type this type extends from -| IMPLEMENTS | <<:Java:Type>> | 0..1 | References an interface type this type implements -| IMPLEMENTS_GENERIC | <<:Java:Bound>> | 0..1 | References a generic interface type this type implements -| ANNOTATED_BY | <<:Java:Value:Annotation>> | 0..n | References an annotation which is present on the type -| DEPENDS_ON | <<:Java:Type>> | 0..n | References a type which this type depends on (i.e. every reference to another class) +| Name | Target label(s) | Cardinality | Description +| DECLARES_TYPE_PARAMETER | <<:Java:Bound:TypeVariable>> | 0..n | Declares a type variable +| REQUIRES_TYPE_PARAMETER | <<:Java:Bound:TypeVariable>> | 0..n | References a required type variable (in case of an inner class referencin a type parameter declared by an outer class) +| DECLARES | <<:Java:Type>> | 0..n | Declares an inner type of the type +| DECLARES | <<:Java:Method>> | 0..n | Declares a method of the type +| DECLARES | <<:Java:Field>> | 0..n | Declares a field of the type +| EXTENDS | <<:Java:Type>> | 0..1 | References a type this type extends from +| EXTENDS_GENERIC | <<:Java:Bound>> | 0..1 | References a generic type this type extends from +| IMPLEMENTS | <<:Java:Type>> | 0..1 | References an interface type this type implements +| IMPLEMENTS_GENERIC | <<:Java:Bound>> | 0..1 | References a generic interface type this type implements +| ANNOTATED_BY | <<:Java:Value:Annotation>> | 0..n | References an annotation which is present on the type +| DEPENDS_ON | <<:Java:Type>> | 0..n | References a type which this type depends on (i.e. every reference to another class) |==== *NOTE* Types which are referenced by scanned classes but have not been scanned themselves @@ -121,6 +123,13 @@ will only provide the property `fqn` and the relation `DECLARES`. using `IMPLEMENTS` relations, i.e. queries must use `(a:Type:Interface)-[:IMPLEMENTS]->(b:Type:Interface)` for pattern matching. +.Properties of `:DECLARES_TYPE_PARAMETER` +[options="header"] +|==== +| Name | Description +| index | The index of the declared type parameter, starting with 0 +|==== + .Properties of `:DEPENDS_ON` [options="header"] |==== @@ -203,22 +212,30 @@ A method declared in a Java type. .Relations of `:Java:Method` [options="header"] |==== -| Name | Target label(s) | Cardinality | Description -| HAS | <<:Java:Parameter>> | 0..n | References a parameter of the method -| THROWS | <<:Java:Type>> | 0..n | References the exception types thrown by the method -| THROWS_GENERIC | <<:Java:Bound>> | 0..n | References the generic exception types thrown by the method -| RETURNS | <<:Java:Type>> | 0..n | References the return type of the method -| RETURNS_GENERIC | <<:Java:Bound>> | 0..n | References the generic return type of the method -| ANNOTATED_BY | <<:Java:Value:Annotation>> | 0..n | References an annotation which is present on the method declaration -| READS | <<:Java:Field>> | 0..n | References a field which is read by the method -| WRITES | <<:Java:Field>> | 0..n | References a field which is written by the method -| INVOKES | <<:Java:Method>> | 0..n | References a method which is invoked by the method -| DECLARES | <<:Java:Variable>> | 0..n | References a variable method which is declared by the method +| Name | Target label(s) | Cardinality | Description +| DECLARES_TYPE_PARAMETER | <<:Java:Bound:TypeVariable>> | 0..n | Declares a type variable +| HAS | <<:Java:Parameter>> | 0..n | References a parameter of the method +| THROWS | <<:Java:Type>> | 0..n | References the exception types thrown by the method +| THROWS_GENERIC | <<:Java:Bound>> | 0..n | References the generic exception types thrown by the method +| RETURNS | <<:Java:Type>> | 0..n | References the return type of the method +| RETURNS_GENERIC | <<:Java:Bound>> | 0..n | References the generic return type of the method +| ANNOTATED_BY | <<:Java:Value:Annotation>> | 0..n | References an annotation which is present on the method declaration +| READS | <<:Java:Field>> | 0..n | References a field which is read by the method +| WRITES | <<:Java:Field>> | 0..n | References a field which is written by the method +| INVOKES | <<:Java:Method>> | 0..n | References a method which is invoked by the method +| DECLARES | <<:Java:Variable>> | 0..n | References a variable method which is declared by the method |==== *NOTE* Methods which are referenced by scanned classes but have not been scanned themselves will only provide the property `signature` +.Properties of `:DECLARES_TYPE_PARAMETER` +[options="header"] +|==== +| Name | Description +| index | The index of the declared type parameter, starting with 0 +|==== + === Nodes labeled with `:Java:Method:Constructor` Qualifies a method as constructor. @@ -359,10 +376,12 @@ Represents a type variable, e.g. .Relations of `:Java:Bound:TypeVariable` [options="header"] |==== -| Name | Target label(s) | Cardinality | Description -| HAS_BOUND | <<:Java:Bound,:Java:Bound>> | 0..1 | References the bound of the type variable. +| Name | Target label(s) | Cardinality | Description +| HAS_BOUND | <<:Java:Bound,:Java:Bound>> | 0..1 | References the bound of the type variable. |==== +NOTE: `TypeVariable` nodes are declared by <<:Java:Type,:Java:Type>> or <<:Java:Method,:Java:Method>> nodes using `:DECLARES_TYPE_PARAMETER` relations. In this case the declaring nodes have an additional label `:GenericDeclaration`. + [[:Java:Bound:ParameterizedType]] === Nodes labeled with `:Java:Bound:ParameterizedType` Represents a parameterized type, e.g. diff --git a/src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/VisitorHelper.java b/src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/VisitorHelper.java index 84a472f..e00faf5 100644 --- a/src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/VisitorHelper.java +++ b/src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/VisitorHelper.java @@ -21,7 +21,7 @@ */ public class VisitorHelper { - public static final int ASM_OPCODES = Opcodes.ASM8; + public static final int ASM_OPCODES = Opcodes.ASM9; /** * The name of constructor methods. diff --git a/src/main/resources/META-INF/jqassistant-rules/java.xml b/src/main/resources/META-INF/jqassistant-rules/java.xml index 0e28587..af55fb2 100644 --- a/src/main/resources/META-INF/jqassistant-rules/java.xml +++ b/src/main/resources/META-INF/jqassistant-rules/java.xml @@ -55,7 +55,8 @@ (superType:Java:Type)-[:DECLARES]->(superMember:Member), path=shortestPath((type)-[:EXTENDS|IMPLEMENTS*]->(superType)) WHERE - not exists(member.name) + type <> superType + and not exists(member.name) and exists(superMember.name) and member.signature = superMember.signature and superMember.visibility <> "private"