mirror of https://github.com/dspinellis/UMLGraph
fix generation with primitive array
This commit is contained in:
parent
16c1937aad
commit
27d7821666
|
|
@ -808,7 +808,7 @@ class ClassGraph {
|
|||
for (TypeMirror type : types) {
|
||||
// skip primitives and type variables, as well as dependencies
|
||||
// on the source class
|
||||
if (type.getKind().isPrimitive()
|
||||
if (ElementUtil.isPrimitive(type)
|
||||
|| ElementUtil.isType(type, TypeKind.TYPEVAR) || ElementUtil.isType(type, TypeKind.WILDCARD)
|
||||
|| type instanceof NoType
|
||||
|| c.toString().equals(ElementUtil.getTypeElement(type).toString())) {
|
||||
|
|
@ -856,7 +856,7 @@ class ClassGraph {
|
|||
|
||||
private FieldRelationInfo getFieldRelationInfo(VariableElement field) {
|
||||
TypeMirror type = field.asType();
|
||||
if (type.getKind().isPrimitive() || ElementUtil.isType(type, TypeKind.WILDCARD) || ElementUtil.isType(type, TypeKind.TYPEVAR)) {
|
||||
if (ElementUtil.isPrimitive(type) || ElementUtil.isType(type, TypeKind.WILDCARD) || ElementUtil.isType(type, TypeKind.TYPEVAR)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,16 @@ import jdk.javadoc.doclet.DocletEnvironment;
|
|||
|
||||
public class ElementUtil {
|
||||
|
||||
public static boolean isPrimitive(TypeMirror type) {
|
||||
if (type.getKind().isPrimitive()) {
|
||||
return true;
|
||||
}
|
||||
if (type.getKind() == TypeKind.ARRAY) {
|
||||
return isPrimitive(((ArrayType) type).getComponentType());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isType(TypeMirror type, TypeKind kind) {
|
||||
if (type.getKind() == kind) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue