Skip to content

Commit

Permalink
Fixed removeAll bug - should be ready for primetime
Browse files Browse the repository at this point in the history
  • Loading branch information
theterg committed Sep 28, 2011
1 parent 7169405 commit 5bc453b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions com.buglabs.xbee/com/buglabs/xbee/XBeeMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,9 @@ public void addPredictive(Class proto) {

@Override
public void removeAll(Class proto) {
dlog("removing "+proto.getName()+" from list...");
boolean success = expectedProtocols.remove(proto);
dlog("..."+success);
for (Map.Entry<XBeeAddress, XBeeProtocol> entry : protocols.entrySet()){
Map<XBeeAddress, XBeeProtocol> copyOfProtocols = new HashMap<XBeeAddress, XBeeProtocol>(protocols);
for (Map.Entry<XBeeAddress, XBeeProtocol> entry : copyOfProtocols.entrySet()){
if (entry.getValue().getClass() == proto){
dlog("removing protocol at "+ByteUtils.toBase16(entry.getKey().getAddress()));
protocols.remove(entry.getKey());
Expand Down

0 comments on commit 5bc453b

Please sign in to comment.