From: Bob J. <jac...@us...> - 2008-12-29 08:10:23
|
Update of /cvsroot/jmri/jmri/jmrix/loconet In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24989/src/jmri/jmrix/loconet Modified Files: LocoNetSlot.java Log Message: fix some missing 1.5 parameterizations Index: LocoNetSlot.java =================================================================== RCS file: /cvsroot/jmri/jmri/jmrix/loconet/LocoNetSlot.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** LocoNetSlot.java 10 Aug 2008 14:38:10 -0000 1.18 --- LocoNetSlot.java 29 Dec 2008 08:10:19 -0000 1.19 *************** *** 3,7 **** package jmri.jmrix.loconet; ! import java.util.Vector; /** --- 3,8 ---- package jmri.jmrix.loconet; ! import java.util.List; ! import java.util.ArrayList; /** *************** *** 292,301 **** // data members to hold contact with the slot listeners ! final private Vector slotListeners = new Vector(); public synchronized void addSlotListener(SlotListener l) { // add only if not already registered if (!slotListeners.contains(l)) { ! slotListeners.addElement(l); } } --- 293,302 ---- // data members to hold contact with the slot listeners ! final private List<SlotListener> slotListeners = new ArrayList<SlotListener>(); public synchronized void addSlotListener(SlotListener l) { // add only if not already registered if (!slotListeners.contains(l)) { ! slotListeners.add(l); } } *************** *** 303,307 **** public synchronized void removeSlotListener(SlotListener l) { if (slotListeners.contains(l)) { ! slotListeners.removeElement(l); } } --- 304,308 ---- public synchronized void removeSlotListener(SlotListener l) { if (slotListeners.contains(l)) { ! slotListeners.remove(l); } } *************** *** 310,318 **** protected void notifySlotListeners() { ! // make a copy of the listener vector to synchronized not needed for transmit ! Vector v; synchronized(this) { ! v = (Vector) slotListeners.clone(); } if (log.isDebugEnabled()) log.debug("notify "+v.size() --- 311,319 ---- protected void notifySlotListeners() { ! // make a copy of the listener list to synchronized not needed for transmit ! List<SlotListener> v; synchronized(this) { ! v = new ArrayList<SlotListener>(slotListeners); } if (log.isDebugEnabled()) log.debug("notify "+v.size() *************** *** 321,325 **** int cnt = v.size(); for (int i=0; i < cnt; i++) { ! SlotListener client = (SlotListener) v.elementAt(i); client.notifyChangedSlot(this); } --- 322,326 ---- int cnt = v.size(); for (int i=0; i < cnt; i++) { ! SlotListener client = v.get(i); client.notifyChangedSlot(this); } |