Changeset 12196 in josm for trunk/src/org
- Timestamp:
- 2017-05-16T21:25:34+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/preferences
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/preferences/AbstractProperty.java
r12181 r12196 7 7 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; 8 8 import org.openstreetmap.josm.tools.ListenableWeakReference; 9 import org.openstreetmap.josm.tools.bugreport.BugReport; 9 10 10 11 /** … … 238 239 */ 239 240 public void addListener(ValueChangeListener<? super T> listener) { 240 addListenerImpl(new PreferenceChangedListenerAdapter(listener)); 241 try { 242 addListenerImpl(new PreferenceChangedListenerAdapter(listener)); 243 } catch (RuntimeException e) { 244 throw BugReport.intercept(e).put("listener", listener).put("preference", key); 245 } 241 246 } 242 247 … … 251 256 */ 252 257 public void addWeakListener(ValueChangeListener<? super T> listener) { 253 ValueChangeListener<T> weakListener = new WeakPreferenceAdapter(listener); 254 PreferenceChangedListenerAdapter adapter = new PreferenceChangedListenerAdapter(weakListener); 255 addListenerImpl(adapter); 258 try { 259 ValueChangeListener<T> weakListener = new WeakPreferenceAdapter(listener); 260 PreferenceChangedListenerAdapter adapter = new PreferenceChangedListenerAdapter(weakListener); 261 addListenerImpl(adapter); 262 } catch (RuntimeException e) { 263 throw BugReport.intercept(e).put("listener", listener).put("preference", key); 264 } 256 265 } 257 266 … … 281 290 */ 282 291 public void removeListener(ValueChangeListener<? super T> listener) { 283 removeListenerImpl(new PreferenceChangedListenerAdapter(listener)); 292 try { 293 removeListenerImpl(new PreferenceChangedListenerAdapter(listener)); 294 } catch (RuntimeException e) { 295 throw BugReport.intercept(e).put("listener", listener).put("preference", key); 296 } 284 297 } 285 298 -
trunk/src/org/openstreetmap/josm/data/preferences/AbstractToStringProperty.java
r12181 r12196 57 57 super.addListenerImpl(adapter); 58 58 parent.addListenerImpl(adapter); 59 } 60 61 @Override 62 protected void removeListenerImpl(PreferenceChangedListener adapter) { 63 super.removeListenerImpl(adapter); 64 parent.removeListenerImpl(adapter); 59 65 } 60 66
Note:
See TracChangeset
for help on using the changeset viewer.