[webbeans-commits] Webbeans SVN: r1946 - in test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl: util and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-12 13:18:50 -0400 (Thu, 12 Mar 2009)
New Revision: 1946
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactDescriptor.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/Files.java
Log:
Improved error reporting
Modified: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactDescriptor.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactDescriptor.java 2009-03-12 16:53:48 UTC (rev 1945)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactDescriptor.java 2009-03-12 17:18:50 UTC (rev 1946)
@@ -365,6 +365,10 @@
classFile.createNewFile();
classFile.deleteOnExit();
clazzStream = loadResourceAsStream(classFilePathName);
+ if (clazzStream == null)
+ {
+ throw new IllegalStateException("Eror loading " + className + " (" + classFilePathName + ")");
+ }
Files.copy(clazzStream, classFile);
}
finally
Modified: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/Files.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/Files.java 2009-03-12 16:53:48 UTC (rev 1945)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/Files.java 2009-03-12 17:18:50 UTC (rev 1946)
@@ -11,6 +11,14 @@
public static void copy(InputStream source, OutputStream destination) throws IOException
{
+ if (source == null)
+ {
+ throw new IllegalArgumentException("source cannot be null");
+ }
+ if (destination == null)
+ {
+ throw new IllegalArgumentException("destination cannot be null");
+ }
byte[] readBuffer = new byte[2156];
int bytesIn = 0;
while((bytesIn = source.read(readBuffer)) != -1)
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1945 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 4 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-12 12:53:48 -0400 (Thu, 12 Mar 2009)
New Revision: 1945
Modified:
ri/trunk/api/src/main/java/javax/inject/manager/Bean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ResolvableAnnotatedClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Names.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java
Log:
WBRI-108
Modified: ri/trunk/api/src/main/java/javax/inject/manager/Bean.java
===================================================================
--- ri/trunk/api/src/main/java/javax/inject/manager/Bean.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/api/src/main/java/javax/inject/manager/Bean.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -60,7 +60,7 @@
*
* @return the bean types
*/
- public abstract Set<Type> getTypes();
+ public abstract Set<? extends Type> getTypes();
/**
* The bindings of a bean
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -48,7 +48,6 @@
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.metadata.MergedStereotypes;
import org.jboss.webbeans.metadata.MetaDataCache;
-import org.jboss.webbeans.util.Beans;
import org.jboss.webbeans.util.Reflections;
/**
@@ -107,7 +106,7 @@
// The type
protected Class<T> type;
// The API types
- protected Set<Type> types;
+ protected Set<? extends Type> types;
// The injection points
protected Set<AnnotatedInjectionPoint<?, ?>> injectionPoints;
// If the type a primitive?
@@ -163,7 +162,7 @@
*/
protected void initTypes()
{
- types = new Reflections.HierarchyDiscovery<Type>(getAnnotatedItem().getUnderlyingType()).getFlattenedTypes();
+ types = getAnnotatedItem().getFlattenedTypeHierarchy();
}
/**
@@ -245,7 +244,7 @@
protected void initProxyable()
{
- proxyable = Beans.apiTypesAreProxyable(getTypes());
+ proxyable = getAnnotatedItem().isProxyable();
}
/**
@@ -459,7 +458,7 @@
* @see javax.inject.manager.Bean#getTypes()
*/
@Override
- public Set<Type> getTypes()
+ public Set<? extends Type> getTypes()
{
return types;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -20,7 +20,6 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
-import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
@@ -94,14 +93,18 @@
{
if (getType().isArray() || getType().isPrimitive())
{
+ Set<Type> types = new HashSet<Type>();
types = new HashSet<Type>();
types.add(getType());
types.add(Object.class);
+ super.types = types;
}
else if (getType().isInterface())
{
- super.initTypes();
+ Set<Type> types = new HashSet<Type>();
types.add(Object.class);
+ types.addAll(getAnnotatedItem().getFlattenedTypeHierarchy());
+ super.types = types;
}
else
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -20,6 +20,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.Arrays;
+import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -123,12 +124,14 @@
protected void initTypes()
{
+ Set<Type> types = new HashSet<Type>();
types = new LinkedHashSet<Type>();
types.add(Object.class);
for (BusinessInterfaceDescriptor<?> businessInterfaceDescriptor : ejbDescriptor.getLocalBusinessInterfaces())
{
types.add(businessInterfaceDescriptor.getInterface());
}
+ super.types = types;
}
protected void initProxyClass()
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -115,7 +115,7 @@
* @return The API types
*/
@Override
- public Set<Type> getTypes()
+ public Set<? extends Type> getTypes()
{
return delegate().getTypes();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ResolvableAnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ResolvableAnnotatedClass.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ResolvableAnnotatedClass.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -8,6 +8,7 @@
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashSet;
+import java.util.Set;
import javax.inject.TypeLiteral;
@@ -111,5 +112,16 @@
{
throw new UnsupportedOperationException();
}
+
+ public Set<? extends Type> getFlattenedTypeHierarchy()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isProxyable()
+ {
+ throw new UnsupportedOperationException();
+ }
}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -105,6 +105,8 @@
* @return An annotation if found, null if the annotation wasn't present.
*/
public <A extends Annotation> A getAnnotation(Class<A> annotationType);
+
+ public Set<? extends Type> getFlattenedTypeHierarchy();
/**
* Indicates if an annotation type specified is present
@@ -149,7 +151,7 @@
* @param types The set of types to match
* @return True if assignable, false otherwise.
*/
- public boolean isAssignableFrom(Set<Type> types);
+ public boolean isAssignableFrom(Set<? extends Type> types);
/**
* Gets the actual type arguments for any parameterized types that this
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -135,7 +135,7 @@
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
- public boolean isAssignableFrom(Set<Type> types)
+ public boolean isAssignableFrom(Set<? extends Type> types)
{
return delegate().isAssignableFrom(types);
}
@@ -218,5 +218,10 @@
{
return delegate().isDeclaredAnnotationPresent(annotationType);
}
+
+ public Set<? extends Type> getFlattenedTypeHierarchy()
+ {
+ return delegate().getFlattenedTypeHierarchy();
+ }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -61,6 +61,9 @@
// Cached string representation
private String toString;
private final AnnotationStore annotationStore;
+ private final Class<T> type;
+ private final Set<? extends Type> flattenedTypes;
+ private final boolean proxyable;
/**
* Constructor
@@ -71,9 +74,20 @@
* @param annotationMap A map of annotation to register
*
*/
+ public AbstractAnnotatedItem(AnnotationStore annotatedItemHelper, Class<T> type)
+ {
+ this.annotationStore = annotatedItemHelper;
+ this.type = type;
+ this.flattenedTypes = new Reflections.HierarchyDiscovery<Type>(type).getFlattenedTypes();
+ this.proxyable = Proxies.isTypesProxyable(flattenedTypes);
+ }
+
public AbstractAnnotatedItem(AnnotationStore annotatedItemHelper)
{
this.annotationStore = annotatedItemHelper;
+ this.type = null;
+ this.flattenedTypes = null;
+ this.proxyable = false;
}
public AnnotationStore getAnnotationStore()
@@ -158,7 +172,7 @@
*
* @see org.jboss.webbeans.introspector.AnnotatedItem#isAssignableFrom(Set)
*/
- public boolean isAssignableFrom(Set<Type> types)
+ public boolean isAssignableFrom(Set<? extends Type> types)
{
for (Type type : types)
{
@@ -255,8 +269,18 @@
*/
public boolean isProxyable()
{
- return Proxies.isTypeProxyable(getType());
+ return proxyable;
}
+
+ public Class<T> getType()
+ {
+ return type;
+ }
+
+ public Set<? extends Type> getFlattenedTypeHierarchy()
+ {
+ return flattenedTypes;
+ }
public abstract S getDelegate();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -110,9 +110,9 @@
*
* @param annotationMap The annotation map
*/
- public AbstractAnnotatedMember(AnnotationStore annotatedItemHelper, Member member)
+ public AbstractAnnotatedMember(AnnotationStore annotatedItemHelper, Member member, Class<T> type)
{
- super(annotatedItemHelper);
+ super(annotatedItemHelper, type);
name = member.getName();
_public = Modifier.isPublic(member.getModifiers());
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -54,7 +54,7 @@
*/
public AbstractAnnotatedType(AnnotationStore annotatedItemHelper, Class<T> type)
{
- super(annotatedItemHelper);
+ super(annotatedItemHelper, type);
this.name = type.getName();
this._simpleName = type.getSimpleName();
if (type.getSuperclass() != null)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -153,16 +153,6 @@
}
/**
- * Gets the type of the annotation
- *
- * @see org.jboss.webbeans.introspector.AnnotatedAnnotation#getType()
- */
- public Class<T> getType()
- {
- return clazz;
- }
-
- /**
* Returns the annotated members with a given annotation type
*
* If the annotated members are null, they are initialized first.
@@ -202,5 +192,4 @@
{
throw new UnsupportedOperationException();
}
-
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -257,6 +257,7 @@
private final boolean _nonStaticMemberClass;
private final boolean _parameterizedType;
private final boolean _abstract;
+
public static <T> AnnotatedClass<T> of(Class<T> clazz)
{
@@ -475,16 +476,6 @@
return Collections.unmodifiableSet(annotatedFields.get(annotationType));
}
- /**
- * Gets the type of the class
- *
- * @return The type
- */
- public Class<T> getType()
- {
- return clazz;
- }
-
public boolean isNonStaticMemberClass()
{
return _nonStaticMemberClass;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -77,7 +77,7 @@
*/
public AnnotatedConstructorImpl(Constructor<T> constructor, AnnotatedType<T> declaringClass)
{
- super(AnnotationStore.of(constructor), constructor);
+ super(AnnotationStore.of(constructor), constructor, constructor.getDeclaringClass());
this.constructor = constructor;
this.declaringClass = declaringClass;
@@ -131,16 +131,6 @@
}
/**
- * Gets the type of the constructor
- *
- * @return The type of the constructor
- */
- public Class<T> getType()
- {
- return constructor.getDeclaringClass();
- }
-
- /**
* Gets the actual type arguments
*
* @return The type arguments
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -60,7 +60,7 @@
*/
public AnnotatedFieldImpl(Field field, AnnotatedType<?> declaringClass)
{
- super(AnnotationStore.of(field), field);
+ super(AnnotationStore.of(field), field, (Class<T>) field.getType());
this.field = field;
field.setAccessible(true);
this.declaringClass = declaringClass;
@@ -91,17 +91,6 @@
}
/**
- * Gets the type
- *
- * @return The type
- */
- @SuppressWarnings("unchecked")
- public Class<T> getType()
- {
- return (Class<T>) field.getType();
- }
-
- /**
* Gets the actual type arguments
*
* @return The type arguments
@@ -189,5 +178,5 @@
{
return getDelegate().hashCode();
}
-
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -26,6 +26,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Set;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotatedParameter;
@@ -68,6 +69,8 @@
// Cached string representation
private String toString;
+ private final Set<? extends Type> flattenedTypes;
+
public static <T> AnnotatedMethodImpl<T> of(Method method, AnnotatedType<?> declaringClass)
{
return new AnnotatedMethodImpl<T>(method, declaringClass);
@@ -85,7 +88,7 @@
@SuppressWarnings("unchecked")
protected AnnotatedMethodImpl(Method method, AnnotatedType<?> declaringClass)
{
- super(AnnotationStore.of(method), method);
+ super(AnnotationStore.of(method), method, (Class<T>) method.getReturnType());
this.method = method;
this.method.setAccessible(true);
this.declaringClass = declaringClass;
@@ -93,11 +96,13 @@
if (method.getGenericReturnType() instanceof ParameterizedType)
{
this.underlyingType = method.getGenericReturnType();
+ this.flattenedTypes = new Reflections.HierarchyDiscovery<Type>(underlyingType).getFlattenedTypes();
this.actualTypeArguments = ((ParameterizedType) underlyingType).getActualTypeArguments();
}
else
{
this.underlyingType = type;
+ this.flattenedTypes = super.getFlattenedTypeHierarchy();
this.actualTypeArguments = new Type[0];
}
@@ -123,7 +128,7 @@
Class<? extends Object> clazz = method.getParameterTypes()[i];
AnnotatedParameter<Object> parameter = new AnnotatedParameterImpl<Object>(new Annotation[0], (Class<Object>) clazz, this);
this.parameters.add(parameter);
- }
+ }
}
String propertyName = Reflections.getPropertyName(getDelegate());
@@ -146,12 +151,6 @@
{
return method;
}
-
- @SuppressWarnings("unchecked")
- public Class<T> getType()
- {
- return type;
- }
@Override
public Type getUnderlyingType()
@@ -240,6 +239,11 @@
toString = "Annotated method on class " + getDeclaringClass().getName() + Names.methodToString(method);
return toString;
}
-
-
+
+ @Override
+ public Set<? extends Type> getFlattenedTypeHierarchy()
+ {
+ return flattenedTypes;
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -67,7 +67,7 @@
*/
public AnnotatedParameterImpl(Annotation[] annotations, Class<T> type, AnnotatedMember<?, ?> declaringMember)
{
- super(AnnotationStore.of(annotations, annotations));
+ super(AnnotationStore.of(annotations, annotations), type);
this.type = type;
this.declaringMember = declaringMember;
}
@@ -97,18 +97,6 @@
}
/**
- * Gets the type of the parameter
- *
- * @return The type
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getType()
- */
- public Class<T> getType()
- {
- return type;
- }
-
- /**
* Indicates if the parameter is final
*
* @return True if final, false otherwise
@@ -195,5 +183,5 @@
{
throw new UnsupportedOperationException();
}
-
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -16,7 +16,6 @@
*/
package org.jboss.webbeans.util;
-import java.lang.reflect.Type;
import java.util.HashSet;
import java.util.Set;
@@ -73,32 +72,10 @@
}
else
{
- return Beans.apiTypesAreProxyable(bean.getTypes());
+ return Proxies.isTypesProxyable(bean.getTypes());
}
}
- /**
- * Indicates if a set of types are all proxyable
- *
- * @param types The types to test
- * @return True if proxyable, false otherwise
- */
- public static boolean apiTypesAreProxyable(Set<Type> types)
- {
- for (Type apiType : types)
- {
- if (Object.class.equals(apiType))
- {
- continue;
- }
- if (!Proxies.isTypeProxyable(apiType))
- {
- return false;
- }
- }
- return true;
- }
-
public static Set<FieldInjectionPoint<?>> getFieldInjectionPoints(AnnotatedClass<?> annotatedItem, Bean<?> declaringBean)
{
Set<FieldInjectionPoint<?>> injectableFields = new HashSet<FieldInjectionPoint<?>>();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Names.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Names.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Names.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -288,7 +288,7 @@
return buffer.toString();
}
- public static String typesToString(Set<Type> types)
+ public static String typesToString(Set<? extends Type> types)
{
StringBuilder buffer = new StringBuilder();
int i = 0;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java 2009-03-12 16:51:55 UTC (rev 1944)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java 2009-03-12 16:53:48 UTC (rev 1945)
@@ -101,7 +101,7 @@
}
}
- public static TypeInfo ofTypes(Set<Type> types)
+ public static TypeInfo ofTypes(Set<? extends Type> types)
{
TypeInfo typeInfo = new TypeInfo();
for (Type type : types)
@@ -157,6 +157,29 @@
}
return false;
}
+
+
+ /**
+ * Indicates if a set of types are all proxyable
+ *
+ * @param types The types to test
+ * @return True if proxyable, false otherwise
+ */
+ public static boolean isTypesProxyable(Iterable<? extends Type> types)
+ {
+ for (Type apiType : types)
+ {
+ if (Object.class.equals(apiType))
+ {
+ continue;
+ }
+ if (!isTypeProxyable(apiType))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
private static boolean isClassProxyable(Class<?> clazz)
{
@@ -186,4 +209,5 @@
}
}
+
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1944 - ri/trunk/jboss-as.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-12 12:51:55 -0400 (Thu, 12 Mar 2009)
New Revision: 1944
Modified:
ri/trunk/jboss-as/build.properties
Log:
oops
Modified: ri/trunk/jboss-as/build.properties
===================================================================
--- ri/trunk/jboss-as/build.properties 2009-03-12 12:02:13 UTC (rev 1943)
+++ ri/trunk/jboss-as/build.properties 2009-03-12 16:51:55 UTC (rev 1944)
@@ -1,8 +1,14 @@
# Container a number of properties associated with installing Web Beans into JBoss AS and running the TCK in JBoss AS
#jboss.home=/Applications/jboss-5.0.1.GA
-java.opts=-Xms128m -Xmx256m -XX:MaxPermSize=128m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 # recommended minimum JAVA_OPTS for running JBoss with the TCK
-# jboss.shutdown.delay=15000 # time to allow before attempting to restart JBoss AS
-# jboss.deployments.restart = 25 # maximum number of TCK tests to deploy before restarting JBoss AS
+
+# recommended minimum JAVA_OPTS for running JBoss with the TCK
+java.opts=-Xms128m -Xmx256m -XX:MaxPermSize=128m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
+
+# time to allow before attempting to restart JBoss AS
+# jboss.shutdown.delay=15000
+
+# maximum number of TCK tests to deploy before restarting JBoss AS
+# jboss.deployments.restart = 25
webbeans-ri-int.version=5.2.0.BETA1
webbeans.version=1.0.0.BETA1
jboss-ejb3.version=1.0.0
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1943 - ri/trunk/dist.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-12 08:02:13 -0400 (Thu, 12 Mar 2009)
New Revision: 1943
Modified:
ri/trunk/dist/build.xml
Log:
oops
Modified: ri/trunk/dist/build.xml
===================================================================
--- ri/trunk/dist/build.xml 2009-03-12 11:38:12 UTC (rev 1942)
+++ ri/trunk/dist/build.xml 2009-03-12 12:02:13 UTC (rev 1943)
@@ -116,6 +116,7 @@
<copy todir="${dist.wb.lib.dir}">
<fileset dir="target">
<include name="webbeans-*.jar" />
+ <include name="jsr299-api.jar" />
<include name="google-collections.jar" />
</fileset>
</copy>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1942 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-12 07:38:12 -0400 (Thu, 12 Mar 2009)
New Revision: 1942
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Enable chapter 9 assertions
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-12 11:27:07 UTC (rev 1941)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-12 11:38:12 UTC (rev 1942)
@@ -5081,7 +5081,7 @@
</assertion>
</section>
- <!-- <section id="9" title="XML based metadata">
+ <section id="9" title="XML based metadata">
<assertion id="a">
<text>XML-based bean declarations define additional beans they do not redefine or disable any bean that was declared via annotations</text>
</assertion>
@@ -5682,6 +5682,6 @@
<section id="9.6.2" title="Child elements of a producer method declaration">
- </section>-->
+ </section>
</specification>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1941 - doc/trunk/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-12 07:27:07 -0400 (Thu, 12 Mar 2009)
New Revision: 1941
Modified:
doc/trunk/reference/en-US/ri.xml
Log:
minor
Modified: doc/trunk/reference/en-US/ri.xml
===================================================================
--- doc/trunk/reference/en-US/ri.xml 2009-03-12 11:18:29 UTC (rev 1940)
+++ doc/trunk/reference/en-US/ri.xml 2009-03-12 11:27:07 UTC (rev 1941)
@@ -22,7 +22,7 @@
<para>the latest release of the Web Beans RI,</para>
</listitem>
<listitem>
- <para>JBoss AS 5.0.0.GA, and</para>
+ <para>JBoss AS 5.0.1.GA, and</para>
</listitem>
<listitem>
<para>Ant 1.7.0.</para>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1939 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-12 02:47:06 -0400 (Thu, 12 Mar 2009)
New Revision: 1939
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
Log:
added tests for implicit bean
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-03-12 03:59:48 UTC (rev 1938)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-03-12 06:47:06 UTC (rev 1939)
@@ -2,8 +2,10 @@
import static org.jboss.jsr299.tck.tests.lookup.dynamic.PayBy.PaymentMethod.CHEQUE;
+import javax.context.Dependent;
import javax.inject.DuplicateBindingTypeException;
import javax.inject.Instance;
+import javax.inject.Standard;
import javax.inject.manager.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -71,5 +73,24 @@
injectionPoint.getPaymentProcessor().get(new NonBinding() );
}
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "5.8", id = "k"),
+ @SpecAssertion(section = "5.8", id = "l"),
+ @SpecAssertion(section = "5.8", id = "m"),
+ @SpecAssertion(section = "5.8", id = "n"),
+ @SpecAssertion(section = "5.8", id = "o")
+ })
+ public void testImplicitBeanExists()
+ {
+ Bean<Instance> instanceBean = getCurrentManager().resolveByType(Instance.class,
+ new PayByBinding() { public PaymentMethod value() { return CHEQUE; }}).iterator().next();
+
+ assert instanceBean != null;
+ assert instanceBean.getDeploymentType().equals(Standard.class);
+ assert instanceBean.getScopeType().equals(Dependent.class);
+ assert instanceBean.getName() == null;
+ }
+
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1938 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-11 23:59:48 -0400 (Wed, 11 Mar 2009)
New Revision: 1938
Modified:
doc/trunk/reference/zh-CN/Author_Group.po
Log:
Modified: doc/trunk/reference/zh-CN/Author_Group.po
===================================================================
--- doc/trunk/reference/zh-CN/Author_Group.po 2009-03-12 03:27:44 UTC (rev 1937)
+++ doc/trunk/reference/zh-CN/Author_Group.po 2009-03-12 03:59:48 UTC (rev 1938)
@@ -6,7 +6,7 @@
"Project-Id-Version: Introduction_to_Web_Beans VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-02-01 21:16+0000\n"
-"PO-Revision-Date: 2009-02-04 15:30+0800\n"
+"PO-Revision-Date: 2009-03-12 11:59+0800\n"
"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -48,7 +48,7 @@
#: Author_Group.xml:53
#, no-c-format
msgid "Italian Translation"
-msgstr "意大利文翻译"
+msgstr "意大利语翻译"
#. Tag: othercredit
#: Author_Group.xml:26
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1937 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-11 23:27:44 -0400 (Wed, 11 Mar 2009)
New Revision: 1937
Modified:
doc/trunk/reference/zh-CN/example.po
Log:
Modified: doc/trunk/reference/zh-CN/example.po
===================================================================
--- doc/trunk/reference/zh-CN/example.po 2009-03-12 03:26:08 UTC (rev 1936)
+++ doc/trunk/reference/zh-CN/example.po 2009-03-12 03:27:44 UTC (rev 1937)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-04 23:18+0000\n"
-"PO-Revision-Date: 2008-12-23 17:55+0800\n"
+"PO-Revision-Date: 2009-03-12 11:27+0800\n"
"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -22,17 +22,12 @@
#. Tag: para
#: example.xml:6
#, no-c-format
-msgid ""
-"Let's illustrate these ideas with a full example. We're going to implement "
-"user login/logout for an application that uses JSF. First, we'll define a "
-"Web Bean to hold the username and password entered during login:"
-msgstr ""
-"让我们通过一个完整的例子来演示这些想法。我们将是使用JSF来实现一个应用的用户登"
-"录/退出功能。首先,我们定一个Web Bean来持有登录过程中用户输入的用户名和密码:"
+msgid "Let's illustrate these ideas with a full example. We're going to implement user login/logout for an application that uses JSF. First, we'll define a Web Bean to hold the username and password entered during login:"
+msgstr "让我们通过一个完整的例子来演示这些想法。我们将是使用JSF来实现一个应用的用户登录/退出功能。首先,我们定一个Web Bean来持有登录过程中用户输入的用户名和密码:"
#. Tag: programlisting
#: example.xml:11
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"<![CDATA[@Named @RequestScoped\n"
"public class Credentials {\n"
@@ -48,7 +43,7 @@
" \n"
"}]]>"
msgstr ""
-"<![CDATA[@Named\n"
+"<![CDATA[@Named @RequestScoped\n"
"public class Credentials {\n"
" \n"
" private String username;\n"
@@ -70,7 +65,7 @@
#. Tag: programlisting
#: example.xml:15
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"<![CDATA[<h:form>\n"
" <h:panelGrid columns=\"2\" rendered=\"#{!login.loggedIn}\">\n"
@@ -79,35 +74,26 @@
" <h:outputLabel for=\"password\">Password:</h:outputLabel>\n"
" <h:inputText id=\"password\" value=\"#{credentials.password}\"/>\n"
" </h:panelGrid>\n"
-" <h:commandButton value=\"Login\" action=\"#{login.login}\" rendered=\"#{!"
-"login.loggedIn}\"/>\n"
-" <h:commandButton value=\"Logout\" acion=\"#{login.logout}\" rendered=\"#"
-"{login.loggedIn}\"/>\n"
+" <h:commandButton value=\"Login\" action=\"#{login.login}\" rendered=\"#{!login.loggedIn}\"/>\n"
+" <h:commandButton value=\"Logout\" acion=\"#{login.logout}\" rendered=\"#{login.loggedIn}\"/>\n"
"</h:form>]]>"
msgstr ""
-"<![CDATA[<f:form>\n"
+"<![CDATA[<h:form>\n"
" <h:panelGrid columns=\"2\" rendered=\"#{!login.loggedIn}\">\n"
" <h:outputLabel for=\"username\">Username:</h:outputLabel>\n"
" <h:inputText id=\"username\" value=\"#{credentials.username}\"/>\n"
" <h:outputLabel for=\"password\">Password:</h:outputLabel>\n"
" <h:inputText id=\"password\" value=\"#{credentials.password}\"/>\n"
" </h:panelGrid>\n"
-" <h:commandButton value=\"Login\" action=\"#{login.login}\" rendered=\"#{!"
-"login.loggedIn}\"/>\n"
-" <h:commandButton value=\"Logout\" acion=\"#{login.logout}\" rendered=\"#"
-"{login.loggedIn}\"/>\n"
-"</f:form]]>"
+" <h:commandButton value=\"Login\" action=\"#{login.login}\" rendered=\"#{!login.loggedIn}\"/>\n"
+" <h:commandButton value=\"Logout\" acion=\"#{login.logout}\" rendered=\"#{login.loggedIn}\"/>\n"
+"</h:form>]]>"
#. Tag: para
#: example.xml:17
#, no-c-format
-msgid ""
-"The actual work is done by a session scoped Web Bean that maintains "
-"information about the currently logged-in user and exposes the "
-"<literal>User</literal> entity to other Web Beans:"
-msgstr ""
-"实际的工作由一个会话范围的Web Bean完成。这个会话范围的Web Bean维护当前登录用"
-"户的信息,并且将<literal>User</literal>实体暴露给其他Web Bean:"
+msgid "The actual work is done by a session scoped Web Bean that maintains information about the currently logged-in user and exposes the <literal>User</literal> entity to other Web Beans:"
+msgstr "实际的工作由一个会话范围的Web Bean完成。这个会话范围的Web Bean维护当前登录用户的信息,并且将<literal>User</literal>实体暴露给其他Web Bean:"
#. Tag: programlisting
#: example.xml:21
@@ -124,8 +110,7 @@
" public void login() {\n"
" \n"
" List<User> results = userDatabase.createQuery(\n"
-" \"select u from User u where u.username=:username and u.password=:"
-"password\")\n"
+" \"select u from User u where u.username=:username and u.password=:password\")\n"
" .setParameter(\"username\", credentials.getUsername())\n"
" .setParameter(\"password\", credentials.getPassword())\n"
" .getResultList();\n"
@@ -161,8 +146,7 @@
" public void login() {\n"
" \n"
" List<User> results = userDatabase.createQuery(\n"
-" \"select u from User u where u.username=:username and u.password=:"
-"password\")\n"
+" \"select u from User u where u.username=:username and u.password=:password\")\n"
" .setParameter(\"username\", credentials.getUsername())\n"
" .setParameter(\"password\", credentials.getPassword())\n"
" .getResultList();\n"
@@ -246,10 +230,6 @@
#. Tag: para
#: example.xml:31
#, no-c-format
-msgid ""
-"Hopefully, this example gives a flavor of the Web Bean programming model. In "
-"the next chapter, we'll explore Web Beans dependency injection in greater "
-"depth."
-msgstr ""
-"希望这个例子能够让你尝试了Web Bean的编程模型。在下一章中,我们将更加深入的研"
-"究Web Bean的依赖注入。"
+msgid "Hopefully, this example gives a flavor of the Web Bean programming model. In the next chapter, we'll explore Web Beans dependency injection in greater depth."
+msgstr "希望这个例子能够让你尝试了Web Bean的编程模型。在下一章中,我们将更加深入的研究Web Bean的依赖注入。"
+
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1936 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-11 23:26:08 -0400 (Wed, 11 Mar 2009)
New Revision: 1936
Modified:
doc/trunk/reference/zh-CN/Book_Info.po
Log:
Modified: doc/trunk/reference/zh-CN/Book_Info.po
===================================================================
--- doc/trunk/reference/zh-CN/Book_Info.po 2009-03-12 03:20:56 UTC (rev 1935)
+++ doc/trunk/reference/zh-CN/Book_Info.po 2009-03-12 03:26:08 UTC (rev 1936)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-02-01 21:16+0000\n"
-"PO-Revision-Date: 2008-12-22 09:36+0800\n"
+"PO-Revision-Date: 2009-03-12 11:25+0800\n"
"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -17,34 +17,30 @@
#: Book_Info.xml:4
#, no-c-format
msgid "Web Beans: Java Contexts and Dependency Injection"
-msgstr ""
+msgstr "Web Beans: Java 上下文和依赖注入"
#. Tag: subtitle
#: Book_Info.xml:5
-#, fuzzy, no-c-format
-msgid ""
-"The new standard for dependency injection and contextual state management"
+#, no-c-format
+msgid "The new standard for dependency injection and contextual state management"
msgstr "关于依赖注入和上下文状态管理的Java新规范"
#~ msgid "Introduction to Web Beans"
#~ msgstr "Web Beans介绍"
-
#~ msgid "<firstname>Gavin</firstname> <surname>King</surname>"
#~ msgstr "<firstname>Gavin</firstname> <surname>King</surname>"
-
#~ msgid ""
#~ "<jobtitle>Web Beans (JSR-299) specification lead</jobtitle> <orgname>Red "
#~ "Hat Middleware LLC</orgname>"
#~ msgstr ""
#~ "<jobtitle>Web Beans (JSR-299) 规范领导人</jobtitle> <orgname>红帽中间件有"
#~ "限责任公司</orgname>"
-
#~ msgid "<firstname>Pete</firstname> <surname>Muir</surname>"
#~ msgstr "<firstname>Pete</firstname> <surname>Muir</surname>"
-
#~ msgid ""
#~ "<jobtitle>Web Beans (JSR-299) Reference Implementation lead</jobtitle> "
#~ "<orgname>Red Hat Middleware LLC</orgname>"
#~ msgstr ""
#~ "<jobtitle>Web Beans (JSR-299) 参考实现领导人</jobtitle> <orgname>红帽中间"
#~ "件有限责任公司</orgname>"
+
15 years, 10 months