Title: [1434] trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaModelUtils.java: JavaModelUtils.getClassByName() should also try to resolve the name from the ClassLibrary
Revision
1434
Author
rfscholte
Date
2011-10-22 08:14:54 -0500 (Sat, 22 Oct 2011)

Log Message

JavaModelUtils.getClassByName() should also try to resolve the name from the ClassLibrary

Modified Paths

Diff

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaModelUtils.java (1433 => 1434)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaModelUtils.java	2011-10-21 20:13:17 UTC (rev 1433)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaModelUtils.java	2011-10-22 13:14:54 UTC (rev 1434)
@@ -24,9 +24,17 @@
 
     private JavaModelUtils()
     {
-        // 
+        // hide constructor for utility class
     }
     
+    /**
+     * Try to resolve the class by the {@code name}, either relative from {@code cls} or
+     * absolute from the classlibrary of the {@code cls}.
+     * 
+     * @param cls 
+     * @param name 
+     * @return the matching class, otherwise <code>null</code>
+     */
     public static JavaClass getClassByName( JavaClass cls, String name )
     {
         JavaClass result = null;
@@ -49,6 +57,10 @@
                 }
             }
         }
+        if ( result == null )
+        {
+            result = cls.getSource().getJavaClassLibrary().getJavaClass( name, false );
+        }
         return result;
     }
-}
+}
\ No newline at end of file


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to