Skip to content

Commit

Permalink
DELTASPIKE-146 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetracek committed Apr 5, 2012
1 parent 84ce679 commit 7c480a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ abstract class AbstractImmutableBean<T> implements Bean<T>
* @param alternative True if the bean is an alternative * @param alternative True if the bean is an alternative
* @param nullable True if the bean is nullable * @param nullable True if the bean is nullable
* @param injectionPoints the bean's injection points, if null an empty set is used * @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 * @throws IllegalArgumentException if the beanClass is null
*/ */
public AbstractImmutableBean(Class<?> beanClass, public AbstractImmutableBean(Class<?> beanClass,
Expand Down Expand Up @@ -129,6 +130,7 @@ public AbstractImmutableBean(Class<?> beanClass,


if (types == null) if (types == null)
{ {
//noinspection unchecked
this.types = ArraysUtils.<Type>asSet(Object.class, beanClass); this.types = ArraysUtils.<Type>asSet(Object.class, beanClass);


//X TODO re-visit after the logging discussion //X TODO re-visit after the logging discussion
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class ImmutableBeanWrapper<T> extends AbstractImmutableBean<T>
* @param stereotypes the bean's stereotypes * @param stereotypes the bean's stereotypes
* @param types the types of the bean * @param types the types of the bean
* @param alternative whether the bean is an alternative * @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, public ImmutableBeanWrapper(Bean<T> bean,
String name, String name,
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package org.apache.deltaspike.core.impl.util; package org.apache.deltaspike.core.impl.util;


import javax.enterprise.inject.Typed; import javax.enterprise.inject.Typed;
import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;


/** /**
* A collection of utilities for working with Arrays that goes beyond that in * A collection of utilities for working with Arrays
* the JDK.
*/ */
@Typed() @Typed()
public abstract class ArraysUtils public abstract class ArraysUtils
Expand All @@ -37,20 +37,15 @@ private ArraysUtils()
/** /**
* Create a set from an array. If the array contains duplicate objects, the * Create a set from an array. If the array contains duplicate objects, the
* last object in the array will be placed in resultant set. * last object in the array will be placed in resultant set.
* *
* @param <T> * @param <T> the type of the objects in the set
* the type of the objects in the set * @param array the array from which to create the set
* @param array
* the array from which to create the set
* @return the created sets * @return the created sets
*/ */
public static <T> Set<T> asSet(T... array) public static <T> Set<T> asSet(T... array)
{ {
Set<T> result = new HashSet<T>(); Set<T> result = new HashSet<T>();
for (T a : array) Collections.addAll(result, array);
{
result.add(a);
}
return result; return result;
} }
} }

0 comments on commit 7c480a0

Please sign in to comment.