### Eclipse Workspace Patch 1.0
#P org.jboss.tools.cdi.core.test
Index: resources/tck/tests/jbt/resolution/Zoo.java
===================================================================
--- resources/tck/tests/jbt/resolution/Zoo.java	(revision 0)
+++ resources/tck/tests/jbt/resolution/Zoo.java	(revision 0)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., 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.jsr299.tck.tests.jbt.resolution;
+
+import java.util.List;
+import java.util.ArrayList;
+import javax.inject.Inject;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.Typed;
+
+import org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.*;
+
+public class Zoo {
+
+	   @Produces @Typed(List.class)
+	   private ArrayList<Cat<European>> catsProducer = new ArrayList<Cat<European>>();
+	   
+	   @Produces @Typed(List.class)
+	   public ArrayList<Lion> getLions()  {
+	      return new ArrayList<Lion>();
+	   }
+
+	   @Inject
+	   List<Cat<European>> cats;
+	   
+	   @Inject
+	   List<Lion> lions;
+	
+}
Index: src/org/jboss/tools/cdi/core/test/tck/ResolutionByTypeTest.java
===================================================================
--- src/org/jboss/tools/cdi/core/test/tck/ResolutionByTypeTest.java	(revision 30450)
+++ src/org/jboss/tools/cdi/core/test/tck/ResolutionByTypeTest.java	(working copy)
@@ -18,7 +18,9 @@
 import org.jboss.tools.cdi.core.IBean;
 import org.jboss.tools.cdi.core.IClassBean;
 import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInjectionPointField;
 import org.jboss.tools.cdi.core.IParametedType;
+import org.jboss.tools.cdi.core.IProducerField;
 import org.jboss.tools.cdi.core.IProducerMethod;
 import org.jboss.tools.cdi.core.IQualifierDeclaration;
 import org.jboss.tools.common.EclipseUtil;
@@ -200,7 +202,7 @@
 
 		assertContainsBeanTypes(false, bean, "java.lang.Object");
 		assertContainsBeanTypes(false, bean, "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.FlightlessBird");
