Title: [1365] trunk/qdox/src/test/java/com/thoughtworks/qdox: Use T for DefaultJavaMethod.returns

Diff

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java (1364 => 1365)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java	2011-10-02 21:35:55 UTC (rev 1364)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java	2011-10-02 21:43:35 UTC (rev 1365)
@@ -27,7 +27,7 @@
 
 public class DefaultJavaMethod<T extends JavaClass & JavaParameterizedType> extends AbstractBaseMethod<T> implements JavaMethod {
 
-	private Type returns = Type.VOID;
+	private T returns = (T) Type.VOID;
     private List<TypeVariable<JavaMethod>> typeParameters = Collections.emptyList();
 	
     /**
@@ -51,7 +51,7 @@
      * @param returns the return type
      * @param name the name of this method
      */
-    public DefaultJavaMethod(Type returns, String name) {
+    public DefaultJavaMethod(T returns, String name) {
         this.returns = returns;
         setName(name);
     }
@@ -59,7 +59,7 @@
     /* (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaMethod#getReturns()
      */
-    public Type getReturns() {
+    public JavaClass getReturns() {
         return returns;
     }
     
@@ -156,7 +156,7 @@
      * 
      * @param returns the return type
      */
-    public void setReturns(Type returns) {
+    public void setReturns(T returns) {
         this.returns = returns;
     }
 
@@ -393,7 +393,7 @@
     /* (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaMethod#getReturnType(boolean)
      */
-    public Type getReturnType( boolean resolve )
+    public JavaType getReturnType( boolean resolve )
     {
         return returns;
     }

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethod.java (1364 => 1365)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethod.java	2011-10-02 21:35:55 UTC (rev 1364)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethod.java	2011-10-02 21:43:35 UTC (rev 1365)
@@ -27,9 +27,8 @@
     /**
      * 
      * @return the return type
-     * @deprecated it is recommended to use getReturnType()
      */
-    Type getReturns();
+    JavaClass getReturns();
 
     List<JavaParameter> getParameters();
 

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethodDelegate.java (1364 => 1365)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethodDelegate.java	2011-10-02 21:35:55 UTC (rev 1364)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethodDelegate.java	2011-10-02 21:43:35 UTC (rev 1365)
@@ -171,7 +171,7 @@
         return originalMethod.getPropertyType();
     }
 
-    public Type getReturns()
+    public JavaClass getReturns()
     {
         return originalMethod.getReturns();
     }

Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/JSR14Test.java (1364 => 1365)

--- trunk/qdox/src/test/java/com/thoughtworks/qdox/JSR14Test.java	2011-10-02 21:35:55 UTC (rev 1364)
+++ trunk/qdox/src/test/java/com/thoughtworks/qdox/JSR14Test.java	2011-10-02 21:43:35 UTC (rev 1365)
@@ -439,7 +439,7 @@
     	JavaClass javaClass = javaSource.getClasses().get(0);
     	JavaMethod javaMethod = javaClass.getMethods().get(0);
     	JavaParameter paramType = javaMethod.getParameters().get(0);
-    	Type returnType = javaMethod.getReturns();
+    	JavaType returnType = javaMethod.getReturns();
     	assertEquals("myMethod(request)", javaMethod.getCallSignature());
     	assertEquals("public java.util.List com.thoughtworks.qdox.TestQDOX150.myMethod(java.lang.StringBuffer) throws java.lang.Exception", javaMethod.toString());
     	assertEquals("StringBuffer", paramType.getResolvedValue());

Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java (1364 => 1365)

--- trunk/qdox/src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java	2011-10-02 21:35:55 UTC (rev 1364)
+++ trunk/qdox/src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java	2011-10-02 21:43:35 UTC (rev 1365)
@@ -311,7 +311,7 @@
         builder.addSource(new StringReader(in));
 
         JavaClass cls = builder.getClassByName("x.X");
-        Type returnType = cls.getMethods().get(0).getReturns();
+        JavaType returnType = cls.getMethods().get(0).getReturns();
         JavaClass returnClass = builder.getClassByName(returnType.getFullyQualifiedName());
 
         assertEquals("java.util.ArrayList", returnClass.getFullyQualifiedName());

Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/builder/ModelBuilderTest.java (1364 => 1365)

--- trunk/qdox/src/test/java/com/thoughtworks/qdox/builder/ModelBuilderTest.java	2011-10-02 21:35:55 UTC (rev 1364)
+++ trunk/qdox/src/test/java/com/thoughtworks/qdox/builder/ModelBuilderTest.java	2011-10-02 21:43:35 UTC (rev 1365)
@@ -323,7 +323,7 @@
         JavaMethod doSomething = source.getClasses().get(0).getMethods().get(0);
         assertEquals("doSomething", doSomething.getName());
         assertEquals("void", doSomething.getReturns().getValue());
-        JavaSource parentSource = doSomething.getReturns().getJavaClassParent().getParentSource();
+        JavaSource parentSource = doSomething.getReturns().getParent().getParentSource();
         assertSame(source, parentSource);
         assertEquals(0, doSomething.getModifiers().size());
         assertEquals(0, doSomething.getParameters().size());


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to