Skip to content

Commit

Permalink
Merge pull request #1 from mbee-dev/fix
Browse files Browse the repository at this point in the history
Fix
  • Loading branch information
Bradley J Clement authored and Bradley J Clement committed Jul 4, 2014
2 parents 9113580 + eb6ec09 commit 1bd069b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>gov.nasa.jpl.mbee.util</groupId>
<artifactId>mbee_util</artifactId>
<version>0.0.3</version>
<version>0.0.4</version>
<name>mbee_util</name>
<description>MBEE java utilities</description>
<distributionManagement>
Expand Down
2 changes: 1 addition & 1 deletion src/gov/nasa/jpl/mbee/util/Seen.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface Seen< E > extends Set< E > {

/**
* Manage a "seen" set for avoiding infinite recursion. If the element is not
* in the set, add it and return {@code false). Otherwise, the element has
* in the set, add it and return {@code false}. Otherwise, the element has
* been seen; return {@code true}.
*
* @param o
Expand Down
14 changes: 12 additions & 2 deletions src/gov/nasa/jpl/mbee/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,24 @@ public class Utils {

// empty collection constants
public static final List<?> emptyList = Collections.EMPTY_LIST;//new ArrayList( 0 );
public static final ArrayList<?> emptyArrayList = new ArrayList( 0 );
@SuppressWarnings( "unchecked" )
public static <T> List<T> getEmptyList() {
return (List< T >)emptyList;
}
@SuppressWarnings( "unchecked" )
public static < T > ArrayList< T > getEmptyArrayList() {
return (ArrayList< T >)emptyArrayList;
}
@SuppressWarnings( "unchecked" )
public static <T> List<T> getEmptyList(Class<T> cls) {
return (List< T >)emptyList;
}
@SuppressWarnings( "unchecked" )
public static <T> ArrayList<T> getEmptyArrayList(Class<T> cls) {
return (ArrayList< T >)emptyArrayList;
}

public static final Set<?> emptySet = Collections.EMPTY_SET;//new TreeSet();
@SuppressWarnings( "unchecked" )
public static <T> Set<T> getEmptySet() {
Expand Down Expand Up @@ -458,8 +468,8 @@ public static <V, T> List<V> asList( Object o, Class<V> cls ) {
* @return a new {@link List} containing
* the elements of c cast to type V
*/
public static <V, T> List<V> asList( Collection<T> c, Class<V> cls ) {
List<V> list = new ArrayList< V >();
public static <V, T> ArrayList<V> asList( Collection<T> c, Class<V> cls ) {
ArrayList<V> list = new ArrayList< V >();
for ( T t : c ) {
if (t == null || cls == null || cls.isAssignableFrom( t.getClass() ) ) {
try {
Expand Down

0 comments on commit 1bd069b

Please sign in to comment.