Weld SVN: r5877 - in archetypes/trunk: jsf/jee and 2 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-18 08:11:54 -0500 (Thu, 18 Feb 2010)
New Revision: 5877
Modified:
archetypes/trunk/
archetypes/trunk/jsf/jee-minimal/
archetypes/trunk/jsf/jee/
archetypes/trunk/jsf/servlet-minimal/
Log:
ignores
Property changes on: archetypes/trunk
___________________________________________________________________
Name: svn:ignore
+ .settings
.project
Property changes on: archetypes/trunk/jsf/jee
___________________________________________________________________
Name: svn:ignore
- .project
.settings
target
+ .project
.settings
target
.classpath
Property changes on: archetypes/trunk/jsf/jee-minimal
___________________________________________________________________
Name: svn:ignore
- .project
.settings
target
+ .project
.settings
target
.classpath
Property changes on: archetypes/trunk/jsf/servlet-minimal
___________________________________________________________________
Name: svn:ignore
- .settings
target
.project
+ .settings
target
.project
.classpath
14 years, 10 months
Weld SVN: r5876 - core/trunk/jboss-tck-runner/src/test/resources.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-18 07:17:11 -0500 (Thu, 18 Feb 2010)
New Revision: 5876
Modified:
core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
Log:
update excludes
Modified: core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
===================================================================
--- core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2010-02-18 12:15:58 UTC (rev 5875)
+++ core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2010-02-18 12:17:11 UTC (rev 5876)
@@ -115,6 +115,32 @@
</methods>
</class>
+ <!-- CDITCK-108 -->
+ <class name="org.jboss.jsr299.tck.tests.context.application.ejb.EJBApplicationContextTest">
+ <methods>
+ <exclude name="testApplicationScopeActiveDuringCallToEjbTimeoutMethod" />
+
+ </methods>
+ </class>
+ <class name="org.jboss.jsr299.tck.tests.context.application.ejb.ApplicationContextSharedTest">
+ <methods>
+ <exclude name="testApplicationContextShared" />
+ </methods>
+ </class>
+
+ <!-- CDITCK-108 -->
+ <class name="org.jboss.jsr299.tck.tests.context.application.ejb.EJBApplicationContextTest">
+ <methods>
+ <exclude name="testApplicationScopeActiveDuringCallToEjbTimeoutMethod" />
+ </methods>
+ </class>
+ <class name="org.jboss.jsr299.tck.tests.context.application.ejb.ApplicationContextSharedTest">
+ <methods>
+ <exclude name="testApplicationContextShared" />
+ </methods>
+ </class>
+
+
<!-- Issues in Weld (the RI) -->
<!-- WELD-390 fixed, but TCK test is broken in 1.0.1-CR1 -->
14 years, 10 months
Weld SVN: r5875 - cdi-tck/branches/1.0/impl/src/main/resources.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-18 07:15:58 -0500 (Thu, 18 Feb 2010)
New Revision: 5875
Modified:
cdi-tck/branches/1.0/impl/src/main/resources/tck-tests.xml
Log:
backport r5863
Modified: cdi-tck/branches/1.0/impl/src/main/resources/tck-tests.xml
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/resources/tck-tests.xml 2010-02-17 22:43:20 UTC (rev 5874)
+++ cdi-tck/branches/1.0/impl/src/main/resources/tck-tests.xml 2010-02-18 12:15:58 UTC (rev 5875)
@@ -65,6 +65,20 @@
</methods>
</class>
+ <!-- CDITCK-108 -->
+ <class name="org.jboss.jsr299.tck.tests.context.application.ejb.EJBApplicationContextTest">
+ <methods>
+ <exclude name="testApplicationScopeActiveDuringCallToEjbTimeoutMethod" />
+
+ </methods>
+ </class>
+ <class name="org.jboss.jsr299.tck.tests.context.application.ejb.ApplicationContextSharedTest">
+ <methods>
+ <exclude name="testApplicationContextShared" />
+ </methods>
+ </class>
+
+
<!-- Issues in Weld (the RI) -->
<!-- WELD-269 -->
14 years, 10 months
Weld SVN: r5874 - build/trunk/parent.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-17 17:43:20 -0500 (Wed, 17 Feb 2010)
New Revision: 5874
Modified:
build/trunk/parent/pom.xml
Log:
WELD-418
Modified: build/trunk/parent/pom.xml
===================================================================
--- build/trunk/parent/pom.xml 2010-02-17 22:34:54 UTC (rev 5873)
+++ build/trunk/parent/pom.xml 2010-02-17 22:43:20 UTC (rev 5874)
@@ -441,6 +441,11 @@
<version>2.0-alpha-4</version>
<extensions>true</extensions>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-maven-plugin</artifactId>
+ <version>1.4</version>
+ </plugin>
</plugins>
</pluginManagement>
</build>
14 years, 10 months
Weld SVN: r5873 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter and 4 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-17 17:34:54 -0500 (Wed, 17 Feb 2010)
New Revision: 5873
Removed:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/Spider.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/SpiderListProducer.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/SpiderListProducer.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/GeneralListProducer.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedReturnTypeWithTypeVariableTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/GeneralListProducer.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties
Log:
WELD-426, WELD-428, WELD-431
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2010-02-17 21:52:15 UTC (rev 5872)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2010-02-17 22:34:54 UTC (rev 5873)
@@ -219,7 +219,6 @@
@SuppressWarnings("serial")
@Test(groups = "producerField")
@SpecAssertion(section = "3.4", id = "fb")
- //WELD-431
public void testProducerFieldWithTypeVariable()
{
assert (getInstanceByType(new TypeLiteral<List<Spider>>(){})) != null;
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/GeneralListProducer.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/GeneralListProducer.java 2010-02-17 21:52:15 UTC (rev 5872)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/GeneralListProducer.java 2010-02-17 22:34:54 UTC (rev 5873)
@@ -24,10 +24,6 @@
public class GeneralListProducer<T>
{
- public GeneralListProducer(String name)
- {
-
- }
@Produces
@RequestScoped
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedReturnTypeWithTypeVariableTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedReturnTypeWithTypeVariableTest.java 2010-02-17 21:52:15 UTC (rev 5872)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedReturnTypeWithTypeVariableTest.java 2010-02-17 22:34:54 UTC (rev 5873)
@@ -32,7 +32,6 @@
{
@Test
@SpecAssertion(section = "3.3", id = "iab")
- //WELD-428
public void testNonDependentScopedProducerMethodWithParameterizedTypeWithTypeVariable()
{
assert false;
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/Spider.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/Spider.java 2010-02-17 21:52:15 UTC (rev 5872)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/Spider.java 2010-02-17 22:34:54 UTC (rev 5873)
@@ -1,23 +0,0 @@
-/*
- * 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.implementation.producer.method.broken.parameterizedTypeWithTypeParameter;
-
-
-class Spider
-{
-
-}
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/SpiderListProducer.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/SpiderListProducer.java 2010-02-17 21:52:15 UTC (rev 5872)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/SpiderListProducer.java 2010-02-17 22:34:54 UTC (rev 5873)
@@ -1,26 +0,0 @@
-/*
- * 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.implementation.producer.method.broken.parameterizedTypeWithTypeParameter;
-
-public class SpiderListProducer extends GeneralListProducer<Spider>
-{
- public SpiderListProducer()
- {
- super(null);
- }
-}
-
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/GeneralListProducer.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/GeneralListProducer.java 2010-02-17 21:52:15 UTC (rev 5872)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/GeneralListProducer.java 2010-02-17 22:34:54 UTC (rev 5873)
@@ -23,10 +23,6 @@
public class GeneralListProducer<T>
{
- public GeneralListProducer(String name)
- {
-
- }
@Produces
public List<T> create()
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2010-02-17 21:52:15 UTC (rev 5872)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2010-02-17 22:34:54 UTC (rev 5873)
@@ -275,7 +275,6 @@
@Test
@SpecAssertion(section = "3.3", id = "iaa")
- //WELD-426
public void testTypeVariableReturnType()
{
// should be created by SpiderListProducer
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/SpiderListProducer.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/SpiderListProducer.java 2010-02-17 21:52:15 UTC (rev 5872)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/SpiderListProducer.java 2010-02-17 22:34:54 UTC (rev 5873)
@@ -1,26 +0,0 @@
-/*
- * 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.implementation.producer.method.definition;
-
-public class SpiderListProducer extends GeneralListProducer<Spider>
-{
- public SpiderListProducer()
- {
- super(null);
- }
-}
-
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-02-17 21:52:15 UTC (rev 5872)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-02-17 22:34:54 UTC (rev 5873)
@@ -26,8 +26,9 @@
import static org.jboss.weld.logging.messages.BeanMessage.NULL_NOT_ALLOWED_FROM_PRODUCER;
import static org.jboss.weld.logging.messages.BeanMessage.ONLY_ONE_SCOPE_ALLOWED;
import static org.jboss.weld.logging.messages.BeanMessage.PRODUCER_CAST_ERROR;
+import static org.jboss.weld.logging.messages.BeanMessage.PRODUCER_METHOD_WITH_TYPE_VARIABLE_RETURN_TYPE_MUST_BE_DEPENDENT;
+import static org.jboss.weld.logging.messages.BeanMessage.PRODUCER_METHOD_WITH_WILDCARD_RETURN_TYPE_MUST_BE_DEPENDENT;
import static org.jboss.weld.logging.messages.BeanMessage.RETURN_TYPE_MUST_BE_CONCRETE;
-import static org.jboss.weld.logging.messages.BeanMessage.TYPE_PARAMETER_MUST_BE_CONCRETE;
import static org.jboss.weld.logging.messages.BeanMessage.USING_DEFAULT_SCOPE;
import static org.jboss.weld.logging.messages.BeanMessage.USING_SCOPE;
@@ -172,11 +173,18 @@
{
throw new DefinitionException(RETURN_TYPE_MUST_BE_CONCRETE, getWeldAnnotated().getBaseType());
}
- for (Type type : getWeldAnnotated().getActualTypeArguments())
+ else if (getWeldAnnotated().isParameterizedType())
{
- if (!(type instanceof Class<?>))
+ for (Type type : getWeldAnnotated().getActualTypeArguments())
{
- throw new DefinitionException(TYPE_PARAMETER_MUST_BE_CONCRETE, this.getWeldAnnotated());
+ if (!Dependent.class.equals(getScope()) && type instanceof TypeVariable<?>)
+ {
+ throw new DefinitionException(PRODUCER_METHOD_WITH_TYPE_VARIABLE_RETURN_TYPE_MUST_BE_DEPENDENT, getWeldAnnotated());
+ }
+ else if (type instanceof WildcardType)
+ {
+ throw new DefinitionException(PRODUCER_METHOD_WITH_WILDCARD_RETURN_TYPE_MUST_BE_DEPENDENT, getWeldAnnotated());
+ }
}
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java 2010-02-17 21:52:15 UTC (rev 5872)
+++ core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java 2010-02-17 22:34:54 UTC (rev 5873)
@@ -130,6 +130,8 @@
@MessageId("000093") CANNOT_READ_OBJECT,
@MessageId("000094") INJECTED_FIELD_CANNOT_BE_PRODUCER,
@MessageId("000095") GENERIC_SESSION_BEAN_MUST_BE_DEPENDENT,
- @MessageId("000096") PRODUCER_FIELD_ON_SESSION_BEAN_MUST_BE_STATIC;
+ @MessageId("000096") PRODUCER_FIELD_ON_SESSION_BEAN_MUST_BE_STATIC,
+ @MessageId("000097") PRODUCER_METHOD_WITH_TYPE_VARIABLE_RETURN_TYPE_MUST_BE_DEPENDENT,
+ @MessageId("000098") PRODUCER_METHOD_WITH_WILDCARD_RETURN_TYPE_MUST_BE_DEPENDENT;
}
Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties 2010-02-17 21:52:15 UTC (rev 5872)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties 2010-02-17 22:34:54 UTC (rev 5873)
@@ -94,4 +94,6 @@
CANNOT_READ_OBJECT=Cannot read object
INJECTED_FIELD_CANNOT_BE_PRODUCER=Injected field {0} cannot be annotated @Produces on {1}
GENERIC_SESSION_BEAN_MUST_BE_DEPENDENT=Session bean with generic class {0} must be @Depedent scope
-PRODUCER_FIELD_ON_SESSION_BEAN_MUST_BE_STATIC=Producer fields on session beans must be static. Field {0} declared on {1}
+PRODUCER_FIELD_ON_SESSION_BEAN_MUST_BE_STATIC=Producer fields on session beans must be static. Field {0} declared on {1}
+PRODUCER_METHOD_WITH_TYPE_VARIABLE_RETURN_TYPE_MUST_BE_DEPENDENT=A producer method with a parameterized return type with a type variable must be declared @Dependent scoped. Method {0}
+PRODUCER_METHOD_WITH_WILDCARD_RETURN_TYPE_MUST_BE_DEPENDENT=A producer method with a parameterized return type with a wildcard must be declared @Dependent scoped. Method {0}
14 years, 10 months
Weld SVN: r5872 - in core/trunk: impl/src/main/java/org/jboss/weld/bean/builtin and 4 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-17 16:52:15 -0500 (Wed, 17 Feb 2010)
New Revision: 5872
Added:
core/trunk/impl/src/main/java/org/jboss/weld/injection/SimpleInjectionPoint.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/ExtraSpecial.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/Pig.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/PigSty.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/Special.java
Removed:
core/trunk/impl/src/main/java/org/jboss/weld/injection/DummyInjectionPoint.java
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java
core/trunk/impl/src/main/java/org/jboss/weld/injection/CurrentInjectionPoint.java
core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/InjectionPointTest.java
Log:
WELD-438
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-02-17 17:29:27 UTC (rev 5871)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -59,7 +59,6 @@
import org.jboss.weld.exceptions.IllegalProductException;
import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.injection.CurrentInjectionPoint;
-import org.jboss.weld.injection.DummyInjectionPoint;
import org.jboss.weld.introspector.WeldMember;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
@@ -256,35 +255,34 @@
throw new IllegalProductException(NON_SERIALIZABLE_PRODUCT_ERROR, getProducer());
}
InjectionPoint injectionPoint = Container.instance().services().get(CurrentInjectionPoint.class).peek();
- if (injectionPoint == null || injectionPoint.equals(DummyInjectionPoint.INSTANCE))
+ if (injectionPoint != null && injectionPoint.getBean() != null)
{
- return;
- }
- if (!instanceSerializable && Beans.isPassivatingScope(injectionPoint.getBean(), beanManager))
- {
- if (injectionPoint.getMember() instanceof Field)
+ if (!instanceSerializable && Beans.isPassivatingScope(injectionPoint.getBean(), beanManager))
{
- if (!injectionPoint.isTransient() && instance != null && !instanceSerializable)
+ if (injectionPoint.getMember() instanceof Field)
{
- throw new IllegalProductException(NON_SERIALIZABLE_FIELD_INJECTION_ERROR, this, injectionPoint);
+ if (!injectionPoint.isTransient() && instance != null && !instanceSerializable)
+ {
+ throw new IllegalProductException(NON_SERIALIZABLE_FIELD_INJECTION_ERROR, this, injectionPoint);
+ }
}
- }
- else if (injectionPoint.getMember() instanceof Method)
- {
- Method method = (Method) injectionPoint.getMember();
- if (method.isAnnotationPresent(Inject.class))
+ else if (injectionPoint.getMember() instanceof Method)
{
- throw new IllegalProductException(NON_SERIALIZABLE_INITIALIZER_PARAM_INJECTION_ERROR, this, injectionPoint);
+ Method method = (Method) injectionPoint.getMember();
+ if (method.isAnnotationPresent(Inject.class))
+ {
+ throw new IllegalProductException(NON_SERIALIZABLE_INITIALIZER_PARAM_INJECTION_ERROR, this, injectionPoint);
+ }
+ if (method.isAnnotationPresent(Produces.class))
+ {
+ throw new IllegalProductException(NON_SERIALIZABLE_PRODUCER_PARAM_INJECTION_ERROR, this, injectionPoint);
+ }
}
- if (method.isAnnotationPresent(Produces.class))
+ else if (injectionPoint.getMember() instanceof Constructor<?>)
{
- throw new IllegalProductException(NON_SERIALIZABLE_PRODUCER_PARAM_INJECTION_ERROR, this, injectionPoint);
+ throw new IllegalProductException(NON_SERIALIZABLE_CONSTRUCTOR_PARAM_INJECTION_ERROR, this, injectionPoint);
}
}
- else if (injectionPoint.getMember() instanceof Constructor<?>)
- {
- throw new IllegalProductException(NON_SERIALIZABLE_CONSTRUCTOR_PARAM_INJECTION_ERROR, this, injectionPoint);
- }
}
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java 2010-02-17 17:29:27 UTC (rev 5871)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -37,6 +37,7 @@
import org.jboss.weld.Container;
import org.jboss.weld.exceptions.InvalidObjectException;
import org.jboss.weld.injection.CurrentInjectionPoint;
+import org.jboss.weld.injection.SimpleInjectionPoint;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resolution.ResolvableBuilder;
import org.jboss.weld.util.Beans;
@@ -67,17 +68,18 @@
public T get()
{
Bean<?> bean = getBeanManager().getBean(new ResolvableBuilder(getType()).addQualifiers(getQualifiers()).setDeclaringBean(getInjectionPoint().getBean()).create());
- // Push in an empty CC to ensure that we don't get the CC of whatever is injecting the bean containing the Instance injection point
+ // Generate a correct injection point for the bean, we do this by taking the original injection point and adjusting the qualifiers and type
+ InjectionPoint ip = new SimpleInjectionPoint(getInjectionPoint().isTransient(), getInjectionPoint().isDelegate(), getType(), getQualifiers(), getInjectionPoint().getMember(), getInjectionPoint().getBean(), getInjectionPoint().getAnnotated());
try
- {
- Container.instance().services().get(CurrentInjectionPoint.class).pushDummy();
+ {
+ Container.instance().services().get(CurrentInjectionPoint.class).push(ip);
@SuppressWarnings("unchecked")
T instance = (T) getBeanManager().getReference(bean, getType(), getBeanManager().createCreationalContext(bean));
return instance;
}
finally
{
- Container.instance().services().get(CurrentInjectionPoint.class).popDummy();
+ Container.instance().services().get(CurrentInjectionPoint.class).pop();
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java 2010-02-17 17:29:27 UTC (rev 5871)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -33,6 +33,7 @@
import org.jboss.weld.context.CreationalContextImpl;
import org.jboss.weld.context.WeldCreationalContext;
import org.jboss.weld.injection.CurrentInjectionPoint;
+import org.jboss.weld.injection.SimpleInjectionPoint;
import org.jboss.weld.serialization.spi.ContextualStore;
import org.jboss.weld.util.reflection.SecureReflections;
import org.slf4j.cal10n.LocLogger;
@@ -134,16 +135,16 @@
creationalContext = currentCreationalContext.get().getCreationalContext(bean);
outer = false;
}
+ Context context = Container.instance().deploymentManager().getContext(bean.getScope());
try
{
- Context context = Container.instance().deploymentManager().getContext(bean.getScope());
// Ensure that there is no injection point associated
- Container.instance().services().get(CurrentInjectionPoint.class).pushDummy();
+ Container.instance().services().get(CurrentInjectionPoint.class).push(SimpleInjectionPoint.EMPTY_INJECTION_POINT);
return context.get(bean, creationalContext);
}
finally
{
- Container.instance().services().get(CurrentInjectionPoint.class).popDummy();
+ Container.instance().services().get(CurrentInjectionPoint.class).pop();
if (outer)
{
currentCreationalContext.remove();
Modified: core/trunk/impl/src/main/java/org/jboss/weld/injection/CurrentInjectionPoint.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/injection/CurrentInjectionPoint.java 2010-02-17 17:29:27 UTC (rev 5871)
+++ core/trunk/impl/src/main/java/org/jboss/weld/injection/CurrentInjectionPoint.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -73,19 +73,6 @@
return null;
}
}
-
- public void pushDummy()
- {
- currentInjectionPoint.get().push(DummyInjectionPoint.INSTANCE);
- }
-
- public void popDummy()
- {
- if (!currentInjectionPoint.get().isEmpty() && DummyInjectionPoint.INSTANCE.equals(currentInjectionPoint.get().peek()))
- {
- currentInjectionPoint.get().pop();
- }
- }
public void cleanup()
{
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/injection/DummyInjectionPoint.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/injection/DummyInjectionPoint.java 2010-02-17 17:29:27 UTC (rev 5871)
+++ core/trunk/impl/src/main/java/org/jboss/weld/injection/DummyInjectionPoint.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.weld.injection;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Member;
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.Set;
-
-import javax.enterprise.inject.spi.Annotated;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.InjectionPoint;
-
-public class DummyInjectionPoint implements InjectionPoint
-{
-
- public static final DummyInjectionPoint INSTANCE = new DummyInjectionPoint();
-
- public boolean isTransient()
- {
- return true;
- }
-
- public boolean isDelegate()
- {
- return false;
- }
-
- public Type getType()
- {
- return InjectionPoint.class;
- }
-
- public Set<Annotation> getQualifiers()
- {
- return Collections.emptySet();
- }
-
- public Member getMember()
- {
- return null;
- }
-
- public Bean<?> getBean()
- {
- return null;
- }
-
- public Annotated getAnnotated()
- {
- return null;
- }
-
-}
Copied: core/trunk/impl/src/main/java/org/jboss/weld/injection/SimpleInjectionPoint.java (from rev 5857, core/trunk/impl/src/main/java/org/jboss/weld/injection/DummyInjectionPoint.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/injection/SimpleInjectionPoint.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/injection/SimpleInjectionPoint.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.weld.injection;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.jboss.weld.util.collections.Arrays2;
+
+public class SimpleInjectionPoint implements InjectionPoint
+{
+
+ public static final InjectionPoint EMPTY_INJECTION_POINT = new SimpleInjectionPoint(false, false, Object.class, Collections.<Annotation>emptySet(), null, null, null);
+
+ private final boolean _transient;
+ private final boolean delegate;
+ private final Type type;
+ private final Set<Annotation> qualifiers;
+ private final Member member;
+ private final Bean<?> bean;
+ private final Annotated annotated;
+
+ public SimpleInjectionPoint(boolean _transient, boolean delegate, Type type, Set<Annotation> qualifiers, Member member, Bean<?> bean, Annotated annotated)
+ {
+ this._transient = _transient;
+ this.delegate = delegate;
+ this.type = type;
+ this.qualifiers = qualifiers;
+ this.member = member;
+ this.bean = bean;
+ this.annotated = annotated;
+ }
+
+ public SimpleInjectionPoint(boolean _transient, boolean delegate, Type type, Annotation[] qualifiers, Member member, Bean<?> bean, Annotated annotated)
+ {
+ this(_transient, delegate, type, Arrays2.asSet(qualifiers), member, bean, annotated);
+ }
+
+ public boolean isTransient()
+ {
+ return _transient;
+ }
+
+ public boolean isDelegate()
+ {
+ return delegate;
+ }
+
+ public Type getType()
+ {
+ return type;
+ }
+
+ public Set<Annotation> getQualifiers()
+ {
+ return qualifiers;
+ }
+
+ public Member getMember()
+ {
+ return member;
+ }
+
+ public Bean<?> getBean()
+ {
+ return bean;
+ }
+
+ public Annotated getAnnotated()
+ {
+ return annotated;
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/injection/SimpleInjectionPoint.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java 2010-02-17 17:29:27 UTC (rev 5871)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -124,8 +124,12 @@
*/
public static boolean isPassivatingScope(Bean<?> bean, BeanManagerImpl manager)
{
- if (bean instanceof SessionBean<?>)
+ if (bean == null)
{
+ return false;
+ }
+ else if (bean instanceof SessionBean<?>)
+ {
return ((SessionBean<?>) bean).getEjbDescriptor().isStateful();
}
else
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/ExtraSpecial.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/ExtraSpecial.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/ExtraSpecial.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -0,0 +1,46 @@
+/*
+ * 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.weld.tests.injectionPoint;
+
+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 java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.AnnotationLiteral;
+import javax.inject.Qualifier;
+
+@Qualifier
+(a)Retention(RetentionPolicy.RUNTIME)
+@Target({FIELD, METHOD, TYPE, PARAMETER})
+public @interface ExtraSpecial
+{
+
+ static class ExtraSpecialLiteral extends AnnotationLiteral<ExtraSpecial> implements ExtraSpecial
+ {
+
+ private ExtraSpecialLiteral() {}
+
+ }
+
+ public static final ExtraSpecial INSTANCE = new ExtraSpecialLiteral();
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/ExtraSpecial.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/InjectionPointTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/InjectionPointTest.java 2010-02-17 17:29:27 UTC (rev 5871)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/InjectionPointTest.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -16,7 +16,10 @@
*/
package org.jboss.weld.tests.injectionPoint;
+import java.lang.reflect.ParameterizedType;
+
import javax.enterprise.inject.IllegalProductException;
+import javax.enterprise.inject.Instance;
import javax.enterprise.inject.spi.InjectionPoint;
import org.jboss.testharness.impl.packaging.Artifact;
@@ -59,5 +62,26 @@
{
assert getReference(GrassyField.class).getCow().getName().equals("daisy");
}
+
+ @Test(description = "WELD-438")
+ public void testInjectionPointWhenInstanceGetIsUsed() throws Exception
+ {
+ Pig pig = getReference(PigSty.class).getPig();
+ assert pig != null;
+ assert pig.getInjectionPoint().getBean() != null;
+ assert pig.getInjectionPoint().getBean().getBeanClass().equals(PigSty.class);
+ assert pig.getInjectionPoint().getMember().equals(PigSty.class.getDeclaredField("pig"));
+ assert pig.getInjectionPoint().getAnnotated() != null;
+ assert pig.getInjectionPoint().getAnnotated().getBaseType() instanceof ParameterizedType;
+ ParameterizedType parameterizedType = ((ParameterizedType) pig.getInjectionPoint().getAnnotated().getBaseType());
+ assert parameterizedType.getRawType().equals(Instance.class);
+ assert parameterizedType.getActualTypeArguments().length == 1;
+ assert parameterizedType.getActualTypeArguments()[0].equals(Pig.class);
+ assert pig.getInjectionPoint().getAnnotated().isAnnotationPresent(Special.class);
+ assert !pig.getInjectionPoint().getAnnotated().isAnnotationPresent(ExtraSpecial.class);
+ assert Utils.annotationSetMatches(pig.injectionPoint.getQualifiers(), Special.class, ExtraSpecial.class);
+ assert Pig.class.equals(pig.getInjectionPoint().getType());
+
+ }
}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/Pig.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/Pig.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/Pig.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -0,0 +1,17 @@
+package org.jboss.weld.tests.injectionPoint;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.inject.Inject;
+
+@Special @ExtraSpecial
+public class Pig
+{
+
+ @Inject InjectionPoint injectionPoint;
+
+ public InjectionPoint getInjectionPoint()
+ {
+ return injectionPoint;
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/Pig.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/PigSty.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/PigSty.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/PigSty.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -0,0 +1,16 @@
+package org.jboss.weld.tests.injectionPoint;
+
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+public class PigSty
+{
+ @Inject @Special Instance<Pig> pig;
+
+ public Pig getPig()
+ {
+ return pig.select(ExtraSpecial.INSTANCE).get();
+ }
+
+}
+
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/PigSty.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/Special.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/Special.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/Special.java 2010-02-17 21:52:15 UTC (rev 5872)
@@ -0,0 +1,36 @@
+/*
+ * 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.weld.tests.injectionPoint;
+
+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 java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Qualifier
+(a)Retention(RetentionPolicy.RUNTIME)
+@Target({FIELD, METHOD, TYPE, PARAMETER})
+public @interface Special
+{
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/injectionPoint/Special.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
14 years, 10 months
Weld SVN: r5871 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed and 6 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-17 12:29:27 -0500 (Wed, 17 Feb 2010)
New Revision: 5871
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Baz.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed2/Bar.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/Bar.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/Foo.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/NamedNonFieldInjectionPointTest.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Bar.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Foo.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed2/Foo.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java
core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ValidatorMessage.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/validator_en.properties
Log:
WELD-427
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Bar.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Bar.java 2010-02-17 17:13:38 UTC (rev 5870)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Bar.java 2010-02-17 17:29:27 UTC (rev 5871)
@@ -1,19 +1,3 @@
-/*
- * 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.lookup.byname.broken.injectionPointWithNamed;
import javax.inject.Named;
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Baz.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Baz.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Baz.java 2010-02-17 17:29:27 UTC (rev 5871)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.lookup.byname.broken.injectionPointWithNamed;
+
+public class Baz
+{
+
+ public Baz(String name)
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Baz.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Foo.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Foo.java 2010-02-17 17:13:38 UTC (rev 5870)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed/Foo.java 2010-02-17 17:29:27 UTC (rev 5871)
@@ -21,13 +21,10 @@
public class Foo
{
- public Foo(Bar bar)
- {
- }
@Produces
- public Foo produceFoo(@Named Bar bar)
+ public Baz produceFoo(@Named Bar bar)
{
- return new Foo(bar);
+ return new Baz("");
}
}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed2/Bar.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed2/Bar.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed2/Bar.java 2010-02-17 17:29:27 UTC (rev 5871)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.byname.broken.injectionPointWithNamed2;
+
+import javax.inject.Named;
+
+@Named
+public class Bar
+{
+
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed2/Bar.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed2/Foo.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed2/Foo.java 2010-02-17 17:13:38 UTC (rev 5870)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed2/Foo.java 2010-02-17 17:29:27 UTC (rev 5871)
@@ -21,7 +21,7 @@
public class Foo
{
- public void observe(@Observes @Named Foo foo)
+ public void observe(@Observes Bar bar, @Named Bar bar1)
{
}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/Bar.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/Bar.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/Bar.java 2010-02-17 17:29:27 UTC (rev 5871)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.byname.broken.injectionPointWithNamed3;
+
+import javax.inject.Named;
+
+@Named
+public class Bar
+{
+
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/Bar.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/Foo.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/Foo.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/Foo.java 2010-02-17 17:29:27 UTC (rev 5871)
@@ -0,0 +1,29 @@
+/*
+ * 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.lookup.byname.broken.injectionPointWithNamed3;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+public class Foo
+{
+ @Inject
+ public void initialize(@Named Bar bar)
+ {
+
+ }
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/Foo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/NamedNonFieldInjectionPointTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/NamedNonFieldInjectionPointTest.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/NamedNonFieldInjectionPointTest.java 2010-02-17 17:29:27 UTC (rev 5871)
@@ -0,0 +1,42 @@
+/*
+ * 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.lookup.byname.broken.injectionPointWithNamed3;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentFailure;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(DeploymentFailure.class)
+@SpecVersion(spec="cdi", version="20091101")
+public class NamedNonFieldInjectionPointTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertion(section = "3.11", id = "b")
+ //WELD-427
+ public void testNamedInitializerMethodInjectionPointNotAllowed() throws Exception
+ {
+ assert false;
+ }
+
+}
Property changes on: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/broken/injectionPointWithNamed3/NamedNonFieldInjectionPointTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java 2010-02-17 17:13:38 UTC (rev 5870)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java 2010-02-17 17:29:27 UTC (rev 5871)
@@ -39,12 +39,14 @@
import static org.jboss.weld.logging.messages.ValidatorMessage.INTERCEPTOR_NOT_ANNOTATED_OR_REGISTERED;
import static org.jboss.weld.logging.messages.ValidatorMessage.INTERCEPTOR_SPECIFIED_TWICE;
import static org.jboss.weld.logging.messages.ValidatorMessage.NEW_WITH_QUALIFIERS;
+import static org.jboss.weld.logging.messages.ValidatorMessage.NON_FIELD_INJECTION_POINT_CANNOT_USE_NAMED;
import static org.jboss.weld.logging.messages.ValidatorMessage.NON_SERIALIZABLE_BEAN_INJECTED_INTO_PASSIVATING_BEAN;
import static org.jboss.weld.logging.messages.ValidatorMessage.NOT_PROXYABLE;
import static org.jboss.weld.logging.messages.ValidatorMessage.PASSIVATING_BEAN_WITH_NONSERIALIZABLE_DECORATOR;
import static org.jboss.weld.logging.messages.ValidatorMessage.PASSIVATING_BEAN_WITH_NONSERIALIZABLE_INTERCEPTOR;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
@@ -66,6 +68,7 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.InjectionTarget;
import javax.enterprise.inject.spi.Interceptor;
+import javax.inject.Named;
import org.jboss.interceptor.model.InterceptionModel;
import org.jboss.weld.bean.AbstractClassBean;
@@ -252,6 +255,10 @@
{
throw new DefinitionException(INJECTION_POINT_WITH_TYPE_VARIABLE, ij);
}
+ if (!(ij.getMember() instanceof Field) && ij.getAnnotated().isAnnotationPresent(Named.class) && ij.getAnnotated().getAnnotation(Named.class).value().equals(""))
+ {
+ throw new DefinitionException(NON_FIELD_INJECTION_POINT_CANNOT_USE_NAMED, ij);
+ }
checkFacadeInjectionPoint(ij, Instance.class);
checkFacadeInjectionPoint(ij, Event.class);
Annotation[] bindings = ij.getQualifiers().toArray(new Annotation[0]);
Modified: core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java 2010-02-17 17:13:38 UTC (rev 5870)
+++ core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java 2010-02-17 17:29:27 UTC (rev 5871)
@@ -21,6 +21,7 @@
import static org.jboss.weld.logging.messages.EventMessage.INVALID_PRODUCER;
import static org.jboss.weld.logging.messages.EventMessage.INVALID_SCOPED_CONDITIONAL_OBSERVER;
import static org.jboss.weld.logging.messages.EventMessage.MULTIPLE_EVENT_PARAMETERS;
+import static org.jboss.weld.logging.messages.ValidatorMessage.NON_FIELD_INJECTION_POINT_CANNOT_USE_NAMED;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
@@ -40,6 +41,7 @@
import javax.enterprise.inject.spi.Extension;
import javax.enterprise.inject.spi.ObserverMethod;
import javax.inject.Inject;
+import javax.inject.Named;
import javax.inject.Qualifier;
import org.jboss.weld.bean.RIBean;
@@ -48,6 +50,7 @@
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
@@ -147,6 +150,13 @@
{
throw new DefinitionException(INVALID_INITIALIZER, this);
}
+ for (WeldParameter<?, ?> parameter : getMethod().getWeldParameters())
+ {
+ if (parameter.isAnnotationPresent(Named.class) && parameter.getAnnotation(Named.class).value().equals(""))
+ {
+ throw new DefinitionException(NON_FIELD_INJECTION_POINT_CANNOT_USE_NAMED, getMethod());
+ }
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ValidatorMessage.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ValidatorMessage.java 2010-02-17 17:13:38 UTC (rev 5870)
+++ core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ValidatorMessage.java 2010-02-17 17:29:27 UTC (rev 5871)
@@ -63,5 +63,6 @@
@MessageId("001423") ALTERNATIVE_BEAN_CLASS_SPECIFIED_MULTIPLE_TIMES,
@MessageId("001424") DISPOSAL_METHODS_WITHOUT_PRODUCER,
@MessageId("001425") INJECTION_POINT_HAS_WILDCARD,
- @MessageId("001426") INJECTION_POINT_MUST_HAVE_TYPE_PARAMETER;
+ @MessageId("001426") INJECTION_POINT_MUST_HAVE_TYPE_PARAMETER,
+ @MessageId("001427") NON_FIELD_INJECTION_POINT_CANNOT_USE_NAMED;
}
Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/validator_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/validator_en.properties 2010-02-17 17:13:38 UTC (rev 5870)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/validator_en.properties 2010-02-17 17:29:27 UTC (rev 5871)
@@ -25,4 +25,4 @@
DISPOSAL_METHODS_WITHOUT_PRODUCER=The following disposal methods were declared but did not resolve to a producer method: {0}
INJECTION_POINT_HAS_WILDCARD=An injection point of type {0} cannot have a wildcard type parameter: {0}
INJECTION_POINT_MUST_HAVE_TYPE_PARAMETER=An injection point of type {0} must have a type parameter: {1}
-
+NON_FIELD_INJECTION_POINT_CANNOT_USE_NAMED=Only field injection points can use the @Named qualifier with no value. {0} is not a field injection point.
14 years, 10 months
Weld SVN: r5870 - cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent.
by weld-commits@lists.jboss.org
Author: marius.bogoevici
Date: 2010-02-17 12:13:38 -0500 (Wed, 17 Feb 2010)
New Revision: 5870
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/TransactionalInterceptor.java
Log:
CDITCK-102 removing thrown exceptions from method signatures
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/TransactionalInterceptor.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/TransactionalInterceptor.java 2010-02-17 17:13:11 UTC (rev 5869)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/TransactionalInterceptor.java 2010-02-17 17:13:38 UTC (rev 5870)
@@ -34,9 +34,14 @@
return ctx.proceed();
}
- @PreDestroy public void destroy(InvocationContext ctx) throws Exception
+ @PreDestroy public void destroy(InvocationContext ctx)
{
destroyed = true;
- ctx.proceed();
+ try {
+ ctx.proceed();
+ } catch (Exception e) {
+ // catch and wrap
+ throw new RuntimeException(e);
+ }
}
}
14 years, 10 months
Weld SVN: r5869 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent.
by weld-commits@lists.jboss.org
Author: marius.bogoevici
Date: 2010-02-17 12:13:11 -0500 (Wed, 17 Feb 2010)
New Revision: 5869
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/TransactionalInterceptor.java
Log:
CDITCK-102 removing thrown exceptions from method signatures
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/TransactionalInterceptor.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/TransactionalInterceptor.java 2010-02-17 15:24:36 UTC (rev 5868)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/TransactionalInterceptor.java 2010-02-17 17:13:11 UTC (rev 5869)
@@ -34,9 +34,14 @@
return ctx.proceed();
}
- @PreDestroy public void destroy(InvocationContext ctx) throws Exception
+ @PreDestroy public void destroy(InvocationContext ctx)
{
destroyed = true;
- ctx.proceed();
+ try {
+ ctx.proceed();
+ } catch (Exception e) {
+ // catch and wrap
+ throw new RuntimeException(e);
+ }
}
}
14 years, 10 months
Weld SVN: r5868 - cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-17 10:24:36 -0500 (Wed, 17 Feb 2010)
New Revision: 5868
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java
Log:
CDITCK-111
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java 2010-02-17 15:05:41 UTC (rev 5867)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java 2010-02-17 15:24:36 UTC (rev 5868)
@@ -26,7 +26,7 @@
public class Fox implements FoxLocal
{
@Produces @Tame
- private Den den = new Den("FoxDen");
+ private static Den den = new Den("FoxDen");
private int nextLitterSize;
14 years, 10 months