This code compiles fine in Java <= 1.4. Java 1.6 bitches and moans with the warning:
"The method add(Object) belongs to the raw type Collection. References to generic type Collection should be parameterized"
import org.apache.commons.collections.Buffer;
import org.apache.commons.collections.BufferUtils;
import org.apache.commons.collections.buffer.UnboundedFifoBuffer;
private Buffer connectqueue = BufferUtils.blockingBuffer(new UnboundedFifoBuffer());
...
connectqueue.add(new Conn(this, address, port));
How do I tweak the code to make that warning go away without adding a @SupressWarnings directive ?
The problem is Jakarta Commons Collections Buffer is non-generic, but extends the generic java.util.Collection interface.