eXtreme Development

Java - remover objeto nulo de lista

de:
ArrayList<String> values = new ArrayList<String>(checker.values());
ArrayList<String> removals = new ArrayList<String>();
removals.add(null);
para:
values.removeAll(Collections.singleton(null));
ou:
public static String[] clean(final String[] v) {
    List<String> list = new ArrayList<String>(Arrays.asList(v));
    list.removeAll(Collections.singleton(null));
    return list.toArray(new String[list.size()]);
}
ou:
while(tourists.remove(null));


SourceForge BootStrap