[Rxtx] NRJavaSerial, a fork of rxtx that fixes the papercuts!
Andre-John Mas
ajmas at sympatico.ca
Mon Mar 28 20:03:03 MDT 2011
On 28-Mar-2011, at 15:43, Chris Bartley wrote:
> Exposing your class member collection to direct modification by user code should almost certainly be considered a bug. As it stands now, there's nothing preventing someone from doing this:
>
> final RXTXCommDriver rxtxCommDriver = ...; // I haven't looked at the code carefully to see how one gets a reference...doesn't matter
> final Set<String> ports = rxtxCommDriver.getPortIdentifiers();
> ports.clear();
Certainly, but you can use Collections.unmodifiableSet() to protect against this.
Andre
More information about the Rxtx
mailing list