[webbeans-commits] Webbeans SVN: r3824 - ri/trunk/impl/src/main/java/org/jboss/webbeans and 15 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Sep 30 19:39:56 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-09-30 19:39:55 -0400 (Wed, 30 Sep 2009)
New Revision: 3824

Modified:
   ri/trunk/api/pom.xml
   ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Strings.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/ParameterizedTypeImpl.java
   ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java
   ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java
   ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java
   ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java
   ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java
   ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java
   ri/trunk/version-matrix/pom.xml
   tck/trunk/impl/pom.xml
Log:
Update to a newer javax.inject api and tck, various small cleanups

Modified: ri/trunk/api/pom.xml
===================================================================
--- ri/trunk/api/pom.xml	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/api/pom.xml	2009-09-30 23:39:55 UTC (rev 3824)
@@ -28,7 +28,7 @@
       
       <dependency>
          <groupId>javax.inject</groupId>
-         <artifactId>inject-api</artifactId>
+         <artifactId>javax.inject</artifactId>
       </dependency>
 	</dependencies>
 </project>

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -877,7 +877,7 @@
       }
       if (getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal())
       {
-         if (creationalContext != null || (creationalContext == null && getContext(bean.getScope()).get(bean) != null))
+         if (creationalContext != null || getContext(bean.getScope()).get(bean) != null)
          {
             return clientProxyProvider.getClientProxy(this, bean);
          }

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -96,10 +96,7 @@
       for (ObserverMethodImpl<?, ?> observer : getEnvironment().getObservers())
       {
          log.debug("Observer : " + observer);
-         if (observer instanceof ObserverMethodImpl<?, ?>)
-         {
-            observer.initialize();
-         }
+         observer.initialize();
          manager.addObserver(observer);
       }
       

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -92,7 +92,7 @@
          boolean needCreationLock = isCreationLockRequired();
          try
          {
-            if(needCreationLock)
+            if (needCreationLock)
             {
                creationLock.lock();
                beanInstance = getBeanStore().get(id);

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -56,6 +56,7 @@
       this.beanStore.set(beanStore);
    }
    
+   @Override
    protected boolean isCreationLockRequired()
    {
       return true;

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -40,7 +40,7 @@
 public class ContextLifecycle implements Lifecycle, Service
 {
    
-   public static LogProvider log = Logging.getLogProvider(ContextLifecycle.class);
+   public static final LogProvider log = Logging.getLogProvider(ContextLifecycle.class);
 
    private final AbstractApplicationContext applicationContext;
    private final AbstractApplicationContext singletonContext;

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -40,7 +40,7 @@
 
    private static LogProvider log = Logging.getLogProvider(JavaSEConversationTerminator.class);
 
-   private ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
+   private transient ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
 
    public Future<?> scheduleForTermination(Runnable terminationTask, long timeoutInMilliseconds)
    {

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -19,6 +19,7 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
@@ -259,7 +260,7 @@
 
    public Type[] getActualTypeArguments()
    {
-      return actualTypeArguments;
+      return Arrays.copyOf(actualTypeArguments, actualTypeArguments.length);
    }
 
    public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy()

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -19,12 +19,13 @@
 import java.util.Arrays;
 
 import org.jboss.webbeans.introspector.ConstructorSignature;
-import org.jboss.webbeans.introspector.MethodSignature;
 import org.jboss.webbeans.introspector.WBConstructor;
 
 public class ConstructorSignatureImpl implements ConstructorSignature
 {
    
+   private static final long serialVersionUID = -9111642596078876778L;
+   
    private final String[] parameterTypes;
    
    public ConstructorSignatureImpl(WBConstructor<?> method)
@@ -40,9 +41,9 @@
    @Override
    public boolean equals(Object obj)
    {
-      if (obj instanceof ConstructorSignatureImpl)
+      if (obj instanceof ConstructorSignature)
       {
-         MethodSignature that = (MethodSignature) obj;
+         ConstructorSignature that = (ConstructorSignature) obj;
          return Arrays.equals(this.getParameterTypes(), that.getParameterTypes());
       }
       else
@@ -59,7 +60,7 @@
    
    public String[] getParameterTypes()
    {
-      return parameterTypes;
+      return Arrays.copyOf(parameterTypes, parameterTypes.length);
    }
    
 }
\ No newline at end of file

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -81,7 +81,7 @@
    
    public String[] getParameterTypes()
    {
-      return parameterTypes;
+      return Arrays.copyOf(parameterTypes, parameterTypes.length);
    }
    
    @Override

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -30,6 +30,7 @@
 import org.jboss.webbeans.introspector.WBClass;
 import org.jboss.webbeans.introspector.WBMethod;
 import org.jboss.webbeans.resources.ClassTransformer;
+import org.jboss.webbeans.util.Names;
 
 import com.google.common.base.Supplier;
 import com.google.common.collect.Multimaps;
@@ -57,7 +58,7 @@
    private final Map<String, WBMethod<?, ?>> namedMembers;
 
    // Cached string representation
-   private String toString;
+   private final String toString;
    
    public static <A extends Annotation> WBAnnotation<A> of(Class<A> annotationType, ClassTransformer classTransformer)
    {
@@ -75,6 +76,7 @@
    {
       super(annotationType, annotationType, null, AnnotationStore.of(annotationType, classTransformer.getTypeStore().get(annotationType), classTransformer.getTypeStore().get(annotationType), classTransformer.getTypeStore()), classTransformer);
       this.clazz = annotationType;
+      this.toString = "class " + Names.classToString(getDelegate());
       members = new HashSet<WBMethod<?, ?>>();
       annotatedMembers = Multimaps.newSetMultimap(new HashMap<Class<? extends Annotation>, Collection<WBMethod<?, ?>>>(), new Supplier<Set<WBMethod<?, ?>>>()
       {
@@ -141,13 +143,10 @@
    @Override
    public String toString()
    {
-      if (toString != null)
-      {
-         return toString;
-      }
       return toString;
    }
 
+   @Override
    public Class<T> getDelegate()
    {
       return clazz;

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -118,7 +118,7 @@
    private final SetMultimap<Class<? extends Annotation>, WBConstructor<?>> constructorsByAnnotatedParameters;
 
    // Cached string representation
-   private String toString;
+   private final String toString;
 
    private final boolean _nonStaticMemberClass;
    private final boolean _abstract;
@@ -139,6 +139,7 @@
    protected WBClassImpl(Class<T> rawType, Type type, AnnotatedType<T> annotatedType, AnnotationStore annotationStore, ClassTransformer classTransformer)
    {
       super(annotationStore, rawType, type);
+      this.toString = "class " + Names.classToString(rawType);
       this.name = rawType.getName();
       this._simpleName = rawType.getSimpleName();
       if (rawType.getSuperclass() != null)
@@ -448,6 +449,7 @@
     * 
     * @return The class
     */
+   @Override
    public Class<T> getDelegate()
    {
       return getJavaClass();
@@ -650,11 +652,6 @@
    @Override
    public String toString()
    {
-      if (toString != null)
-      {
-         return toString;
-      }
-      toString = "Annotated class " + Names.classToString(getDelegate());
       return toString;
    }
    

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -387,7 +387,7 @@
       }
       catch (Exception e)
       {
-         throw new RuntimeException("Error accessing constructor (with parameters " + parameterTypes + ") of " + clazz, e);
+         throw new RuntimeException("Error accessing constructor (with parameters " + Arrays.toString(parameterTypes) + ") of " + clazz, e);
       }
    }
 

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Strings.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Strings.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Strings.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -20,7 +20,9 @@
 import java.util.Collection;
 import java.util.Map;
 import java.util.StringTokenizer;
+import java.util.Map.Entry;
 
+
 /**
  * String utilities
  * 
@@ -79,26 +81,26 @@
       StringBuilder buffer = new StringBuilder();
       if (map == null)
       {
-         buffer.append(header + "null\n");
+         buffer.append(header).append("null\n");
          return buffer.toString();
       }
-      buffer.append(header + "[" + map.size() + " entries]\n");
+      buffer.append(header).append("[").append(map.size()).append(" entries]\n");
       int i = 0;
-      for (Object key : map.keySet())
+      for (Entry<?, ?> entry: map.entrySet())
       {
-         Object value = map.get(key);
-         buffer.append("  #" + ++i + ": " + key.toString() + " -> ");
-         if (value instanceof Iterable)
+         Object value = entry.getValue();
+         buffer.append("  #").append(++i).append(": ").append(entry.getKey()).append(" -> ");
+         if (value instanceof Iterable<?>)
          {
             buffer.append("\n");
             for (Object subValue : (Iterable<?>) value)
             {
-               buffer.append("    " + subValue.toString() + "\n");
+               buffer.append("    ").append(subValue.toString()).append("\n");
             }
          }
          else
          {
-            buffer.append(value.toString() + "\n");
+            buffer.append(value.toString()).append("\n");
          }
       }
       return buffer.toString();

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/ParameterizedTypeImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/ParameterizedTypeImpl.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/reflection/ParameterizedTypeImpl.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -28,14 +28,14 @@
 
    public ParameterizedTypeImpl(Type rawType, Type[] actualTypeArguments, Type ownerType)
    {
-      this.actualTypeArguments = actualTypeArguments;
+      this.actualTypeArguments = Arrays.copyOf(actualTypeArguments, actualTypeArguments.length);
       this.rawType = rawType;
       this.ownerType = ownerType;
    }
 
    public Type[] getActualTypeArguments()
    {
-      return actualTypeArguments;
+      return Arrays.copyOf(actualTypeArguments, actualTypeArguments.length);
    }
 
    public Type getOwnerType()
@@ -75,6 +75,7 @@
       
    }
 
+   @Override
    public String toString()
    {
       StringBuilder sb = new StringBuilder();

Modified: ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -10,8 +10,8 @@
 import org.atinject.tck.Tck;
 import org.atinject.tck.auto.Car;
 import org.atinject.tck.auto.Convertible;
-import org.atinject.tck.auto.DriversSeat;
 import org.atinject.tck.auto.FuelTank;
+import org.atinject.tck.auto.Seat;
 import org.atinject.tck.auto.V8Engine;
 import org.atinject.tck.auto.accessories.Cupholder;
 import org.atinject.tck.auto.accessories.SpareTire;
@@ -21,7 +21,7 @@
 public class AtInjectTCK
 {
    
-   private static final List<Class<?>> classes = Arrays.<Class<?>>asList(Convertible.class, DriversSeat.class, DriversSeatProducer.class, V8Engine.class, Cupholder.class, FuelTank.class, SpareTireProducer.class, SpareTire.class);
+   private static final List<Class<?>> classes = Arrays.<Class<?>>asList(Convertible.class, Seat.class, DriversSeatProducer.class, V8Engine.class, Cupholder.class, FuelTank.class, SpareTireProducer.class, SpareTire.class);
    
    public static Test suite()
    {

Modified: ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/DriversSeatProducer.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -1,6 +1,9 @@
 package org.jboss.webbeans.atinject.tck;
 
 import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.inject.Inject;
 
 import org.atinject.tck.auto.Drivers;
 import org.atinject.tck.auto.DriversSeat;
@@ -8,11 +11,21 @@
 
 public class DriversSeatProducer
 {
+   
+   private final InjectionTarget<DriversSeat> injectionTarget;
+   private final BeanManager beanManager;
+   
+   @Inject
+   public DriversSeatProducer(BeanManager beanManager)
+   {
+      this.injectionTarget = beanManager.createInjectionTarget(beanManager.createAnnotatedType(DriversSeat.class));
+      this.beanManager = beanManager;
+   }
 
    @Produces @Drivers
-   public Seat produceDriversSeat(DriversSeat seat)
+   public Seat produceDriversSeat()
    {
-      return seat;
+      return injectionTarget.produce(beanManager.<DriversSeat>createCreationalContext(null));
    }
    
 }

Modified: ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -1,6 +1,9 @@
 package org.jboss.webbeans.atinject.tck;
 
 import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.inject.Inject;
 import javax.inject.Named;
 
 import org.atinject.tck.auto.Tire;
@@ -8,11 +11,21 @@
 
 public class SpareTireProducer
 {
+   
+   private final InjectionTarget<SpareTire> injectionTarget;
+   private final BeanManager beanManager;
+   
+   @Inject
+   public SpareTireProducer(BeanManager beanManager)
+   {
+      this.injectionTarget = beanManager.createInjectionTarget(beanManager.createAnnotatedType(SpareTire.class));
+      this.beanManager = beanManager;
+   }
 
    @Produces @Named("spare")
-   public Tire produceSpareTire(SpareTire spareTire)
+   public Tire produceSpareTire()
    {
-      return spareTire;
+      return injectionTarget.produce(beanManager.<SpareTire>createCreationalContext(null));
    }
    
 }

Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -14,15 +14,7 @@
 public class ManagersImpl implements Managers
 {
    
-   public static ThreadLocal<ServletContext> SERVLET_CONTEXT = new ThreadLocal<ServletContext>()
-   {
-      
-      protected ServletContext initialValue() 
-      {
-         return new MockServletContext("");
-      }
-      
-   };
+   private static final ServletContext SERVLET_CONTEXT = new MockServletContext("");
 
    public BeanManager getManager()
    {
@@ -32,7 +24,7 @@
       }
       else
       {
-         return ServletHelper.getModuleBeanManager(SERVLET_CONTEXT.get());
+         return ServletHelper.getModuleBeanManager(SERVLET_CONTEXT);
       }
    }
 

Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/SimpleServiceRegistry.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -99,7 +99,14 @@
    @Override
    public boolean equals(Object obj)
    {
-      return services.equals(obj);
+      if (obj instanceof Map<?, ?>)
+      {
+         return services.equals(obj);
+      }
+      else
+      {
+         return false;
+      }
    }
    
    public Iterator<Service> iterator()

Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -42,8 +42,8 @@
 {
    
 
-   private Set<Class<?>> beanClasses;
-   private Collection<URL> webBeansXmlFiles;
+   private Collection<Class<?>> beanClasses;
+   private Collection<URL> beansXmlFiles;
    private List<EjbDescriptor<?>> ejbs;
    private final ServiceRegistry services;
    
@@ -51,7 +51,7 @@
    {
       this.services = new SimpleServiceRegistry();
       this.beanClasses = new HashSet<Class<?>>();
-      this.webBeansXmlFiles = new HashSet<URL>();
+      this.beansXmlFiles = new HashSet<URL>();
    }
 
    public Collection<Class<?>> getBeanClasses()
@@ -59,13 +59,9 @@
       return beanClasses;
    }
    
-   public void setBeanClasses(Iterable<Class<?>> beanClasses)
+   public void setBeanClasses(Collection<Class<?>> beanClasses)
    {
-      this.beanClasses.clear();
-      for (Class<?> clazz : beanClasses)
-      {
-         this.beanClasses.add(clazz);
-      }
+      this.beanClasses = beanClasses;
       ejbs = new ArrayList<EjbDescriptor<?>>();
       for (Class<?> ejbClass : discoverEjbs(getBeanClasses()))
       {
@@ -75,16 +71,12 @@
 
    public Collection<URL> getBeansXml()
    {
-      return webBeansXmlFiles;
+      return beansXmlFiles;
    }
    
-   public void setWebBeansXmlFiles(Iterable<URL> webBeansXmlFiles)
+   public void setBeansXmlFiles(Collection<URL> beansXmlFiles)
    {
-      this.webBeansXmlFiles.clear();
-      for (URL url : webBeansXmlFiles)
-      {
-         this.webBeansXmlFiles.add(url);
-      }
+      this.beansXmlFiles = beansXmlFiles;
    }
 
    public List<BeanDeploymentArchive> getBeanDeploymentArchives()

Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -1,6 +1,7 @@
 package org.jboss.webbeans.mock;
 
 import java.net.URL;
+import java.util.Collection;
 
 import org.jboss.webbeans.BeanManagerImpl;
 
@@ -36,8 +37,8 @@
    }
    
    private final MockServletLifecycle lifecycle;
-   private final Iterable<Class<?>> classes;
-   private final Iterable<URL> beansXml;
+   private final Collection<Class<?>> classes;
+   private final Collection<URL> beansXml;
 
    /**
     * Create a container, specifying the classes and beans.xml to deploy
@@ -46,7 +47,7 @@
     * @param classes
     * @param beansXml
     */
-   public TestContainer(MockServletLifecycle lifecycle, Iterable<Class<?>> classes, Iterable<URL> beansXml)
+   public TestContainer(MockServletLifecycle lifecycle, Collection<Class<?>> classes, Collection<URL> beansXml)
    {
       this.lifecycle = lifecycle;
       this.classes = classes;
@@ -77,7 +78,7 @@
       archive.setBeanClasses(classes);
       if (beansXml != null)
       {
-         archive.setWebBeansXmlFiles(beansXml);
+         archive.setBeansXmlFiles(beansXml);
       }
       lifecycle.initialize();
       lifecycle.beginApplication();

Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -5,6 +5,7 @@
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.util.Collection;
 
 import org.jboss.webbeans.BeanManagerImpl;
 import org.jboss.webbeans.bootstrap.api.SingletonProvider;
@@ -31,7 +32,7 @@
       SingletonProvider.reset();
    }
 
-   protected TestContainer bootstrapContainer(int id, Iterable<Class<?>> classes)
+   protected TestContainer bootstrapContainer(int id, Collection<Class<?>> classes)
    {
       // Bootstrap container
       SwitchableSingletonProvider.use(id);

Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -1,6 +1,7 @@
 package org.jboss.webbeans.test.harness;
 
 import java.net.URL;
+import java.util.Collection;
 
 import org.jboss.testharness.api.DeploymentException;
 import org.jboss.testharness.spi.StandaloneContainers;
@@ -15,7 +16,7 @@
    
    private TestContainer testContainer;
 
-   public boolean deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml)
+   public boolean deploy(Collection<Class<?>> classes, Collection<URL> beansXml)
    {
       this.testContainer = new TestContainer(newLifecycle(), classes, beansXml);
       
@@ -35,7 +36,7 @@
 
    protected abstract MockServletLifecycle newLifecycle();
 
-   public void deploy(Iterable<Class<?>> classes) throws DeploymentException
+   public void deploy(Collection<Class<?>> classes) throws DeploymentException
    {
       deploy(classes, null);
    }

Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java	2009-09-30 23:39:55 UTC (rev 3824)
@@ -1,6 +1,7 @@
 package org.jboss.webbeans.test.unit.cluster;
 
 import java.util.Arrays;
+import java.util.Collection;
 
 import javax.enterprise.inject.spi.Bean;
 
@@ -39,7 +40,7 @@
    @Test
    public void testMultipleDependentObjectsSessionReplication() throws Exception
    {
-      Iterable<Class<?>> classes = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class);
+      Collection<Class<?>> classes = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class);
       TestContainer container1 = bootstrapContainer(1, classes);
       BeanManagerImpl beanManager1 = container1.getBeanManager();
       Bean<?> stableBean1 = beanManager1.resolve(beanManager1.getBeans(Stable.class));
@@ -81,8 +82,8 @@
    public void testVariableBeanDeploymentStructure() throws Exception
    {
       // NB This is not a valid deployment scenario for a cluster, but it does allow us to test bean ids neatly!
-      Iterable<Class<?>> classes1 = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class);
-      Iterable<Class<?>> classes2 = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class, Foo.class);
+      Collection<Class<?>> classes1 = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class);
+      Collection<Class<?>> classes2 = Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class, Foo.class);
       TestContainer container1 = bootstrapContainer(1, classes1);
       BeanManagerImpl beanManager1 = container1.getBeanManager();
       Bean<?> stableBean1 = beanManager1.resolve(beanManager1.getBeans(Stable.class));

Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml	2009-09-30 14:39:18 UTC (rev 3823)
+++ ri/trunk/version-matrix/pom.xml	2009-09-30 23:39:55 UTC (rev 3824)
@@ -87,7 +87,7 @@
          <dependency>
             <groupId>org.atinject</groupId>
             <artifactId>inject-tck</artifactId>
-            <version>1.0.0-PRD</version>
+            <version>1.0.0-PFD-2</version>
          </dependency>
          
          
@@ -137,8 +137,8 @@
          
          <dependency>
             <groupId>javax.inject</groupId>
-            <artifactId>inject-api</artifactId>
-            <version>1.0.0-PRD</version>
+            <artifactId>javax.inject</artifactId>
+            <version>1.0-PFD-1</version>
          </dependency>
   
          <dependency>

Modified: tck/trunk/impl/pom.xml
===================================================================
--- tck/trunk/impl/pom.xml	2009-09-30 14:39:18 UTC (rev 3823)
+++ tck/trunk/impl/pom.xml	2009-09-30 23:39:55 UTC (rev 3824)
@@ -104,7 +104,7 @@
       
       <dependency>
          <groupId>javax.inject</groupId>
-         <artifactId>inject-api</artifactId>
+         <artifactId>javax.inject</artifactId>
       </dependency>
       
       <dependency>




More information about the weld-commits mailing list