rollback incorrect optimization

This commit is contained in:
Alexey Kudravtsev
2010-08-25 14:37:21 +04:00
parent 51ab66430b
commit dceb81ed3e
@@ -751,17 +751,14 @@ public class ContainerUtil {
@NotNull
public static <T, V> List<V> mapNotNull(Iterable<? extends T> iterable, Function<T, V> mapping) {
List<V> result = null;
List<V> result = new ArrayList<V>();
for (T t : iterable) {
final V o = mapping.fun(t);
if (o != null) {
if (result == null ) {
result = new ArrayList<V>();
}
result.add(o);
}
}
return result == null ? Collections.<V>emptyList() : result;
return result;
}
@NotNull