Skip to content

Commit

Permalink
WELD-372, still needs work on verifying parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuir committed Jan 28, 2010
1 parent d921eb9 commit 392a7a9
Show file tree
Hide file tree
Showing 18 changed files with 989 additions and 107 deletions.
Expand Up @@ -80,14 +80,16 @@ public WeldException(List<Throwable> errors)
{
super();
StringBuilder errorMessage = new StringBuilder();
boolean firstError = true;
int i = 0;;
for (Throwable throwable : errors)
{
if (!firstError)
if (i > 0)
{
errorMessage.append('\n');
}
errorMessage.append("Exception #").append(i).append(" :");
errorMessage.append(throwable.getLocalizedMessage());
i++;
}
this.message = new WeldExceptionMessage(errorMessage.toString());
}
Expand Down
220 changes: 128 additions & 92 deletions impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion impl/src/main/java/org/jboss/weld/util/Beans.java
Expand Up @@ -672,7 +672,7 @@ public static <T> ConstructorInjectionPoint<T> getBeanConstructor(Bean<T> declar
{
if (initializerAnnotatedConstructors.size() > 1)
{
throw new DefinitionException(AMBIGUOUS_CONSTRUCTOR, type);
throw new DefinitionException(AMBIGUOUS_CONSTRUCTOR, type, initializerAnnotatedConstructors);
}
}
else if (initializerAnnotatedConstructors.size() == 1)
Expand Down
17 changes: 17 additions & 0 deletions impl/src/main/java/org/jboss/weld/util/reflection/Reflections.java
Expand Up @@ -635,5 +635,22 @@ public static boolean isSerializable(Class<?> clazz)
{
return clazz.isPrimitive() || Serializable.class.isAssignableFrom(clazz);
}

@SuppressWarnings("unchecked")
public static <T> Class<T> getRawType(Type type)
{
if (type instanceof Class<?>)
{
return (Class<T>) type;
}
else if (type instanceof ParameterizedType)
{
if (((ParameterizedType) type).getRawType() instanceof Class<?>)
{
return (Class<T>) ((ParameterizedType) type).getRawType();
}
}
return null;
}

}
Expand Up @@ -10,8 +10,8 @@ INITIALIZER_CANNOT_BE_DISPOSAL_METHOD=Initializer method {0} cannot have paramet
INITIALIZER_CANNOT_BE_OBSERVER=Initializer method {0} cannot be annotated @Observes on {1}
QUALIFIER_ON_FINAL_FIELD=Cannot place qualifiers on final fields: {0}
TOO_MANY_INITIALIZERS=Cannot have more than one constructor annotated with @Initializer for {0}
AMBIGUOUS_CONSTRUCTOR=Cannot determine constructor to use for {0}
INVALID_QUANTITY_INJECTABLE_FIELDS_AND_INITIALIZER_METHODS=injectableFields and initializerMethods must have the same size.\\n\\nInjectable Fields: {0}\\nInitializerMethods: {1}
AMBIGUOUS_CONSTRUCTOR=Cannot determine constructor to use for {0}. Possible constructors {1}
INVALID_QUANTITY_INJECTABLE_FIELDS_AND_INITIALIZER_METHODS=injectableFields and initializerMethods must have the same size.\\n\\nInjectable Fields\: {0}\\nInitializerMethods\: {1}
ANNOTATION_NOT_QUALIFIER=Annotation {0} is not a qualifier
REDUNDANT_QUALIFIER=Qualifier {0} is already present in the set {1}
UNABLE_TO_FIND_CONSTRUCTOR=Cannot determine constructor to use for {0}
Expand Down

0 comments on commit 392a7a9

Please sign in to comment.