-		assertContainsBeanTypeSignatures(false, bean, "Qorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.FlightlessBird<Qorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Australian;>;");
+		assertContainsBeanTypeSignatures(false, bean, "Lorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.FlightlessBird<Lorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Australian;>;");
 	}
 
 	/**
@@ -235,7 +237,7 @@
 
 		assertContainsBeanTypes(false, bean, "java.lang.Object");
 		assertContainsBeanTypes(false, bean, "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Cat");
-		assertContainsBeanTypeSignatures(false, bean, "Qorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Cat<Qorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.European;>;");
+		assertContainsBeanTypeSignatures(false, bean, "Lorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Cat<Lorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.European;>;");
 
 		beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.DomesticCat", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Tame");
 		assertEquals("Wrong number of the beans", 0, beans.size());
@@ -258,7 +260,7 @@
 
 		assertContainsBeanTypes(false, bean, "java.lang.Object");
 		assertContainsBeanTypes(false, bean, "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Cat");
-		assertContainsBeanTypeSignatures(false, bean, "Qorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Cat<Qorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.African;>;");
+		assertContainsBeanTypeSignatures(false, bean, "Lorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Cat<Lorg.jboss.jsr299.tck.tests.lookup.typesafe.resolution.African;>;");
 
 		beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Lion", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Wild");
 		assertEquals("Wrong number of the beans", 0, beans.size());
@@ -278,4 +280,21 @@
 		beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Bird");
 		assertEquals("Wrong number of the beans", 0, beans.size());
 	}
+
+	public void testInjectionResolutionOfRestrictedProducerField() throws CoreException {
+		IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/Zoo.java", "cats");
+		Set<IBean> beans = cdiProject.getBeans(true, injection);
+		assertEquals("Wrong number of the beans", 1, beans.size());
+		IBean bean = beans.iterator().next();
+		assertTrue(bean instanceof IProducerField);
+	}
+
+	public void testInjectionResolutionOfRestrictedProducerMethod() throws CoreException {
+		IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/Zoo.java", "lions");
+		Set<IBean> beans = cdiProject.getBeans(true, injection);
+		assertEquals("Wrong number of the beans", 1, beans.size());
+		IBean bean = beans.iterator().next();
+		assertTrue(bean instanceof IProducerMethod);
+	}
+
 }
\ No newline at end of file
Index: src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
===================================================================
--- src/org/jboss/tools/cdi/core/test/tck/TCKTest.java	(revision 30450)
+++ src/org/jboss/tools/cdi/core/test/tck/TCKTest.java	(working copy)
@@ -3,6 +3,7 @@
 import java.io.File;
 import java.io.FileFilter;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.Set;
 
 import junit.framework.TestCase;
@@ -30,6 +31,7 @@
 import org.jboss.tools.cdi.core.IInjectionPoint;
 import org.jboss.tools.cdi.core.IInjectionPointField;
 import org.jboss.tools.cdi.core.IParametedType;
+import org.jboss.tools.cdi.core.IProducer;
 import org.jboss.tools.cdi.core.IQualifier;
 import org.jboss.tools.cdi.core.IQualifierDeclaration;
 import org.jboss.tools.cdi.core.test.tck.validation.CoreValidationTest;
@@ -295,6 +297,11 @@
 	protected IInjectionPointField getInjectionPointField(String beanClassFilePath, String fieldName) {
 		IFile file = tckProject.getFile(beanClassFilePath);
 		Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+		Iterator<IBean> it = beans.iterator();
+		while(it.hasNext()) {
+			IBean b = it.next();
+			if(b instanceof IProducer) it.remove();
+		}
 		assertEquals("Wrong number of the beans", 1, beans.size());
 		Set<IInjectionPoint> injections = beans.iterator().next().getInjectionPoints();
 		for (IInjectionPoint injectionPoint : injections) {
#P org.jboss.tools.cdi.core
Index: src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
===================================================================
--- src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java	(revision 30599)
+++ src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java	(working copy)
@@ -305,8 +305,10 @@
 								if(!s1.equals(s2) && Signature.getArrayCount(s1) == Signature.getArrayCount(s2)) {
 									p.setSignature(s2);
 								}
+								result.add(new TypeDeclaration((ParametedType)other, offset, length));
+							} else {
+								result.add(new TypeDeclaration(p, offset, length));
 							}
-							result.add(new TypeDeclaration(p, offset, length));
 						}
 					}
 				} else if(value != null) {
@@ -331,8 +333,10 @@
 							if(!s1.equals(s2) && Signature.getArrayCount(s1) == Signature.getArrayCount(s2)) {
 								p.setSignature(s2);
 							}
+							result.add(new TypeDeclaration((ParametedType)other, offset, length));
+						} else {
+							result.add(new TypeDeclaration(p, offset, length));
 						}
-						result.add(new TypeDeclaration(p, offset, length));
 					}
 				}
 			} catch (CoreException e) {
Index: src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java
===================================================================
--- src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java	(revision 30599)
+++ src/org/jboss/tools/cdi/internal/core/impl/definition/ParametedTypeFactory.java	(working copy)
@@ -30,14 +30,16 @@
 	// I S J C F D Z
 	static HashMap<String,String> primitives = new HashMap<String, String>();
 	static {
-		primitives.put("I", "Qjava.lang.Integer;");
-		primitives.put("S", "Qjava.lang.Short;");
-		primitives.put("J", "Qjava.lang.Long;");
-		primitives.put("C", "Qjava.lang.Character;");
-		primitives.put("F", "Qjava.lang.Float;");
-		primitives.put("D", "Qjava.lang.Double;");
-		primitives.put("Z", "Qjava.lang.Boolean;");
+		primitives.put("I", "Ljava.lang.Integer;");
+		primitives.put("S", "Ljava.lang.Short;");
+		primitives.put("J", "Ljava.lang.Long;");
+		primitives.put("C", "Ljava.lang.Character;");
+		primitives.put("F", "Ljava.lang.Float;");
+		primitives.put("D", "Ljava.lang.Double;");
+		primitives.put("Z", "Ljava.lang.Boolean;");
 	}
+	//unresolved Object signature
+	public static String OBJECT = "QObject;";
 	Map<String, ParametedType> cache = new HashMap<String, ParametedType>();
 
 	public ParametedType newParametedType(IType type) {
@@ -55,7 +57,7 @@
 		}
 		parametedType.setFactory(this);
 		parametedType.setType(type);
-		if(type != null) parametedType.setSignature("Q" + type.getFullyQualifiedName() + ";");
+		if(type != null) parametedType.setSignature("L" + type.getFullyQualifiedName() + ";");
 		String[] ps = null;
 		try {
 			ps = type.getTypeParameterSignatures();
@@ -83,7 +85,7 @@
 		
 		IType contextType = context instanceof IType ? (IType)context : context.getDeclaringType();
 
-		String key = context == null || context.isBinary() || "QObject;".equals(typeSignature) ? typeSignature : contextType.getFullyQualifiedName() + "+" + typeSignature;
+		String key = context == null || context.isBinary() || OBJECT.equals(typeSignature) ? typeSignature : contextType.getFullyQualifiedName() + "+" + typeSignature;
 		if(cache.containsKey(key)) return cache.get(key);
 		ParametedType result = new ParametedType();
 		result.setFactory(this);
@@ -112,7 +114,7 @@
 				ns.append(result.getArrayPrefix());
 				if(result.isLower()) ns.append('-');
 				if(result.isUpper()) ns.append('+');
-				ns.append('Q').append(resovedTypeName).append(";");
+				ns.append('L').append(resovedTypeName).append(";");
 				result.setSignature(ns.toString());
 			}
 			IType type = EclipseJavaUtil.findType(context.getJavaProject(), resovedTypeName);
@@ -169,7 +171,7 @@
 					ns.append(result.getArrayPrefix());
 					if(result.isLower()) ns.append('-');
 					if(result.isUpper()) ns.append('+');
-					ns.append('Q').append(resovedTypeName).append('<').append(newParams).append(">;");
+					ns.append('L').append(resovedTypeName).append('<').append(newParams).append(">;");
 					result.setSignature(ns.toString());
 				}
 				return result;
@@ -185,7 +187,7 @@
 		String t = Signature.getTypeVariable(typeParameterSignature);
 		String[] bounds = Signature.getTypeParameterBounds(typeParameterSignature);
 		
-		t = "Q" + t + ";";
+		t = "L" + t + ";";
 		if(result == null || t.equals(result.getSignature())) {
 			String sts = bounds.length > 0 ? bounds[0] : "";
 			if(sts.length() > 0) {
Index: src/org/jboss/tools/cdi/internal/core/impl/CDIElement.java
===================================================================
--- src/org/jboss/tools/cdi/internal/core/impl/CDIElement.java	(revision 30599)
+++ src/org/jboss/tools/cdi/internal/core/impl/CDIElement.java	(working copy)
@@ -18,6 +18,7 @@
 import org.jboss.tools.cdi.core.CDICorePlugin;
 import org.jboss.tools.cdi.core.ICDIElement;
 import org.jboss.tools.cdi.core.extension.CDIExtensionManager;
+import org.jboss.tools.cdi.internal.core.impl.definition.ParametedTypeFactory;
 
 /**
  * 
@@ -39,7 +40,7 @@
 
 	protected ParametedType getObjectType(IMember context) {
 		try {
-			return getCDIProject().getNature().getTypeFactory().getParametedType(context, "QObject;");
+			return getCDIProject().getNature().getTypeFactory().getParametedType(context, ParametedTypeFactory.OBJECT);
 		} catch (JavaModelException e) {
 			CDICorePlugin.getDefault().logError(e);
 			return null;
Index: src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java
===================================================================
--- src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java	(revision 30599)
+++ src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java	(working copy)
@@ -176,10 +176,10 @@
 						CDICorePlugin.getDefault().logError(e);
 					}
 				} else if(!"java.lang.Object".equals(type.getFullyQualifiedName())) {
-					sc = "QObject;";
+					sc = ParametedTypeFactory.OBJECT;
 				} else if("java.lang.Object".equals(type.getFullyQualifiedName()) && arrayPrefix.length() > 0) {
 					objectArray = true;
-					sc = "QObject;";
+					sc = ParametedTypeFactory.OBJECT;
 				}
 				if(!objectArray && arrayPrefix.length() > 0) {
 					sc = arrayPrefix + sc;
@@ -240,7 +240,7 @@
 		}
 		int i = typeSignature.indexOf('<');
 		if(i < 0) {
-			if(( typeSignature.startsWith("T") || typeSignature.startsWith("Q")) && typeSignature.endsWith(";")) {
+			if(( typeSignature.startsWith("T") || typeSignature.startsWith("Q") || typeSignature.startsWith("L")) && typeSignature.endsWith(";")) {
 				String param = typeSignature.substring(1, typeSignature.length() - 1);
 				String s = findParameterSignature(param);
 				return s == null ? typeSignature : s;
