diff options
author | Henri Sara <hesara@vaadin.com> | 2011-11-07 17:54:18 +0200 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2011-11-07 17:54:18 +0200 |
commit | c93efdf86d84ae42e67f344ad5fdd13e197f952a (patch) | |
tree | ac74b5b541dc37ff97b5eb638b5956999d00e415 /src/com/vaadin/ui/AbstractTextField.java | |
parent | b7dc0286b82ee10fb7ac991d88040afe157f74a4 (diff) | |
download | vaadin-framework-c93efdf86d84ae42e67f344ad5fdd13e197f952a.tar.gz vaadin-framework-c93efdf86d84ae42e67f344ad5fdd13e197f952a.zip |
Partly eliminate the use of Property.toString().
The toString() method should not be used on a property to get its value.
Added getStringValue() to AbstractField, Label etc. Using them
where applicable. Added comments to some problematic locations where
Property.toString() is known to be used.
AbstractField.toString() and Label.toString() still return the same
values as before, but it will throw an exception in future revisions.
Migration needed: Replace explicit and implicit uses of
Property.toString() with use property.getValue() and its
string representation.
Alternatively, use AbstractProperty.getStringValue() and
AbstractField.getStringValue() instead of Property.toString() during
migration.
Diffstat (limited to 'src/com/vaadin/ui/AbstractTextField.java')
-rw-r--r-- | src/com/vaadin/ui/AbstractTextField.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/vaadin/ui/AbstractTextField.java b/src/com/vaadin/ui/AbstractTextField.java index 62904330c2..8d775c862e 100644 --- a/src/com/vaadin/ui/AbstractTextField.java +++ b/src/com/vaadin/ui/AbstractTextField.java @@ -373,7 +373,7 @@ public abstract class AbstractTextField extends AbstractField implements @Override protected boolean isEmpty() { - return super.isEmpty() || toString().length() == 0; + return super.isEmpty() || getStringValue().length() == 0; } /** @@ -751,4 +751,4 @@ public abstract class AbstractTextField extends AbstractField implements removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener); } -}
\ No newline at end of file +} |