Author: pete.muir(a)jboss.org
Date: 2010-01-28 12:59:05 -0500 (Thu, 28 Jan 2010)
New Revision: 5656
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/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/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java
Log:
WELD-309
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
17:21:48 UTC (rev 5655)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java 2010-01-28
17:59:05 UTC (rev 5656)
@@ -47,6 +47,7 @@
import org.jboss.weld.introspector.WeldField;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.util.AnnotatedTypes;
import org.jboss.weld.util.Names;
import org.jboss.weld.util.collections.HashSetSupplier;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
@@ -365,6 +366,17 @@
}
}
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof WeldClassImpl<?>)
+ {
+ WeldClassImpl<?> that = (WeldClassImpl<?>) other;
+ return AnnotatedTypes.compareAnnotatedTypes(this, that) &&
this.getActualTypeArguments().length == that.getActualTypeArguments().length &&
Arrays.equals(this.getActualTypeArguments(), that.getActualTypeArguments());
+ }
+ return false;
+ }
+
/**
* Gets the implementing class
*
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
17:21:48 UTC (rev 5655)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java 2010-01-28
17:59:05 UTC (rev 5656)
@@ -270,7 +270,7 @@
if (super.equals(other) && other instanceof WeldConstructor)
{
WeldConstructor<?> that = (WeldConstructor<?>) other;
- return this.getDeclaringType().equals(that.getDeclaringType()) &&
this.getWeldParameters().equals(that.getWeldParameters());
+ return this.getJavaMember().equals(that.getJavaMember()) &&
this.getWeldParameters().equals(that.getWeldParameters());
}
return false;
}
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
17:21:48 UTC (rev 5655)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java 2010-01-28
17:59:05 UTC (rev 5656)
@@ -138,10 +138,10 @@
@Override
public boolean equals(Object other)
{
- if (other instanceof WeldField<?, ?>)
+ if (super.equals(other) && other instanceof WeldField<?, ?>)
{
WeldField<?, ?> that = (WeldField<?, ?>) other;
- return this.getDeclaringType().equals(that.getDeclaringType()) &&
this.getName().equals(that.getName());
+ return this.getJavaMember().equals(that.getJavaMember());
}
else
{
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
17:21:48 UTC (rev 5655)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldMethodImpl.java 2010-01-28
17:59:05 UTC (rev 5656)
@@ -190,10 +190,10 @@
@Override
public boolean equals(Object other)
{
- if (other instanceof WeldMethod)
+ if (super.equals(other) && other instanceof WeldMethod)
{
WeldMethod<?, ?> that = (WeldMethod<?, ?>) other;
- return this.getDeclaringType().equals(that.getDeclaringType()) &&
this.getName().equals(that.getName()) &&
this.getWeldParameters().equals(that.getWeldParameters());
+ return this.getJavaMember().equals(that.getJavaMember()) &&
this.getWeldParameters().equals(that.getWeldParameters());
}
else
{
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java 2010-01-28
17:21:48 UTC (rev 5655)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/extensions/annotatedType/AnnotatedTypeExtension.java 2010-01-28
17:59:05 UTC (rev 5656)
@@ -36,6 +36,7 @@
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
import javax.inject.Inject;
import
org.jboss.weld.tests.extensions.annotatedType.EcoFriendlyWashingMachine.EcoFriendlyWashingMachineLiteral;
@@ -553,4 +554,10 @@
beforeBeanDiscovery.addAnnotatedType(type);
}
+
+ public void vetoOriginalTumbleDryer(@Observes ProcessAnnotatedType<TumbleDryer>
event)
+ {
+ event.veto();
+ }
+
}