From ec6fbc4e54823315afc90400da1e98ec6007bc5e Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 3 Aug 2016 22:08:45 +0300 Subject: [PATCH 01/16] [maven-release-plugin] prepare release javainspect-1.5 --- pom.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 8352a8f..fe6f707 100644 --- a/pom.xml +++ b/pom.xml @@ -1,9 +1,8 @@ - + 4.0.0 eu.svjatoslav javainspect - 1.5-SNAPSHOT + 1.5 jar Java inspect Utility to visualize Java code -- 2.20.1 From 3ab2617625df3fa410c63e7fb307893b7fd39fc0 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 3 Aug 2016 22:08:48 +0300 Subject: [PATCH 02/16] [maven-release-plugin] prepare for next development iteration --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fe6f707..47acd34 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 eu.svjatoslav javainspect - 1.5 + 1.6-SNAPSHOT jar Java inspect Utility to visualize Java code -- 2.20.1 From 827fc6629a9905006ebef0274d0271386e68d128 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 9 Nov 2016 12:09:57 +0200 Subject: [PATCH 03/16] updated install manual --- doc/index.html | 293 ++++++++++++++++++++++--------------------------- doc/index.org | 9 +- 2 files changed, 135 insertions(+), 167 deletions(-) diff --git a/doc/index.html b/doc/index.html index 4c426bf..5836449 100644 --- a/doc/index.html +++ b/doc/index.html @@ -3,23 +3,30 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -JavaInspect - Utility to visualize java software - + + +JavaInspect - Utility to visualize java software + - -
-

JavaInspect - Utility to visualize java software

- -
+
+

JavaInspect - Utility to visualize java software

