[jboss-cvs] JBossAS SVN: r102448 - in projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins: introspection and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 16 05:35:42 EDT 2010


Author: kabir.khan at jboss.com
Date: 2010-03-16 05:35:42 -0400 (Tue, 16 Mar 2010)
New Revision: 102448

Removed:
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/WildcardNumberInfo.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/WildcardTypeInfo.java
Modified:
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/introspection/IntrospectionTypeInfoFactoryImpl.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistHelper.java
   projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfoFactoryImpl.java
Log:
[JBREFLECT-5] Return the raw types for wildcards

Deleted: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/WildcardNumberInfo.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/WildcardNumberInfo.java	2010-03-16 07:51:00 UTC (rev 102447)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/WildcardNumberInfo.java	2010-03-16 09:35:42 UTC (rev 102448)
@@ -1,56 +0,0 @@
-/*
-* 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.reflect.plugins;
-
-import org.jboss.reflect.spi.NumberInfo;
-import org.jboss.util.JBossStringBuilder;
-
-/**
- * TypeInfo for a generic type with numeric bounds
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class WildcardNumberInfo extends NumberInfo
-{
-   private static final long serialVersionUID = 1L;
-
-   private final String name;
-   
-   public WildcardNumberInfo(String name, NumberInfo info)
-   {
-      super(info.ordinal(), info.getType());
-      this.name = name;
-   }
-
-   @Override
-   public void toShortString(JBossStringBuilder buffer)
-   {
-      buffer.append(name);
-   }
-
-   @Override
-   protected void toString(JBossStringBuilder buffer)
-   {
-      buffer.append(name);
-   }
-}

Deleted: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/WildcardTypeInfo.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/WildcardTypeInfo.java	2010-03-16 07:51:00 UTC (rev 102447)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/WildcardTypeInfo.java	2010-03-16 09:35:42 UTC (rev 102448)
@@ -1,58 +0,0 @@
-/*
-* 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.reflect.plugins;
-
-import org.jboss.reflect.spi.ClassInfo;
-import org.jboss.reflect.spi.DelegateClassInfo;
-import org.jboss.util.JBossStringBuilder;
-
-/**
- * Type info for a wildcard type
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class WildcardTypeInfo extends DelegateClassInfo
-{
-   private static final long serialVersionUID = 1L;
-   
-   private final String name;
-   
-   public WildcardTypeInfo(String name, ClassInfo delegate)
-   {
-      super(delegate);
-      this.name = name;
-   }
-
-   @Override
-   public void toShortString(JBossStringBuilder buffer)
-   {
-      buffer.append(name);
-   }
-
-   @Override
-   protected void toString(JBossStringBuilder buffer)
-   {
-      buffer.append("name=").append(name);
-   }
-}
-

Modified: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/introspection/IntrospectionTypeInfoFactoryImpl.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/introspection/IntrospectionTypeInfoFactoryImpl.java	2010-03-16 07:51:00 UTC (rev 102447)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/introspection/IntrospectionTypeInfoFactoryImpl.java	2010-03-16 09:35:42 UTC (rev 102448)
@@ -22,7 +22,6 @@
 package org.jboss.reflect.plugins.introspection;
 
 import java.lang.annotation.Annotation;
-import java.lang.ref.WeakReference;
 import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
@@ -51,14 +50,11 @@
 import org.jboss.reflect.plugins.GenericsUtil;
 import org.jboss.reflect.plugins.MethodInfoImpl;
 import org.jboss.reflect.plugins.PackageInfoImpl;
-import org.jboss.reflect.plugins.WildcardNumberInfo;
-import org.jboss.reflect.plugins.WildcardTypeInfo;
 import org.jboss.reflect.spi.AnnotationInfo;
 import org.jboss.reflect.spi.AnnotationValue;
 import org.jboss.reflect.spi.ArrayInfo;
 import org.jboss.reflect.spi.ClassInfo;
 import org.jboss.reflect.spi.InterfaceInfo;
-import org.jboss.reflect.spi.ModifierInfo;
 import org.jboss.reflect.spi.NumberInfo;
 import org.jboss.reflect.spi.PrimitiveInfo;
 import org.jboss.reflect.spi.TypeInfo;
@@ -725,25 +721,7 @@
    @Override
    protected TypeInfo getWildcardType(WildcardType type)
    {
-      //Look in the cache first
-      String genericName = GenericsUtil.getGenericName(type);
-      ClassLoader cl = GenericsUtil.findClassLoader(type);
-      Map<String, TypeInfo> cache = getClassLoaderCache(cl);
-      TypeInfo info = cache.get(genericName);
-      if (info != null)
-         return info;
-      
-      //Create the wildcard type info
       Type bound = type.getLowerBounds().length > 0 ? type.getLowerBounds()[0] : type.getUpperBounds()[0];
-      ClassInfo raw = (ClassInfo)getTypeInfo(bound);
-      if (raw instanceof NumberInfo)
-         info = new WildcardNumberInfo(genericName, (NumberInfo)raw);
-      else
-         info = new WildcardTypeInfo(genericName, raw);
-      
-      //Cache the wildcard type info
-      cache.put(genericName, info);
-      
-      return info;
+      return getTypeInfo(bound);
    }
 }

Modified: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistHelper.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistHelper.java	2010-03-16 07:51:00 UTC (rev 102447)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistHelper.java	2010-03-16 09:35:42 UTC (rev 102448)
@@ -21,8 +21,6 @@
 */ 
 package org.jboss.reflect.plugins.javassist;
 
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
 import java.util.Arrays;
 import java.util.Stack;
 
