openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r1563825 - in /openwebbeans/branches/owb_1.1.x/webbeans-impl/src: main/java/org/apache/webbeans/inject/instance/ test/java/org/apache/webbeans/newtests/instance/
Date Mon, 03 Feb 2014 10:30:33 GMT
Author: gpetracek
Date: Mon Feb  3 10:30:32 2014
New Revision: 1563825

URL: http://svn.apache.org/r1563825
Log:
OWB-929 InstanceImpl#iterator fixed

Added:
    openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/instance/
    openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/instance/InstanceIteratorTest.java
      - copied, changed from r1563824, openwebbeans/branches/owb_1.2.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/instance/InstanceIteratorTest.java
Modified:
    openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/inject/instance/InstanceImpl.java

Modified: openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/inject/instance/InstanceImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/inject/instance/InstanceImpl.java?rev=1563825&r1=1563824&r2=1563825&view=diff
==============================================================================
--- openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/inject/instance/InstanceImpl.java
(original)
+++ openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/inject/instance/InstanceImpl.java
Mon Feb  3 10:30:32 2014
@@ -24,8 +24,10 @@ import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Set;
 
 import javax.enterprise.context.spi.CreationalContext;
@@ -256,7 +258,7 @@ class InstanceImpl<T> implements Instanc
     public Iterator<T> iterator()
     {
         Set<Bean<?>> beans = resolveBeans();
-        Set<T> instances = new HashSet<T>();
+        List<T> instances = new ArrayList<T>();
         for(Bean<?> bean : beans)
         {
             T instance = (T) webBeansContext.getBeanManagerImpl().getReference(bean,null,
parentCreationalContext);

Copied: openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/instance/InstanceIteratorTest.java
(from r1563824, openwebbeans/branches/owb_1.2.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/instance/InstanceIteratorTest.java)
URL: http://svn.apache.org/viewvc/openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/instance/InstanceIteratorTest.java?p2=openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/instance/InstanceIteratorTest.java&p1=openwebbeans/branches/owb_1.2.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/instance/InstanceIteratorTest.java&r1=1563824&r2=1563825&rev=1563825&view=diff
==============================================================================
--- openwebbeans/branches/owb_1.2.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/instance/InstanceIteratorTest.java
(original)
+++ openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/instance/InstanceIteratorTest.java
Mon Feb  3 10:30:32 2014
@@ -29,6 +29,8 @@ import javax.inject.Inject;
 import javax.inject.Qualifier;
 import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
+import java.util.ArrayList;
+import java.util.Collection;
 
 import static java.lang.annotation.ElementType.*;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
@@ -39,14 +41,15 @@ public class InstanceIteratorTest extend
 {
     @Test
     public void testInstanceIteratorWithBeanSelector() {
-        startContainer(
-                Qualifier1.class,
-                Qualifier2.class,
-                ShardContract.class,
-                Bean1.class,
-                Bean2.class,
-                BeanSelector.class,
-                InstanceHolder.class);
+        Collection<Class<?>> testBeanClasses = new ArrayList<Class<?>>();
+        testBeanClasses.add(Qualifier1.class);
+        testBeanClasses.add(Qualifier2.class);
+        testBeanClasses.add(ShardContract.class);
+        testBeanClasses.add(Bean1.class);
+        testBeanClasses.add(Bean2.class);
+        testBeanClasses.add(BeanSelector.class);
+        testBeanClasses.add(InstanceHolder.class);
+        startContainer(testBeanClasses);
 
         InstanceHolder instanceHolder = getInstance(InstanceHolder.class);
         assertNotNull(instanceHolder);



Mime
View raw message