better notNull() function v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 04 Jan 2014 15:11:49 +0100
branchv_0
changeset 12546eb1925f2bb
parent 124 9277b02a3b02
child 126 2357a9d08660
better notNull() function
java/sql-dk/src/info/globalcode/sql/dk/Functions.java
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/Functions.java	Fri Jan 03 22:09:05 2014 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/Functions.java	Sat Jan 04 15:11:49 2014 +0100
     1.3 @@ -23,9 +23,9 @@
     1.4  import java.io.IOException;
     1.5  import java.io.InputStreamReader;
     1.6  import java.io.PrintWriter;
     1.7 -import java.util.ArrayList;
     1.8  import java.util.Arrays;
     1.9  import java.util.Collection;
    1.10 +import java.util.Collections;
    1.11  import java.util.Map;
    1.12  
    1.13  /**
    1.14 @@ -86,7 +86,7 @@
    1.15  	 */
    1.16  	public static <T> Collection<T> notNull(Collection<T> c) {
    1.17  		if (c == null) {
    1.18 -			return new ArrayList<>();
    1.19 +			return Collections.emptyList();
    1.20  		} else {
    1.21  			return c;
    1.22  		}