From 5420578cb5e2f66fd0ca780192808be376f9d5b9 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Sat, 29 Jun 2013 10:40:41 +0300 Subject: [PATCH] use better class name to avoid potetntial name collisions --- .../javainspect/example/RenderExampleProject.java | 4 ++-- .../svjatoslav/javainspect/example/RenderJavaInspect.java | 4 ++-- .../svjatoslav/javainspect/structure/ClassDescriptor.java | 4 ++-- .../javainspect/structure/{Graph.java => ClassGraph.java} | 8 ++++---- .../svjatoslav/javainspect/structure/FieldDescriptor.java | 2 +- .../javainspect/structure/MethodDescriptor.java | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) rename src/main/java/eu/svjatoslav/javainspect/structure/{Graph.java => ClassGraph.java} (94%) diff --git a/src/main/java/eu/svjatoslav/javainspect/example/RenderExampleProject.java b/src/main/java/eu/svjatoslav/javainspect/example/RenderExampleProject.java index 0cea641..0c7d28a 100644 --- a/src/main/java/eu/svjatoslav/javainspect/example/RenderExampleProject.java +++ b/src/main/java/eu/svjatoslav/javainspect/example/RenderExampleProject.java @@ -10,12 +10,12 @@ package eu.svjatoslav.javainspect.example; import eu.svjatoslav.javainspect.example.structure.SampleClass; -import eu.svjatoslav.javainspect.structure.Graph; +import eu.svjatoslav.javainspect.structure.ClassGraph; public class RenderExampleProject { public static void main(final String[] args) { - final Graph graph = new Graph(); + final ClassGraph graph = new ClassGraph(); graph.addClass(SampleClass.class); diff --git a/src/main/java/eu/svjatoslav/javainspect/example/RenderJavaInspect.java b/src/main/java/eu/svjatoslav/javainspect/example/RenderJavaInspect.java index e749a1b..d79e23e 100644 --- a/src/main/java/eu/svjatoslav/javainspect/example/RenderJavaInspect.java +++ b/src/main/java/eu/svjatoslav/javainspect/example/RenderJavaInspect.java @@ -11,7 +11,7 @@ package eu.svjatoslav.javainspect.example; import java.io.FileNotFoundException; -import eu.svjatoslav.javainspect.structure.Graph; +import eu.svjatoslav.javainspect.structure.ClassGraph; import eu.svjatoslav.javainspect.structure.Utils; public class RenderJavaInspect { @@ -19,7 +19,7 @@ public class RenderJavaInspect { public static void main(final String[] args) throws FileNotFoundException { // Create graph - final Graph graph = new Graph(); + final ClassGraph graph = new ClassGraph(); // Add some object to the graph. graph.addObject(graph); diff --git a/src/main/java/eu/svjatoslav/javainspect/structure/ClassDescriptor.java b/src/main/java/eu/svjatoslav/javainspect/structure/ClassDescriptor.java index 86b07de..f1d6a51 100644 --- a/src/main/java/eu/svjatoslav/javainspect/structure/ClassDescriptor.java +++ b/src/main/java/eu/svjatoslav/javainspect/structure/ClassDescriptor.java @@ -44,7 +44,7 @@ public class ClassDescriptor implements GraphElement { boolean isArray; - private final Graph dump; + private final ClassGraph dump; List interfaces = new ArrayList(); @@ -55,7 +55,7 @@ public class ClassDescriptor implements GraphElement { */ private int referenceCount = 0; - public ClassDescriptor(final Class clazz, final Graph dump) { + public ClassDescriptor(final Class clazz, final ClassGraph dump) { this.dump = dump; fullyQualifiedName = clazz.getName(); diff --git a/src/main/java/eu/svjatoslav/javainspect/structure/Graph.java b/src/main/java/eu/svjatoslav/javainspect/structure/ClassGraph.java similarity index 94% rename from src/main/java/eu/svjatoslav/javainspect/structure/Graph.java rename to src/main/java/eu/svjatoslav/javainspect/structure/ClassGraph.java index e1f7ff8..180b2c7 100644 --- a/src/main/java/eu/svjatoslav/javainspect/structure/Graph.java +++ b/src/main/java/eu/svjatoslav/javainspect/structure/ClassGraph.java @@ -17,21 +17,21 @@ import java.util.Map; import eu.svjatoslav.commons.file.CommonPathResolver; -public class Graph { +public class ClassGraph { /** * Maps class fully qualified names to class descriptors. */ Map nameToClassMap = new HashMap(); - public Graph() { + public ClassGraph() { } - public Graph(final Class clazz) { + public ClassGraph(final Class clazz) { addClass(clazz); } - public Graph(final Object root) { + public ClassGraph(final Object root) { addClass(root.getClass()); } diff --git a/src/main/java/eu/svjatoslav/javainspect/structure/FieldDescriptor.java b/src/main/java/eu/svjatoslav/javainspect/structure/FieldDescriptor.java index 96b3602..a91da4d 100644 --- a/src/main/java/eu/svjatoslav/javainspect/structure/FieldDescriptor.java +++ b/src/main/java/eu/svjatoslav/javainspect/structure/FieldDescriptor.java @@ -23,7 +23,7 @@ public class FieldDescriptor implements GraphElement { List typeArguments = new ArrayList(); public FieldDescriptor(final Field field, final ClassDescriptor parent, - final Graph dump) { + final ClassGraph dump) { this.parent = parent; diff --git a/src/main/java/eu/svjatoslav/javainspect/structure/MethodDescriptor.java b/src/main/java/eu/svjatoslav/javainspect/structure/MethodDescriptor.java index a7ce38b..c541b03 100644 --- a/src/main/java/eu/svjatoslav/javainspect/structure/MethodDescriptor.java +++ b/src/main/java/eu/svjatoslav/javainspect/structure/MethodDescriptor.java @@ -24,7 +24,7 @@ public class MethodDescriptor implements GraphElement { List typeArguments = new ArrayList(); public MethodDescriptor(final Method method, final ClassDescriptor parent, - final Graph dump) { + final ClassGraph dump) { this.parent = parent; -- 2.20.1