Java 1.5
Mac OSX
GXT 1.2.3
If you instantiate BaseModel and then immediately use the remove() method, a NPE will be thrown. Looks like the underlying hash map is lazily created. BaseModel's parent actually does do a null check, but BaseModel overrides the parent method and uses the map without checking for null.
Original 1.2.3 Code:
Code:
public <X> X remove(String name) {
if (map.containsKey(name)) {
X oldValue = (X) super.remove(name);
notifyPropertyChanged(name, null, oldValue);
return oldValue;
}
return null;
}
The FIX:
Code:
public <X> X remove(String name) {
if (map != null && map.containsKey(name)) {
X oldValue = (X) super.remove(name);
notifyPropertyChanged(name, null, oldValue);
return oldValue;
}
return null;
}