Fixed exception when an unknown class dependency is specified.

This commit is contained in:
Diomidis Spinellis 2008-10-20 09:55:42 +00:00
parent 328901d184
commit 569d6849cc
3 changed files with 9 additions and 4 deletions

View File

@ -13,7 +13,7 @@ like the following.
<pathelement path="${src.java.dir}"/>
</path>
<javadoc sourcepathref="uml.source.path" packagenames="*" package="true">
<doclet name="org.umlgraph.doclet.UmlGraph" path="${basedir}/lib/UMLGraph.jar">
<doclet name="org.umlgraph.doclet.UmlGraph" path="${basedir}/lib/UmlGraph.jar">
<param name="-d" value="${uml.dir}"/>
</doclet>
</javadoc>

View File

@ -6,7 +6,10 @@
<dt>Version 5.2 Under development </dt><dd>
<ul>
<li> Corrected case of the tools.jar filename in the umlgraph shell script.
(Noted by &#216;yvind Jergan).
(Reported by &#216;yvind Jergan).
</li>
<li> Fixed exception when an unknown class dependency is specified.
(Reported by Jan Schl&#252;ter).
</li>
</dd>

View File

@ -1043,7 +1043,8 @@ class ClassGraph {
private String getPackageName(String className) {
if (this.rootClassdocs.get(className) == null) {
return className.substring(0, className.lastIndexOf('.'));
int idx = className.lastIndexOf('.');
return idx > 0 ? className.substring(0, idx) : "";
} else {
return this.rootClassdocs.get(className).containingPackage().name();
}
@ -1051,7 +1052,8 @@ class ClassGraph {
private String getUnqualifiedName(String className) {
if (this.rootClassdocs.get(className) == null) {
return className.substring(className.lastIndexOf('.') + 1);
int idx = className.lastIndexOf('.');
return idx > 0 ? className.substring(idx + 1) : className;
} else {
return this.rootClassdocs.get(className).name();
}