Fedict / commons-eid

Java library to interact with the Belgian eID card
GNU Lesser General Public License v3.0
12 stars 5 forks source link

CardTerminals.list() may return different objects on subsequent calls #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
CardAndTerminalManager assumes that subsequent calls to CardTerminals.list() 
return the same CardTerminal objects every time. As far as I can tell from the 
smartcardio API documentation, this is not guaranteed. In fact, the 
jnasmartcardio implementation returns new objects every time.

The consequence is that CardAndTerminalManager will trigger 
terminalsDetached/terminalsAttached and cardsRemoved/cardsInserted events for 
every terminal and card present during each iteration.

At first sight, it looks relatively easy to fix, by using the CardTerminal name 
instead of the object to identity the terminals.

Original issue reported on code.google.com by bartcorn...@gmail.com on 16 Feb 2015 at 7:41