* @since 5.3.0
*/
@SuppressWarnings("serial")
-public abstract class PropertyFormatter extends AbstractProperty implements Property.Viewer,
- Property.ValueChangeListener, Property.ReadOnlyStatusChangeListener {
+public abstract class PropertyFormatter extends AbstractProperty implements
+ Property.Viewer, Property.ValueChangeListener,
+ Property.ReadOnlyStatusChangeListener {
/** Datasource that stores the actual value. */
Property dataSource;
*/
@Override
public String toString() {
- if (dataSource == null || dataSource.getValue() == null) {
+ if (dataSource == null) {
+ return null;
+ }
+ Object value = dataSource.getValue();
+ if (value == null) {
return null;
}
- return format(dataSource.getValue());
+ return format(value);
}
/** Reflects the read-only status of the datasource. */