[Rxtx] NRJavaSerial, a fork of rxtx that fixes the papercuts!
Kevin Harrington NR
kharrington at neuronrobotics.com
Mon Mar 28 12:57:42 MDT 2011
>Either way, the code as it stands now is buggy because the client could
modify your Set.
>Chris
>[1]
http://code.google.com/p/nrjavaserial/source/browse/trunk/nrjavaserial/src/main/java/gnu/io/RXTXCommDriver.java
Well the Set<> was left modifiable by intention. If a user wanted to
artificially add an option to the list (maybe to add in linux the
/dev/serial/by-id/* dev nodes which are not mapped normally) then they are
free to do that in user land for their application without having to create
a new object. Likewise, if they added the /dev/serial/by-id/ node for a
port, they would need to remove the duplicate that exists in the Set. I see
no reasonable reason to remove this option from the user, mostly because
having the option adds to the usability and does not detract from it. I
would say that maybe the documentation has a bug by not stating that
possible use case, but think it is unfair to label the code as buggy. As i
stated before, the goal is to make the library more friendly to the end
user.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qbang.org/pipermail/rxtx/attachments/20110328/3a6066f9/attachment-0448.htm>
More information about the Rxtx
mailing list