Author: pete.muir(a)jboss.org
Date: 2010-01-28 11:34:47 -0500 (Thu, 28 Jan 2010)
New Revision: 5653
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/AnnotatedTypeExtension.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/AnnotatedTypeExtensionTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/Clothes.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/InjectLiteral.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/TumbleDryer.java
core/trunk/tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/
core/trunk/tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/javax.enterprise.inject.spi.Extension
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerFieldImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java
core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/event/TransactionalObserverMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties
Log:
WELD-372
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-01-28
04:56:14 UTC (rev 5652)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -119,7 +119,7 @@
}
@Override
- public abstract WeldMember<T, X, S> getWeldAnnotated();
+ public abstract WeldMember<T, ? super X, S> getWeldAnnotated();
@Override
// Overriden to provide the class of the bean that declares the producer
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2010-01-28
04:56:14 UTC (rev 5652)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -46,10 +46,15 @@
public class DisposalMethod<X, T> extends AbstractReceiverBean<X, T, Method>
{
- protected MethodInjectionPoint<T, X> disposalMethodInjectionPoint;
- private WeldParameter<?, X> disposesParameter;
+ protected MethodInjectionPoint<T, ? super X> disposalMethodInjectionPoint;
+ private WeldParameter<?, ? super X> disposesParameter;
+
+ public static <X, T> DisposalMethod<X, T> of(BeanManagerImpl manager,
WeldMethod<T, ? super X> method, AbstractClassBean<X> declaringBean)
+ {
+ return new DisposalMethod<X, T>(manager, method, declaringBean);
+ }
- protected DisposalMethod(BeanManagerImpl beanManager, WeldMethod<T, X>
disposalMethod, AbstractClassBean<X> declaringBean)
+ protected DisposalMethod(BeanManagerImpl beanManager, WeldMethod<T, ? super X>
disposalMethod, AbstractClassBean<X> declaringBean)
{
super(new
StringBuilder().append(DisposalMethod.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getWeldAnnotated().getName()).append(disposalMethod.getSignature().toString()).toString(),
declaringBean, beanManager);
this.disposalMethodInjectionPoint = MethodInjectionPoint.of(this, disposalMethod);
@@ -65,7 +70,7 @@
this.disposesParameter =
getWeldAnnotated().getWeldParameters(Disposes.class).get(0);
}
- public WeldParameter<?, X> getDisposesParameter()
+ public WeldParameter<?, ? super X> getDisposesParameter()
{
return disposesParameter;
}
@@ -85,16 +90,11 @@
}
@Override
- public WeldMethod<T, X> getWeldAnnotated()
+ public WeldMethod<T, ? super X> getWeldAnnotated()
{
return disposalMethodInjectionPoint;
}
- public static <X, T> DisposalMethod<X, T> of(BeanManagerImpl manager,
WeldMethod<T, X> disposalMethod, AbstractClassBean<X> declaringBean)
- {
- return new DisposalMethod<X, T>(manager, disposalMethod, declaringBean);
- }
-
@Override
protected void initQualifiers()
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2010-01-28
04:56:14 UTC (rev 5652)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -41,7 +41,7 @@
public class ProducerField<X, T> extends AbstractProducerBean<X, T, Field>
{
// The underlying field
- private WeldField<T, X> field;
+ private WeldField<T, ? super X> field;
/**
* Creates a producer field
@@ -51,7 +51,7 @@
* @param beanManager the current manager
* @return A producer field
*/
- public static <X, T> ProducerField<X, T> of(WeldField<T, X> field,
AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager)
+ public static <X, T> ProducerField<X, T> of(WeldField<T, ? super X>
field, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager)
{
return new ProducerField<X, T>(field, declaringBean, beanManager);
}
@@ -63,7 +63,7 @@
* @param declaringBean The declaring bean
* @param manager The Bean manager
*/
- protected ProducerField(WeldField<T, X> field, AbstractClassBean<X>
declaringBean, BeanManagerImpl manager)
+ protected ProducerField(WeldField<T, ? super X> field,
AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
{
super(createId(field, declaringBean), declaringBean, manager);
this.field = field;
@@ -142,7 +142,7 @@
* @return The annotated item
*/
@Override
- public WeldField<T, X> getWeldAnnotated()
+ public WeldField<T, ? super X> getWeldAnnotated()
{
return field;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-28
04:56:14 UTC (rev 5652)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -55,7 +55,7 @@
public class ProducerMethod<X, T> extends AbstractProducerBean<X, T, Method>
{
// The underlying method
- private MethodInjectionPoint<T, X> method;
+ private MethodInjectionPoint<T, ? super X> method;
private DisposalMethod<X, ?> disposalMethodBean;
private ProducerMethod<?, ?> specializedBean;
private final String id;
@@ -68,12 +68,12 @@
* @param beanManager the current manager
* @return A producer Web Bean
*/
- public static <X, T> ProducerMethod<X, T> of(WeldMethod<T, X>
method, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager)
+ public static <X, T> ProducerMethod<X, T> of(WeldMethod<T, ? super
X> method, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager)
{
return new ProducerMethod<X, T>(method, declaringBean, beanManager);
}
- protected ProducerMethod(WeldMethod<T, X> method, AbstractClassBean<X>
declaringBean, BeanManagerImpl beanManager)
+ protected ProducerMethod(WeldMethod<T, ? super X> method,
AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager)
{
super(new
StringBuilder().append(ProducerMethod.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getWeldAnnotated().getName()).append(".").append(method.getSignature().toString()).toString(),
declaringBean, beanManager);
this.method = MethodInjectionPoint.of(this, method);
@@ -85,7 +85,7 @@
initProducerMethodInjectableParameters();
}
- protected String createId(WeldMethod<T, X> method, AbstractClassBean<X>
declaringBean)
+ protected String createId(WeldMethod<T, ? super X> method,
AbstractClassBean<X> declaringBean)
{
if (declaringBean.getWeldAnnotated().isDiscovered())
{
@@ -240,7 +240,7 @@
* @return The annotated item
*/
@Override
- public WeldMethod<T, X> getWeldAnnotated()
+ public WeldMethod<T, ? super X> getWeldAnnotated()
{
return method;
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -103,12 +103,12 @@
* @param manager the current manager
* @return A producer field
*/
- public static <X, T> EEResourceProducerField<X, T> of(WeldField<T,
X> field, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ public static <X, T> EEResourceProducerField<X, T> of(WeldField<T, ?
super X> field, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
{
return new EEResourceProducerField<X, T>(field, declaringBean, manager);
}
- protected EEResourceProducerField(WeldField<T, X> field,
AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ protected EEResourceProducerField(WeldField<T, ? super X> field,
AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
{
super(field, declaringBean, manager);
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -173,7 +173,7 @@
protected <X> void createProducerMethods(AbstractClassBean<X>
declaringBean, WeldClass<X> annotatedClass)
{
- for (WeldMethod<?, X> method :
annotatedClass.getDeclaredWeldMethods(Produces.class))
+ for (WeldMethod<?, ? super X> method :
annotatedClass.getDeclaredWeldMethods(Produces.class))
{
createProducerMethod(declaringBean, method);
}
@@ -181,21 +181,21 @@
protected <X> void createDisposalMethods(AbstractClassBean<X>
declaringBean, WeldClass<X> annotatedClass)
{
- for (WeldMethod<?, X> method :
annotatedClass.getDeclaredWeldMethodsWithAnnotatedParameters(Disposes.class))
+ for (WeldMethod<?, ? super X> method :
annotatedClass.getDeclaredWeldMethodsWithAnnotatedParameters(Disposes.class))
{
- DisposalMethod<X, ?> disposalBean = DisposalMethod.of(manager, method,
declaringBean);
+ DisposalMethod<? super X, ?> disposalBean = DisposalMethod.of(manager,
method, declaringBean);
disposalBean.initialize(getEnvironment());
getEnvironment().addDisposesMethod(disposalBean);
}
}
- protected <X, T> void createProducerMethod(AbstractClassBean<X>
declaringBean, WeldMethod<T, X> annotatedMethod)
+ protected <X, T> void createProducerMethod(AbstractClassBean<X>
declaringBean, WeldMethod<T, ? super X> annotatedMethod)
{
- ProducerMethod<X, T> bean = ProducerMethod.of(annotatedMethod, declaringBean,
manager);
+ ProducerMethod<? super X, T> bean = ProducerMethod.of(annotatedMethod,
declaringBean, manager);
getEnvironment().addProducerMethod(bean);
}
- protected <X, T> void createProducerField(AbstractClassBean<X>
declaringBean, WeldField<T, X> field)
+ protected <X, T> void createProducerField(AbstractClassBean<X>
declaringBean, WeldField<T, ? super X> field)
{
ProducerField<X, T> bean;
if (isEEResourceProducerField(field))
@@ -211,7 +211,7 @@
protected <X> void createProducerFields(AbstractClassBean<X>
declaringBean, WeldClass<X> annotatedClass)
{
- for (WeldField<?, X> field :
annotatedClass.getDeclaredWeldFields(Produces.class))
+ for (WeldField<?, ? super X> field :
annotatedClass.getDeclaredWeldFields(Produces.class))
{
createProducerField(declaringBean, field);
}
@@ -219,15 +219,15 @@
protected <X> void createObserverMethods(RIBean<X> declaringBean,
WeldClass<X> annotatedClass)
{
- for (WeldMethod<?, X> method :
annotatedClass.getDeclaredWeldMethodsWithAnnotatedParameters(Observes.class))
+ for (WeldMethod<?, ? super X> method :
annotatedClass.getDeclaredWeldMethodsWithAnnotatedParameters(Observes.class))
{
createObserverMethod(declaringBean, method);
}
}
- protected <T, X> void createObserverMethod(RIBean<X> declaringBean,
WeldMethod<T, X> method)
+ protected <T, X> void createObserverMethod(RIBean<X> declaringBean,
WeldMethod<T, ? super X> method)
{
- ObserverMethodImpl<T, X> observer = ObserverFactory.create(method,
declaringBean, manager);
+ ObserverMethodImpl<T, ? super X> observer = ObserverFactory.create(method,
declaringBean, manager);
getEnvironment().addObserverMethod(observer);
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -96,13 +96,13 @@
protected <X> void createObserverMethods(RIBean<X> declaringBean,
BeanManagerImpl beanManager, WeldClass<X> annotatedClass,
Set<ObserverMethodImpl<?, ?>> observerMethods)
{
- for (WeldMethod<?, X> method :
annotatedClass.getDeclaredWeldMethodsWithAnnotatedParameters(Observes.class))
+ for (WeldMethod<?, ? super X> method :
annotatedClass.getDeclaredWeldMethodsWithAnnotatedParameters(Observes.class))
{
createObserverMethod(declaringBean, beanManager, method, observerMethods);
}
}
- protected <T, X> void createObserverMethod(RIBean<X> declaringBean,
BeanManagerImpl beanManager, WeldMethod<T, X> method,
Set<ObserverMethodImpl<?, ?>> observerMethods)
+ protected <T, X> void createObserverMethod(RIBean<X> declaringBean,
BeanManagerImpl beanManager, WeldMethod<T, ? super X> method,
Set<ObserverMethodImpl<?, ?>> observerMethods)
{
ObserverMethodImpl<T, X> observer = ObserverFactory.create(method,
declaringBean, beanManager);
observerMethods.add(observer);
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -40,7 +40,7 @@
public static <T, X> void fire(BeanManagerImpl beanManager,
ObserverMethodImpl<T, X> observer)
{
- new ProcessObserverMethodImpl<T, X>(beanManager, observer.getMethod(),
observer) {}.fire();
+ new ProcessObserverMethodImpl<T, X>(beanManager, (AnnotatedMethod<X>)
observer.getMethod(), observer) {}.fire();
}
private final AnnotatedMethod<X> beanMethod;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerFieldImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerFieldImpl.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerFieldImpl.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -40,7 +40,7 @@
public AnnotatedField<X> getAnnotatedProducerField()
{
- return getBean().getWeldAnnotated();
+ return (AnnotatedField<X>) getBean().getWeldAnnotated();
}
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -32,7 +32,7 @@
public static <X, T> void fire(BeanManagerImpl beanManager,
AbstractProducerBean<X, T, Member> producer)
{
- new ProcessProducerImpl<X, T>(beanManager, producer.getWeldAnnotated(),
producer) {}.fire();
+ new ProcessProducerImpl<X, T>(beanManager, (AnnotatedMember<X>)
producer.getWeldAnnotated(), producer) {}.fire();
}
private final AnnotatedMember<X> annotatedMember;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerMethodImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerMethodImpl.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerMethodImpl.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -41,12 +41,12 @@
public AnnotatedParameter<X> getAnnotatedDisposedParameter()
{
- return getBean().getDisposalMethod().getDisposesParameter();
+ return (AnnotatedParameter<X>)
getBean().getDisposalMethod().getDisposesParameter();
}
public AnnotatedMethod<X> getAnnotatedProducerMethod()
{
- return getBean().getWeldAnnotated();
+ return (AnnotatedMethod<X>) getBean().getWeldAnnotated();
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java 2010-01-28
04:56:14 UTC (rev 5652)
+++ core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -41,7 +41,7 @@
* @param manager The Bean manager
* @return An observer implementation built from the method abstraction
*/
- public static <T, X> ObserverMethodImpl<T, X> create(WeldMethod<T,
X> method, RIBean<X> declaringBean, BeanManagerImpl manager)
+ public static <T, X> ObserverMethodImpl<T, X> create(WeldMethod<T, ?
super X> method, RIBean<X> declaringBean, BeanManagerImpl manager)
{
ObserverMethodImpl<T, X> result = null;
TransactionPhase transactionPhase = getTransactionalPhase(method);
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-01-28
04:56:14 UTC (rev 5652)
+++ core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -48,7 +48,6 @@
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;
@@ -76,7 +75,7 @@
protected BeanManagerImpl manager;
private final Reception notifyType;
protected final RIBean<X> declaringBean;
- protected final MethodInjectionPoint<T, X> observerMethod;
+ protected final MethodInjectionPoint<T, ? super X> observerMethod;
protected TransactionPhase transactionPhase;
private final String id;
@@ -90,7 +89,7 @@
* @param declaringBean The observer bean
* @param manager The Bean manager
*/
- protected ObserverMethodImpl(final WeldMethod<T, X> observer, final
RIBean<X> declaringBean, final BeanManagerImpl manager)
+ protected ObserverMethodImpl(final WeldMethod<T, ? super X> observer, final
RIBean<X> declaringBean, final BeanManagerImpl manager)
{
this.manager = manager;
this.declaringBean = declaringBean;
@@ -123,7 +122,7 @@
private void checkObserverMethod()
{
// Make sure exactly one and only one parameter is annotated with Observes
- List<WeldParameter<?, X>> eventObjects =
this.observerMethod.getAnnotatedParameters(Observes.class);
+ List<?> eventObjects =
this.observerMethod.getAnnotatedParameters(Observes.class);
if (this.notifyType.equals(Reception.IF_EXISTS) &&
declaringBean.getScope().equals(Dependent.class))
{
throw new DefinitionException(INVALID_SCOPED_CONDITIONAL_OBSERVER, this);
@@ -133,7 +132,7 @@
throw new DefinitionException(MULTIPLE_EVENT_PARAMETERS, this);
}
// Check for parameters annotated with @Disposes
- List<WeldParameter<?, X>> disposeParams =
this.observerMethod.getAnnotatedParameters(Disposes.class);
+ List<?> disposeParams =
this.observerMethod.getAnnotatedParameters(Disposes.class);
if (disposeParams.size() > 0)
{
throw new DefinitionException(INVALID_DISPOSES_PARAMETER, this);
@@ -184,7 +183,7 @@
/**
* @return the observerMethod
*/
- public MethodInjectionPoint<T, X> getMethod()
+ public MethodInjectionPoint<T, ? super X> getMethod()
{
return observerMethod;
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/event/TransactionalObserverMethodImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/event/TransactionalObserverMethodImpl.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/event/TransactionalObserverMethodImpl.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -38,7 +38,7 @@
* @param observerBean The bean declaring the observer method
* @param manager The JCDI manager in use
*/
- protected TransactionalObserverMethodImpl(WeldMethod<T, X> observer,
RIBean<X> observerBean, TransactionPhase transactionPhase, BeanManagerImpl manager)
+ protected TransactionalObserverMethodImpl(WeldMethod<T, ? super X> observer,
RIBean<X> observerBean, TransactionPhase transactionPhase, BeanManagerImpl manager)
{
super(observer, observerBean, manager);
this.transactionPhase = transactionPhase;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -51,17 +51,17 @@
return delegate().getWeldMethods();
}
- public Set<WeldField<?, T>> getDeclaredWeldFields(Class<? extends
Annotation> annotationType)
+ public Set<WeldField<?, ? super T>> getDeclaredWeldFields(Class<?
extends Annotation> annotationType)
{
return delegate().getDeclaredWeldFields(annotationType);
}
- public Set<WeldMethod<?, T>> getDeclaredWeldMethods(Class<? extends
Annotation> annotationType)
+ public Set<WeldMethod<?, ? super T>> getDeclaredWeldMethods(Class<?
extends Annotation> annotationType)
{
return delegate().getDeclaredWeldMethods(annotationType);
}
- public Set<WeldMethod<?, T>>
getDeclaredWeldMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
+ public Set<WeldMethod<?, ? super T>>
getDeclaredWeldMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
{
return delegate().getDeclaredWeldMethodsWithAnnotatedParameters(annotationType);
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java 2010-01-28
04:56:14 UTC (rev 5652)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -79,7 +79,7 @@
* @return A set of abstracted fields with the given annotation. Returns an
* empty set if there are no matches
*/
- public Set<WeldField<?, T>> getDeclaredWeldFields(Class<? extends
Annotation> annotationType);
+ public Set<WeldField<?, ? super T>> getDeclaredWeldFields(Class<?
extends Annotation> annotationType);
/**
* Gets all constructors which are annotated with annotationType
@@ -121,7 +121,7 @@
* @return A set of abstracted methods with the given annotation. Returns an
* empty set if there are no matches
*/
- public Set<WeldMethod<?, T>> getDeclaredWeldMethods(Class<? extends
Annotation> annotationType);
+ public Set<WeldMethod<?, ? super T>> getDeclaredWeldMethods(Class<?
extends Annotation> annotationType);
/**
* Find the annotated method for a given methodDescriptor
@@ -163,7 +163,7 @@
* @return A set of abstracted methods with the given annotation. Returns an
* empty set if there are no matches
*/
- public Set<WeldMethod<?, T>>
getDeclaredWeldMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType);
+ public Set<WeldMethod<?, ? super T>>
getDeclaredWeldMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType);
/**
* Gets the superclass.
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -93,7 +93,7 @@
private final Set<WeldField<?, ?>> declaredFields;
private final Map<String, WeldField<?, ?>> declaredFieldsByName;
// The map from annotation type to abstracted field with annotation
- private final SetMultimap<Class<? extends Annotation>, WeldField<?,
T>> declaredAnnotatedFields;
+ private final SetMultimap<Class<? extends Annotation>, WeldField<?, ?
super T>> declaredAnnotatedFields;
// The map from annotation type to abstracted field with meta-annotation
private final SetMultimap<Class<? extends Annotation>, WeldField<?,
?>> declaredMetaAnnotatedFields;
@@ -107,9 +107,9 @@
// The set of abstracted methods
private final Set<WeldMethod<?, ?>> declaredMethods;
// The map from annotation type to abstracted method with annotation
- private final SetMultimap<Class<? extends Annotation>, WeldMethod<?,
T>> declaredAnnotatedMethods;
+ private final SetMultimap<Class<? extends Annotation>, WeldMethod<?, ?
super T>> declaredAnnotatedMethods;
// The map from annotation type to method with a parameter with annotation
- private final SetMultimap<Class<? extends Annotation>, WeldMethod<?,
T>> declaredMethodsByAnnotatedParameters;
+ private final SetMultimap<Class<? extends Annotation>, WeldMethod<?, ?
super T>> declaredMethodsByAnnotatedParameters;
// The set of abstracted constructors
private final Set<AnnotatedConstructor<T>> constructors;
@@ -167,7 +167,7 @@
this.annotatedFields = Multimaps.newSetMultimap(new HashMap<Class<? extends
Annotation>, Collection<WeldField<?, ?>>>(),
HashSetSupplier.<WeldField<?, ?>> instance());
this.declaredFields = new HashSet<WeldField<?, ?>>();
this.declaredFieldsByName = new HashMap<String, WeldField<?, ?>>();
- this.declaredAnnotatedFields = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WeldField<?, T>>>(),
HashSetSupplier.<WeldField<?, T>> instance());
+ this.declaredAnnotatedFields = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WeldField<?, ? super T>>>(),
HashSetSupplier.<WeldField<?, ? super T>> instance());
this.declaredMetaAnnotatedFields = Multimaps.newSetMultimap(new
HashMap<Class<? extends Annotation>, Collection<WeldField<?,
?>>>(), HashSetSupplier.<WeldField<?, ?>> instance());
if (annotatedType == null)
@@ -203,11 +203,11 @@
}
else
{
- for (AnnotatedField<? super T> field : annotatedType.getFields())
+ for (AnnotatedField<? super T> annotatedField :
annotatedType.getFields())
{
- WeldField<?, T> weldField = WeldFieldImpl.of(field, this.<T>
getDeclaringWeldClass(field.getJavaMember(), classTransformer), classTransformer);
+ WeldField<?, ? super T> weldField = WeldFieldImpl.of(annotatedField,
this, classTransformer);
this.fields.add(weldField);
- if (field.getDeclaringType().getJavaClass() == rawType)
+ if (annotatedField.getDeclaringType().getJavaClass() == rawType)
{
this.declaredFields.add(weldField);
this.declaredFieldsByName.put(weldField.getName(), weldField);
@@ -215,7 +215,7 @@
for (Annotation annotation : weldField.getAnnotations())
{
this.annotatedFields.put(annotation.annotationType(), weldField);
- if (field.getDeclaringType().getJavaClass() == rawType)
+ if (annotatedField.getDeclaringType().getJavaClass() == rawType)
{
this.declaredAnnotatedFields.put(annotation.annotationType(),
weldField);
for (Annotation metaAnnotation :
annotation.annotationType().getAnnotations())
@@ -251,8 +251,7 @@
{
for (AnnotatedConstructor<T> constructor :
annotatedType.getConstructors())
{
- WeldClass<T> declaringClass =
this.getDeclaringWeldClass(constructor.getJavaMember(), classTransformer);
- WeldConstructor<T> weldConstructor =
WeldConstructorImpl.of(constructor, declaringClass, classTransformer);
+ WeldConstructor<T> weldConstructor =
WeldConstructorImpl.of(constructor, this, classTransformer);
this.constructors.add(weldConstructor);
@@ -271,8 +270,8 @@
this.methods = new HashSet<WeldMethod<?, ?>>();
this.annotatedMethods = Multimaps.newSetMultimap(new HashMap<Class<? extends
Annotation>, Collection<WeldMethod<?, ?>>>(),
HashSetSupplier.<WeldMethod<?, ?>> instance());
this.declaredMethods = new HashSet<WeldMethod<?, ?>>();
- this.declaredAnnotatedMethods = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WeldMethod<?, T>>>(),
HashSetSupplier.<WeldMethod<?, T>> instance());
- this.declaredMethodsByAnnotatedParameters = Multimaps.newSetMultimap(new
HashMap<Class<? extends Annotation>, Collection<WeldMethod<?,
T>>>(), HashSetSupplier.<WeldMethod<?, T>> instance());
+ this.declaredAnnotatedMethods = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WeldMethod<?, ? super T>>>(),
HashSetSupplier.<WeldMethod<?, ? super T>> instance());
+ this.declaredMethodsByAnnotatedParameters = Multimaps.newSetMultimap(new
HashMap<Class<? extends Annotation>, Collection<WeldMethod<?,? super
T>>>(), HashSetSupplier.<WeldMethod<?, ? super T>> instance());
this.declaredMethodsBySignature = new HashMap<MethodSignature, WeldMethod<?,
?>>();
this.methodsBySignature = new HashMap<MethodSignature, WeldMethod<?,
?>>();
@@ -315,7 +314,7 @@
{
for (AnnotatedMethod<? super T> method : annotatedType.getMethods())
{
- WeldMethod<?, T> weldMethod = WeldMethodImpl.of(method, this,
classTransformer);
+ WeldMethod<?, ? super T> weldMethod = WeldMethodImpl.of(method, this,
classTransformer);
this.methods.add(weldMethod);
this.methodsBySignature.put(weldMethod.getSignature(), weldMethod);
if (method.getDeclaringType().getJavaClass() == rawType)
@@ -409,7 +408,7 @@
return (WeldField<F, ?>) declaredFieldsByName.get(fieldName);
}
- public Set<WeldField<?, T>> getDeclaredWeldFields(Class<? extends
Annotation> annotationType)
+ public Set<WeldField<?, ? super T>> getDeclaredWeldFields(Class<?
extends Annotation> annotationType)
{
return Collections.unmodifiableSet(declaredAnnotatedFields.get(annotationType));
}
@@ -479,7 +478,7 @@
return Collections.unmodifiableSet(annotatedMethods.get(annotationType));
}
- public Set<WeldMethod<?, T>> getDeclaredWeldMethods(Class<? extends
Annotation> annotationType)
+ public Set<WeldMethod<?, ? super T>> getDeclaredWeldMethods(Class<?
extends Annotation> annotationType)
{
return Collections.unmodifiableSet(declaredAnnotatedMethods.get(annotationType));
}
@@ -504,7 +503,7 @@
return constructorsByArgumentMap.get(Collections.emptyList());
}
- public Set<WeldMethod<?, T>>
getDeclaredWeldMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
+ public Set<WeldMethod<?, ? super T>>
getDeclaredWeldMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
{
return
Collections.unmodifiableSet(declaredMethodsByAnnotatedParameters.get(annotationType));
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -21,6 +21,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Type;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -31,10 +32,12 @@
import javax.enterprise.inject.spi.AnnotatedConstructor;
import javax.enterprise.inject.spi.AnnotatedParameter;
+import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.introspector.ConstructorSignature;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldConstructor;
import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.logging.messages.ReflectionMessage;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
@@ -56,7 +59,7 @@
*/
public class WeldConstructorImpl<T> extends AbstractWeldCallable<T, T,
Constructor<T>> implements WeldConstructor<T>
{
-
+
// The underlying constructor
private final Constructor<T> constructor;
@@ -64,17 +67,17 @@
private final List<WeldParameter<?, T>> parameters;
// The mapping of annotation -> parameter abstraction
private final ListMultimap<Class<? extends Annotation>, WeldParameter<?,
T>> annotatedParameters;
-
+
private final ConstructorSignature signature;
-
+
public static <T> WeldConstructor<T> of(Constructor<T> constructor,
WeldClass<T> declaringClass, ClassTransformer classTransformer)
{
return new WeldConstructorImpl<T>(constructor,
constructor.getDeclaringClass(), constructor.getDeclaringClass(), null, new
HierarchyDiscovery(constructor.getDeclaringClass()).getTypeClosure(),
buildAnnotationMap(constructor.getAnnotations()),
buildAnnotationMap(constructor.getDeclaredAnnotations()), declaringClass,
classTransformer);
}
-
- public static <T> WeldConstructor<T> of(AnnotatedConstructor<T>
annotatedConstructor, WeldClass<T> declaringClass, ClassTransformer
classTransformer)
+
+ public static <T> WeldConstructor<T> of(AnnotatedConstructor<T>
annotatedConstructor, WeldClass<T> declaringClass, ClassTransformer
classTransformer)
{
- return new WeldConstructorImpl<T>(annotatedConstructor.getJavaMember(),
annotatedConstructor.getJavaMember().getDeclaringClass(),
annotatedConstructor.getBaseType(), annotatedConstructor,
annotatedConstructor.getTypeClosure(),
buildAnnotationMap(annotatedConstructor.getAnnotations()),
buildAnnotationMap(annotatedConstructor.getAnnotations()), declaringClass,
classTransformer);
+ return new WeldConstructorImpl<T>(annotatedConstructor.getJavaMember(),
Reflections.<T>getRawType(annotatedConstructor.getBaseType()),
annotatedConstructor.getBaseType(), annotatedConstructor,
annotatedConstructor.getTypeClosure(),
buildAnnotationMap(annotatedConstructor.getAnnotations()),
buildAnnotationMap(annotatedConstructor.getAnnotations()), declaringClass,
classTransformer);
}
/**
@@ -91,18 +94,18 @@
this.constructor = constructor;
this.parameters = new ArrayList<WeldParameter<?, T>>();
- annotatedParameters = Multimaps.newListMultimap(new HashMap<Class<? extends
Annotation>, Collection<WeldParameter<?, T>>>(), new Supplier<
List<WeldParameter<?, T>>>()
+ annotatedParameters = Multimaps.newListMultimap(new HashMap<Class<? extends
Annotation>, Collection<WeldParameter<?, T>>>(), new
Supplier<List<WeldParameter<?, T>>>()
{
-
+
public List<WeldParameter<?, T>> get()
{
return new ArrayList<WeldParameter<?, T>>();
}
-
+
});
-
+
Map<Integer, AnnotatedParameter<?>> annotatedTypeParameters = new
HashMap<Integer, AnnotatedParameter<?>>();
-
+
if (annotatedConstructor != null)
{
for (AnnotatedParameter<?> annotated :
annotatedConstructor.getParameters())
@@ -110,66 +113,78 @@
annotatedTypeParameters.put(annotated.getPosition(), annotated);
}
}
-
- // If the class is a (non-static) member class, its constructors parameterTypes
array will prefix the
- // outer class instance, whilst the genericParameterTypes array isn't
prefix'd
+
+ // If the class is a (non-static) member class, its constructors
+ // parameterTypes array will prefix the
+ // outer class instance, whilst the genericParameterTypes array isn't
+ // prefix'd
int nesting = Reflections.getNesting(declaringClass.getJavaClass());
- for (int i = 0; i < constructor.getParameterTypes().length; i++)
+ if (annotatedConstructor == null)
{
- int gi = i - nesting;
- if (constructor.getParameterAnnotations()[i].length > 0 ||
annotatedTypeParameters.containsKey(i))
+ for (int i = 0; i < constructor.getParameterTypes().length; i++)
{
- Class<?> clazz = constructor.getParameterTypes()[i];
- Type parameterType;
- if (constructor.getGenericParameterTypes().length > gi && gi
>=0)
+ int gi = i - nesting;
+ if (constructor.getParameterAnnotations()[i].length > 0)
{
- parameterType = constructor.getGenericParameterTypes()[gi];
+ Class<? extends Object> clazz = constructor.getParameterTypes()[i];
+ Type parameterType;
+ if (constructor.getGenericParameterTypes().length > gi && gi
>= 0)
+ {
+ parameterType = constructor.getGenericParameterTypes()[gi];
+ }
+ else
+ {
+ parameterType = clazz;
+ }
+ WeldParameter<?, T> parameter =
WeldParameterImpl.of(constructor.getParameterAnnotations()[i], clazz, parameterType, this,
i, classTransformer);
+ this.parameters.add(parameter);
+ for (Annotation annotation : parameter.getAnnotations())
+ {
+ if
(MAPPED_PARAMETER_ANNOTATIONS.contains(annotation.annotationType()))
+ {
+ annotatedParameters.put(annotation.annotationType(), parameter);
+ }
+ }
}
else
{
- parameterType = clazz;
+ Class<? extends Object> clazz = constructor.getParameterTypes()[i];
+ Type parameterType;
+ if (constructor.getGenericParameterTypes().length > gi && gi
>= 0)
+ {
+ parameterType = constructor.getGenericParameterTypes()[gi];
+ }
+ else
+ {
+ parameterType = clazz;
+ }
+ WeldParameter<?, T> parameter = WeldParameterImpl.of(new
Annotation[0], (Class<Object>) clazz, parameterType, this, i, classTransformer);
+ this.parameters.add(parameter);
}
- WeldParameter<?, T> parameter = null;
- if (annotatedTypeParameters.containsKey(i))
- {
- AnnotatedParameter<?> annotatedParameter =
annotatedTypeParameters.get(i);
- parameter = WeldParameterImpl.of(annotatedParameter.getAnnotations(),
clazz, parameterType, this, i, classTransformer);
- }
- else
- {
- parameter = WeldParameterImpl.of(constructor.getParameterAnnotations()[i],
clazz, parameterType, this, i, classTransformer);
- }
-
- parameters.add(parameter);
-
- for (Annotation annotation : parameter.getAnnotations())
- {
- annotatedParameters.put(annotation.annotationType(), parameter);
- }
}
+ }
+ else
+ {
+ if (annotatedConstructor.getParameters().size() !=
constructor.getParameterTypes().length)
+ {
+ throw new
DefinitionException(ReflectionMessage.INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_METHOD,
annotatedConstructor.getParameters().size(), annotatedConstructor,
annotatedConstructor.getParameters(), Arrays.asList(constructor.getParameterTypes()));
+ }
else
{
- Class<?> clazz = constructor.getParameterTypes()[i];
- Type parameterType;
- if (constructor.getGenericParameterTypes().length > gi && gi
>=0)
+ for (AnnotatedParameter<T> annotatedParameter :
annotatedConstructor.getParameters())
{
- parameterType = constructor.getGenericParameterTypes()[gi];
- }
- else
- {
- parameterType = clazz;
- }
- WeldParameter<?, T> parameter = WeldParameterImpl.of(new Annotation[0],
clazz, parameterType, this, i, classTransformer);
- parameters.add(parameter);
-
- for (Annotation annotation : parameter.getAnnotations())
- {
- if (MAPPED_PARAMETER_ANNOTATIONS.contains(annotation.annotationType()))
+ WeldParameter<?, T> parameter =
WeldParameterImpl.of(annotatedParameter.getAnnotations(),
Reflections.getRawType(annotatedParameter.getBaseType()),
annotatedParameter.getBaseType(), this, annotatedParameter.getPosition(),
classTransformer);
+ this.parameters.add(parameter);
+ for (Annotation annotation : parameter.getAnnotations())
{
- annotatedParameters.put(annotation.annotationType(), parameter);
+ if
(MAPPED_PARAMETER_ANNOTATIONS.contains(annotation.annotationType()))
+ {
+ annotatedParameters.put(annotation.annotationType(), parameter);
+ }
}
}
}
+
}
this.signature = new ConstructorSignatureImpl(this);
}
@@ -190,7 +205,7 @@
* @return The delegate
*/
@Override
-public Constructor<T> getDelegate()
+ public Constructor<T> getDelegate()
{
return constructor;
}
@@ -230,10 +245,10 @@
*
* @param beanManager The Bean manager
* @return An instance
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws InstantiationException
- * @throws IllegalArgumentException
+ * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws InstantiationException
+ * @throws IllegalArgumentException
*
* @see org.jboss.weld.introspector.WeldConstructor#newInstance(BeanManagerImpl)
*/
@@ -283,12 +298,12 @@
{
return new StringBuilder().append("constructor
").append(constructor.toString()).toString();
}
-
+
public ConstructorSignature getSignature()
{
return signature;
}
-
+
public List<AnnotatedParameter<T>> getParameters()
{
return Collections.unmodifiableList((List) parameters);
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -53,9 +53,9 @@
return new WeldFieldImpl<T, X>(field, (Class<T>) field.getType(),
field.getGenericType(), new HierarchyDiscovery(field.getGenericType()).getTypeClosure(),
buildAnnotationMap(field.getAnnotations()),
buildAnnotationMap(field.getDeclaredAnnotations()), declaringClass, classTransformer);
}
- public static <T, X> WeldFieldImpl<T, X> of(AnnotatedField<? super
X> annotatedField, WeldClass<X> declaringClass, ClassTransformer
classTransformer)
+ public static <X> WeldFieldImpl<?, X> of(AnnotatedField<? super X>
annotatedField, WeldClass<X> declaringClass, ClassTransformer classTransformer)
{
- return new WeldFieldImpl<T, X>(annotatedField.getJavaMember(),
(Class<T>) annotatedField.getJavaMember().getType(), annotatedField.getBaseType(),
annotatedField.getTypeClosure(), buildAnnotationMap(annotatedField.getAnnotations()),
buildAnnotationMap(annotatedField.getAnnotations()), declaringClass, classTransformer);
+ return new WeldFieldImpl<Object, X>(annotatedField.getJavaMember(),
(Class<Object>) annotatedField.getJavaMember().getType(),
annotatedField.getBaseType(), annotatedField.getTypeClosure(),
buildAnnotationMap(annotatedField.getAnnotations()),
buildAnnotationMap(annotatedField.getAnnotations()), declaringClass, classTransformer);
}
/**
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldMethodImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldMethodImpl.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldMethodImpl.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -32,10 +32,12 @@
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.AnnotatedParameter;
+import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.introspector.MethodSignature;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.logging.messages.ReflectionMessage;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.collections.ArrayListSupplier;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
@@ -76,9 +78,9 @@
return new WeldMethodImpl<T, X>(method, (Class<T>)
method.getReturnType(), method.getGenericReturnType(), new
HierarchyDiscovery(method.getGenericReturnType()).getTypeClosure(), null,
buildAnnotationMap(method.getAnnotations()),
buildAnnotationMap(method.getDeclaredAnnotations()), declaringClass, classTransformer);
}
- public static <T, X> WeldMethodImpl<T, X> of(AnnotatedMethod<T>
method, WeldClass<X> declaringClass, ClassTransformer classTransformer)
+ public static <T, X> WeldMethodImpl<T, X> of(AnnotatedMethod<? super
X> method, WeldClass<X> declaringClass, ClassTransformer classTransformer)
{
- return new WeldMethodImpl<T, X>(method.getJavaMember(), (Class<T>)
method.getJavaMember().getReturnType(), method.getBaseType(), method.getTypeClosure(),
method, buildAnnotationMap(method.getAnnotations()),
buildAnnotationMap(method.getAnnotations()), declaringClass, classTransformer);
+ return new WeldMethodImpl<T, X>(method.getJavaMember(),
Reflections.<T>getRawType(method.getBaseType()), method.getBaseType(),
method.getTypeClosure(), method, buildAnnotationMap(method.getAnnotations()),
buildAnnotationMap(method.getAnnotations()), declaringClass, classTransformer);
}
/**
@@ -91,57 +93,66 @@
* @param declaringClass The declaring class abstraction
*/
@SuppressWarnings("unchecked")
- private WeldMethodImpl(Method method, final Class<T> rawType, final Type type,
Set<Type> typeClosure, AnnotatedMethod<T> annotatedMethod, Map<Class<?
extends Annotation>, Annotation> annotationMap, Map<Class<? extends
Annotation>, Annotation> declaredAnnotationMap, WeldClass<X> declaringClass,
ClassTransformer classTransformer)
+ private WeldMethodImpl(Method method, final Class<T> rawType, final Type type,
Set<Type> typeClosure, AnnotatedMethod<? super X> annotatedMethod,
Map<Class<? extends Annotation>, Annotation> annotationMap, Map<Class<?
extends Annotation>, Annotation> declaredAnnotationMap, WeldClass<X>
declaringClass, ClassTransformer classTransformer)
{
super(annotationMap, declaredAnnotationMap, classTransformer, method, rawType,
type, typeClosure, declaringClass);
this.method = method;
this.parameters = new ArrayList<WeldParameter<?, X>>();
this.annotatedParameters = Multimaps.newListMultimap(new HashMap<Class<?
extends Annotation>, Collection<WeldParameter<?, X>>>(),
ArrayListSupplier.<WeldParameter<?, X>>instance());
- Map<Integer, AnnotatedParameter<?>> annotatedTypeParameters = new
HashMap<Integer, AnnotatedParameter<?>>();
-
- if (annotatedMethod != null)
+ if (annotatedMethod == null)
{
- for (AnnotatedParameter<?> annotated : annotatedMethod.getParameters())
+ for (int i = 0; i < method.getParameterTypes().length; i++)
{
- annotatedTypeParameters.put(annotated.getPosition(), annotated);
- }
- }
-
- for (int i = 0; i < method.getParameterTypes().length; i++)
- {
- if (method.getParameterAnnotations()[i].length > 0 ||
annotatedTypeParameters.containsKey(i))
- {
- Class<? extends Object> clazz = method.getParameterTypes()[i];
- Type parametertype = method.getGenericParameterTypes()[i];
- WeldParameter<?, X> parameter = null;
- if (annotatedTypeParameters.containsKey(i))
+ if (method.getParameterAnnotations()[i].length > 0)
{
- AnnotatedParameter<?> annotatedParameter =
annotatedTypeParameters.get(i);
- parameter = WeldParameterImpl.of(annotatedParameter.getAnnotations(),
clazz, parametertype, this, i, classTransformer);
+ Class<? extends Object> clazz = method.getParameterTypes()[i];
+ Type parametertype = method.getGenericParameterTypes()[i];
+ WeldParameter<?, X> parameter =
WeldParameterImpl.of(method.getParameterAnnotations()[i], clazz, parametertype, this, i,
classTransformer);
+ this.parameters.add(parameter);
+ for (Annotation annotation : parameter.getAnnotations())
+ {
+ if
(MAPPED_PARAMETER_ANNOTATIONS.contains(annotation.annotationType()))
+ {
+ annotatedParameters.put(annotation.annotationType(), parameter);
+ }
+ }
}
else
{
- parameter = WeldParameterImpl.of(method.getParameterAnnotations()[i],
clazz, parametertype, this, i, classTransformer);
+ Class<? extends Object> clazz = method.getParameterTypes()[i];
+ Type parameterType = method.getGenericParameterTypes()[i];
+ WeldParameter<?, X> parameter = WeldParameterImpl.of(new
Annotation[0], (Class<Object>) clazz, parameterType, this, i, classTransformer);
+ this.parameters.add(parameter);
}
- this.parameters.add(parameter);
- for (Annotation annotation : parameter.getAnnotations())
+ }
+ }
+ else
+ {
+ if (annotatedMethod.getParameters().size() !=
method.getParameterTypes().length)
+ {
+ throw new
DefinitionException(ReflectionMessage.INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_METHOD,
annotatedMethod.getParameters().size(), annotatedMethod, annotatedMethod.getParameters(),
Arrays.asList(method.getParameterTypes()));
+ }
+ else
+ {
+ for (AnnotatedParameter<? super X> annotatedParameter :
annotatedMethod.getParameters())
{
- if (MAPPED_PARAMETER_ANNOTATIONS.contains(annotation.annotationType()))
+ WeldParameter<?, X> parameter =
WeldParameterImpl.of(annotatedParameter.getAnnotations(),
Reflections.getRawType(annotatedParameter.getBaseType()),
annotatedParameter.getBaseType(), this, annotatedParameter.getPosition(),
classTransformer);
+ this.parameters.add(parameter);
+ for (Annotation annotation : parameter.getAnnotations())
{
- annotatedParameters.put(annotation.annotationType(), parameter);
+ if
(MAPPED_PARAMETER_ANNOTATIONS.contains(annotation.annotationType()))
+ {
+ annotatedParameters.put(annotation.annotationType(), parameter);
+ }
}
}
}
- else
- {
- Class<? extends Object> clazz = method.getParameterTypes()[i];
- Type parameterType = method.getGenericParameterTypes()[i];
- WeldParameter<?, X> parameter = WeldParameterImpl.of(new Annotation[0],
(Class<Object>) clazz, parameterType, this, i, classTransformer);
- this.parameters.add(parameter);
- }
+
}
+
+
String propertyName = Reflections.getPropertyName(getDelegate());
if (propertyName == null)
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -48,6 +48,8 @@
@MessageId("000610") UNABLE_TO_GET_CONSTRUCTOR_ON_DESERIALIZATION,
@MessageId("000611") UNABLE_TO_GET_METHOD_ON_DESERIALIZATION,
@MessageId("000612") UNABLE_TO_GET_FIELD_ON_DESERIALIZATION,
- @MessageId("000613") UNABLE_TO_GET_PARAMETER_ON_DESERIALIZATION;
+ @MessageId("000613") UNABLE_TO_GET_PARAMETER_ON_DESERIALIZATION,
+ @MessageId("000614") INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_METHOD,
+ @MessageId("000615") INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_CONSTRUCTOR;
}
Modified:
core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties
===================================================================
---
core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties 2010-01-28
04:56:14 UTC (rev 5652)
+++
core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties 2010-01-28
16:34:47 UTC (rev 5653)
@@ -11,4 +11,6 @@
UNABLE_TO_GET_FIELD_ON_DESERIALIZATION=Unable to deserialize field. Declaring bean id
{0}, declaring class {1}, field name {2}
UNABLE_TO_GET_CONSTRUCTOR_ON_DESERIALIZATION=Unable to deserialize constructor. Declaring
bean id {0}, declaring class {1}, signature {2}
UNABLE_TO_GET_METHOD_ON_DESERIALIZATION=Unable to deserialize method. Declaring bean id
{0}, declaring class {1}, signature {2}
-UNABLE_TO_GET_PARAMETER_ON_DESERIALIZATION=Unable to deserialize paramter. Declaring bean
id {0}, declaring class {1}, parameter {3} of method with signature {2}
\ No newline at end of file
+UNABLE_TO_GET_PARAMETER_ON_DESERIALIZATION=Unable to deserialize paramter. Declaring bean
id {0}, declaring class {1}, parameter {3} of method with signature {2}
+INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_METHOD=Incorrect number of AnnotatedParameters
{0} on AnnotatedMethod {1}. AnnotatedMethod has {2} as parameters but should have {3} as
parameters
+INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_CONSTRUCTOR=Incorrect number of
AnnotatedParameters {0} on AnnotatedConstructor {1}. AnnotatedConstructor has {2} as
parameters but should have {3} as parameters
\ No newline at end of file
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/AnnotatedTypeExtension.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/AnnotatedTypeExtension.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/AnnotatedTypeExtension.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -0,0 +1,221 @@
+/*
+ * 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.extensions.annotatedType.invalidParameters;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.event.Observes;
+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;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+import javax.inject.Inject;
+
+import org.jboss.weld.util.collections.Arrays2;
+
+public class AnnotatedTypeExtension implements Extension
+{
+
+ public void addTumbleDryer(@Observes BeforeBeanDiscovery beforeBeanDiscovery)
+ {
+
+ final Set<AnnotatedConstructor<TumbleDryer>> constructors = new
HashSet<AnnotatedConstructor<TumbleDryer>>();
+
+
+ final AnnotatedType<TumbleDryer> tumbleDryer = new
AnnotatedType<TumbleDryer>()
+ {
+
+ public Set<AnnotatedConstructor<TumbleDryer>> getConstructors()
+ {
+ return constructors;
+ }
+
+ public Set<AnnotatedField<? super TumbleDryer>> getFields()
+ {
+ return Collections.emptySet();
+ }
+
+ public Set<AnnotatedMethod<? super TumbleDryer>> getMethods()
+ {
+ return Collections.emptySet();
+ }
+
+ // Now the easy stuff
+
+ public Class<TumbleDryer> getJavaClass()
+ {
+ return TumbleDryer.class;
+ }
+
+ public <T extends Annotation> T getAnnotation(Class<T>
annotationType)
+ {
+ // Class has no annotations
+ return null;
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return Collections.emptySet();
+ }
+
+ public Type getBaseType()
+ {
+ return TumbleDryer.class;
+ }
+
+ public Set<Type> getTypeClosure()
+ {
+ return Arrays2.<Type>asSet(TumbleDryer.class, Object.class);
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation>
annotationType)
+ {
+ // Class has no annotations
+ return false;
+ }
+
+ };
+
+ final List<AnnotatedParameter<TumbleDryer>> clothesParameters = new
ArrayList<AnnotatedParameter<TumbleDryer>>();
+ final AnnotatedConstructor<TumbleDryer> clothesConstructor = new
AnnotatedConstructor<TumbleDryer>()
+ {
+
+ public Constructor<TumbleDryer> getJavaMember()
+ {
+ try
+ {
+ return TumbleDryer.class.getDeclaredConstructor(Clothes.class);
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public List<AnnotatedParameter<TumbleDryer>> getParameters()
+ {
+ return clothesParameters;
+ }
+
+ public AnnotatedType<TumbleDryer> getDeclaringType()
+ {
+ return tumbleDryer;
+ }
+
+ public boolean isStatic()
+ {
+ return false;
+ }
+
+ public <T extends Annotation> T getAnnotation(Class<T>
annotationType)
+ {
+ if (annotationType.equals(Inject.class))
+ {
+ return annotationType.cast(InjectLiteral.INSTANCE);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return Collections.<Annotation>singleton(InjectLiteral.INSTANCE);
+ }
+
+ public Type getBaseType()
+ {
+ return TumbleDryer.class;
+ }
+
+ public Set<Type> getTypeClosure()
+ {
+ return Arrays2.<Type>asSet(TumbleDryer.class, Object.class);
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation>
annotationType)
+ {
+ if (annotationType.equals(Inject.class))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ };
+ constructors.add(clothesConstructor);
+
+ AnnotatedParameter<TumbleDryer> clothesParameter = new
AnnotatedParameter<TumbleDryer>()
+ {
+
+ public AnnotatedCallable<TumbleDryer> getDeclaringCallable()
+ {
+ return clothesConstructor;
+ }
+
+ public int getPosition()
+ {
+ return 0;
+ }
+
+
+ public <T extends Annotation> T getAnnotation(Class<T>
annotationType)
+ {
+ return null;
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return Collections.emptySet();
+ }
+
+ public Type getBaseType()
+ {
+ return Clothes.class;
+ }
+
+ public Set<Type> getTypeClosure()
+ {
+ return Arrays2.<Type>asSet(Clothes.class, Object.class);
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation>
annotationType)
+ {
+ return false;
+ }
+ };
+ clothesParameters.add(clothesParameter);
+ clothesParameters.add(clothesParameter);
+
+ beforeBeanDiscovery.addAnnotatedType(tumbleDryer);
+ }
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/AnnotatedTypeExtension.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/AnnotatedTypeExtensionTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/AnnotatedTypeExtensionTest.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/AnnotatedTypeExtensionTest.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -0,0 +1,40 @@
+/*
+ * 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.extensions.annotatedType.invalidParameters;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.jsr299.Extension;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+(a)ExpectedDeploymentException(Exception.class)
+(a)Extension("javax.enterprise.inject.spi.Extension")
+public class AnnotatedTypeExtensionTest extends AbstractWeldTest
+{
+
+ @Test(description = "WELD-371")
+ public void testIncorrectlyOverridenParameters()
+ {
+ assert false;
+ }
+
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/AnnotatedTypeExtensionTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/Clothes.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/Clothes.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/Clothes.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -0,0 +1,27 @@
+package org.jboss.weld.tests.extensions.annotatedType.invalidParameters;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.inject.Inject;
+
+public class Clothes
+{
+
+ private static InjectionPoint injectionPoint;
+
+ @Inject
+ public void setInjectionPoint(InjectionPoint injectionPoint)
+ {
+ Clothes.injectionPoint = injectionPoint;
+ }
+
+ public static void reset()
+ {
+ injectionPoint = null;
+ }
+
+ public static InjectionPoint getInjectionPoint()
+ {
+ return injectionPoint;
+ }
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/Clothes.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/InjectLiteral.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/InjectLiteral.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/InjectLiteral.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -0,0 +1,29 @@
+/*
+ * 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.tests.extensions.annotatedType.invalidParameters;
+
+import javax.enterprise.util.AnnotationLiteral;
+import javax.inject.Inject;
+
+public class InjectLiteral extends AnnotationLiteral<Inject> implements Inject
+{
+
+ public static final Inject INSTANCE = new InjectLiteral();
+
+ private InjectLiteral() {}
+
+}
\ No newline at end of file
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/InjectLiteral.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/TumbleDryer.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/TumbleDryer.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/TumbleDryer.java 2010-01-28
16:34:47 UTC (rev 5653)
@@ -0,0 +1,23 @@
+package org.jboss.weld.tests.extensions.annotatedType.invalidParameters;
+
+import javax.inject.Inject;
+
+
+
+public class TumbleDryer
+{
+
+ private final Clothes clothers;
+
+ @Inject
+ public TumbleDryer(Clothes clothes)
+ {
+ this.clothers = clothes;
+ }
+
+ public Clothes getClothes()
+ {
+ return clothers;
+ }
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/TumbleDryer.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added:
core/trunk/tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/javax.enterprise.inject.spi.Extension
===================================================================
---
core/trunk/tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/javax.enterprise.inject.spi.Extension
(rev 0)
+++
core/trunk/tests/src/test/resources/org/jboss/weld/tests/extensions/annotatedType/invalidParameters/javax.enterprise.inject.spi.Extension 2010-01-28
16:34:47 UTC (rev 5653)
@@ -0,0 +1 @@
+org.jboss.weld.tests.extensions.annotatedType.invalidParameters.AnnotatedTypeExtension