Title: [1349] trunk/qdox/src/main/java/com/thoughtworks/qdox/model/Type.java: Refactor Type.getGenericValue(List<TypeVariable<D>>) to a static method
Revision
1349
Author
rfscholte
Date
2011-10-02 08:19:41 -0500 (Sun, 02 Oct 2011)

Log Message

Refactor Type.getGenericValue(List<TypeVariable<D>>) to a static method

Modified Paths

Diff

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

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/Type.java	2011-10-02 12:48:39 UTC (rev 1348)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/Type.java	2011-10-02 13:19:41 UTC (rev 1349)
@@ -166,12 +166,12 @@
         return result.toString();
     }
     
-    protected <D extends JavaGenericDeclaration> String getGenericValue( List<TypeVariable<D>> typeVariableList )
+    protected static <D extends JavaGenericDeclaration> String getGenericValue( Type base, List<TypeVariable<D>> typeVariableList )
     {
-        StringBuffer result = new StringBuffer( getResolvedValue( this, typeVariableList ) );
-        for ( Iterator<Type> iter = actualArgumentTypes.iterator(); iter.hasNext(); )
+        StringBuffer result = new StringBuffer( getResolvedValue( base, typeVariableList ) );
+        for ( Iterator<Type> iter = base.getActualTypeArguments().iterator(); iter.hasNext(); )
         {
-            result.append( iter.next().resolve( this, typeVariableList ) );
+            result.append( iter.next().resolve( base, typeVariableList ) );
             if ( iter.hasNext() )
             {
                 result.append( "," );
@@ -504,7 +504,7 @@
         return result.toString();
     }
 
-    public static <D extends JavaGenericDeclaration> String getResolvedGenericValue( Type base, List<TypeVariable<D>> typeParameters )
+    protected static <D extends JavaGenericDeclaration> String getResolvedGenericValue( Type base, List<TypeVariable<D>> typeParameters )
     {
         StringBuffer result = new StringBuffer();
         TypeVariable<?> variable = resolve( base, typeParameters );
@@ -514,7 +514,7 @@
             result.append( "<" );
             for ( Iterator<Type> iter = base.getActualTypeArguments().iterator(); iter.hasNext(); )
             {
-                result.append( iter.next().getGenericValue(typeParameters) );
+                result.append( getGenericValue( iter.next(), typeParameters) );
                 if ( iter.hasNext() )
                 {
                     result.append( "," );


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to