Browse files

DELTASPIKE-146 cleanup

  • Loading branch information...
1 parent 84ce679 commit 7c480a0513d047386a18fb169813300e1acb9dc7 @gpetracek gpetracek committed Apr 6, 2012
View
2 ...ore/impl/src/main/java/org/apache/deltaspike/core/impl/message/AbstractImmutableBean.java
@@ -73,6 +73,7 @@
* @param alternative True if the bean is an alternative
* @param nullable True if the bean is nullable
* @param injectionPoints the bean's injection points, if null an empty set is used
+ * @param toString the string which should be returned by #{@link #toString()}
* @throws IllegalArgumentException if the beanClass is null
*/
public AbstractImmutableBean(Class<?> beanClass,
@@ -129,6 +130,7 @@ public AbstractImmutableBean(Class<?> beanClass,
if (types == null)
{
+ //noinspection unchecked
this.types = ArraysUtils.<Type>asSet(Object.class, beanClass);
//X TODO re-visit after the logging discussion
View
2 ...core/impl/src/main/java/org/apache/deltaspike/core/impl/message/ImmutableBeanWrapper.java
@@ -93,6 +93,8 @@
* @param stereotypes the bean's stereotypes
* @param types the types of the bean
* @param alternative whether the bean is an alternative
+ * @param nullable true if the bean is nullable
+ * @param toString the string which should be returned by #{@link #toString()}
*/
public ImmutableBeanWrapper(Bean<T> bean,
String name,
View
17 deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/util/ArraysUtils.java
@@ -19,12 +19,12 @@
package org.apache.deltaspike.core.impl.util;
import javax.enterprise.inject.Typed;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
/**
- * A collection of utilities for working with Arrays that goes beyond that in
- * the JDK.
+ * A collection of utilities for working with Arrays
*/
@Typed()
public abstract class ArraysUtils
@@ -37,20 +37,15 @@ private ArraysUtils()
/**
* Create a set from an array. If the array contains duplicate objects, the
* last object in the array will be placed in resultant set.
- *
- * @param <T>
- * the type of the objects in the set
- * @param array
- * the array from which to create the set
+ *
+ * @param <T> the type of the objects in the set
+ * @param array the array from which to create the set
* @return the created sets
*/
public static <T> Set<T> asSet(T... array)
{
Set<T> result = new HashSet<T>();
- for (T a : array)
- {
- result.add(a);
- }
+ Collections.addAll(result, array);
return result;
}
}

0 comments on commit 7c480a0

Please sign in to comment.