properly handle nested classes
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Thu, 4 Jul 2013 07:55:36 +0000 (10:55 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Thu, 4 Jul 2013 07:55:36 +0000 (10:55 +0300)
src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java

index 7e7c4ee..9f4be8a 100644 (file)
@@ -234,6 +234,8 @@ public class ClassDescriptor implements GraphElement {
                        if (isArray)
                                result += " []";
 
+               // this is needed for nested classes
+               result = result.replace('$', '.');
                return result;
        }
 
@@ -286,7 +288,7 @@ public class ClassDescriptor implements GraphElement {
        public String getGraphId() {
                final String result = "class_"
                                + fullyQualifiedName.replace('.', '_').replace(";", "")
-                                               .replace("[L", "");
+                                               .replace("[L", "").replace('$', '_');
                return result;
        }