Author: swd847
Date: 2010-01-27 21:45:45 -0500 (Wed, 27 Jan 2010)
New Revision: 5650
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java
Log:
minor change to annotated type comparison
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java 2010-01-28
02:26:52 UTC (rev 5649)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java 2010-01-28
02:45:45 UTC (rev 5650)
@@ -393,6 +393,27 @@
return builder.toString();
}
+ public static <X> String createParameterId(AnnotatedParameter<X>
annotatedParameter)
+ {
+ return createParameterId(annotatedParameter.getBaseType(),
annotatedParameter.getAnnotations());
+ }
+
+ public static <X> String createParameterId(Type type, Set<Annotation>
annotations)
+ {
+ StringBuilder builder = new StringBuilder();
+ if (type instanceof Class<?>)
+ {
+ Class<?> c = (Class<?>) type;
+ builder.append(c.getName());
+ }
+ else
+ {
+ builder.append(type.toString());
+ }
+ builder.append(createAnnotationCollectionId(annotations));
+ return builder.toString();
+ }
+
/**
* compares two annotated elemetes to see if they have the same annotations
*
@@ -427,7 +448,7 @@
public static boolean compareAnnotatedField(AnnotatedField<?> f1,
AnnotatedField<?> f2)
{
- if (f1.getJavaMember() != f2.getJavaMember())
+ if (f1.getJavaMember().equals(f2.getJavaMember()))
{
return false;
}
@@ -436,7 +457,7 @@
public static boolean compareAnnotatedCallable(AnnotatedCallable<?> m1,
AnnotatedCallable<?> m2)
{
- if(m1.getJavaMember() != m2.getJavaMember())
+ if (m1.getJavaMember().equals(m2.getJavaMember()))
{
return false;
}
@@ -452,7 +473,7 @@
*/
public static boolean compareAnnotatedTypes(AnnotatedType<?> t1,
AnnotatedType<?> t2)
{
- if (t1.getJavaClass() != t2.getJavaClass())
+ if (t1.getJavaClass().equals(t2.getJavaClass()))
{
return false;
}
@@ -523,27 +544,7 @@
}
- public static <X> String createParameterId(AnnotatedParameter<X>
annotatedParameter)
- {
- return createParameterId(annotatedParameter.getBaseType(),
annotatedParameter.getAnnotations());
- }
- public static <X> String createParameterId(Type type, Set<Annotation>
annotations)
- {
- StringBuilder builder = new StringBuilder();
- if (type instanceof Class<?>)
- {
- Class<?> c = (Class<?>) type;
- builder.append(c.getName());
- }
- else
- {
- builder.append(type.toString());
- }
- builder.append(createAnnotationCollectionId(annotations));
- return builder.toString();
- }
-
private AnnotatedTypes()
{
}
Show replies by date