Regarding null safe oprators

Vimil Saju vimilsaju at yahoo.com
Wed Jul 15 15:33:45 PDT 2009


If null-safe operators are going to be a part of JDK-7, is it possible to modify the new 'for loop' syntax so that a null pointer exception is not thrown if the list or array over which the loop iterates is null?

Currently the below code will throw a NPE because integerList is null.

List<Integer> integerList = null;
for(Integer i: integerList) {

}


      


More information about the coin-dev mailing list