[webbeans-commits] Webbeans SVN: r2005 - in ri/trunk/impl/src: main/java/org/jboss/webbeans/bootstrap and 9 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sun Mar 15 13:38:54 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-03-15 13:38:52 -0400 (Sun, 15 Mar 2009)
New Revision: 2005

Added:
   ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/
   ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java
   ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java
   ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java
   ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/
Removed:
   ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/
Modified:
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EventBean.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ResolvableAnnotatedClass.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/ScopeModel.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java
   ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
   ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/IntInjection.java
   ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducer.java
   ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducerTest.java
Log:
rename methods to reflect JDK

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -260,10 +260,10 @@
       // TODO CACHE THIS and rebuild on addBean
       // TODO: a bit crude, don't check *all* injectionpoints, only those listed
       // in the spec for passivation checks
-      for (AnnotatedItem<?, ?> injectionPoint : getInjectionPoints())
+      for (AnnotatedInjectionPoint<?, ?> injectionPoint : getInjectionPoints())
       {
          Annotation[] bindings = injectionPoint.getMetaAnnotationsAsArray(BindingType.class);
-         Bean<?> resolvedBean = manager.resolveByType(injectionPoint.getType(), bindings).iterator().next();
+         Bean<?> resolvedBean = manager.resolveByType(injectionPoint.getRawType(), bindings).iterator().next();
          if (MetaDataCache.instance().getScopeModel(this.getScopeType()).isPassivating())
          {
             if (Dependent.class.equals(resolvedBean.getScopeType()) && !resolvedBean.isSerializable() && (((injectionPoint instanceof AnnotatedField) && !((AnnotatedField<?>) injectionPoint).isTransient()) || (injectionPoint instanceof AnnotatedParameter)) )
@@ -314,7 +314,7 @@
       {
          throw new DefinitionException("type: " + getType() + " must specify a deployment type");
       }
-      else if (deploymentType.equals(Standard.class) && !STANDARD_WEB_BEAN_CLASSES.contains(getAnnotatedItem().getType()))
+      else if (deploymentType.equals(Standard.class) && !STANDARD_WEB_BEAN_CLASSES.contains(getAnnotatedItem().getRawType()))
       {
          throw new DefinitionException(getAnnotatedItem().getName() + " cannot have deployment type @Standard");
       }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -121,7 +121,7 @@
    protected void initType()
    {
       log.trace("Bean type specified in Java");
-      this.type = getAnnotatedItem().getType();
+      this.type = getAnnotatedItem().getRawType();
    }
 
    /**
@@ -270,7 +270,7 @@
    protected void preSpecialize()
    {
       super.preSpecialize();
-      if (getAnnotatedItem().getSuperclass() == null || getAnnotatedItem().getSuperclass().getType().equals(Object.class))
+      if (getAnnotatedItem().getSuperclass() == null || getAnnotatedItem().getSuperclass().getRawType().equals(Object.class))
       {
          throw new DefinitionException("Specializing bean must extend another bean " + toString());
       }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -62,7 +62,7 @@
    @SuppressWarnings("unchecked")
    protected Class<P> getTypeParameter()
    {
-      return (Class<P>) annotatedItem.getType().getTypeParameters()[0].getClass();
+      return (Class<P>) annotatedItem.getActualTypeArguments()[0].getClass();
    }
 
    /**
@@ -121,7 +121,7 @@
       {
          if (getAnnotatedItem() != null)
          {
-            this.type = getAnnotatedItem().getType();
+            this.type = getAnnotatedItem().getRawType();
          }
       }
       catch (ClassCastException e)

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -120,11 +120,11 @@
    {
       try
       {
-         this.type = getAnnotatedItem().getType();
+         this.type = getAnnotatedItem().getRawType();
       }
       catch (ClassCastException e)
       {
-         throw new RuntimeException(" Cannot cast producer type " + getAnnotatedItem().getType() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
+         throw new RuntimeException(" Cannot cast producer type " + getAnnotatedItem().getRawType() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
       }
    }
 

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -189,7 +189,7 @@
    protected void preSpecialize()
    {
       super.preSpecialize();
-      if (!manager.getEjbDescriptorCache().containsKey(getAnnotatedItem().getSuperclass().getType()))
+      if (!manager.getEjbDescriptorCache().containsKey(getAnnotatedItem().getSuperclass().getRawType()))
       {
          throw new DefinitionException("Annotation defined specializing EJB must have EJB superclass");
       }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EventBean.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EventBean.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -88,7 +88,7 @@
     */
    private void validateInjectionPoint()
    {
-      if (!this.getAnnotatedItem().getType().equals(Event.class))
+      if (!this.getAnnotatedItem().getRawType().equals(Event.class))
       {
          throw new DefinitionException("Event field/parameter is not of type Event<T>: " + this.getAnnotatedItem());
       }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -365,7 +365,7 @@
    protected void preSpecialize()
    {
       super.preSpecialize();
-      if (manager.getEjbDescriptorCache().containsKey(getAnnotatedItem().getSuperclass().getType()))
+      if (manager.getEjbDescriptorCache().containsKey(getAnnotatedItem().getSuperclass().getRawType()))
       {
          throw new DefinitionException("Simple bean must specialize a simple bean");
       }
@@ -458,7 +458,7 @@
    protected void initType()
    {
       log.trace("Bean type specified in Java");
-      this.type = getAnnotatedItem().getType();
+      this.type = getAnnotatedItem().getRawType();
    }
 
    /**

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -84,7 +84,7 @@
    {
       for (AnnotatedClass<?> clazz : deferredClasses)
       {
-         if (manager.getEjbDescriptorCache().containsKey(clazz.getType()))
+         if (manager.getEjbDescriptorCache().containsKey(clazz.getRawType()))
          {
             createEnterpriseBean(clazz);
          }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -40,7 +40,6 @@
 import org.jboss.webbeans.injection.MethodInjectionPoint;
 import org.jboss.webbeans.introspector.AnnotatedMethod;
 import org.jboss.webbeans.introspector.AnnotatedParameter;
-import org.jboss.webbeans.util.Reflections;
 
 /**
  * <p>
@@ -79,7 +78,7 @@
       checkObserverMethod();
 
       @SuppressWarnings("unchecked")
-      Class<T> c = (Class<T>) observerMethod.getAnnotatedParameters(Observes.class).get(0).getType();
+      Class<T> c = (Class<T>) observerMethod.getAnnotatedParameters(Observes.class).get(0).getRawType();
       this.eventType = c;
 
       this.bindings = observerMethod.getAnnotatedParameters(Observes.class).get(0).getBindingsAsArray();
@@ -114,7 +113,7 @@
       if (eventObjects.size() > 0)
       {
          AnnotatedParameter<?> eventParam = eventObjects.iterator().next();
-         if (Reflections.isParameterizedType(eventParam.getType()))
+         if (eventParam.isParameterizedType())
          {
             throw new DefinitionException(this + " cannot observe parameterized event types");
          }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -21,6 +21,7 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Type;
 import java.util.AbstractList;
 import java.util.Iterator;
 import java.util.List;
@@ -173,5 +174,10 @@
       }
       return parameterValues;
    }
+   
+   public Type getType()
+   {
+      return getRawType();
+   }
 
 }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ResolvableAnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ResolvableAnnotatedClass.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ResolvableAnnotatedClass.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -93,10 +93,16 @@
       throw new UnsupportedOperationException();
    }
 
-   public Class<T> getType()
+   public Class<T> getRawType()
    {
       return rawType;
    }
+   
+   @Override
+   public Type getType()
+   {
+      return getRawType();
+   }
 
    public boolean isFinal()
    {

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -129,9 +129,9 @@
     * 
     * @return The type of the element
     */
-   public Class<T> getType();
+   public Class<T> getRawType();
    
-   public Type getUnderlyingType();
+   public Type getType();
 
    /**
     * Extends Java Class assignability such that actual type parameters are also
@@ -199,5 +199,7 @@
    public String getName();
    
    public AnnotationStore getAnnotationStore();
+   
+   public boolean isParameterizedType();
 
 }
\ No newline at end of file

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -114,14 +114,14 @@
    /**
     * @see org.jboss.webbeans.introspector.AnnotatedItem
     */
-   public Class<T> getType()
+   public Class<T> getRawType()
    {
-      return delegate().getType();
+      return delegate().getRawType();
    }
    
-   public Type getUnderlyingType()
+   public Type getType()
    {
-      return delegate().getUnderlyingType();
+      return delegate().getType();
    }
 
    /**
@@ -223,5 +223,10 @@
    {
       return delegate().getFlattenedTypeHierarchy();
    }
+   
+   public boolean isParameterizedType()
+   {
+      return delegate().isParameterizedType();
+   }
 
 }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -53,17 +53,18 @@
       
    }
 
-   public Type getUnderlyingType()
+   public Type getType()
    {
-      return getType();
+      return getRawType();
    }
    
    // Cached string representation
    private String toString;
    private final AnnotationStore annotationStore;
-   private final Class<T> type;
+   private final Class<T> rawType;
    private final Set<? extends Type> flattenedTypes;
    private final boolean proxyable;
+   private final boolean _parameterizedType;
 
    /**
     * Constructor
@@ -74,18 +75,20 @@
     * @param annotationMap A map of annotation to register
     * 
     */
-   public AbstractAnnotatedItem(AnnotationStore annotatedItemHelper, Class<T> type)
+   public AbstractAnnotatedItem(AnnotationStore annotatedItemHelper, Class<T> rawType)
    {
       this.annotationStore = annotatedItemHelper;
-      this.type = type;
-      this.flattenedTypes = new Reflections.HierarchyDiscovery<Type>(type).getFlattenedTypes();
+      this.rawType = rawType;
+      this._parameterizedType = Reflections.isParameterizedType(rawType);
+      this.flattenedTypes = new Reflections.HierarchyDiscovery<Type>(rawType).getFlattenedTypes();
       this.proxyable = Proxies.isTypesProxyable(flattenedTypes);
    }
    
    public AbstractAnnotatedItem(AnnotationStore annotatedItemHelper)
    {
       this.annotationStore = annotatedItemHelper;
-      this.type = null;
+      this.rawType = null;
+      this._parameterizedType = false;
       this.flattenedTypes = null;
       this.proxyable = false;
    }
@@ -145,7 +148,7 @@
       if (other instanceof AnnotatedItem)
       {
          AnnotatedItem<?, ?> that = (AnnotatedItem<?, ?>) other;
-         return this.getAnnotationsAsSet().equals(that.getAnnotationsAsSet()) && this.getType().equals(that.getType());
+         return this.getAnnotationsAsSet().equals(that.getAnnotationsAsSet()) && this.getRawType().equals(that.getRawType());
       }
       return false;
    }
@@ -161,7 +164,7 @@
     */
    public boolean isAssignableFrom(AnnotatedItem<?, ?> that)
    {
-      return isAssignableFrom(that.getType(), that.getActualTypeArguments());
+      return isAssignableFrom(that.getRawType(), that.getActualTypeArguments());
    }
 
    /**
@@ -208,7 +211,7 @@
     */
    private boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
    {
-      return Types.boxedType(getType()).isAssignableFrom(Types.boxedType(type)) && Arrays.equals(getActualTypeArguments(), actualTypeArguments);
+      return Types.boxedType(getRawType()).isAssignableFrom(Types.boxedType(type)) && Arrays.equals(getActualTypeArguments(), actualTypeArguments);
    }
 
    /**
@@ -219,7 +222,7 @@
    @Override
    public int hashCode()
    {
-      return getType().hashCode();
+      return getRawType().hashCode();
    }
 
    /**
@@ -272,9 +275,9 @@
       return proxyable;
    }
    
-   public Class<T> getType()
+   public Class<T> getRawType()
    {
-      return type;
+      return rawType;
    }
    
    public Set<? extends Type> getFlattenedTypeHierarchy()
@@ -288,5 +291,10 @@
    {
       return getAnnotationStore().isDeclaredAnnotationPresent(annotationType);
    }
+   
+   public boolean isParameterizedType()
+   {
+      return _parameterizedType;
+   }
 
 }
\ No newline at end of file

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -159,7 +159,7 @@
     */
    public T getValue(Manager manager)
    {
-      return manager.getInstanceByType(getType(), getMetaAnnotationsAsArray(BindingType.class));
+      return manager.getInstanceByType(getRawType(), getMetaAnnotationsAsArray(BindingType.class));
    }
 
    /**

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -255,7 +255,6 @@
    private String toString;
    
    private final boolean _nonStaticMemberClass;
-   private final boolean _parameterizedType;
    private final boolean _abstract;
 
    
@@ -284,7 +283,6 @@
       this.declaredAnnotatedFields = new AnnotatedFieldMap();
       this.declaredMetaAnnotatedFields = new AnnotatedFieldMap();
       this._nonStaticMemberClass = Reflections.isNonMemberInnerClass(rawType);
-      this._parameterizedType = Reflections.isParameterizedType(rawType);
       this._abstract = Reflections.isAbstract(rawType);
       for (Class<?> c = clazz; c != Object.class && c != null; c = c.getSuperclass())
       {
@@ -481,11 +479,6 @@
       return _nonStaticMemberClass;
    }
    
-   public boolean isParameterizedType()
-   {
-      return _parameterizedType;
-   }
-   
    public boolean isAbstract()
    {
       return _abstract;
@@ -613,9 +606,4 @@
       return toString;
    }
    
-   public AnnotatedClass<T> wrap(Set<Annotation> annotations)
-   {
-      throw new UnsupportedOperationException();
-   }
-   
 }
\ No newline at end of file

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -113,7 +113,7 @@
          if (method.getParameterAnnotations()[i].length > 0)
          {
             Class<? extends Object> clazz = method.getParameterTypes()[i];
-            AnnotatedParameter<Object> parameter = new AnnotatedParameterImpl<Object>(method.getParameterAnnotations()[i], (Class<Object>) clazz, this);
+            AnnotatedParameter<?> parameter = AnnotatedParameterImpl.of(method.getParameterAnnotations()[i], (Class<Object>) clazz, this);
             this.parameters.add(parameter);
             for (Annotation annotation : parameter.getAnnotationsAsSet())
             {
@@ -126,7 +126,7 @@
          else
          {
             Class<? extends Object> clazz = method.getParameterTypes()[i];
-            AnnotatedParameter<Object> parameter = new AnnotatedParameterImpl<Object>(new Annotation[0], (Class<Object>) clazz, this);
+            AnnotatedParameter<?> parameter = AnnotatedParameterImpl.of(new Annotation[0], (Class<Object>) clazz, this);
             this.parameters.add(parameter);
          }  
       }
@@ -153,7 +153,7 @@
    }
    
    @Override
-   public Type getUnderlyingType()
+   public Type getType()
    {
       return underlyingType;
    }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -65,7 +65,7 @@
     * @param annotations The annotations array
     * @param type The type of the parameter
     */
-   public AnnotatedParameterImpl(Annotation[] annotations, Class<T> type, AnnotatedMember<?, ?> declaringMember)
+   private AnnotatedParameterImpl(Annotation[] annotations, Class<T> type, AnnotatedMember<?, ?> declaringMember)
    {
       super(AnnotationStore.of(annotations, annotations), type);
       this.type = type;
@@ -135,7 +135,7 @@
     */
    public T getValue(Manager manager)
    {
-      return manager.getInstanceByType(getType(), getMetaAnnotationsAsArray(BindingType.class));
+      return manager.getInstanceByType(getRawType(), getMetaAnnotationsAsArray(BindingType.class));
    }
 
    /**
@@ -166,7 +166,7 @@
             buffer.append("static ");
          if (_final)
             buffer.append("final ");
-         buffer.append(getType().getName());
+         buffer.append(getRawType().getName());
          buffer.append(" for operation ");
          buffer.append(getDeclaringMember().toString());
          toString = buffer.toString();

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -61,9 +61,9 @@
     */
    protected void initType()
    {
-      if (!Annotation.class.isAssignableFrom(getType()))
+      if (!Annotation.class.isAssignableFrom(getRawType()))
       {
-         throw new DefinitionException(getMetaAnnotation().toString() + " can only be applied to an annotation, it was applied to " + getType());
+         throw new DefinitionException(getMetaAnnotation().toString() + " can only be applied to an annotation, it was applied to " + getRawType());
       }
    }
 
@@ -80,9 +80,9 @@
     * 
     * @return The type
     */
-   public Class<T> getType()
+   public Class<T> getRawType()
    {
-      return annotatedAnnotation.getType();
+      return annotatedAnnotation.getRawType();
    }
 
    /**
@@ -120,7 +120,7 @@
    @Override
    public String toString()
    {
-     return (isValid() ? "Valid" : "Invalid") + " annotation model for " + getType();
+     return (isValid() ? "Valid" : "Invalid") + " annotation model for " + getRawType();
    }
    
 }
\ No newline at end of file

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -69,7 +69,7 @@
    {
       for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMembers())
       {
-         if ((Reflections.isArrayType(annotatedMethod.getType()) || Annotation.class.isAssignableFrom(annotatedMethod.getType())) && !nonBindingTypes.contains(annotatedMethod))
+         if ((Reflections.isArrayType(annotatedMethod.getRawType()) || Annotation.class.isAssignableFrom(annotatedMethod.getRawType())) && !nonBindingTypes.contains(annotatedMethod))
          {
             throw new DefinitionException("Member of array type or annotation type must be annotated @NonBinding " + annotatedMethod);
          }
@@ -126,7 +126,7 @@
     */
    public boolean isEqual(Annotation instance, Annotation other)
    {
-      if (instance.annotationType().equals(getType()) && other.annotationType().equals(getType()))
+      if (instance.annotationType().equals(getRawType()) && other.annotationType().equals(getRawType()))
       {
          for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMembers())
          {
@@ -169,7 +169,7 @@
    @Override
    public String toString()
    {
-     return (isValid() ? "Valid" : "Invalid") + " binding type model for " + getType() + " with non-binding types " + getNonBindingTypes();
+     return (isValid() ? "Valid" : "Invalid") + " binding type model for " + getRawType() + " with non-binding types " + getNonBindingTypes();
    }
 
 }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/ScopeModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/ScopeModel.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/ScopeModel.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -82,7 +82,7 @@
       String valid = isValid() ? "Valid " : "Invalid";
       String normal = isNormal() ? "normal " : "non-normal ";
       String passivating = isPassivating() ? "passivating " : "pon-passivating ";
-      return valid + normal + passivating + " scope model for " + getType();
+      return valid + normal + passivating + " scope model for " + getRawType();
    }
 
 }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -230,7 +230,7 @@
    @Deprecated
    public Class<? extends Annotation> getStereotypeClass()
    {
-      return getType();
+      return getRawType();
    }
 
    /**

Modified: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java	2009-03-15 17:25:15 UTC (rev 2004)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -24,7 +24,7 @@
       AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class);
       assert annotatedElement.getAnnotationsAsSet().size() == 1;
       assert annotatedElement.getAnnotation(Production.class) != null;
-      assert annotatedElement.getType().equals(Order.class);
+      assert annotatedElement.getRawType().equals(Order.class);
    }
    
    @Test

Added: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java	                        (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -0,0 +1,42 @@
+package org.jboss.webbeans.test.unit.implementation.producer.field;
+
+import java.util.List;
+
+public class ParameterizedListInjection
+{
+
+   private List<String> value;
+
+   //@Current
+   private List<String> fieldInjection;
+
+   private List<String> setterInjection;
+
+   //@Initializer
+   public void init(List<String> setterInjection)
+   {
+      this.setterInjection = setterInjection;
+   }
+
+   /*@Initializer
+   public ParameterizedListInjection(List<String> com)
+   {
+      this.value = com;
+   }*/
+
+   public java.util.List<String> getValue()
+   {
+      return value;
+   }
+
+   public List<String> getFieldInjection()
+   {
+      return fieldInjection;
+   }
+
+   public List<String> getSetterInjection()
+   {
+      return setterInjection;
+   }
+
+}


Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java	                        (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.test.unit.implementation.producer.field;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.inject.Produces;
+
+public class ParameterizedProducer
+{
+
+   @Produces
+   public List<String> create()
+   {
+      return Arrays.asList("aaa", "bbb");
+   }
+
+}


Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java	                        (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -0,0 +1,25 @@
+package org.jboss.webbeans.test.unit.implementation.producer.field;
+
+import java.util.List;
+
+import javax.inject.TypeLiteral;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+
+ at Artifact
+public class ParameterizedProducerTest extends AbstractWebBeansTest
+{
+
+   //@Test
+   public void testInjectManagerProducer()
+   {
+      assert manager.getInstanceByType(new TypeLiteral<List<String>>(){}).size() == 2;
+
+      ParameterizedListInjection item = manager.getInstanceByType(ParameterizedListInjection.class);
+      assert item.getValue().size() == 2;
+      assert item.getFieldInjection().size() == 2;
+      assert item.getSetterInjection().size() == 2;
+
+   }
+}


Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method (from rev 2003, ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method)

Modified: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/IntInjection.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/IntInjection.java	2009-03-15 15:53:42 UTC (rev 2003)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/IntInjection.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.unit.implementation.producer.method;
+package org.jboss.webbeans.test.unit.implementation.producer.field.method;
 
 import javax.inject.Initializer;
 

Modified: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducer.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/ManagerProducer.java	2009-03-15 15:53:42 UTC (rev 2003)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducer.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.unit.implementation.producer.method;
+package org.jboss.webbeans.test.unit.implementation.producer.field.method;
 
 import javax.inject.Current;
 import javax.inject.Produces;

Modified: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducerTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/ManagerProducerTest.java	2009-03-15 15:53:42 UTC (rev 2003)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducerTest.java	2009-03-15 17:38:52 UTC (rev 2005)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.test.unit.implementation.producer.method;
+package org.jboss.webbeans.test.unit.implementation.producer.field.method;
 
 import org.jboss.testharness.impl.packaging.Artifact;
 import org.jboss.webbeans.test.unit.AbstractWebBeansTest;




More information about the weld-commits mailing list