Ticket #19196: 19196.3.patch

File 19196.3.patch, 1.3 KB (added by taylor.smock, 5 years ago)

Fix unit tests

  • src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

     
    4949
    5050    private static final class MapPaintStylesPreferenceListener implements PreferenceChangedListener {
    5151        private final IPreferences pref;
     52        /** Preferences to ignore (i.e., if they change, don't reload) */
     53        private final List<String> preferenceIgnoreList;
    5254
    5355        MapPaintStylesPreferenceListener(IPreferences pref) {
    5456            this.pref = pref;
     57            this.preferenceIgnoreList = Arrays.asList("mappaint.style.entries", "mappaint.style.known-defaults");
    5558        }
    5659
    5760        @Override
    5861        public void preferenceChanged(PreferenceChangeEvent e) {
    59             if (e.getKey().contains("mappaint")) {
     62            if (e.getKey().contains("mappaint") && !this.preferenceIgnoreList.contains(e.getKey())) {
    6063                // We need to remove this from the listeners, so that we don't recursively call ourselves.
    6164                pref.removePreferenceChangeListener(this);
    6265                MapPaintStyles.readFromPreferences();