Weld SVN: r6070 - extensions/trunk/src/main/java/org/jboss/weld/extensions/util.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-03-30 23:21:16 -0400 (Tue, 30 Mar 2010)
New Revision: 6070
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java
Log:
WELDX-89
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java 2010-03-30 10:22:59 UTC (rev 6069)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java 2010-03-31 03:21:16 UTC (rev 6070)
@@ -19,7 +19,7 @@
{
HashSet<Field> ret = new HashSet<Field>();
Class<?> p = clazz;
- while (p != Object.class)
+ while (p != null && p != Object.class)
{
for (Field a : p.getDeclaredFields())
{
@@ -33,7 +33,7 @@
public static Field getField(Class<?> parent, String name)
{
Class<?> p = parent;
- while (p != Object.class)
+ while (p != null && p != Object.class)
{
try
{
@@ -51,7 +51,7 @@
public static boolean methodExists(Class<?> parent, String name)
{
Class<?> p = parent;
- while (p != Object.class)
+ while (p != null && p != Object.class)
{
for (Method m : p.getDeclaredMethods())
{
@@ -69,7 +69,7 @@
{
HashSet<Method> ret = new HashSet<Method>();
Class<?> p = clazz;
- while (p != Object.class)
+ while (p != null && p != Object.class)
{
for (Method a : p.getDeclaredMethods())
{
@@ -83,7 +83,7 @@
public static Method getMethod(Class<?> parent, String name, Class<?>... args)
{
Class<?> p = parent;
- while (p != Object.class)
+ while (p != null && p != Object.class)
{
try
{
@@ -101,7 +101,7 @@
public static Constructor<?> getConstructor(Class<?> parent, Class<?>... args)
{
Class<?> p = parent;
- while (p != Object.class)
+ while (p != null && p != Object.class)
{
try
{
14 years, 7 months
Weld SVN: r6069 - extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-03-30 06:22:59 -0400 (Tue, 30 Mar 2010)
New Revision: 6069
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java
Log:
allow overriding of parameter types
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java 2010-03-30 09:55:00 UTC (rev 6068)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java 2010-03-30 10:22:59 UTC (rev 6069)
@@ -21,10 +21,10 @@
private final List<AnnotatedParameter<X>> parameters;
- protected AbstractNewAnnotatedCallable(AnnotatedType<X> declaringType, Y member, Class<?> memberType, Class<?>[] parameterTypes, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Type genericType)
+ protected AbstractNewAnnotatedCallable(AnnotatedType<X> declaringType, Y member, Class<?> memberType, Class<?>[] parameterTypes, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Type genericType, Map<Integer, Type> parameterTypeOverrides)
{
super(declaringType, member, memberType, annotations, genericType, null);
- this.parameters = getAnnotatedParameters(this, parameterTypes, parameterAnnotations);
+ this.parameters = getAnnotatedParameters(this, parameterTypes, parameterAnnotations, parameterTypeOverrides);
}
public List<AnnotatedParameter<X>> getParameters()
@@ -38,7 +38,7 @@
}
- private static <X, Y extends Member> List<AnnotatedParameter<X>> getAnnotatedParameters(AbstractNewAnnotatedCallable<X, Y> callable, Class<?>[] parameterTypes, Map<Integer, AnnotationStore> parameterAnnotations)
+ private static <X, Y extends Member> List<AnnotatedParameter<X>> getAnnotatedParameters(AbstractNewAnnotatedCallable<X, Y> callable, Class<?>[] parameterTypes, Map<Integer, AnnotationStore> parameterAnnotations, Map<Integer, Type> parameterTypeOverrides)
{
List<AnnotatedParameter<X>> parameters = new ArrayList<AnnotatedParameter<X>>();
int len = parameterTypes.length;
@@ -49,7 +49,12 @@
{
builder.addAll(parameterAnnotations.get(i));
}
- NewAnnotatedParameter<X> p = new NewAnnotatedParameter<X>(callable, parameterTypes[i], i, builder.create());
+ Type over = null;
+ if (parameterTypeOverrides != null)
+ {
+ over = parameterTypeOverrides.get(i);
+ }
+ NewAnnotatedParameter<X> p = new NewAnnotatedParameter<X>(callable, parameterTypes[i], i, builder.create(), over);
parameters.add(p);
}
return parameters;
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java 2010-03-30 09:55:00 UTC (rev 6068)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedConstructor.java 2010-03-30 10:22:59 UTC (rev 6069)
@@ -1,6 +1,7 @@
package org.jboss.weld.extensions.util.annotated;
import java.lang.reflect.Constructor;
+import java.lang.reflect.Type;
import java.util.Map;
import javax.enterprise.inject.spi.AnnotatedConstructor;
@@ -13,9 +14,9 @@
class NewAnnotatedConstructor<X> extends AbstractNewAnnotatedCallable<X, Constructor<X>> implements AnnotatedConstructor<X>
{
- NewAnnotatedConstructor(NewAnnotatedType<X> type, Constructor<?> constructor, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations)
+ NewAnnotatedConstructor(NewAnnotatedType<X> type, Constructor<?> constructor, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Map<Integer, Type> typeOverrides)
{
- super(type, (Constructor<X>) constructor, constructor.getDeclaringClass(), constructor.getParameterTypes(), annotations, parameterAnnotations, null);
+ super(type, (Constructor<X>) constructor, constructor.getDeclaringClass(), constructor.getParameterTypes(), annotations, parameterAnnotations, null, typeOverrides);
}
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java 2010-03-30 09:55:00 UTC (rev 6068)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedMethod.java 2010-03-30 10:22:59 UTC (rev 6069)
@@ -1,6 +1,7 @@
package org.jboss.weld.extensions.util.annotated;
import java.lang.reflect.Method;
+import java.lang.reflect.Type;
import java.util.Map;
import javax.enterprise.inject.spi.AnnotatedMethod;
@@ -13,9 +14,9 @@
*/
class NewAnnotatedMethod<X> extends AbstractNewAnnotatedCallable<X, Method> implements AnnotatedMethod<X>
{
- NewAnnotatedMethod(AnnotatedType<X> type, Method method, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations)
+ NewAnnotatedMethod(AnnotatedType<X> type, Method method, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Map<Integer, Type> parameterTypeOverrides)
{
- super(type, method, method.getReturnType(), method.getParameterTypes(), annotations, parameterAnnotations, method.getGenericReturnType());
+ super(type, method, method.getReturnType(), method.getParameterTypes(), annotations, parameterAnnotations, method.getGenericReturnType(), parameterTypeOverrides);
}
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java 2010-03-30 09:55:00 UTC (rev 6068)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java 2010-03-30 10:22:59 UTC (rev 6069)
@@ -1,5 +1,7 @@
package org.jboss.weld.extensions.util.annotated;
+import java.lang.reflect.Type;
+
import javax.enterprise.inject.spi.AnnotatedCallable;
import javax.enterprise.inject.spi.AnnotatedParameter;
@@ -14,9 +16,9 @@
private final int position;
private final AnnotatedCallable<X> declaringCallable;
- NewAnnotatedParameter(AnnotatedCallable<X> declaringCallable, Class<?> type, int position, AnnotationStore annotations)
+ NewAnnotatedParameter(AnnotatedCallable<X> declaringCallable, Class<?> type, int position, AnnotationStore annotations, Type typeOverride)
{
- super(type, annotations, null, null);
+ super(type, annotations, null, typeOverride);
this.declaringCallable = declaringCallable;
this.position = position;
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java 2010-03-30 09:55:00 UTC (rev 6068)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java 2010-03-30 10:22:59 UTC (rev 6069)
@@ -38,7 +38,7 @@
* If annotation have been added to other methods as well we add them to
*
*/
- NewAnnotatedType(Class<X> clazz, AnnotationStore typeAnnotations, Map<Field, AnnotationStore> fieldAnnotations, Map<Method, AnnotationStore> methodAnnotations, Map<Method, Map<Integer, AnnotationStore>> methodParameterAnnotations, Map<Constructor<X>, AnnotationStore> constructorAnnotations, Map<Constructor<X>, Map<Integer, AnnotationStore>> constructorParameterAnnotations, Map<Field, Type> fieldTypes)
+ NewAnnotatedType(Class<X> clazz, AnnotationStore typeAnnotations, Map<Field, AnnotationStore> fieldAnnotations, Map<Method, AnnotationStore> methodAnnotations, Map<Method, Map<Integer, AnnotationStore>> methodParameterAnnotations, Map<Constructor<X>, AnnotationStore> constructorAnnotations, Map<Constructor<X>, Map<Integer, AnnotationStore>> constructorParameterAnnotations, Map<Field, Type> fieldTypes, Map<Method, Map<Integer, Type>> methodParameterTypes, Map<Constructor<?>, Map<Integer, Type>> constructorParameterTypes)
{
super(clazz, typeAnnotations, null, null);
this.javaClass = clazz;
@@ -48,7 +48,7 @@
Set<Field> fset = new HashSet<Field>();
for (Constructor<?> c : clazz.getConstructors())
{
- NewAnnotatedConstructor<X> nc = new NewAnnotatedConstructor<X>(this, c, constructorAnnotations.get(c), constructorParameterAnnotations.get(c));
+ NewAnnotatedConstructor<X> nc = new NewAnnotatedConstructor<X>(this, c, constructorAnnotations.get(c), constructorParameterAnnotations.get(c), constructorParameterTypes.get(c));
constructors.add(nc);
cset.add(c);
}
@@ -56,14 +56,14 @@
{
if (!cset.contains(c.getKey()))
{
- NewAnnotatedConstructor<X> nc = new NewAnnotatedConstructor<X>(this, c.getKey(), c.getValue(), constructorParameterAnnotations.get(c.getKey()));
+ NewAnnotatedConstructor<X> nc = new NewAnnotatedConstructor<X>(this, c.getKey(), c.getValue(), constructorParameterAnnotations.get(c.getKey()), constructorParameterTypes.get(c.getKey()));
constructors.add(nc);
}
}
this.methods = new HashSet<AnnotatedMethod<? super X>>();
for (Method m : clazz.getMethods())
{
- NewAnnotatedMethod<X> met = new NewAnnotatedMethod<X>(this, m, methodAnnotations.get(m), methodParameterAnnotations.get(m));
+ NewAnnotatedMethod<X> met = new NewAnnotatedMethod<X>(this, m, methodAnnotations.get(m), methodParameterAnnotations.get(m), methodParameterTypes.get(m));
methods.add(met);
mset.add(m);
}
@@ -71,7 +71,7 @@
{
if (!mset.contains(c.getKey()))
{
- NewAnnotatedMethod<X> nc = new NewAnnotatedMethod<X>(this, c.getKey(), c.getValue(), methodParameterAnnotations.get(c.getKey()));
+ NewAnnotatedMethod<X> nc = new NewAnnotatedMethod<X>(this, c.getKey(), c.getValue(), methodParameterAnnotations.get(c.getKey()), methodParameterTypes.get(c.getKey()));
methods.add(nc);
}
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java 2010-03-30 09:55:00 UTC (rev 6068)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java 2010-03-30 10:22:59 UTC (rev 6069)
@@ -40,6 +40,8 @@
private Class<X> underlying;
private Map<Field, Type> fieldTypes = new HashMap<Field, Type>();
+ private Map<Method, Map<Integer, Type>> methodParameterTypes = new HashMap<Method, Map<Integer, Type>>();
+ private Map<Constructor<?>, Map<Integer, Type>> constructorParameterTypes = new HashMap<Constructor<?>, Map<Integer, Type>>();
public NewAnnotatedTypeBuilder(Class<X> underlying)
{
@@ -540,7 +542,7 @@
}
}
- return new NewAnnotatedType<X>(underlying, typeAnnotations.create(), fieldAnnotations, methodAnnotations, methodParameterAnnnotations, constructorAnnotations, constructorParameterAnnnotations, fieldTypes);
+ return new NewAnnotatedType<X>(underlying, typeAnnotations.create(), fieldAnnotations, methodAnnotations, methodParameterAnnnotations, constructorAnnotations, constructorParameterAnnnotations, fieldTypes, methodParameterTypes, constructorParameterTypes);
}
public void overrideFieldType(Field field, Type type)
@@ -548,4 +550,26 @@
fieldTypes.put(field, type);
}
+ public void overrideMethodParameterType(Method method, Type type, int position)
+ {
+ Map<Integer, Type> t = methodParameterTypes.get(method);
+ if (t == null)
+ {
+ t = new HashMap<Integer, Type>();
+ methodParameterTypes.put(method, t);
+ }
+ t.put(position, type);
+ }
+
+ public void overrideConstructorParameterType(Constructor<?> constructor, Type type, int position)
+ {
+ Map<Integer, Type> t = constructorParameterTypes.get(constructor);
+ if (t == null)
+ {
+ t = new HashMap<Integer, Type>();
+ constructorParameterTypes.put(constructor, t);
+ }
+ t.put(position, type);
+ }
+
}
14 years, 8 months
Weld SVN: r6068 - extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-03-30 05:55:00 -0400 (Tue, 30 Mar 2010)
New Revision: 6068
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedMember.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedField.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java
Log:
added ability to override field type
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java 2010-03-28 21:03:47 UTC (rev 6067)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedCallable.java 2010-03-30 09:55:00 UTC (rev 6068)
@@ -23,7 +23,7 @@
protected AbstractNewAnnotatedCallable(AnnotatedType<X> declaringType, Y member, Class<?> memberType, Class<?>[] parameterTypes, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Type genericType)
{
- super(declaringType, member, memberType, annotations, genericType);
+ super(declaringType, member, memberType, annotations, genericType, null);
this.parameters = getAnnotatedParameters(this, parameterTypes, parameterAnnotations);
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java 2010-03-28 21:03:47 UTC (rev 6067)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedElement.java 2010-03-30 09:55:00 UTC (rev 6068)
@@ -20,18 +20,29 @@
private final Set<Type> typeClosure;
private final AnnotationStore annotations;
- protected AbstractNewAnnotatedElement(Class<?> type, AnnotationStore annotations, Type genericType)
+ protected AbstractNewAnnotatedElement(Class<?> type, AnnotationStore annotations, Type genericType, Type overridenType)
{
- this.typeClosure = new TypeClosureBuilder().add(type).getTypes();
- if (genericType != null)
+
+ if (overridenType == null)
{
- typeClosure.add(genericType);
- this.type = genericType;
+ this.typeClosure = new TypeClosureBuilder().add(type).getTypes();
+ if (genericType != null)
+ {
+ typeClosure.add(genericType);
+ this.type = genericType;
+ }
+ else
+ {
+ this.type = type;
+ }
}
else
{
- this.type = type;
+ this.type = overridenType;
+ this.typeClosure = Collections.singleton(overridenType);
}
+
+
if (annotations == null)
{
this.annotations = new AnnotationStore();
@@ -66,5 +77,5 @@
{
return type;
}
-
+
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedMember.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedMember.java 2010-03-28 21:03:47 UTC (rev 6067)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/AbstractNewAnnotatedMember.java 2010-03-30 09:55:00 UTC (rev 6068)
@@ -17,9 +17,9 @@
private final AnnotatedType<X> declaringType;
private final M javaMember;
- protected AbstractNewAnnotatedMember(AnnotatedType<X> declaringType, M member, Class<?> memberType, AnnotationStore annotations, Type genericType)
+ protected AbstractNewAnnotatedMember(AnnotatedType<X> declaringType, M member, Class<?> memberType, AnnotationStore annotations, Type genericType, Type overridenType)
{
- super(memberType, annotations, genericType);
+ super(memberType, annotations, genericType, overridenType);
this.declaringType = declaringType;
this.javaMember = member;
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedField.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedField.java 2010-03-28 21:03:47 UTC (rev 6067)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedField.java 2010-03-30 09:55:00 UTC (rev 6068)
@@ -1,6 +1,7 @@
package org.jboss.weld.extensions.util.annotated;
import java.lang.reflect.Field;
+import java.lang.reflect.Type;
import javax.enterprise.inject.spi.AnnotatedField;
import javax.enterprise.inject.spi.AnnotatedType;
@@ -13,9 +14,9 @@
class NewAnnotatedField<X> extends AbstractNewAnnotatedMember<X, Field> implements AnnotatedField<X>
{
- NewAnnotatedField(AnnotatedType<X> declaringType, Field field, AnnotationStore annotations)
+ NewAnnotatedField(AnnotatedType<X> declaringType, Field field, AnnotationStore annotations, Type overridenType)
{
- super(declaringType, field, field.getType(), annotations, field.getGenericType());
+ super(declaringType, field, field.getType(), annotations, field.getGenericType(), overridenType);
}
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java 2010-03-28 21:03:47 UTC (rev 6067)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedParameter.java 2010-03-30 09:55:00 UTC (rev 6068)
@@ -16,7 +16,7 @@
NewAnnotatedParameter(AnnotatedCallable<X> declaringCallable, Class<?> type, int position, AnnotationStore annotations)
{
- super(type, annotations, null);
+ super(type, annotations, null, null);
this.declaringCallable = declaringCallable;
this.position = position;
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java 2010-03-28 21:03:47 UTC (rev 6067)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedType.java 2010-03-30 09:55:00 UTC (rev 6068)
@@ -3,6 +3,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.lang.reflect.Type;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
@@ -37,9 +38,9 @@
* If annotation have been added to other methods as well we add them to
*
*/
- NewAnnotatedType(Class<X> clazz, AnnotationStore typeAnnotations, Map<Field, AnnotationStore> fieldAnnotations, Map<Method, AnnotationStore> methodAnnotations, Map<Method, Map<Integer, AnnotationStore>> methodParameterAnnotations, Map<Constructor<X>, AnnotationStore> constructorAnnotations, Map<Constructor<X>, Map<Integer, AnnotationStore>> constructorParameterAnnotations)
+ NewAnnotatedType(Class<X> clazz, AnnotationStore typeAnnotations, Map<Field, AnnotationStore> fieldAnnotations, Map<Method, AnnotationStore> methodAnnotations, Map<Method, Map<Integer, AnnotationStore>> methodParameterAnnotations, Map<Constructor<X>, AnnotationStore> constructorAnnotations, Map<Constructor<X>, Map<Integer, AnnotationStore>> constructorParameterAnnotations, Map<Field, Type> fieldTypes)
{
- super(clazz, typeAnnotations, null);
+ super(clazz, typeAnnotations, null, null);
this.javaClass = clazz;
this.constructors = new HashSet<AnnotatedConstructor<X>>();
Set<Constructor<?>> cset = new HashSet<Constructor<?>>();
@@ -77,7 +78,7 @@
this.fields = new HashSet<AnnotatedField<? super X>>();
for (Field f : clazz.getFields())
{
- NewAnnotatedField<X> b = new NewAnnotatedField<X>(this, f, fieldAnnotations.get(f));
+ NewAnnotatedField<X> b = new NewAnnotatedField<X>(this, f, fieldAnnotations.get(f), fieldTypes.get(f));
fields.add(b);
fset.add(f);
}
@@ -85,7 +86,7 @@
{
if (!fset.contains(e.getKey()))
{
- fields.add(new NewAnnotatedField<X>(this, e.getKey(), e.getValue()));
+ fields.add(new NewAnnotatedField<X>(this, e.getKey(), e.getValue(), fieldTypes.get(e.getKey())));
}
}
}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java 2010-03-28 21:03:47 UTC (rev 6067)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/annotated/NewAnnotatedTypeBuilder.java 2010-03-30 09:55:00 UTC (rev 6068)
@@ -4,6 +4,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
@@ -38,6 +39,8 @@
private AnnotationBuilder typeAnnotations = new AnnotationBuilder();
private Class<X> underlying;
+ private Map<Field, Type> fieldTypes = new HashMap<Field, Type>();
+
public NewAnnotatedTypeBuilder(Class<X> underlying)
{
this(underlying, false);
@@ -537,7 +540,12 @@
}
}
- return new NewAnnotatedType<X>(underlying, typeAnnotations.create(), fieldAnnotations, methodAnnotations, methodParameterAnnnotations, constructorAnnotations, constructorParameterAnnnotations);
+ return new NewAnnotatedType<X>(underlying, typeAnnotations.create(), fieldAnnotations, methodAnnotations, methodParameterAnnnotations, constructorAnnotations, constructorParameterAnnnotations, fieldTypes);
}
+ public void overrideFieldType(Field field, Type type)
+ {
+ fieldTypes.put(field, type);
+ }
+
}
14 years, 8 months
Weld SVN: r6067 - in core/trunk/impl/src/main/java/org/jboss/weld: util and 1 other directory.
by weld-commits@lists.jboss.org
Author: nickarls
Date: 2010-03-28 17:03:47 -0400 (Sun, 28 Mar 2010)
New Revision: 6067
Added:
core/trunk/impl/src/main/java/org/jboss/weld/util/NamesStringBuilder.java
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/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/util/Names.java
Log:
WELD-374, jlr part
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-03-27 11:53:37 UTC (rev 6066)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java 2010-03-28 21:03:47 UTC (rev 6067)
@@ -564,7 +564,7 @@
@Override
public String toString()
{
- return Names.toString(getJavaClass(), getAnnotations(), getActualTypeArguments());
+ return Names.classToString(getJavaClass(), getAnnotations(), getActualTypeArguments());
}
public String getSimpleName()
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-03-27 11:53:37 UTC (rev 6066)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java 2010-03-28 21:03:47 UTC (rev 6067)
@@ -40,6 +40,7 @@
import org.jboss.weld.logging.messages.ReflectionMessage;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.util.Names;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
import org.jboss.weld.util.reflection.Reflections;
import org.jboss.weld.util.reflection.SecureReflections;
@@ -283,7 +284,7 @@
@Override
public String toString()
{
- return new StringBuilder().append("constructor ").append(constructor.toString()).toString();
+ return Names.constructorToString(getDelegate(), getAnnotations(), getActualTypeArguments(), getParameters());
}
public ConstructorSignature getSignature()
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-03-27 11:53:37 UTC (rev 6066)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java 2010-03-28 21:03:47 UTC (rev 6067)
@@ -30,6 +30,7 @@
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldField;
import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.util.Names;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
import org.jboss.weld.util.reflection.SecureReflections;
@@ -132,7 +133,7 @@
@Override
public String toString()
{
- return new StringBuilder().append("field ").append(getDeclaringType().getName()).append(".").append(field.getName()).toString();
+ return Names.fieldToString(getDelegate(), getAnnotations(), getActualTypeArguments());
}
public boolean isGeneric()
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-03-27 11:53:37 UTC (rev 6066)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldMethodImpl.java 2010-03-28 21:03:47 UTC (rev 6067)
@@ -39,6 +39,7 @@
import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.logging.messages.ReflectionMessage;
import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.util.Names;
import org.jboss.weld.util.collections.ArrayListSupplier;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
import org.jboss.weld.util.reflection.Reflections;
@@ -216,7 +217,7 @@
@Override
public String toString()
{
- return new StringBuilder().append(method.toString()).toString();
+ return Names.methodToString(getDelegate(), getAnnotations(), getActualTypeArguments(), getParameters());
}
public MethodSignature getSignature()
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java 2010-03-27 11:53:37 UTC (rev 6066)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java 2010-03-28 21:03:47 UTC (rev 6067)
@@ -30,6 +30,7 @@
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.util.Names;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
/**
@@ -139,7 +140,7 @@
@Override
public String toString()
{
- return new StringBuilder().append("parameter ").append(position).append(" of ").append(declaringMember.toString()).toString();
+ return Names.parameterToString(getJavaClass(), getAnnotations(), getActualTypeArguments());
}
public AnnotatedCallable<X> getDeclaringCallable()
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Names.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Names.java 2010-03-27 11:53:37 UTC (rev 6066)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Names.java 2010-03-28 21:03:47 UTC (rev 6067)
@@ -17,6 +17,9 @@
package org.jboss.weld.util;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
import java.util.ArrayList;
@@ -31,6 +34,7 @@
* Utility class to produce friendly names e.g. for debugging
*
* @author Pete Muir
+ * @author Nicklas Karlsson
*
*/
public class Names
@@ -65,19 +69,37 @@
}
return result.toString();
}
-
- public static String toString(Class<?> rawType, Set<Annotation> annotations, Type[] actualTypeArguments)
+
+ public static String classToString(Class<?> rawType, Set<Annotation> annotations, Type[] actualTypeArguments)
{
- if (actualTypeArguments.length > 0)
- {
- return new StringBuilder().append(Names.annotationsToString(annotations)).append(" ").append(rawType.getName()).append("<").append(Arrays.asList(actualTypeArguments)).append(">").toString();
- }
- else
- {
- return new StringBuilder().append(Names.annotationsToString(annotations)).append(" ").append(rawType.getName()).toString();
- }
+ return new NamesStringBuilder("class").add(modifiersToString(rawType.getModifiers())).add(annotationsToString(annotations)).add(rawType.getName()).add(typesToString(actualTypeArguments)).toString();
}
+ public static String fieldToString(Field field, Set<Annotation> annotations, Type[] actualTypeArguments)
+ {
+ return new NamesStringBuilder("field in " + field.getDeclaringClass().getName()).add(modifiersToString(field.getModifiers())).add(annotationsToString(annotations)).add(field.getType().getName()).add(typesToString(actualTypeArguments)).add(field.getName()).toString();
+ }
+
+ public static String methodToString(Method method, Set<Annotation> annotations, Type[] actualTypeArguments, List<?> parameters)
+ {
+ return new NamesStringBuilder("method in " + method.getDeclaringClass().getName()).add(modifiersToString(method.getModifiers())).add(annotationsToString(annotations)).add(method.getName()).add(typesToString(actualTypeArguments)).add(parametersToString(parameters)).toString();
+ }
+
+ private static String parametersToString(List<?> parameters)
+ {
+ return "(" + iterableToString(parameters, ", ") + ")";
+ }
+
+ public static String constructorToString(Constructor<?> constructor, Set<Annotation> annotations, Type[] actualTypeArguments, List<?> parameters)
+ {
+ return new NamesStringBuilder("constructor for " + constructor.getDeclaringClass().getName()).add(modifiersToString(constructor.getModifiers())).add(annotationsToString(annotations)).add(constructor.getName()).add(typesToString(actualTypeArguments)).add(parametersToString(parameters)).toString();
+ }
+
+ public static String parameterToString(Class<?> rawType, Set<Annotation> annotations, Type[] actualTypeArguments)
+ {
+ return new NamesStringBuilder().add(modifiersToString(rawType.getModifiers())).add(annotationsToString(annotations)).add(rawType.getName()).add(typesToString(actualTypeArguments)).toString();
+ }
+
/**
* Counts item in an iteratble
*
@@ -94,6 +116,27 @@
return count;
}
+ private static String modifiersToString(int modifiers)
+ {
+ return iterableToString(parseModifiers(modifiers), " ");
+ }
+
+ private static String iterableToString(Iterable<?> items, String delimiter)
+ {
+ StringBuffer stringBuffer = new StringBuffer();
+ int i = 0;
+ for (Object item : items)
+ {
+ if (i > 0)
+ {
+ stringBuffer.append(delimiter);
+ }
+ stringBuffer.append(item);
+ i++;
+ }
+ return stringBuffer.toString();
+ }
+
/**
* Parses a reflection modifier to a list of string
*
@@ -153,13 +196,17 @@
}
return modifiers;
}
-
- public static String typesToString(Set<? extends Type> types)
+
+ public static String typesToString(Type[] actualTypeArguments)
{
+ if (actualTypeArguments.length == 0)
+ {
+ return "";
+ }
StringBuilder buffer = new StringBuilder();
int i = 0;
- buffer.append("[");
- for (Type type : types)
+ buffer.append("<");
+ for (Type type : actualTypeArguments)
{
if (i > 0)
{
@@ -175,26 +222,21 @@
}
i++;
}
- buffer.append("]");
+ buffer.append(">");
return buffer.toString();
}
-
+
public static String annotationsToString(Iterable<Annotation> annotations)
{
StringBuilder builder = new StringBuilder();
- int i = 0;
for (Annotation annotation : annotations)
{
- if (i > 0)
- {
- builder.append(" ");
- }
+ builder.append(" ");
builder.append("@").append(annotation.annotationType().getSimpleName());
- i++;
}
- return builder.toString();
+ return builder.toString().trim();
}
-
+
/**
* Gets a string representation from an array of annotations
*
@@ -205,7 +247,7 @@
{
return annotationsToString(Arrays.asList(annotations));
}
-
+
public static String version(Package pkg)
{
if (pkg == null)
@@ -217,9 +259,9 @@
return version(pkg.getImplementationVersion());
}
}
-
+
public static String version(String version)
- {
+ {
if (version != null)
{
StringBuilder builder = new StringBuilder();
@@ -245,7 +287,7 @@
}
else
{
- builder.append(version);
+ builder.append(version);
}
return builder.toString();
}
Added: core/trunk/impl/src/main/java/org/jboss/weld/util/NamesStringBuilder.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/NamesStringBuilder.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/NamesStringBuilder.java 2010-03-28 21:03:47 UTC (rev 6067)
@@ -0,0 +1,32 @@
+package org.jboss.weld.util;
+
+public class NamesStringBuilder
+{
+ private StringBuilder stringBuilder = new StringBuilder();
+
+ public NamesStringBuilder(String context)
+ {
+ stringBuilder.append("[");
+ stringBuilder.append(context);
+ stringBuilder.append("]");
+ }
+
+ public NamesStringBuilder()
+ {
+ }
+
+ public NamesStringBuilder add(String text)
+ {
+ if (text != null && !"".equals(text))
+ {
+ stringBuilder.append(" ");
+ stringBuilder.append(text);
+ }
+ return this;
+ }
+
+ public String toString()
+ {
+ return stringBuilder.toString().trim();
+ }
+}
14 years, 8 months
Weld SVN: r6066 - in core/trunk: tests/src/test/java/org/jboss/weld/tests/builtinBeans and 1 other directories.
by weld-commits@lists.jboss.org
Author: nickarls
Date: 2010-03-27 07:53:37 -0400 (Sat, 27 Mar 2010)
New Revision: 6066
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/
core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/Bar.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/Foo.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/InstanceTest.java
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java
Log:
WELD-471
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java 2010-03-24 21:21:46 UTC (rev 6065)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java 2010-03-27 11:53:37 UTC (rev 6066)
@@ -26,6 +26,8 @@
import java.util.Map;
import java.util.Set;
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Instance;
import javax.enterprise.inject.New;
import org.jboss.weld.bean.AbstractBean;
@@ -88,12 +90,12 @@
this.newManagedBeanClasses = new HashSet<WeldClass<?>>();
this.newSessionBeanDescriptors = new HashSet<InternalEjbDescriptor<?>>();
}
-
+
public Set<WeldClass<?>> getNewManagedBeanClasses()
{
return newManagedBeanClasses;
}
-
+
public Set<InternalEjbDescriptor<?>> getNewSessionBeanDescriptors()
{
return newSessionBeanDescriptors;
@@ -113,7 +115,7 @@
return (ProducerMethod<X, T>) bean;
}
}
-
+
public AbstractClassBean<?> getClassBean(WeldClass<?> clazz)
{
if (!classBeanMap.containsKey(clazz))
@@ -133,22 +135,22 @@
producerMethodBeanMap.put(new WeldMethodKey(bean.getWeldAnnotated()), bean);
addAbstractBean(bean);
}
-
+
public void addProducerField(ProducerField<?, ?> bean)
{
addAbstractBean(bean);
}
-
+
public void addExtension(ExtensionBean bean)
{
beans.add(bean);
}
-
+
public void addBuiltInBean(AbstractBuiltInBean<?> bean)
{
beans.add(bean);
}
-
+
protected void addAbstractClassBean(AbstractClassBean<?> bean)
{
if (!(bean instanceof NewBean))
@@ -157,29 +159,29 @@
}
addAbstractBean(bean);
}
-
+
public void addManagedBean(ManagedBean<?> bean)
{
newManagedBeanClasses.add(bean.getWeldAnnotated());
addAbstractClassBean(bean);
}
-
+
public void addSessionBean(SessionBean<?> bean)
{
newSessionBeanDescriptors.add(bean.getEjbDescriptor());
addAbstractClassBean(bean);
}
-
+
public void addNewManagedBean(NewManagedBean<?> bean)
{
beans.add(bean);
}
-
+
public void addNewSessionBean(NewSessionBean<?> bean)
{
beans.add(bean);
}
-
+
protected void addAbstractBean(AbstractBean<?, ?> bean)
{
addNewBeansFromInjectionPoints(bean);
@@ -195,29 +197,33 @@
{
interceptors.add(bean);
}
-
+
public void addDisposesMethod(DisposalMethod<?, ?> bean)
{
allDisposalBeans.add(bean);
addNewBeansFromInjectionPoints(bean);
}
-
+
public void addObserverMethod(ObserverMethodImpl<?, ?> observer)
{
this.observers.add(observer);
addNewBeansFromInjectionPoints(observer.getNewInjectionPoints());
}
-
-
+
private void addNewBeansFromInjectionPoints(AbstractBean<?, ?> bean)
{
addNewBeansFromInjectionPoints(bean.getNewInjectionPoints());
}
-
+
private void addNewBeansFromInjectionPoints(Set<WeldInjectionPoint<?, ?>> newInjectionPoints)
{
for (WeldInjectionPoint<?, ?> injectionPoint : newInjectionPoints)
{
+ // FIXME: better check
+ if (injectionPoint.getJavaClass() == Instance.class || injectionPoint.getJavaClass() == Event.class)
+ {
+ continue;
+ }
New _new = injectionPoint.getAnnotation(New.class);
if (_new.value().equals(New.class))
{
@@ -227,10 +233,10 @@
{
addNewBeanFromInjecitonPoint(_new.value(), _new.value());
}
-
+
}
}
-
+
private void addNewBeanFromInjecitonPoint(Class<?> rawType, Type baseType)
{
if (getEjbDescriptors().contains(rawType))
@@ -247,7 +253,7 @@
{
return Collections.unmodifiableSet(beans);
}
-
+
public Set<DecoratorImpl<?>> getDecorators()
{
return Collections.unmodifiableSet(decorators);
@@ -263,7 +269,6 @@
return Collections.unmodifiableSet(observers);
}
-
public Set<DisposalMethod<?, ?>> getUnresolvedDisposalBeans()
{
Set<DisposalMethod<?, ?>> beans = new HashSet<DisposalMethod<?, ?>>(allDisposalBeans);
@@ -275,7 +280,7 @@
{
return ejbDescriptors;
}
-
+
/**
* Resolve the disposal method for the given producer method. Any resolved
* beans will be marked as such for the purpose of validating that all
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/Bar.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/Bar.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/Bar.java 2010-03-27 11:53:37 UTC (rev 6066)
@@ -0,0 +1,11 @@
+package org.jboss.weld.tests.builtinBeans.weld471;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.New;
+import javax.inject.Inject;
+
+@ApplicationScoped
+public class Bar {
+ @Inject @New private Instance<Foo> foo;
+}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/Foo.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/Foo.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/Foo.java 2010-03-27 11:53:37 UTC (rev 6066)
@@ -0,0 +1,8 @@
+package org.jboss.weld.tests.builtinBeans.weld471;
+
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+public class Foo {
+
+}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/InstanceTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/InstanceTest.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/builtinBeans/weld471/InstanceTest.java 2010-03-27 11:53:37 UTC (rev 6066)
@@ -0,0 +1,13 @@
+package org.jboss.weld.tests.builtinBeans.weld471;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class InstanceTest extends AbstractWeldTest {
+
+ @Test
+ public void testNewInstance() {
+ }
+}
14 years, 8 months
Weld SVN: r6065 - in core/trunk: impl/src/main/java/org/jboss/weld/logging/messages and 6 other directories.
by weld-commits@lists.jboss.org
Author: nickarls
Date: 2010-03-24 17:21:46 -0400 (Wed, 24 Mar 2010)
New Revision: 6065
Added:
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/Instantiator.java
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/InstantiatorFactory.java
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/ReflectionFactoryInstantiator.java
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/UnsafeInstantiator.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/
core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/Bar.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/Foo.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/ProxyTest.java
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java
core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/SecureReflections.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties
Log:
WELD-56
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2010-03-23 13:06:14 UTC (rev 6064)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2010-03-24 21:21:46 UTC (rev 6065)
@@ -66,6 +66,7 @@
import org.jboss.weld.persistence.PersistenceApiAbstraction;
import org.jboss.weld.servlet.ServletApiAbstraction;
import org.jboss.weld.util.reflection.Reflections;
+import org.jboss.weld.util.reflection.instantiation.InstantiatorFactory;
import org.jboss.weld.ws.WSApiAbstraction;
import org.slf4j.cal10n.LocLogger;
@@ -302,7 +303,7 @@
!servletApiAbstraction.SERVLET_REQUEST_LISTENER_CLASS.isAssignableFrom(javaClass) &&
!ejbApiAbstraction.ENTERPRISE_BEAN_CLASS.isAssignableFrom(javaClass) &&
!jsfApiAbstraction.UICOMPONENT_CLASS.isAssignableFrom(javaClass) &&
- hasSimpleWebBeanConstructor(clazz);
+ (hasSimpleWebBeanConstructor(clazz) || InstantiatorFactory.useInstantiators());
}
protected boolean isEEResourceProducerField(WeldField<?, ?> field)
Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java 2010-03-23 13:06:14 UTC (rev 6064)
+++ core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java 2010-03-24 21:21:46 UTC (rev 6065)
@@ -50,6 +50,9 @@
@MessageId("000612") UNABLE_TO_GET_FIELD_ON_DESERIALIZATION,
@MessageId("000613") UNABLE_TO_GET_PARAMETER_ON_DESERIALIZATION,
@MessageId("000614") INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_METHOD,
- @MessageId("000615") INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_CONSTRUCTOR;
+ @MessageId("000615") INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_CONSTRUCTOR,
+ @MessageId("000616") REFLECTIONFACTORY_INSTANTIATION_FAILED,
+ @MessageId("000617") UNSAFE_INSTANTIATION_FAILED,
+ @MessageId("000618") METHODHANDLER_SET_FAILED;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java 2010-03-23 13:06:14 UTC (rev 6064)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java 2010-03-24 21:21:46 UTC (rev 6065)
@@ -17,6 +17,7 @@
package org.jboss.weld.util;
import static org.jboss.weld.logging.messages.UtilMessage.CANNOT_PROXY_NON_CLASS_TYPE;
+import static org.jboss.weld.logging.messages.ReflectionMessage.METHODHANDLER_SET_FAILED;
import static org.jboss.weld.logging.messages.UtilMessage.INSTANCE_NOT_A_PROXY;
import static org.jboss.weld.logging.messages.ValidatorMessage.NOT_PROXYABLE_ARRAY_TYPE;
import static org.jboss.weld.logging.messages.ValidatorMessage.NOT_PROXYABLE_FINAL_TYPE_OR_METHOD;
@@ -43,8 +44,10 @@
import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.exceptions.UnproxyableResolutionException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.util.reflection.Reflections;
import org.jboss.weld.util.reflection.SecureReflections;
+import org.jboss.weld.util.reflection.instantiation.InstantiatorFactory;
/**
* Utilties for working with Javassist proxies
@@ -55,17 +58,18 @@
*/
public class Proxies
{
-
+
private static class IgnoreFinalizeMethodFilter implements MethodFilter, Serializable
{
+ private static final long serialVersionUID = 1L;
public boolean isHandled(Method m)
{
return !m.getName().equals("finalize");
}
-
+
}
-
+
public static class TypeInfo
{
@@ -109,10 +113,10 @@
public ProxyFactory createProxyFactory()
{
ProxyFactory proxyFactory = new ProxyFactory();
- ProxyFactory.useCache = false;
+ ProxyFactory.useCache = false;
proxyFactory.setFilter(new IgnoreFinalizeMethodFilter());
Class<?> superClass = getSuperClass();
- if(superClass != null && superClass != Object.class)
+ if (superClass != null && superClass != Object.class)
{
proxyFactory.setSuperclass(superClass);
}
@@ -136,7 +140,7 @@
}
else if (type instanceof ParameterizedType)
{
- add(((ParameterizedType)type).getRawType());
+ add(((ParameterizedType) type).getRawType());
}
else
{
@@ -154,16 +158,14 @@
}
return typeInfo;
}
-
+
public static TypeInfo create()
{
return new TypeInfo();
}
}
-
- private static final String DEFAULT_INTERCEPTOR = "default_interceptor";
-
+
/**
* Create a proxy with a handler, registering the proxy for cleanup
*
@@ -176,9 +178,32 @@
*/
public static <T> T createProxy(MethodHandler methodHandler, TypeInfo typeInfo) throws IllegalAccessException, InstantiationException
{
- return SecureReflections.newInstance(Proxies.<T>createProxyClass(methodHandler, typeInfo));
+ if (InstantiatorFactory.useInstantiators())
+ {
+ Class<T> proxyClass = Proxies.<T> createProxyClass(methodHandler, typeInfo);
+ T instance = SecureReflections.newUnsafeInstance(proxyClass);
+ setMethodHandler(proxyClass, instance, methodHandler);
+ return instance;
+ }
+ else
+ {
+ return SecureReflections.newInstance(Proxies.<T> createProxyClass(methodHandler, typeInfo));
+ }
}
-
+
+ private static <T> void setMethodHandler(Class<T> clazz, T instance, MethodHandler methodHandler)
+ {
+ try
+ {
+ Method setter = SecureReflections.getDeclaredMethod(clazz, "setHandler", MethodHandler.class);
+ SecureReflections.invoke(instance, setter, methodHandler);
+ }
+ catch (Exception e)
+ {
+ throw new WeldException(METHODHANDLER_SET_FAILED, e, clazz);
+ }
+ }
+
/**
* Create a proxy class
*
@@ -192,7 +217,7 @@
{
return createProxyClass(null, typeInfo);
}
-
+
/**
* Create a proxy class
*
@@ -207,7 +232,7 @@
{
ProxyFactory proxyFactory = typeInfo.createProxyFactory();
attachMethodHandler(proxyFactory, methodHandler);
-
+
@SuppressWarnings("unchecked")
Class<T> clazz = proxyFactory.createClass();
return clazz;
@@ -223,7 +248,7 @@
{
return getUnproxyableTypeException(type) == null;
}
-
+
public static UnproxyableResolutionException getUnproxyableTypeException(Type type)
{
if (type instanceof Class<?>)
@@ -240,7 +265,6 @@
}
return new UnproxyableResolutionException(NOT_PROXYABLE_UNKNOWN, type);
}
-
/**
* Indicates if a set of types are all proxyable
@@ -269,51 +293,55 @@
}
return null;
}
-
+
private static UnproxyableResolutionException getUnproxyableClassException(Class<?> clazz)
{
if (clazz.isInterface())
{
return null;
}
- else
+ Constructor<?> constructor = null;
+ try
{
- Constructor<?> constructor = null;
- try
+ constructor = SecureReflections.getDeclaredConstructor(clazz);
+ }
+ catch (NoSuchMethodException e)
+ {
+ if (!InstantiatorFactory.useInstantiators())
{
- constructor = SecureReflections.getDeclaredConstructor(clazz);
- }
- catch (NoSuchMethodException e)
- {
return new UnproxyableResolutionException(NOT_PROXYABLE_NO_CONSTRUCTOR, clazz);
}
- if (constructor == null)
- {
- return new UnproxyableResolutionException(NOT_PROXYABLE_NO_CONSTRUCTOR, clazz);
- }
- else if (Modifier.isPrivate(constructor.getModifiers()))
- {
- return new UnproxyableResolutionException(NOT_PROXYABLE_PRIVATE_CONSTRUCTOR, clazz, constructor);
- }
- else if (Reflections.isTypeOrAnyMethodFinal(clazz))
- {
- return new UnproxyableResolutionException(NOT_PROXYABLE_FINAL_TYPE_OR_METHOD, clazz, Reflections.getFinalMethodOrType(clazz));
- }
- else if (clazz.isPrimitive())
- {
- return new UnproxyableResolutionException(NOT_PROXYABLE_PRIMITIVE, clazz);
- }
- else if (Reflections.isArrayType(clazz))
- {
- return new UnproxyableResolutionException(NOT_PROXYABLE_ARRAY_TYPE, clazz);
- }
else
{
return null;
}
}
+ if (constructor == null)
+ {
+ return new UnproxyableResolutionException(NOT_PROXYABLE_NO_CONSTRUCTOR, clazz);
+ }
+ else if (Modifier.isPrivate(constructor.getModifiers()))
+ {
+ return new UnproxyableResolutionException(NOT_PROXYABLE_PRIVATE_CONSTRUCTOR, clazz, constructor);
+ }
+ else if (Reflections.isTypeOrAnyMethodFinal(clazz))
+ {
+ return new UnproxyableResolutionException(NOT_PROXYABLE_FINAL_TYPE_OR_METHOD, clazz, Reflections.getFinalMethodOrType(clazz));
+ }
+ else if (clazz.isPrimitive())
+ {
+ return new UnproxyableResolutionException(NOT_PROXYABLE_PRIMITIVE, clazz);
+ }
+ else if (Reflections.isArrayType(clazz))
+ {
+ return new UnproxyableResolutionException(NOT_PROXYABLE_ARRAY_TYPE, clazz);
+ }
+ else
+ {
+ return null;
+ }
}
-
+
public static ProxyFactory attachMethodHandler(ProxyFactory proxyFactory, MethodHandler methodHandler)
{
if (methodHandler != null)
@@ -322,7 +350,7 @@
}
return proxyFactory;
}
-
+
public static <T> T attachMethodHandler(T instance, MethodHandler methodHandler)
{
if (instance instanceof ProxyObject)
@@ -337,8 +365,7 @@
{
throw new ForbiddenArgumentException(INSTANCE_NOT_A_PROXY, instance);
}
-
+
}
-
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/SecureReflections.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/SecureReflections.java 2010-03-23 13:06:14 UTC (rev 6064)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/SecureReflections.java 2010-03-24 21:21:46 UTC (rev 6065)
@@ -26,6 +26,7 @@
import java.lang.reflect.Method;
import org.jboss.weld.exceptions.DeploymentException;
+import org.jboss.weld.util.reflection.instantiation.InstantiatorFactory;
/**
*
@@ -398,6 +399,29 @@
}
/**
+ * Creates a new instance of a class using unportable methods, if available
+ *
+ * @param <T> The type of the instance
+ * @param clazz The class to construct from
+ * @return The new instance
+ * @throws InstantiationException If the instance could not be create
+ * @throws IllegalAccessException If there was an illegal access attempt
+ * @see java.lang.Class#newInstance()
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T newUnsafeInstance(final Class<T> clazz) throws InstantiationException, IllegalAccessException
+ {
+ return (T) new SecureReflectionAccess()
+ {
+ @Override
+ protected Object work() throws Exception
+ {
+ return InstantiatorFactory.getInstantiator().instantiate(clazz);
+ }
+ }.runAsInstantiation();
+ }
+
+ /**
* Looks up a method in an inheritance hierarchy
*
* @param instance The instance (class) to start from
Added: core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/Instantiator.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/Instantiator.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/Instantiator.java 2010-03-24 21:21:46 UTC (rev 6065)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.util.reflection.instantiation;
+
+/**
+ * An interface for instantiating classes using non-portable reflection methods
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public interface Instantiator
+{
+ /**
+ * Create a new instance of a class
+ * @param <T> The type of the class
+ * @param clazz The class
+ * @return The created instance
+ */
+ public abstract <T> T instantiate(Class<T> clazz);
+
+ /**
+ * Used for checking if this particular instantiation method is available in the environment
+ *
+ * @return True if available, false otherwise
+ */
+ public abstract boolean isAvailable();
+}
Added: core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/InstantiatorFactory.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/InstantiatorFactory.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/InstantiatorFactory.java 2010-03-24 21:21:46 UTC (rev 6065)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.util.reflection.instantiation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.weld.bootstrap.api.Service;
+
+/**
+ * A factory class for obtaining the first available instantiator
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+@SuppressWarnings("serial")
+public class InstantiatorFactory implements Service
+{
+ private static Instantiator availableInstantiator;
+
+ private static final List<Instantiator> instantiators = new ArrayList<Instantiator>()
+ {
+ {
+ add(new UnsafeInstantiator());
+ add(new ReflectionFactoryInstantiator());
+ }
+ };
+
+ static
+ {
+ for (Instantiator instantiator : instantiators)
+ {
+ if (instantiator.isAvailable())
+ {
+ availableInstantiator = instantiator;
+ break;
+ }
+ }
+ }
+
+ public static Instantiator getInstantiator()
+ {
+ return availableInstantiator;
+ }
+
+ public static boolean useInstantiators()
+ {
+ return "true".equals(System.getProperty("org.jboss.weld.instantiators"));
+ }
+
+ public void cleanup()
+ {
+ instantiators.clear();
+ }
+}
Added: core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/ReflectionFactoryInstantiator.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/ReflectionFactoryInstantiator.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/ReflectionFactoryInstantiator.java 2010-03-24 21:21:46 UTC (rev 6065)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.util.reflection.instantiation;
+
+import java.lang.reflect.Constructor;
+import static org.jboss.weld.logging.messages.ReflectionMessage.REFLECTIONFACTORY_INSTANTIATION_FAILED;
+import java.lang.reflect.Method;
+
+import org.jboss.weld.exceptions.WeldException;
+
+/**
+ * A instantiator for sun.reflect.ReflectionFactory
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public class ReflectionFactoryInstantiator implements Instantiator
+{
+ private static final String REFLECTION_CLASS_NAME = "sun.reflect.ReflectionFactory";
+
+ private Method generator = null;
+ private Object reflectionFactoryInstance = null;
+
+ public ReflectionFactoryInstantiator()
+ {
+ try
+ {
+ Class<?> reflectionFactory = Class.forName(REFLECTION_CLASS_NAME);
+ Method accessor = reflectionFactory.getMethod("getReflectionFactory");
+ reflectionFactoryInstance = accessor.invoke(null);
+ generator = reflectionFactory.getMethod("newConstructorForSerialization", new Class[] { Class.class, Constructor.class });
+ }
+ catch (Exception e)
+ {
+ // OK to fail
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T instantiate(Class<T> clazz)
+ {
+ T instance = null;
+ try
+ {
+ Constructor<T> instanceConstructor = (Constructor<T>) generator.invoke(reflectionFactoryInstance, new Object[] { clazz, Object.class.getDeclaredConstructor() });
+ instance = instanceConstructor.newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new WeldException(REFLECTIONFACTORY_INSTANTIATION_FAILED, e, clazz);
+ }
+ return instance;
+ }
+
+ public boolean isAvailable()
+ {
+ return generator != null && reflectionFactoryInstance != null;
+ }
+
+}
Added: core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/UnsafeInstantiator.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/UnsafeInstantiator.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/UnsafeInstantiator.java 2010-03-24 21:21:46 UTC (rev 6065)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.util.reflection.instantiation;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import org.jboss.weld.exceptions.WeldException;
+
+import static org.jboss.weld.logging.messages.ReflectionMessage.UNSAFE_INSTANTIATION_FAILED;
+
+
+/**
+ * An instantiator for sun.misc.Unsafe
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public class UnsafeInstantiator implements Instantiator
+{
+ private static final String REFLECTION_CLASS_NAME = "sun.misc.Unsafe";
+
+ private Method allocateInstanceMethod = null;
+ private Object unsafeInstance = null;
+
+ public UnsafeInstantiator()
+ {
+ try
+ {
+ Class<?> unsafe = Class.forName(REFLECTION_CLASS_NAME);
+ Field accessor = unsafe.getDeclaredField("theUnsafe");
+ accessor.setAccessible(true);
+ unsafeInstance = accessor.get(null);
+ allocateInstanceMethod = unsafe.getDeclaredMethod("allocateInstance", Class.class);
+ }
+ catch (Exception e)
+ {
+ // OK to fail
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T instantiate(Class<T> clazz)
+ {
+ T instance = null;
+ try
+ {
+ instance = (T) allocateInstanceMethod.invoke(unsafeInstance, clazz);
+ }
+ catch (Exception e)
+ {
+ throw new WeldException(UNSAFE_INSTANTIATION_FAILED, e, clazz);
+ }
+ return instance;
+ }
+
+ public boolean isAvailable()
+ {
+ return allocateInstanceMethod != null && unsafeInstance != null;
+ }
+
+}
\ No newline at end of file
Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties 2010-03-23 13:06:14 UTC (rev 6064)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties 2010-03-24 21:21:46 UTC (rev 6065)
@@ -13,4 +13,7 @@
UNABLE_TO_GET_METHOD_ON_DESERIALIZATION=Unable to deserialize method. Declaring bean id {0}, declaring class {1}, signature {2}
UNABLE_TO_GET_PARAMETER_ON_DESERIALIZATION=Unable to deserialize paramter. Declaring bean id {0}, declaring class {1}, parameter {3} of method with signature {2}
INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_METHOD=Incorrect number of AnnotatedParameters {0} on AnnotatedMethod {1}. AnnotatedMethod has {2} as parameters but should have {3} as parameters
-INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_CONSTRUCTOR=Incorrect number of AnnotatedParameters {0} on AnnotatedConstructor {1}. AnnotatedConstructor has {2} as parameters but should have {3} as parameters
\ No newline at end of file
+INCORRECT_NUMBER_OF_ANNOTATED_PARAMETERS_CONSTRUCTOR=Incorrect number of AnnotatedParameters {0} on AnnotatedConstructor {1}. AnnotatedConstructor has {2} as parameters but should have {3} as parameters
+REFLECTIONFACTORY_INSTANTIATION_FAILED=Instantiation through ReflectionFactory of {0} failed
+UNSAFE_INSTANTIATION_FAILED=Instantiation through Unsafe of {0} failed
+METHODHANDLER_SET_FAILED=Could not set MethodHandler on {0}
\ No newline at end of file
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/Bar.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/Bar.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/Bar.java 2010-03-24 21:21:46 UTC (rev 6065)
@@ -0,0 +1,8 @@
+package org.jboss.weld.tests.proxy.weld56;
+
+import javax.enterprise.context.RequestScoped;
+
+@RequestScoped
+public class Bar
+{
+}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/Foo.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/Foo.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/Foo.java 2010-03-24 21:21:46 UTC (rev 6065)
@@ -0,0 +1,20 @@
+package org.jboss.weld.tests.proxy.weld56;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+
+
+@RequestScoped
+public class Foo
+{
+
+ @Inject
+ public Foo(Bar bar)
+ {
+ }
+
+ public String ping()
+ {
+ return "ping";
+ }
+}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/ProxyTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/ProxyTest.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/proxy/weld56/ProxyTest.java 2010-03-24 21:21:46 UTC (rev 6065)
@@ -0,0 +1,16 @@
+package org.jboss.weld.tests.proxy.weld56;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class ProxyTest extends AbstractWeldTest
+{
+
+ @Test(groups="broken")
+ public void testProxy()
+ {
+ assert "ping".equals(getReference(Foo.class).ping());
+ }
+}
14 years, 8 months
Weld SVN: r6064 - ftest/login/trunk/src/main/java/org/jboss/weld/example/login/test/selenium.
by weld-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2010-03-23 09:06:14 -0400 (Tue, 23 Mar 2010)
New Revision: 6064
Modified:
ftest/login/trunk/src/main/java/org/jboss/weld/example/login/test/selenium/CommonLoginTest.java
Log:
fixed ftest for login - just change of right credentials
Modified: ftest/login/trunk/src/main/java/org/jboss/weld/example/login/test/selenium/CommonLoginTest.java
===================================================================
--- ftest/login/trunk/src/main/java/org/jboss/weld/example/login/test/selenium/CommonLoginTest.java 2010-03-22 13:25:35 UTC (rev 6063)
+++ ftest/login/trunk/src/main/java/org/jboss/weld/example/login/test/selenium/CommonLoginTest.java 2010-03-23 13:06:14 UTC (rev 6064)
@@ -57,8 +57,8 @@
public void loginTest()
{
assertFalse(browser.isElementPresent(LOGGED_IN), "User should not be logged in!");
- browser.type(USERNAME_FIELD, "User");
- browser.type(PASSWORD_FIELD, "password");
+ browser.type(USERNAME_FIELD, "demo");
+ browser.type(PASSWORD_FIELD, "demo");
browser.clickAndWait(LOGIN_BUTTON);
assertTrue(browser.isElementPresent(LOGGED_IN), "User should be logged in!");
}
@@ -67,8 +67,8 @@
public void logoutTest()
{
assertFalse(browser.isElementPresent(LOGGED_IN), "User should not be logged in!");
- browser.type(USERNAME_FIELD, "User");
- browser.type(PASSWORD_FIELD, "password");
+ browser.type(USERNAME_FIELD, "demo");
+ browser.type(PASSWORD_FIELD, "demo");
browser.clickAndWait(LOGIN_BUTTON);
assertTrue(browser.isElementPresent(LOGGED_IN), "User should be logged in!");
browser.clickAndWait(LOGOUT_BUTTON);
14 years, 8 months
Weld SVN: r6063 - core/trunk/impl/src/main/java/org/jboss/weld/util.
by weld-commits@lists.jboss.org
Author: nickarls
Date: 2010-03-22 09:25:35 -0400 (Mon, 22 Mar 2010)
New Revision: 6063
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
Log:
minor NPE guard
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java 2010-03-22 09:14:26 UTC (rev 6062)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java 2010-03-22 13:25:35 UTC (rev 6063)
@@ -209,7 +209,7 @@
{
List<Set<FieldInjectionPoint<?, ?>>> injectableFieldsList = new ArrayList<Set<FieldInjectionPoint<?, ?>>>();
WeldClass<?> t = type;
- while (!t.getJavaClass().equals(Object.class))
+ while (t != null && !t.getJavaClass().equals(Object.class))
{
Set<FieldInjectionPoint<?, ?>> fields = new HashSet<FieldInjectionPoint<?,?>>();
injectableFieldsList.add(0, fields);
@@ -392,7 +392,7 @@
});
WeldClass<?> t = type;
- while (!t.getJavaClass().equals(Object.class))
+ while (t != null && !t.getJavaClass().equals(Object.class))
{
Set<MethodInjectionPoint<?, ?>> initializerMethods = new HashSet<MethodInjectionPoint<?,?>>();
initializerMethodsList.add(0, initializerMethods);
14 years, 8 months
Weld SVN: r6062 - in archetypes/trunk: jsf/jee and 1 other directory.
by weld-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2010-03-22 05:14:26 -0400 (Mon, 22 Mar 2010)
New Revision: 6062
Modified:
archetypes/trunk/jsf/jee/pom.xml
archetypes/trunk/pom.xml
Log:
WELDX-70 fixed handling of local maven private repo and added maven code for jee archetype
Modified: archetypes/trunk/jsf/jee/pom.xml
===================================================================
--- archetypes/trunk/jsf/jee/pom.xml 2010-03-22 08:30:24 UTC (rev 6061)
+++ archetypes/trunk/jsf/jee/pom.xml 2010-03-22 09:14:26 UTC (rev 6062)
@@ -32,6 +32,362 @@
</plugins>
</build>
-
-
+ <profiles>
+ <profile>
+ <id>ftest-jboss</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+
+ <properties>
+ <ftest.artifact>ftest-archetypes</ftest.artifact>
+ <ftest.version>0.1${ftest.version.discriminator}</ftest.version>
+ <selenium.browser.url>http://localhost:8080</selenium.browser.url>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.weld.examples.ftest</groupId>
+ <artifactId>${ftest.artifact}</artifactId>
+ <version>${ftest.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>failsafe-maven-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+
+ <executions>
+ <!-- remove a project generated earlier -->
+ <execution>
+ <id>remove-old-project</id>
+ <phase>process-sources</phase>
+ <configuration>
+ <tasks>
+ <echo message="Removing old project" />
+ <delete dir="${java.io.tmpdir}/${project.artifactId}" failonerror="false"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <!-- tomcat:run has to be executed in background otherwise it would block further maven execution -->
+ <execution>
+ <id>wait-for-project</id>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <tasks>
+ <property name="url.to.wait" value="http://localhost:8080/${project.artifactId}" />
+ <echo message="Waiting for application at ${url.to.wait} using jboss container" />
+ <waitfor maxwait="${application.deploy.timeout}" maxwaitunit="second">
+ <http url="${url.to.wait}" errorsBeginAt="404" />
+ </waitfor>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <!-- generate project using weld archetypes -->
+ <execution>
+ <id>generate-project-artifacts</id>
+ <phase>generate-resources</phase>
+ <configuration>
+ <executable>mvn</executable>
+ <workingDirectory>${java.io.tmpdir}</workingDirectory>
+ <arguments>
+ <argument>archetype:generate</argument>
+ <argument>-DinteractiveMode=n</argument>
+ <argument>-DarchetypeArtifactId=${project.artifactId}</argument>
+ <argument>-DarchetypeGroupId=org.jboss.weld.archetypes</argument>
+ <argument>-DarchetypeVersion=${archetype.test.version}</argument>
+ <argument>-DgroupId=com.mycompany</argument>
+ <argument>-DartifactId=${project.artifactId}</argument>
+ <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
+ </arguments>
+ </configuration>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ <!-- just compile generated project -->
+ <execution>
+ <id>package-project</id>
+ <phase>compile</phase>
+ <configuration>
+ <executable>mvn</executable>
+ <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+ <arguments>
+ <argument>package</argument>
+ <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
+ </arguments>
+ </configuration>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ <!-- deploy -->
+ <execution>
+ <id>deploy-project</id>
+ <phase>compile</phase>
+ <configuration>
+ <executable>mvn</executable>
+ <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+ <arguments>
+ <argument>jboss:hard-deploy</argument>
+ <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
+ </arguments>
+ </configuration>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>run-unit-tests</id>
+ <phase>integration-test</phase>
+ <configuration>
+ <executable>mvn</executable>
+ <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+ <arguments>
+ <argument>test</argument>
+ <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
+ </arguments>
+ </configuration>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>undeploy-project</id>
+ <phase>post-integration-test</phase>
+ <configuration>
+ <executable>mvn</executable>
+ <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+ <arguments>
+ <argument>jboss:hard-undeploy</argument>
+ <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
+ </arguments>
+ </configuration>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>ftest-glassfish</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+
+ <properties>
+ <ftest.artifact>ftest-archetypes</ftest.artifact>
+ <ftest.version>0.1${ftest.version.discriminator}</ftest.version>
+ <selenium.browser.url>http://localhost:8080</selenium.browser.url>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.weld.examples.ftest</groupId>
+ <artifactId>${ftest.artifact}</artifactId>
+ <version>${ftest.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>failsafe-maven-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.glassfish.maven.plugin</groupId>
+ <artifactId>maven-glassfish-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <!-- remove a project generated earlier -->
+ <execution>
+ <id>remove-old-project</id>
+ <phase>process-sources</phase>
+ <configuration>
+ <tasks>
+ <echo message="Removing old project" />
+ <delete dir="${java.io.tmpdir}/${project.artifactId}" failonerror="false"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <!-- tomcat:run has to be executed in background otherwise it would block further maven execution -->
+ <execution>
+ <id>deploy-project</id>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <tasks>
+ <property name="url.to.wait" value="http://localhost:8080/${project.artifactId}" />
+ <echo message="Waiting for application at ${url.to.wait} using Glassfish container" />
+ <waitfor maxwait="${application.deploy.timeout}" maxwaitunit="second">
+ <http url="${url.to.wait}" errorsBeginAt="404" />
+ </waitfor>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>copy-persistencexml-to-temp</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <tasks>
+ <echo message="Copying persistence.xml to temp dir" />
+ <copy file="${java.io.tmpdir}/${project.artifactId}/src/main/resources/META-INF/persistence.xml" todir="${java.io.tmpdir}" overwrite="true"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>datasource-for-glassfish</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>transform</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <transformationSets>
+ <transformationSet>
+ <dir>${java.io.tmpdir}</dir>
+ <includes>
+ <include>persistence.xml</include>
+ </includes>
+ <outputDir>${java.io.tmpdir}/${project.artifactId}/src/main/resources/META-INF</outputDir>
+ <stylesheet>src/test/resources/glassfishdatasource.xsl</stylesheet>
+ </transformationSet>
+ </transformationSets>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <!-- generate project using weld archetypes -->
+ <execution>
+ <id>generate-project-artifacts</id>
+ <phase>generate-resources</phase>
+ <configuration>
+ <executable>mvn</executable>
+ <workingDirectory>${java.io.tmpdir}</workingDirectory>
+ <arguments>
+ <argument>archetype:generate</argument>
+ <argument>-DinteractiveMode=n</argument>
+ <argument>-DarchetypeArtifactId=${project.artifactId}</argument>
+ <argument>-DarchetypeGroupId=org.jboss.weld.archetypes</argument>
+ <argument>-DarchetypeVersion=${archetype.test.version}</argument>
+ <argument>-DgroupId=com.mycompany</argument>
+ <argument>-DartifactId=${project.artifactId}</argument>
+ <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
+ </arguments>
+ </configuration>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ <!-- just compile generated project -->
+ <execution>
+ <id>compile-project</id>
+ <phase>compile</phase>
+ <configuration>
+ <executable>mvn</executable>
+ <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+ <arguments>
+ <argument>package</argument>
+ <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
+ </arguments>
+ </configuration>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ <!-- run unit tests -->
+ <execution>
+ <id>run-unit-tests</id>
+ <phase>integration-test</phase>
+ <configuration>
+ <executable>mvn</executable>
+ <workingDirectory>${java.io.tmpdir}/${project.artifactId}</workingDirectory>
+ <arguments>
+ <argument>test</argument>
+ <argument>-Dmaven.repo.local=${maven.private.repo}/</argument>
+ </arguments>
+ </configuration>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
Modified: archetypes/trunk/pom.xml
===================================================================
--- archetypes/trunk/pom.xml 2010-03-22 08:30:24 UTC (rev 6061)
+++ archetypes/trunk/pom.xml 2010-03-22 09:14:26 UTC (rev 6062)
@@ -75,6 +75,8 @@
<maven.antrun.plugin.version>1.3</maven.antrun.plugin.version>
<failsafe.maven.plugin.version>2.4.3-alpha-1</failsafe.maven.plugin.version>
<exec.maven.plugin.version>1.1</exec.maven.plugin.version>
+ <xml.maven.plugin.version>1.0-beta-3</xml.maven.plugin.version>
+ <maven.glassfish.plugin.version>2.1</maven.glassfish.plugin.version>
<ant.junit.version>1.6.2</ant.junit.version>
<ftest.version.discriminator />
<selenium.browser>*firefoxproxy</selenium.browser>
@@ -182,8 +184,9 @@
<tasks>
<property name="tmpdir" value="${maven.private.repo}"/>
<delete dir="${tmpdir}" failonerror="false"/>
- <mkdir dir="${tmpdir}"/>
- <copy todir="${tmpdir}" overwrite="true">
+ <property name="archdir" value="${tmpdir}/org/jboss/weld/archetypes"/>
+ <mkdir dir="${archdir}"/>
+ <copy todir="${archdir}" overwrite="true">
<fileset dir="${user.home}/.m2/repository/org/jboss/weld/archetypes">
<include name="**/*"/>
</fileset>
@@ -370,8 +373,9 @@
<tasks>
<property name="tmpdir" value="${maven.private.repo}"/>
<delete dir="${tmpdir}" failonerror="false"/>
- <mkdir dir="${tmpdir}"/>
- <copy todir="${tmpdir}" overwrite="true">
+ <property name="archdir" value="${tmpdir}/org/jboss/weld/archetypes"/>
+ <mkdir dir="${archdir}"/>
+ <copy todir="${archdir}" overwrite="true">
<fileset dir="${user.home}/.m2/repository/org/jboss/weld/archetypes">
<include name="**/*"/>
</fileset>
@@ -535,7 +539,7 @@
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
- <version>2.1</version>
+ <version>${maven.glassfish.plugin.version}</version>
<configuration>
<glassfishDirectory>${env.GLASSFISH_HOME}</glassfishDirectory>
<user>${glassfish.admin.user}</user>
@@ -616,8 +620,9 @@
<tasks>
<property name="tmpdir" value="${maven.private.repo}"/>
<delete dir="${tmpdir}" failonerror="false"/>
- <mkdir dir="${tmpdir}"/>
- <copy todir="${tmpdir}" overwrite="true">
+ <property name="archdir" value="${tmpdir}/org/jboss/weld/archetypes"/>
+ <mkdir dir="${archdir}"/>
+ <copy todir="${archdir}" overwrite="true">
<fileset dir="${user.home}/.m2/repository/org/jboss/weld/archetypes">
<include name="**/*"/>
</fileset>
@@ -647,6 +652,12 @@
</plugin>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ <version>${xml.maven.plugin.version}</version>
+ </plugin>
+
+ <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec.maven.plugin.version}</version>
14 years, 8 months
Weld SVN: r6061 - ftest/trunk.
by weld-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2010-03-22 04:30:24 -0400 (Mon, 22 Mar 2010)
New Revision: 6061
Modified:
ftest/trunk/pom.xml
Log:
added module archetypes to parent pom
Modified: ftest/trunk/pom.xml
===================================================================
--- ftest/trunk/pom.xml 2010-03-19 09:00:44 UTC (rev 6060)
+++ ftest/trunk/pom.xml 2010-03-22 08:30:24 UTC (rev 6061)
@@ -21,6 +21,7 @@
<module>login</module>
<module>translator</module>
<module>permalink</module>
+ <module>archetypes</module>
</modules>
<properties>
14 years, 8 months