Author: dallen6
Date: 2009-07-27 15:59:32 -0400 (Mon, 27 Jul 2009)
New Revision: 3289
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java
Log:
Fixed WBRI-313, and removed older checks in fireEvent() method
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-07-27
19:44:22 UTC (rev 3288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-07-27
19:59:32 UTC (rev 3289)
@@ -791,27 +791,6 @@
*/
public void fireEvent(Object event, Annotation... bindings)
{
- // Make sure the event object above is not parameterized with a type
- // variable
- if (Reflections.isParameterizedType(event.getClass()))
- {
- for (Type type : Reflections.getActualTypeArguments(event.getClass()))
- {
- if (type instanceof TypeVariable<?>)
- {
- throw new IllegalArgumentException("Cannot use a type variable "
+ type + " in an parameterized type " + toString());
- }
- }
- }
- // Also check that the binding types are truly binding types
- for (Annotation binding : bindings)
- {
- if (!Reflections.isBindings(binding))
- {
- throw new IllegalArgumentException("Event type " +
event.getClass().getName() + " cannot be fired with non-binding type " +
binding.getClass().getName() + " specified");
- }
- }
-
notifyObservers(event, resolveObserverMethods(event, bindings));
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java 2009-07-27
19:44:22 UTC (rev 3288)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverMethodImpl.java 2009-07-27
19:59:32 UTC (rev 3289)
@@ -84,7 +84,6 @@
this.eventType =
observerMethod.getAnnotatedParameters(Observes.class).get(0).getBaseType();
this.bindings = new
HashSet<Annotation>(Arrays.asList(observerMethod.getAnnotatedParameters(Observes.class).get(0).getBindingsAsArray()));
- this.bindings.add(new AnyLiteral()); // Always add the Any annotation in case it
is not there yet
Observes observesAnnotation =
observerMethod.getAnnotatedParameters(Observes.class).get(0).getAnnotation(Observes.class);
this.notifyType = observesAnnotation.notifyObserver();
transactionPhase = TransactionPhase.IN_PROGRESS;
Show replies by date