Title: [1294] trunk/qdox/src/main/java/com/thoughtworks/qdox/model/Type.java: One step closer to be able to extract a JavaClassResolver
Revision
1294
Author
rfscholte
Date
2011-08-15 05:19:09 -0500 (Mon, 15 Aug 2011)

Log Message

One step closer to be able to extract a JavaClassResolver

Modified Paths


Diff

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/Type.java (1293 => 1294)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/Type.java	2011-08-15 08:53:29 UTC (rev 1293)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/Type.java	2011-08-15 10:19:09 UTC (rev 1294)
@@ -413,7 +413,7 @@
      *  
      *  <ul>
      *   <li>{@code this} would be T</li>
-     *   <li>{@code declaringClass} would be AbstractClass</li>
+     *   <li>{@code declaringClass} would be AbstractClass, since that's where T is used</li>
      *   <li>{@code callingClass}  would be ConcreteClass</li>
      *  </ul>
      * 
@@ -430,7 +430,8 @@
         if ( typeIndex >= 0 )
         {
             String fqn = declaringClass.getFullyQualifiedName();
-            if ( callingClass.getSuperClass() != null && fqn.equals( callingClass.getSuperClass().getFullyQualifiedName() ) )
+            if ( callingClass.getSuperClass() != null
+                && fqn.equals( callingClass.getSuperClass().getFullyQualifiedName() ) )
             {
                 result = callingClass.getSuperClass().getActualTypeArguments().get( typeIndex );
             }
@@ -447,15 +448,19 @@
                 // no direct interface available, try indirect
             }
         }
-        
-        if ( !this.actualArgumentTypes.isEmpty() ) {
-            result = new Type( this.fullName, this.name, this.dimensions, this.context );
-            
-            result.actualArgumentTypes = new LinkedList<Type>();
-            for (Type actualArgType : getActualTypeArguments())
+
+        if ( !this.getActualTypeArguments().isEmpty() )
+        {
+            result =
+                new Type( this.getFullyQualifiedName(), this.getValue(), this.getDimensions(),
+                          this.getJavaClassParent() );
+
+            List<Type> actualTypes = new LinkedList<Type>();
+            for ( Type actualArgType : getActualTypeArguments() )
             {
-                result.actualArgumentTypes.add(actualArgType.resolve( declaringClass, callingClass ));
+                actualTypes.add( actualArgType.resolve( declaringClass, callingClass ) );
             }
+            result.setActualArgumentTypes( actualTypes );
         }
         return result;
     }


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to