/** Returns the list obtained from 'l' after removing all elements 'elem' */ public static <A> List<A> filter(List<A> l, A elem) { Assert.checkNonNull(elem); List<A> res = List.nil(); for (A a : l) { if (a != null && !a.equals(elem)) { res = res.prepend(a); } } return res.reverse(); }
public void setWriter(WriterKind kind, PrintWriter pw) { Assert.checkNonNull(pw); switch (kind) { case NOTICE: noticeWriter = pw; break; case WARNING: warnWriter = pw; break; case ERROR: errWriter = pw; break; default: throw new IllegalArgumentException(); } }
public void setWriters(PrintWriter pw) { noticeWriter = warnWriter = errWriter = Assert.checkNonNull(pw); }
public void setEndPosTable(JavaFileObject name, EndPosTable endPosTable) { Assert.checkNonNull(name); getSource(name).setEndPosTable(endPosTable); }
public Enum(Type type, VarSymbol value) { super(type); this.value = Assert.checkNonNull(value); }