[webbeans-commits] Webbeans SVN: r1185 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector and 2 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Thu Jan 22 19:52:16 EST 2009
Author: pete.muir at jboss.org
Date: 2009-01-22 19:52:16 -0500 (Thu, 22 Jan 2009)
New Revision: 1185
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java
Log:
One more :-)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-01-23 00:47:31 UTC (rev 1184)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-01-23 00:52:16 UTC (rev 1185)
@@ -216,8 +216,7 @@
@Override
protected void preCheckSpecialization()
{
- // Need to do getDeclaredMethod!
- if (declaringBean.getAnnotatedItem().getSuperclass().getMethod(getAnnotatedItem().getAnnotatedMethod()) == null)
+ if (declaringBean.getAnnotatedItem().getSuperclass().getDeclaredMethod(getAnnotatedItem().getAnnotatedMethod()) == null)
{
throw new DefinitionException("Specialized producer method does not override a method on the direct superclass");
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2009-01-23 00:47:31 UTC (rev 1184)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2009-01-23 00:52:16 UTC (rev 1185)
@@ -118,6 +118,8 @@
*/
public AnnotatedMethod<?> getMethod(Method method);
+ public AnnotatedMethod<?> getDeclaredMethod(Method method);
+
/**
* Gets all with parameters annotated with annotationType
*
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java 2009-01-23 00:47:31 UTC (rev 1184)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java 2009-01-23 00:52:16 UTC (rev 1185)
@@ -85,4 +85,9 @@
return delegate().isParameterizedType();
}
+ public AnnotatedMethod<?> getDeclaredMethod(Method method)
+ {
+ return delegate().getDeclaredMethod(method);
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-01-23 00:47:31 UTC (rev 1184)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-01-23 00:52:16 UTC (rev 1185)
@@ -598,6 +598,19 @@
return null;
}
+ public AnnotatedMethod<?> getDeclaredMethod(Method method)
+ {
+ // TODO Cache?
+ for (AnnotatedMethod<?> annotatedMethod : declaredMethods)
+ {
+ if (annotatedMethod.getName().equals(method.getName()) && Arrays.equals(annotatedMethod.getParameterTypesAsArray(), method.getParameterTypes()))
+ {
+ return annotatedMethod;
+ }
+ }
+ return null;
+ }
+
/**
* Gets a string representation of the class
*
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java 2009-01-23 00:47:31 UTC (rev 1184)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java 2009-01-23 00:52:16 UTC (rev 1185)
@@ -96,7 +96,7 @@
deployBeans(FurnitureShop_Broken.class);
}
- @Test(groups="broken", expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4.5")
+ @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4.5")
public void testSpecializedMethodIndirectlyOverridesAnotherProducerMethod()
{
deployBeans(ShoeShop_Broken.class);
More information about the weld-commits
mailing list