fix minor bug in the way config property change events were being fired

the way in which property change event handlers where comparing
properties to find out which was being changed would result in any
checks for properties without "section" values to never be matched
(as the propertyName string here would end up being ".name" or similar
and the actual property's name string would just be "name")
This commit is contained in:
Gered 2016-01-16 11:38:32 -05:00
parent 41ae37c789
commit 5242d629a5

View file

@ -99,7 +99,12 @@ public class Configuration implements Serializable {
Object old = subMap.get(key); Object old = subMap.get(key);
subMap.put(key, value); subMap.put(key, value);
this.pcSupport.firePropertyChange(section + "." + key, old, value); String propertyName;
if (section.length() == 0)
propertyName = key;
else
propertyName = section + "." + key;
this.pcSupport.firePropertyChange(propertyName, old, value);
} else { } else {
throw new NullPointerException("Null key"); throw new NullPointerException("Null key");
} }