From: Svjatoslav Agejenko Date: Fri, 9 Jun 2017 11:39:12 +0000 (+0300) Subject: bugfixes X-Git-Tag: javainspect-1.7~36 X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=d15b56dda6f6b1fbd3337250e4fc2ac9c11b0890;p=javainspect.git bugfixes --- diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/FieldDescriptor.java b/src/main/java/eu/svjatoslav/inspector/java/structure/FieldDescriptor.java index b6de871..1213e2d 100755 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/FieldDescriptor.java +++ b/src/main/java/eu/svjatoslav/inspector/java/structure/FieldDescriptor.java @@ -74,6 +74,7 @@ public class FieldDescriptor implements GraphElement { + "\", color=\"" + classDescriptor.getColor() + "\", style=\"bold\"];\n"); + if (type == null) return result.toString(); if (!type.isVisible()) return result.toString(); @@ -110,7 +111,7 @@ public class FieldDescriptor implements GraphElement { } else { result.append(" "); result.append(""); - result.append(type.getClassName(true) + ""); + result.append(describeType() + ""); result.append(""); result.append(name + "\n"); @@ -118,6 +119,11 @@ public class FieldDescriptor implements GraphElement { return result.toString(); } + private String describeType() { + if (type == null) return "-null-"; + return type.getClassName(true); + } + @Override public String getGraphId() { return parentClassDescriptior.getGraphId() + ":" + name; diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/MethodDescriptor.java b/src/main/java/eu/svjatoslav/inspector/java/structure/MethodDescriptor.java index efe6992..1929348 100755 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/MethodDescriptor.java +++ b/src/main/java/eu/svjatoslav/inspector/java/structure/MethodDescriptor.java @@ -98,8 +98,8 @@ public class MethodDescriptor implements GraphElement, + classDescriptor.getColor() + "\", style=\"dotted, bold\"];\n"); - if (!returnType.isVisible()) - return result.toString(); + if (returnType == null) return result.toString(); + if (!returnType.isVisible()) return result.toString(); // main type if (returnType.areReferencesShown()) @@ -121,7 +121,7 @@ public class MethodDescriptor implements GraphElement, result.append(" // " + methodName + "\n"); result.append(" " - + "" + returnType.getClassName(true) + + "" + describeReturnType() + "" + "" + getMethodLabel() + "\n"); @@ -129,6 +129,12 @@ public class MethodDescriptor implements GraphElement, return result.toString(); } + private String describeReturnType() { + if (returnType == null) return "-null-"; + + return returnType.getClassName(true); + } + @Override public String getGraphId() { return parentClass.getGraphId() + ":" + methodName;