Author: swd847
Date: 2010-03-05 16:42:52 -0500 (Fri, 05 Mar 2010)
New Revision: 6011
Modified:
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java
Log:
minor fixes to NewAnnotatedType
Modified:
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java
===================================================================
---
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java 2010-03-05
20:37:57 UTC (rev 6010)
+++
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java 2010-03-05
21:42:52 UTC (rev 6011)
@@ -83,7 +83,7 @@
}
for (Entry<Field, AnnotationStore> e : fieldAnnotations.entrySet())
{
- if (fset.contains(e.getKey()))
+ if (!fset.contains(e.getKey()))
{
fields.add(new NewAnnotatedField<X>(this, e.getKey(), e.getValue()));
}
Modified:
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java
===================================================================
---
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java 2010-03-05
20:37:57 UTC (rev 6010)
+++
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java 2010-03-05
21:42:52 UTC (rev 6011)
@@ -226,6 +226,10 @@
public NewAnnotatedTypeBuilder<X> addToMethodParameter(Method method, int
parameter, Annotation a)
{
+ if (!methods.containsKey(method))
+ {
+ methods.put(method, new AnnotationBuilder());
+ }
Map<Integer, AnnotationBuilder> anmap = methodParameters.get(method);
if (anmap == null)
{
@@ -268,7 +272,7 @@
return this;
}
- public NewAnnotatedTypeBuilder<X> removeFromConstructor(Constructor constructor,
Class<? extends Annotation> a)
+ public NewAnnotatedTypeBuilder<X> removeFromConstructor(Constructor<?>
constructor, Class<? extends Annotation> a)
{
AnnotationBuilder annotations = constructors.get(constructor);
if (annotations != null)
@@ -280,6 +284,10 @@
public NewAnnotatedTypeBuilder<X> addToConstructorParameter(Constructor<X>
constructor, int parameter, Annotation a)
{
+ if (!constructors.containsKey(constructor))
+ {
+ constructors.put(constructor, new AnnotationBuilder());
+ }
Map<Integer, AnnotationBuilder> anmap =
constructorParameters.get(constructor);
if (anmap == null)
{