+
+ -
  • other applications hosted at svjatoslav.eu
  • +
  • other applications hosted at svjatoslav.eu +
  • -
    -

    1 General

    +
    +

    1 General

    Goal: simplify/speed up understanding the computer program code by @@ -208,12 +247,14 @@ up with 2 solutions:

      -
    1. Add JavaInspect library in your project as a dependency.
    2. +
    3. Add JavaInspect library in your project as a dependency. +
    4. Create new Java project for the purpose visualizing your other projects and include JavaInspect and your projecs binary artifacts (Jar's) into new project classpath. Built binary Jar's (with no source code) are sufficient because JavaInspect operates via -reflection.
    5. +reflection. +

    @@ -224,42 +265,42 @@ bitmap graph in PNG format. By default on your Desktop directory.

    -Note: GraphViz is developed and tested so far only on GNU Linux. +Note: GraphViz is developed and tested so far only on GNU/Linux.

    -
    -

    2 Example graphs

    +
    +

    2 Example graphs

    -
    -

    3 Usage

    +
    +

    3 Usage

    Currently the only way to control JavaInspect is by using Java @@ -273,35 +314,46 @@ product or project artifact I'm just willing to visualize. Control code in general does the following:

      -
    1. Create graph object.
    2. +
    3. Create graph object. +
    4. Java reflection/classloaders does not provide mechanism for discovering all classes under given package. Therefore you need to declare at least some classes to be added to the graph by:
        -
      • Manually adding individual classes to the graph.
      • +
      • Manually adding individual classes to the graph. +
      • and/or: Let GraphViz recursively scan and parse specified -directories with Java source code files to discover class names.
      • +directories with Java source code files to discover class names. +
      • For every class added to the graph, GraphViz will recursively -inspect it and add all referecned classes to the graph as well.
      • -
    5. +inspect it and add all referecned classes to the graph as well. + + +
    6. Graphs easilly get very big and complex so optionally we filter important code using classname wildcards patterns based blacklist -and/or whitelist.
    7. +and/or whitelist. +
    8. Optionally we can tune some rendering parameters like:
      • Possibility to remove orphaned classes (classes with no -references) from the graph.
      • +references) from the graph. +
      • Specify target directory for generated visualization -files. (Default is user desktop directory)
      • -
      • Keep intermediate GraphViz dot file for later inspection.
      • -
    9. -
    10. Render graph.
    11. +files. (Default is user desktop directory) + +
    12. Keep intermediate GraphViz dot file for later inspection. +
    13. + + +
    14. Render graph. +
    -
    -

    3.1 example 1: individually picked objects

    +
    +

    3.1 example 1: individually picked objects

    This example demonstrates generating of class graph from hand picked @@ -310,22 +362,22 @@ classes and visualizing GraphViz itself.

    -
    // Create graph
    -final ClassGraph graph = new ClassGraph();
    +
    // Create graph
    +final ClassGraph graph = new ClassGraph();
     
    -// Add some random object to the graph. GraphViz will detect Class from
    -// the object.
    -graph.add(graph);
    +// Add some random object to the graph. GraphViz will detect Class from
    +// the object.
    +graph.add(graph);
     
    -// Also add some random class to the graph.
    -graph.add(Utils.class);
    +// Also add some random class to the graph.
    +graph.add(Utils.class);
     
    -// Keep intermediary GraphViz DOT file for reference.
    -graph.setKeepDotFile(true);
    +// Keep intermediary GraphViz DOT file for reference.
    +graph.setKeepDotFile(true);
     
    -// Produce bitmap image titled "JavaInspect.png" to the user Desktop
    -// directory
    -graph.generateGraph("JavaInspect");
    +// Produce bitmap image titled "JavaInspect.png" to the user Desktop
    +// directory
    +graph.generateGraph("JavaInspect");
     
    @@ -334,8 +386,8 @@ Note: if desired, more compact version of the above:

    -
    new ClassGraph().add(randomObject, RandomClass.class)
    -                .setKeepDotFile(true).generateGraph("JavaInspect");
    +
    new ClassGraph().add(randomObject, RandomClass.class)
    +                .setKeepDotFile(true).generateGraph("JavaInspect");
     
    @@ -344,72 +396,77 @@ Note: if desired, more compact version of the above: Result:

    -
    -

    3.2 example 2: scan java code, apply filters

    +
    +

    3.2 example 2: scan java code, apply filters

    -
    // Create graph
    -final ClassGraph graph = new ClassGraph();
    +
    // Create graph
    +final ClassGraph graph = new ClassGraph();
     
    -// Recursively scan current directory for Java source code and attempt
    -// to detect class names from there to be added to the graph.
    -graph.addProject(".");
    +// Recursively scan current directory for Java source code and attempt
    +// to detect class names from there to be added to the graph.
    +graph.addProject(".");
     
    -// Blacklist example classes from being shown on the graph
    -graph.blacklistClassPattern("eu.svjatoslav.inspector.java.structure.example.*");
    +// Blacklist example classes from being shown on the graph
    +graph.blacklistClassPattern("eu.svjatoslav.inspector.java.structure.example.*");
     
    -// do not show single classes with no relationships on the graph
    -graph.hideOrphanedClasses();
    +// do not show single classes with no relationships on the graph
    +graph.hideOrphanedClasses();
     
    -// Produce bitmap image titled "JavaInspect full project.png" to the
    -// user Desktop directory.
    -graph.generateGraph("JavaInspect full project");
    +// Produce bitmap image titled "JavaInspect full project.png" to the
    +// user Desktop directory.
    +graph.generateGraph("JavaInspect full project");
     

    Result:

    -
    -

    3.3 example 3: GraphViz embedded in another project

    +
    +

    3.3 example 3: GraphViz embedded in another project

      -
    1. Download project Sixth code snapshot.
    2. -
    3. Inspect and run *DataGraph.java*.
    4. +
    5. Download project Sixth code snapshot. +
    6. +
    7. Inspect and run *DataGraph.java*. +
    -
    -

    4 Embedding JavaInspect in your Maven project

    +
    +

    4 Embedding JavaInspect in your Maven project

    Declare JavaInspect as dependency:

    -
    <dependencies>
    +
    <dependencies>
         ...
    -    <dependency>
    -        <groupId>eu.svjatoslav</groupId>
    -        <artifactId>javainspect</artifactId>
    -        <version>1.5</version>
    -    </dependency>
    +    <dependency>
    +        <groupId>eu.svjatoslav</groupId>
    +        <artifactId>javainspect</artifactId>
    +        <version>1.5</version>
    +    </dependency>
         ...
    -</dependencies>
    +</dependencies>
     
    @@ -419,22 +476,22 @@ Add Maven repository to retrieve artifact from:

    -
    <repositories>
    +
    <repositories>
         ...
    -    <repository>
    -        <id>svjatoslav.eu</id>
    -        <name>Svjatoslav repository</name>
    -        <url>http://www2.svjatoslav.eu/maven/</url>
    -    </repository>
    +    <repository>
    +        <id>svjatoslav.eu</id>
    +        <name>Svjatoslav repository</name>
    +        <url>http://www2.svjatoslav.eu/maven/</url>
    +    </repository>
         ...
    -</repositories>
    +</repositories>
     
    -
    -

    5 Requirements

    +
    +

    5 Requirements

    GraphViz - shall be installed on the computer. @@ -450,35 +507,64 @@ On Ubuntu/Debian use:

    -
    -

    6 TO DO

    +
    +

    6 TO DO

    • BUG: Should not hide references if there are too many of them to classes if referring classes are not visible anyway because of blacklist/whitelist rules. -Basically reference counting should exclude not visible classes.
    • -
    • FEATURE: add dark theme
    • -
    • FEATURE: sort Class fields by alphabet
    • +Basically reference counting should exclude not visible classes. + +
    • FEATURE: add dark theme +
    • +
    • FEATURE: sort Class fields by alphabet +
    • FEATURE: visualize also concrete field values so it could be used as -ultra cool runtime logging framework
    • +ultra cool runtime logging framework +
    • FEATURE: possibility to visualize structure and data from JVM -snapshot
    • +snapshot +
    • FEATURE: possibility to attach to remote process to visualize -data/structure using JVM debug port and mechanism.
    • -
    • FEATURE: possibility to attach to JVM using JVM agent
    • -
    • FEATURE: possibility to script javainspect behavior
    • +data/structure using JVM debug port and mechanism. + +
    • FEATURE: possibility to attach to JVM using JVM agent +
    • +
    • FEATURE: possibility to script javainspect behavior +
    • FEATURE: possibility to select classes/fields/values to be -visualized in SQL like syntax
    • +visualized in SQL like syntax +
    • FEATURE: configurable maven plugin to generate graphs as part of the -project build/release process
    • +project build/release process +
    +
    +
    +

    Author: Svjatoslav Agejenko

    +

    Created: 2017-01-21 Sat 21:56

    +

    Emacs 24.4.1 (Org-mode 8.2.10)

    +
    diff --git a/doc/index.org b/doc/index.org index 42916a3..120b9e8 100644 --- a/doc/index.org +++ b/doc/index.org @@ -14,6 +14,16 @@ - [[http://svjatoslav.eu/programs.jsp][other applications hosted at svjatoslav.eu]] +* (document settings) :noexport: +** use dark style for TWBS-HTML exporter +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: " +#+HTML_HEAD: + * General Goal: simplify/speed up understanding the computer program code by automatically visualizing its structure. @@ -41,7 +51,7 @@ unimportant parts, JavaInspect produces GraphViz dot file that describes data to be visualized. Then launches GraphViz to generate bitmap graph in PNG format. By default on your Desktop directory. -Note: GraphViz is developed and tested so far only on GNU Linux. +Note: GraphViz is developed and tested so far only on GNU/Linux. * Example graphs + A very simple example: -- 2.20.1 From 398b77318e2d84934ef5e2fa853b322df0146707 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Mon, 23 Jan 2017 12:32:04 +0200 Subject: [PATCH 05/16] Updated example links. --- doc/index.html | 6 +++--- doc/index.org | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/index.html b/doc/index.html index 5ee48a2..9f15392 100644 --- a/doc/index.html +++ b/doc/index.html @@ -2,7 +2,7 @@ JavaInspect - Utility to visualize java software - + @@ -293,7 +293,7 @@ Graph legend: -
  • Example visualization of Sixth project: architecture graphs. +
  • Example visualization of Sixth 3D project: architecture graphs.
  • @@ -562,7 +562,7 @@ project build/release process

    Author: Svjatoslav Agejenko

    -

    Created: 2017-01-21 Sat 21:56

    +

    Created: 2017-01-23 Mon 12:31

    Emacs 24.4.1 (Org-mode 8.2.10)

    diff --git a/doc/index.org b/doc/index.org index 120b9e8..085a858 100644 --- a/doc/index.org +++ b/doc/index.org @@ -62,7 +62,7 @@ Note: GraphViz is developed and tested so far only on GNU/Linux. file:legend.png -+ Example visualization of [[http://www2.svjatoslav.eu/gitbrowse/sixth/doc/][Sixth]] project: [[http://www2.svjatoslav.eu/projects/sixth/codegraphs/][architecture graphs]]. ++ Example visualization of [[http://www2.svjatoslav.eu/gitbrowse/sixth-3d/doc/][Sixth 3D]] project: [[http://www2.svjatoslav.eu/gitbrowse/sixth-3d/doc/codeGraph/][architecture graphs]]. * Usage Currently the only way to control JavaInspect is by using Java -- 2.20.1 From 54ee4f18181d978bb0c269b516d9654895e2b395 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Tue, 18 Apr 2017 12:32:37 +0300 Subject: [PATCH 06/16] PlantUML integration idea. --- doc/index.html | 6 ++++-- doc/index.org | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/index.html b/doc/index.html index 9f15392..af7b23b 100644 --- a/doc/index.html +++ b/doc/index.html @@ -2,7 +2,7 @@ JavaInspect - Utility to visualize java software - + @@ -515,6 +515,8 @@ On Ubuntu/Debian use: referring classes are not visible anyway because of blacklist/whitelist rules. Basically reference counting should exclude not visible classes. +
  • FEATURE: integarte with PlantUML. +
  • FEATURE: add dark theme
  • FEATURE: sort Class fields by alphabet @@ -562,7 +564,7 @@ project build/release process
  • Author: Svjatoslav Agejenko

    -

    Created: 2017-01-23 Mon 12:31

    +

    Created: 2017-04-18 Tue 12:32

    Emacs 24.4.1 (Org-mode 8.2.10)

    diff --git a/doc/index.org b/doc/index.org index 085a858..ac53f6b 100644 --- a/doc/index.org +++ b/doc/index.org @@ -195,6 +195,7 @@ sudo apt-get install graphviz - BUG: Should not hide references if there are too many of them to classes if referring classes are not visible anyway because of blacklist/whitelist rules. Basically reference counting should exclude not visible classes. +- FEATURE: integarte with [[http://plantuml.com/class-diagram][PlantUML]]. - FEATURE: add dark theme - FEATURE: sort Class fields by alphabet - FEATURE: visualize also concrete field values so it could be used as -- 2.20.1 From fa90e6506de0c6c93a087a6edbb52a378b5cded1 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 19 Apr 2017 22:48:36 +0300 Subject: [PATCH 07/16] Better variable names. --- javainspect.iml | 2 +- .../java/structure/FieldDescriptor.java | 34 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/javainspect.iml b/javainspect.iml index 9036949..ea566de 100644 --- a/javainspect.iml +++ b/javainspect.iml @@ -1,6 +1,6 @@ - + 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 59f93fc..b6de871 100755 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/FieldDescriptor.java +++ b/src/main/java/eu/svjatoslav/inspector/java/structure/FieldDescriptor.java @@ -1,6 +1,6 @@ /* * JavaInspect - Utility to visualize java software - * Copyright (C) 2013-2015, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright (C) 2013-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License @@ -21,35 +21,35 @@ import java.util.List; public class FieldDescriptor implements GraphElement { - private final ClassDescriptor parentClass; + private final ClassDescriptor parentClassDescriptior; private final List typeArguments = new ArrayList(); private String name; private ClassDescriptor type; private boolean isInherited; public FieldDescriptor(final ClassDescriptor parent) { - parentClass = parent; + parentClassDescriptior = parent; } public void analyzeField(final Field field) { if (!field.getDeclaringClass().getName() - .equals(parentClass.getFullyQualifiedName())) + .equals(parentClassDescriptior.getFullyQualifiedName())) isInherited = true; name = field.getName(); - type = parentClass.getClassGraph().getOrCreateClassDescriptor( + type = parentClassDescriptior.getClassGraph().getOrCreateClassDescriptor( field.getType()); type.registerReference(); - final Type genericType = field.getGenericType(); - if (genericType instanceof ParameterizedType) { - final ParameterizedType pt = (ParameterizedType) genericType; - for (final Type t : pt.getActualTypeArguments()) - if (t instanceof Class) { - final Class cl = (Class) t; - final ClassDescriptor genericTypeDescriptor = parentClass - .getClassGraph().getOrCreateClassDescriptor(cl); + final Type fieldGenericType = field.getGenericType(); + if (fieldGenericType instanceof ParameterizedType) { + final ParameterizedType fieldParameterizedGenericType = (ParameterizedType) fieldGenericType; + for (final Type type : fieldParameterizedGenericType.getActualTypeArguments()) + if (type instanceof Class) { + final Class aClass = (Class) type; + final ClassDescriptor genericTypeDescriptor = parentClassDescriptior + .getClassGraph().getOrCreateClassDescriptor(aClass); genericTypeDescriptor.registerReference(); typeArguments.add(genericTypeDescriptor); } @@ -80,10 +80,10 @@ public class FieldDescriptor implements GraphElement { // main type boolean showLink = type.areReferencesShown(); - if (type == parentClass) + if (type == parentClassDescriptior) showLink = false; - if (parentClass.isEnum) + if (parentClassDescriptior.isEnum) showLink = false; if (showLink) @@ -103,7 +103,7 @@ public class FieldDescriptor implements GraphElement { final StringBuffer result = new StringBuffer(); result.append(" // " + name + "\n"); - if (parentClass.isEnum && (type == parentClass)) { + if (parentClassDescriptior.isEnum && (type == parentClassDescriptior)) { result.append(" "); result.append(name + "\n"); @@ -120,7 +120,7 @@ public class FieldDescriptor implements GraphElement { @Override public String getGraphId() { - return parentClass.getGraphId() + ":" + name; + return parentClassDescriptior.getGraphId() + ":" + name; } protected int getOutsideVisibleReferencesCount() { -- 2.20.1 From 2375888de0c132707f1512646210e0f2f366868b Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 19 Apr 2017 22:50:01 +0300 Subject: [PATCH 08/16] Bugfix: no langer generate illegal square brackets in the dot file --- .../inspector/java/structure/ClassDescriptor.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java b/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java index c21761c..3bd1049 100755 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java +++ b/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java @@ -318,8 +318,12 @@ public class ClassDescriptor implements GraphElement, Comparable Date: Wed, 19 Apr 2017 22:53:29 +0300 Subject: [PATCH 09/16] bugfix: Graphviz warning: aqua is not a known color. --- src/main/java/eu/svjatoslav/inspector/java/structure/Utils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/Utils.java b/src/main/java/eu/svjatoslav/inspector/java/structure/Utils.java index 41dc633..9f28ad1 100755 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/Utils.java +++ b/src/main/java/eu/svjatoslav/inspector/java/structure/Utils.java @@ -96,7 +96,7 @@ public class Utils { lightColors.add("peachpuff2"); lightColors.add("seagreen1"); lightColors.add("violet"); - lightColors.add("aqua"); + lightColors.add("cyan"); lightColors.add("orange"); } -- 2.20.1 From e058812f4214955233c94e2d23cf23ec48a3f51c Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 19 Apr 2017 23:03:55 +0300 Subject: [PATCH 10/16] [maven-release-plugin] prepare release javainspect-1.6 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 47acd34..c9d43e6 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 eu.svjatoslav javainspect - 1.6-SNAPSHOT + 1.6 jar Java inspect Utility to visualize Java code -- 2.20.1 From 06305a7463d8cd1ad75d055ee226e021847930c4 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 19 Apr 2017 23:03:59 +0300 Subject: [PATCH 11/16] [maven-release-plugin] prepare for next development iteration --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c9d43e6..4929dbe 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 eu.svjatoslav javainspect - 1.6 + 1.7-SNAPSHOT jar Java inspect Utility to visualize Java code -- 2.20.1 From 948a8cc00e3dbfb7448bb76ff4b056d19bdfb863 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 19 Apr 2017 23:07:16 +0300 Subject: [PATCH 12/16] Updated version number in documentation. --- doc/index.html | 6 +++--- doc/index.org | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/index.html b/doc/index.html index af7b23b..59c8408 100644 --- a/doc/index.html +++ b/doc/index.html @@ -2,7 +2,7 @@ JavaInspect - Utility to visualize java software - + @@ -463,7 +463,7 @@ Declare JavaInspect as dependency: <dependency> <groupId>eu.svjatoslav</groupId> <artifactId>javainspect</artifactId> - <version>1.5</version> + <version>1.6</version> </dependency> ... </dependencies> @@ -564,7 +564,7 @@ project build/release process

    Author: Svjatoslav Agejenko

    -

    Created: 2017-04-18 Tue 12:32

    +

    Created: 2017-04-19 Wed 23:05

    Emacs 24.4.1 (Org-mode 8.2.10)

    diff --git a/doc/index.org b/doc/index.org index ac53f6b..ae30d3b 100644 --- a/doc/index.org +++ b/doc/index.org @@ -164,7 +164,7 @@ Declare JavaInspect as dependency: eu.svjatoslav javainspect - 1.5 + 1.6 ... -- 2.20.1 From 348751e5ed1d0c4b0dd09997f568eb38ea556527 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Fri, 9 Jun 2017 13:55:29 +0300 Subject: [PATCH 13/16] Handle no class def errors --- .../inspector/java/structure/ClassDescriptor.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java b/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java index 3bd1049..13d87b8 100755 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java +++ b/src/main/java/eu/svjatoslav/inspector/java/structure/ClassDescriptor.java @@ -73,8 +73,13 @@ public class ClassDescriptor implements GraphElement, Comparable Date: Fri, 9 Jun 2017 14:01:31 +0300 Subject: [PATCH 14/16] Fixed null pointer exception --- .../inspector/java/structure/MethodDescriptor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 d411cb0..efe6992 100755 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/MethodDescriptor.java +++ b/src/main/java/eu/svjatoslav/inspector/java/structure/MethodDescriptor.java @@ -141,8 +141,9 @@ public class MethodDescriptor implements GraphElement, protected int getOutsideVisibleReferencesCount() { int result = 0; - if (returnType.isVisible()) - result++; + if (returnType != null) + if (returnType.isVisible()) + result++; for (final ClassDescriptor classDescriptor : argumentTypes) if (classDescriptor.isVisible()) -- 2.20.1 From d15b56dda6f6b1fbd3337250e4fc2ac9c11b0890 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Fri, 9 Jun 2017 14:39:12 +0300 Subject: [PATCH 15/16] bugfixes --- .../inspector/java/structure/FieldDescriptor.java | 8 +++++++- .../inspector/java/structure/MethodDescriptor.java | 12 +++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) 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; -- 2.20.1 From 02756977e668ccfd20059b920bb9259f83847a4f Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Fri, 7 Jul 2017 13:14:55 +0200 Subject: [PATCH 16/16] fixed broken link --- doc/index.html | 8 ++++---- doc/index.org | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/index.html b/doc/index.html index 59c8408..20c1290 100644 --- a/doc/index.html +++ b/doc/index.html @@ -2,7 +2,7 @@ JavaInspect - Utility to visualize java software - + @@ -217,7 +217,7 @@ License or later as published by the Free Software Foundation. -
  • other applications hosted at svjatoslav.eu +
  • other applications hosted at svjatoslav.eu
  • @@ -564,8 +564,8 @@ project build/release process diff --git a/doc/index.org b/doc/index.org index ae30d3b..4293347 100644 --- a/doc/index.org +++ b/doc/index.org @@ -12,7 +12,7 @@ - Homepage: http://svjatoslav.eu - Email: mailto://svjatoslav@svjatoslav.eu -- [[http://svjatoslav.eu/programs.jsp][other applications hosted at svjatoslav.eu]] +- [[http://www.svjatoslav.eu/programs.jsp][other applications hosted at svjatoslav.eu]] * (document settings) :noexport: ** use dark style for TWBS-HTML exporter -- 2.20.1