Title: [682] trunk/qdox/src/java/com/thoughtworks/qdox/model/annotation/AnnotationFieldRef.java: fixed failing test due to QDOX-192
Revision
682
Author
rfscholte
Date
2009-11-26 15:00:53 -0600 (Thu, 26 Nov 2009)

Log Message

fixed failing test due to QDOX-192

Modified Paths

Diff

Modified: trunk/qdox/src/java/com/thoughtworks/qdox/model/annotation/AnnotationFieldRef.java (681 => 682)

--- trunk/qdox/src/java/com/thoughtworks/qdox/model/annotation/AnnotationFieldRef.java	2009-11-25 23:03:20 UTC (rev 681)
+++ trunk/qdox/src/java/com/thoughtworks/qdox/model/annotation/AnnotationFieldRef.java	2009-11-26 21:00:53 UTC (rev 682)
@@ -9,6 +9,7 @@
 import com.thoughtworks.qdox.model.AbstractBaseJavaEntity;
 import com.thoughtworks.qdox.model.AbstractJavaEntity;
 import com.thoughtworks.qdox.model.JavaClass;
+import com.thoughtworks.qdox.model.JavaClassParent;
 import com.thoughtworks.qdox.model.JavaField;
 import com.thoughtworks.qdox.model.Type;
 
@@ -120,12 +121,19 @@
             }
 
             if( field == null ) {
+                JavaClassParent classParent = context.getParentClass();
+
+                //assume context is a JavaClass itself
+                if(classParent == null) {
+                    classParent = (JavaClass) context;
+                }
+                
                 for( int i = 0; i < parts.length - 1; ++i ) {
                     String className = getNamePrefix( i );
-                    String typeName = context.getParentClass().resolveType( className );
+                    String typeName = classParent.resolveType( className );
 
                     if( typeName != null ) {
-                        Type type = Type.createUnresolved( typeName, 0, context.getParentClass() );
+                        Type type = Type.createUnresolved( typeName, 0, classParent );
                         JavaClass javaClass = type.getJavaClass();
 
                         if( javaClass != null ) {


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to