@@ -37,7 +35,6 @@
 import javassist.bytecode.SignatureAttribute.TypeParameter;
 import javassist.bytecode.SignatureAttribute.TypeVariable;
 
-import org.jboss.reflect.spi.ClassInfo;
 import org.jboss.reflect.spi.TypeInfo;
 
 /**

Modified: projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfoFactoryImpl.java
===================================================================
--- projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfoFactoryImpl.java	2010-03-16 07:51:00 UTC (rev 102447)
+++ projects/jboss-reflect/trunk/src/main/java/org/jboss/reflect/plugins/javassist/JavassistTypeInfoFactoryImpl.java	2010-03-16 09:35:42 UTC (rev 102448)
@@ -44,16 +44,12 @@
 import org.jboss.reflect.plugins.AnnotationHelper;
 import org.jboss.reflect.plugins.AnnotationValueFactory;
 import org.jboss.reflect.plugins.AnnotationValueImpl;
-import org.jboss.reflect.plugins.ArrayInfoImpl;
 import org.jboss.reflect.plugins.EnumConstantInfoImpl;
 import org.jboss.reflect.plugins.GenericsUtil;
-import org.jboss.reflect.plugins.WildcardNumberInfo;
-import org.jboss.reflect.plugins.WildcardTypeInfo;
 import org.jboss.reflect.plugins.javassist.classpool.ClassPoolFactory;
 import org.jboss.reflect.plugins.javassist.classpool.DefaultClassPoolFactory;
 import org.jboss.reflect.spi.AnnotationInfo;
 import org.jboss.reflect.spi.AnnotationValue;
-import org.jboss.reflect.spi.ArrayInfo;
 import org.jboss.reflect.spi.ClassInfo;
 import org.jboss.reflect.spi.DelegateClassInfo;
 import org.jboss.reflect.spi.MutableClassInfo;
@@ -743,26 +739,9 @@
 
    protected TypeInfo getWildcardType(WildcardType type)
    {
-      //Look in the cache first
-      String genericName = GenericsUtil.getGenericName(type);
-      ClassLoader cl = GenericsUtil.findClassLoader(type);
-      Map<String, WeakReference<TypeInfo>> cache = getClassLoaderCache(cl);
-      TypeInfo info = getFromCache(genericName, cache);
-      if (info != null)
-         return info;
-      
       //Create the wildcard type info
       Type bound = type.getLowerBounds().length > 0 ? type.getLowerBounds()[0] : type.getUpperBounds()[0];
-      ClassInfo raw = (ClassInfo)getTypeInfo(bound);
-      if (raw instanceof NumberInfo)
-         info = new WildcardNumberInfo(genericName, (NumberInfo)raw);
-      else
-         info = new WildcardTypeInfo(genericName, raw);
-      
-      //Cache the wildcard type info
-      cache.put(genericName, new WeakReference<TypeInfo>(info));
-      
-      return info;
+      return getTypeInfo(bound);
    }
    
    @Override




More information about the jboss-cvs-commits mailing list