Index: impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java
===================================================================
--- impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java	(revision 5456)
+++ impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java	(working copy)
@@ -169,4 +169,8 @@
       return delegate().getDeclaredMetaAnnotations(metaAnnotationType);
    }
    
+   public boolean isAddedThroughSpi()
+   {
+      return delegate().isAddedThroughSpi();
+   }
 }
Index: impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java
===================================================================
--- impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java	(revision 5456)
+++ impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java	(working copy)
@@ -39,6 +39,7 @@
 
 import org.jboss.weld.introspector.ConstructorSignature;
 import org.jboss.weld.introspector.MethodSignature;
+import org.jboss.weld.introspector.SpiAnnotatedType;
 import org.jboss.weld.introspector.WeldClass;
 import org.jboss.weld.introspector.WeldConstructor;
 import org.jboss.weld.introspector.WeldField;
@@ -108,6 +109,8 @@
    // meta-annotation) of the item
    private final SetMultimap<Class<? extends Annotation>, Annotation> declaredMetaAnnotationMap;
 
+   private final boolean addedThroughSpi;
+
    public static <T> WeldClass<T> of(Class<T> clazz, ClassTransformer classTransformer)
    {
       return new WeldClassImpl<T>(clazz, clazz, null, new HierarchyDiscovery(clazz).getTypeClosure(), buildAnnotationMap(clazz.getAnnotations()), buildAnnotationMap(clazz.getDeclaredAnnotations()), classTransformer);
@@ -127,6 +130,22 @@
    {
       super(annotationMap, declaredAnnotationMap, classTransformer, rawType, type, typeClosure);
 
+      if (annotatedType != null)
+      {
+         if (annotatedType instanceof SpiAnnotatedType)
+         {
+            addedThroughSpi = true;
+         }
+         else
+         {
+            addedThroughSpi = false;
+         }
+      }
+      else
+      {
+         addedThroughSpi = false;
+      }
+
       if (rawType.getSuperclass() != null)
       {
          this.superclass = classTransformer.loadClass(rawType.getSuperclass());
@@ -630,4 +649,9 @@
       return Collections.unmodifiableSet(declaredMetaAnnotationMap.get(metaAnnotationType));
    }
 
+   public boolean isAddedThroughSpi()
+   {
+      return addedThroughSpi;
+   }
+
 }
\ No newline at end of file
Index: impl/src/main/java/org/jboss/weld/introspector/WeldClass.java
===================================================================
--- impl/src/main/java/org/jboss/weld/introspector/WeldClass.java	(revision 5456)
+++ impl/src/main/java/org/jboss/weld/introspector/WeldClass.java	(working copy)
@@ -185,6 +185,8 @@
    public boolean isAnonymousClass();
 
    public boolean isSerializable();
+   
+   public boolean isAddedThroughSpi();
 
    public <S> S cast(Object object);
 
Index: impl/src/main/java/org/jboss/weld/introspector/SpiAnnotatedType.java
===================================================================
--- impl/src/main/java/org/jboss/weld/introspector/SpiAnnotatedType.java	(revision 0)
+++ impl/src/main/java/org/jboss/weld/introspector/SpiAnnotatedType.java	(revision 0)
@@ -0,0 +1,61 @@
+package org.jboss.weld.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+/**
+ * Forwarding implementation of AnnotatedType that can be used
+ * as a marker to identify AnnotatedTypes added through the SPI
+ * @author Stuart Douglas <stuart@baileyroberts.com.au>
+ *
+ */
+public class SpiAnnotatedType<X> implements AnnotatedType<X>
+{
+   final AnnotatedType<X> delegate;
+   public SpiAnnotatedType(AnnotatedType<X> type)
+   {
+      delegate = type;
+   }
+   public Set<AnnotatedConstructor<X>> getConstructors()
+   {
+     return delegate.getConstructors();
+   }
+   public Set<AnnotatedField<? super X>> getFields()
+   {
+      return delegate.getFields();
+   }
+   public Class<X> getJavaClass()
+   {
+      return delegate.getJavaClass();
+   }
+   public Set<AnnotatedMethod<? super X>> getMethods()
+   {
+      return delegate.getMethods();
+   }
+   public <T extends Annotation> T getAnnotation(Class<T> annotationType)
+   {
+      return delegate.getAnnotation(annotationType);
+   }
+   public Set<Annotation> getAnnotations()
+   {
+      return delegate.getAnnotations();
+   }
+   public Type getBaseType()
+   {
+      return delegate.getBaseType();
+   }
+   public Set<Type> getTypeClosure()
+   {
+      return delegate.getTypeClosure();
+   }
+   public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+   {
+      return delegate.isAnnotationPresent(annotationType);
+   }
+}
Index: impl/src/main/java/org/jboss/weld/bean/RIBean.java
===================================================================
--- impl/src/main/java/org/jboss/weld/bean/RIBean.java	(revision 5456)
+++ impl/src/main/java/org/jboss/weld/bean/RIBean.java	(working copy)
@@ -116,7 +116,17 @@
       if (obj instanceof RIBean<?>)
       {
          RIBean<?> that = (RIBean<?>) obj;
-         return this.getId().equals(that.getId());
+         //we need to compare the class objects to make sure
+         //that we do not have the same class deployed inside
+         //two different modules
+         if (this.getBeanClass() == that.getBeanClass())
+         {
+            return this.getId().equals(that.getId());
+         }
+         else
+         {
+            return false;
+         }
       }
       else
       {
Index: impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
===================================================================
--- impl/src/main/java/org/jboss/weld/bean/ManagedBean.java	(revision 5456)
+++ impl/src/main/java/org/jboss/weld/bean/ManagedBean.java	(working copy)
@@ -62,6 +62,7 @@
 import org.jboss.weld.metadata.cache.MetaAnnotationStore;
 import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
 import org.jboss.weld.util.Beans;
+import org.jboss.weld.util.reflection.AnnotatedTypeIdProvider;
 import org.jboss.weld.util.reflection.Reflections;
 import org.slf4j.cal10n.LocLogger;
 import org.slf4j.ext.XLogger;
@@ -101,7 +102,16 @@
     */
    public static <T> ManagedBean<T> of(WeldClass<T> clazz, BeanManagerImpl beanManager)
    {
-      return new ManagedBean<T>(clazz, createId(ManagedBean.class.getSimpleName(), clazz), beanManager);
+      String id;
+      if (clazz.isAddedThroughSpi())
+      {
+         id = createSpiId(ManagedBean.class.getSimpleName(), clazz);
+      }
+      else
+      {
+         id = createId(ManagedBean.class.getSimpleName(), clazz);
+      }
+      return new ManagedBean<T>(clazz, id, beanManager);
    }
    
    protected static String createId(String beanType, WeldClass<?> clazz)
@@ -110,6 +120,15 @@
    }
 
    /**
+    * create a more complete id for types that have been added through the SPI
+    * to prevent duplicate id's
+    */
+   protected static String createSpiId(String beanType, WeldClass<?> clazz)
+   {
+      return new StringBuilder().append(beanType).append(BEAN_ID_SEPARATOR).append(AnnotatedTypeIdProvider.getAnnotatedTypeId(clazz)).toString();
+   }
+
+   /**
     * Constructor
     *
     * @param type The type of the bean
Index: impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java
===================================================================
--- impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java	(revision 5456)
+++ impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java	(working copy)
@@ -25,9 +25,10 @@
 import org.jboss.weld.bootstrap.BeanDeployment;
 import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
 import org.jboss.weld.bootstrap.spi.Deployment;
-import org.jboss.weld.literal.QualifierLiteral;
+import org.jboss.weld.introspector.SpiAnnotatedType;
 import org.jboss.weld.literal.InterceptorBindingTypeLiteral;
 import org.jboss.weld.literal.NormalScopeLiteral;
+import org.jboss.weld.literal.QualifierLiteral;
 import org.jboss.weld.literal.ScopeLiteral;
 import org.jboss.weld.literal.StereotypeLiteral;
 import org.jboss.weld.manager.BeanManagerImpl;
@@ -78,7 +79,8 @@
 
    public void addAnnotatedType(AnnotatedType<?> type)
    {
-      getOrCreateBeanDeployment(type.getJavaClass()).getBeanDeployer().addClass(type);
+      AnnotatedType<?> newType = new SpiAnnotatedType(type);
+      getOrCreateBeanDeployment(type.getJavaClass()).getBeanDeployer().addClass(newType);
    }
 
 }
Index: impl/src/main/java/org/jboss/weld/util/reflection/AnnotatedTypeIdProvider.java
===================================================================
--- impl/src/main/java/org/jboss/weld/util/reflection/AnnotatedTypeIdProvider.java	(revision 0)
+++ impl/src/main/java/org/jboss/weld/util/reflection/AnnotatedTypeIdProvider.java	(revision 0)
@@ -0,0 +1,363 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.util.reflection;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.AnnotatedCallable;
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+/**
+ * Class that can take an AnnotatedType and return a unique 
+ * string representation of that type
+ * @author Stuart Douglas <stuart@baileyroberts.com.au>
+ *
+ */
+public class AnnotatedTypeIdProvider
+{
+
+   static final char SEPERATOR = ';';
+
+   /**
+    * generates a unique signature for an annotated type.
+    * members without annotations are ommited to reduce 
+    * the length of the signature
+    * @param <X>
+    * @param annotatedType
+    * @return
+    */
+   public static <X> String getAnnotatedTypeId(AnnotatedType<X> annotatedType)
+   {
+      return getTypeId(annotatedType.getJavaClass(), annotatedType.getAnnotations(), annotatedType.getMethods(), annotatedType.getFields(), annotatedType.getConstructors());
+   }
+
+   /**
+    * generates a unique signature for a concrete class
+    * @param <X>
+    * @param annotatedType
+    * @return
+    */
+   public static <X> String getTypeId(Class clazz, Collection<Annotation> annotations, Collection<AnnotatedMethod<? super X>> methods, Collection<AnnotatedField<? super X>> fields,
+         Collection<AnnotatedConstructor<X>> constructors)
+   {
+      StringBuilder builder = new StringBuilder();
+
+      builder.append(clazz.getName());
+      builder.append(getAnnotationSetId(annotations));
+      builder.append("{ ");
+
+      //now deal with the fields
+      List<AnnotatedField<? super X>> sortedFields = new ArrayList<AnnotatedField<? super X>>();
+      sortedFields.addAll(fields);
+      Collections.sort(sortedFields, new Comparator<AnnotatedField<? super X>>()
+      {
+         public int compare(AnnotatedField<? super X> arg0, AnnotatedField<? super X> arg1)
+         {
+            if (arg0.getJavaMember().getName().equals(arg1.getJavaMember().getName()))
+            {
+               return arg0.getJavaMember().getDeclaringClass().getName().compareTo(arg1.getJavaMember().getDeclaringClass().getName());
+            }
+            return arg0.getJavaMember().getName().compareTo(arg1.getJavaMember().getName());
+         }
+      });
+      for (AnnotatedField<? super X> field : sortedFields)
+      {
+         if (!field.getAnnotations().isEmpty())
+         {
+            builder.append(getAnnotatedFieldId(field));
+            builder.append(SEPERATOR);
+         }
+      }
+
+      //methods
+      List<AnnotatedMethod<? super X>> sortedMethods = new ArrayList<AnnotatedMethod<? super X>>();
+      sortedMethods.addAll(methods);
+      Collections.sort(sortedMethods, new AnnotatedMethodComparator());
+      for (AnnotatedMethod<? super X> method : sortedMethods)
+      {
+         if (!method.getAnnotations().isEmpty() || hasMethodParameters(method))
+         {
+            builder.append(getAnnotatedCallableId(method));
+            builder.append(SEPERATOR);
+         }
+      }
+
+      //constructors
+      List<AnnotatedConstructor<? super X>> sortedConstructors = new ArrayList<AnnotatedConstructor<? super X>>();
+      sortedConstructors.addAll(constructors);
+      Collections.sort(sortedConstructors, new AnnotatedConstructorComparator());
+      for (AnnotatedConstructor<? super X> con : sortedConstructors)
+      {
+         if (!con.getAnnotations().isEmpty() || hasMethodParameters(con))
+         {
+            builder.append(getAnnotatedCallableId(con));
+            builder.append(SEPERATOR);
+         }
+      }
+      builder.append("}");
+
+      return builder.toString();
+   }
+
+   public  static <X> boolean hasMethodParameters(AnnotatedCallable<X> callable)
+   {
+      for(AnnotatedParameter<X> p : callable.getParameters())
+      {
+         if (p.getAnnotations().isEmpty())
+            return true;
+      }
+      return false;
+   }
+
+   public static String getAnnotationSetId(Collection<Annotation> annotations)
+   {
+      if (annotations.isEmpty())
+         return "";
+      StringBuilder builder = new StringBuilder();
+      builder.append('[');
+
+      List<Annotation> anList = new ArrayList<Annotation>(annotations.size());
+      anList.addAll(annotations);
+      Collections.sort(anList, new Comparator<Annotation>()
+      {
+         public int compare(Annotation arg0, Annotation arg1)
+         {
+            return arg0.annotationType().getName().compareTo(arg1.annotationType().getName());
+         }
+      });
+      for(Annotation a : anList)
+      {
+         builder.append('@');
+         builder.append(a.annotationType().getName());
+         builder.append('(');
+         Method[] decMethod = a.annotationType().getDeclaredMethods();
+         List<Method> methods = new ArrayList<Method>(decMethod.length);
+         Collections.sort(methods, new Comparator<Method>()
+         {
+
+            public int compare(Method arg0, Method arg1)
+            {
+               return arg0.getName().compareTo(arg1.getName());
+            }
+         });
+
+         for (int i = 0; i < methods.size(); ++i)
+         {
+            Method m = methods.get(i);
+            try
+            {
+               Object value = m.invoke(a);
+               builder.append(m.getName());
+               builder.append('=');
+               builder.append(value.toString());
+            }
+            catch (NullPointerException e)
+            {
+               throw new RuntimeException("NullPointerException accessing annotation member, annotation:" + a.annotationType().getName() + " member: " + m.getName(), e);
+            }
+            catch (IllegalArgumentException e)
+            {
+               throw new RuntimeException("IllegalArgumentException accessing annotation member, annotation:" + a.annotationType().getName() + " member: " + m.getName(), e);
+            }
+            catch (IllegalAccessException e)
+            {
+               throw new RuntimeException("IllegalAccessException accessing annotation member, annotation:" + a.annotationType().getName() + " member: " + m.getName(), e);
+            }
+            catch (InvocationTargetException e)
+            {
+               throw new RuntimeException("InvocationTargetException accessing annotation member, annotation:" + a.annotationType().getName() + " member: " + m.getName(), e);
+            }
+            if (i + 1 != methods.size())
+            {
+               builder.append(',');
+            }
+         }
+         builder.append(')');
+      }
+      builder.append(']');
+      return builder.toString();
+   }
+
+   public static <X> String getAnnotatedFieldId(AnnotatedField<X> field)
+   {
+      return getFieldId(field.getJavaMember(), field.getAnnotations());
+   }
+
+   public static <X> String getFieldId(Field field, Collection<Annotation> annotations)
+   {
+      StringBuilder builder = new StringBuilder();
+      builder.append(field.getDeclaringClass().getName());
+      builder.append('.');
+      builder.append(field.getName());
+      builder.append(getAnnotationSetId(annotations));
+      return builder.toString();
+   }
+
+   public static <X> String getAnnotatedCallableId(AnnotatedCallable<X> method)
+   {
+      StringBuilder builder = new StringBuilder();
+      builder.append(method.getJavaMember().getDeclaringClass().getName());
+      builder.append('.');
+      builder.append(method.getJavaMember().getName());
+      builder.append(getAnnotationSetId(method.getAnnotations()));
+      builder.append(getAnnotatatedParameterListId(method.getParameters()));
+      return builder.toString();
+   }
+
+   public static <X> String getMethodId(Method method, Set<Annotation> annotations, List<AnnotatedParameter<X>> parameters)
+   {
+      StringBuilder builder = new StringBuilder();
+      builder.append(method.getDeclaringClass().getName());
+      builder.append('.');
+      builder.append(method.getName());
+      builder.append(getAnnotationSetId(annotations));
+      builder.append(getAnnotatatedParameterListId(parameters));
+      return builder.toString();
+   }
+
+   public static <X> String getConstructorId(Constructor constructor, Set<Annotation> annotations, List<AnnotatedParameter<X>> parameters)
+   {
+      StringBuilder builder = new StringBuilder();
+      builder.append(constructor.getDeclaringClass().getName());
+      builder.append('.');
+      builder.append(constructor.getName());
+      builder.append(getAnnotationSetId(annotations));
+      builder.append(getAnnotatatedParameterListId(parameters));
+      return builder.toString();
+   }
+
+   public static <X> String getAnnotatatedParameterListId(List<AnnotatedParameter<X>> parameters)
+   {
+      StringBuilder builder = new StringBuilder();
+      builder.append("(");
+      for (int i = 0; i < parameters.size(); ++i)
+      {
+         AnnotatedParameter<X> ap = parameters.get(i);
+         builder.append(getAnnotatedParameterId(ap));
+         if (i + 1 != parameters.size())
+         {
+            builder.append(',');
+         }
+      }
+      builder.append(")");
+      return builder.toString();
+   }
+
+
+   public static <X> String getAnnotatedParameterId(AnnotatedParameter<X> annotatedParameter)
+   {
+      return getParameterId(annotatedParameter.getBaseType(), annotatedParameter.getAnnotations());
+   }
+
+   public static <X> String getParameterId(Type type, Set<Annotation> annotations)
+   {
+      StringBuilder builder = new StringBuilder();
+      if (type instanceof Class)
+      {
+         Class c = (Class) type;
+         builder.append(c.getName());
+      }
+      else
+      {
+         builder.append(type.toString());
+      }
+      builder.append(getAnnotationSetId(annotations));
+      return builder.toString();
+   }
+
+   /**
+    * Does the first stage of comparing AnnoatedCallables, however it cannot compare the
+    * method parameters
+    */
+   static class AnnotatedCallableComparator<T> implements Comparator<AnnotatedCallable<T>>
+   {
+
+      public int compare(AnnotatedCallable<T> arg0, AnnotatedCallable<T> arg1)
+      {
+         //compare the names first
+         int res = (arg0.getJavaMember().getName().compareTo(arg1.getJavaMember().getName()));
+         if (res != 0)
+            return res;
+         res = arg0.getJavaMember().getDeclaringClass().getName().compareTo(arg1.getJavaMember().getDeclaringClass().getName());
+         if (res != 0)
+            return res;
+         res = arg0.getParameters().size() - arg1.getParameters().size();
+         return res;
+      }
+
+   }
+
+   static class AnnotatedMethodComparator<T> implements Comparator<AnnotatedMethod<T>>
+   {
+      AnnotatedCallableComparator cmp = new AnnotatedCallableComparator<T>();
+
+      public int compare(AnnotatedMethod<T> arg0, AnnotatedMethod<T> arg1)
+      {
+         int res = cmp.compare(arg0, arg1);
+         if (res != 0)
+            return res;
+         for (int i = 0; i < arg0.getJavaMember().getParameterTypes().length; ++i)
+         {
+            Class p0 = arg0.getJavaMember().getParameterTypes()[i];
+            Class p1 = arg1.getJavaMember().getParameterTypes()[i];
+            res = p0.getName().compareTo(p1.getName());
+            if (res != 0)
+               return res;
+         }
+         return 0;
+      }
+
+   }
+
+   static class AnnotatedConstructorComparator<T> implements Comparator<AnnotatedConstructor<T>>
+   {
+      AnnotatedCallableComparator cmp = new AnnotatedCallableComparator<T>();
+
+      public int compare(AnnotatedConstructor<T> arg0, AnnotatedConstructor<T> arg1)
+      {
+         int res = cmp.compare(arg0, arg1);
+         if (res != 0)
+            return res;
+         for (int i = 0; i < arg0.getJavaMember().getParameterTypes().length; ++i)
+         {
+            Class p0 = arg0.getJavaMember().getParameterTypes()[i];
+            Class p1 = arg1.getJavaMember().getParameterTypes()[i];
+            res = p0.getName().compareTo(p1.getName());
+            if (res != 0)
+               return res;
+         }
+         return 0;
+      }
+
+   }
+
+}
Index: tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/FastWashingMachine.java
===================================================================
--- tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/FastWashingMachine.java	(revision 0)
+++ tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/FastWashingMachine.java	(revision 0)
@@ -0,0 +1,22 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+public @interface FastWashingMachine
+{
+
+}
Index: tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/WashingMachine.java
===================================================================
--- tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/WashingMachine.java	(revision 0)
+++ tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/WashingMachine.java	(revision 0)
@@ -0,0 +1,6 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+@FastWashingMachine
+public class WashingMachine
+{
+
+}
Index: tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java
===================================================================
--- tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java	(revision 0)
+++ tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/EcoFriendlyWashingMachine.java	(revision 0)
@@ -0,0 +1,22 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+public @interface EcoFriendlyWashingMachine
+{
+
+}
Index: tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java
===================================================================
--- tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java	(revision 0)
+++ tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtensionTest.java	(revision 0)
@@ -0,0 +1,27 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.testharness.impl.packaging.jsr299.Extension;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+@Packaging(PackagingType.EAR)
+@Extension("javax.enterprise.inject.spi.Extension")
+public class AnnotatedTypeExtensionTest extends AbstractWeldTest
+{
+   
+   @Test
+   public void testMultipleBeansOfSameType()
+   {
+      Laundry laundry = getReference(Laundry.class);
+      assert laundry.ecoFriendlyWashingMachine != null;
+      assert laundry.fastWashingMachine != null;
+   }
+   
+
+}
Index: tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java
===================================================================
--- tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java	(revision 0)
+++ tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java	(revision 0)
@@ -0,0 +1,85 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.util.AnnotationLiteral;
+
+public class AnnotatedTypeExtension implements Extension
+{
+   /**
+    * Adds an eco friendly wasing machine
+    * @param beforeBeanDiscovery
+    */
+   public void addWashingMachine(@Observes BeforeBeanDiscovery beforeBeanDiscovery)
+   {
+      beforeBeanDiscovery.addAnnotatedType(new AnnotatedType<WashingMachine>()
+      {
+
+         public Set<AnnotatedConstructor<WashingMachine>> getConstructors()
+         {
+            return Collections.EMPTY_SET;
+         }
+
+         public Set<AnnotatedField<? super WashingMachine>> getFields()
+         {
+            return Collections.EMPTY_SET;
+         }
+
+         public Class<WashingMachine> getJavaClass()
+         {
+            return WashingMachine.class;
+         }
+
+         public Set<AnnotatedMethod<? super WashingMachine>> getMethods()
+         {
+            return Collections.EMPTY_SET;
+         }
+
+         public <T extends Annotation> T getAnnotation(Class<T> annotationType)
+         {
+            if(annotationType == EcoFriendlyWashingMachine.class)
+            {
+               return (T) new AnnotationLiteral<EcoFriendlyWashingMachine>()
+               {
+               };
+            }
+            return null;
+         }
+
+         public Set<Annotation> getAnnotations()
+         {
+            return (Set)Collections.singleton(new AnnotationLiteral<EcoFriendlyWashingMachine>(){});
+         }
+
+         public Type getBaseType()
+         {
+           return WashingMachine.class;
+         }
+
+         public Set<Type> getTypeClosure()
+         {
+            Set<Type> ret = new HashSet<Type>();
+            ret.add(Object.class);
+            ret.add(WashingMachine.class);
+            return ret;
+         }
+
+         public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+         {
+            return annotationType == EcoFriendlyWashingMachine.class;
+         }
+         
+      });
+   }
+}
Index: tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/Laundry.java
===================================================================
--- tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/Laundry.java	(revision 0)
+++ tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/Laundry.java	(revision 0)
@@ -0,0 +1,12 @@
+package org.jboss.weld.tests.extensions.annotatedType;
+
+import javax.inject.Inject;
+
+public class Laundry
+{
+   @Inject @FastWashingMachine
+   public WashingMachine fastWashingMachine;
+   
+   @Inject @EcoFriendlyWashingMachine
+   public WashingMachine ecoFriendlyWashingMachine;
+}
Index: tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/javax.enterprise.inject.spi.Extension
===================================================================
--- tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/javax.enterprise.inject.spi.Extension	(revision 0)
+++ tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/javax.enterprise.inject.spi.Extension	(revision 0)
@@ -0,0 +1 @@
+org.jboss.weld.tests.extensions.annotatedType.AnnotatedTypeExtension
