From 100f252a56c4159088915e435f1ca91a64230f3f Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Wed, 20 Feb 2013 09:44:43 +0200 Subject: Merge of (#9940) to Vaadin 7 Change-Id: Ie2e53c8cdba20c8265fa04e35e9469b39b21d43e --- client/src/com/vaadin/client/ui/VTextField.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'client') diff --git a/client/src/com/vaadin/client/ui/VTextField.java b/client/src/com/vaadin/client/ui/VTextField.java index 1229eda093..0fbed0dd90 100644 --- a/client/src/com/vaadin/client/ui/VTextField.java +++ b/client/src/com/vaadin/client/ui/VTextField.java @@ -272,19 +272,16 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, /** For internal use only. May be removed or replaced in the future. */ public void setMaxLength(int newMaxLength) { - if (newMaxLength >= 0 && newMaxLength != maxLength) { - maxLength = newMaxLength; - updateMaxLength(maxLength); - } else if (maxLength != -1) { - maxLength = -1; - updateMaxLength(maxLength); + if (newMaxLength == maxLength) { + return; } - + maxLength = newMaxLength; + updateMaxLength(maxLength); } /** - * This method is reponsible for updating the DOM or otherwise ensuring that - * the given max length is enforced. Called when the max length for the + * This method is responsible for updating the DOM or otherwise ensuring + * that the given max length is enforced. Called when the max length for the * field has changed. * * @param maxLength -- cgit v1.2.3