[jboss-cvs] JBossAS SVN: r103748 - in projects/jboss-reflect/trunk/src: test/java/org/jboss/test/classinfo/support and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Apr 9 06:21:51 EDT 2010


Author: kabir.khan at jboss.com
Date: 2010-04-09 06:21:51 -0400 (Fri, 09 Apr 2010)
New Revision: 103748

Added:
   projects/jboss-reflect/trunk/src/test/java/org/jboss/test/classinfo/support/ClassInfoNotGeneric.java
Modified:
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/ClassInfo.java
   projects/jboss-reflect/trunk/src/test/java/org/jboss/test/classinfo/test/ClassInfoGenericClassTest.java
Log:
[JBREFLECT-5] Document ClassInfo.getAcctualTypeArguments()

Modified: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/ClassInfo.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/ClassInfo.java	2010-04-09 10:19:26 UTC (rev 103747)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/spi/ClassInfo.java	2010-04-09 10:21:51 UTC (rev 103748)
@@ -120,7 +120,7 @@
    /**
     * Get the actual type parameters
     * 
-    * @return the type parameters
+    * @return the type parameters. If there are none, a zero length array is returned
     */
    TypeInfo[] getActualTypeArguments();
    

Added: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/classinfo/support/ClassInfoNotGeneric.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/classinfo/support/ClassInfoNotGeneric.java	                        (rev 0)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/classinfo/support/ClassInfoNotGeneric.java	2010-04-09 10:21:51 UTC (rev 103748)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.classinfo.support;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClassInfoNotGeneric
+{
+
+}

Modified: projects/jboss-reflect/trunk/src/test/java/org/jboss/test/classinfo/test/ClassInfoGenericClassTest.java
===================================================================
--- projects/jboss-reflect/trunk/src/test/java/org/jboss/test/classinfo/test/ClassInfoGenericClassTest.java	2010-04-09 10:19:26 UTC (rev 103747)
+++ projects/jboss-reflect/trunk/src/test/java/org/jboss/test/classinfo/test/ClassInfoGenericClassTest.java	2010-04-09 10:21:51 UTC (rev 103748)
@@ -78,6 +78,7 @@
 import org.jboss.test.classinfo.support.ClassInfoGenericSuperInterfaceString;
 import org.jboss.test.classinfo.support.ClassInfoGenericSuperInterfaceTypeVariable;
 import org.jboss.test.classinfo.support.ClassInfoGenericSuperInterfaceTypeVariableBounded;
+import org.jboss.test.classinfo.support.ClassInfoNotGeneric;
 
 
 
@@ -707,6 +708,13 @@
       assertEquals(classInfo.getActualTypeArguments()[1], valueType);
       assertSame(classInfo.getActualTypeArguments()[1], valueType);
    }
+   
+   public void testNotGenericClassInfoActualTypeArguments() throws Throwable
+   {
+      ClassInfo classInfo = (ClassInfo)getTypeInfoFactory().getTypeInfo(ClassInfoNotGeneric.class);
+      assertNotNull(classInfo.getActualTypeArguments());
+      assertEquals(0, classInfo.getActualTypeArguments().length);
+   }
 
    private Type getGenericReturnType(String methodName) throws Exception
    {




More information about the jboss-cvs-commits mailing list