diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-09-21 10:51:51 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-09-21 11:51:51 +0300 |
commit | 867006d2f81aa813c36f614fc6f1b98a5937c5f3 (patch) | |
tree | fb2c34b1b58db8b3610a4a47010196069e90c436 /compatibility-server | |
parent | 719b12e44afc8b62458b1e29d1503e28544acc24 (diff) | |
download | vaadin-framework-867006d2f81aa813c36f614fc6f1b98a5937c5f3.tar.gz vaadin-framework-867006d2f81aa813c36f614fc6f1b98a5937c5f3.zip |
Use String.isEmpty() (#10045)
Diffstat (limited to 'compatibility-server')
10 files changed, 12 insertions, 12 deletions
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/Validator.java b/compatibility-server/src/main/java/com/vaadin/v7/data/Validator.java index 00fb4b86fa..f226622359 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/Validator.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/Validator.java @@ -136,7 +136,7 @@ public interface Validator extends Serializable { */ public boolean isInvisible() { String msg = getMessage(); - if (msg != null && msg.length() > 0) { + if (msg != null && !msg.isEmpty()) { return false; } if (causes != null) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedMethodProperty.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedMethodProperty.java index b7c838c09e..6cbff702ad 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedMethodProperty.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedMethodProperty.java @@ -146,7 +146,7 @@ public class NestedMethodProperty<T> extends AbstractProperty<T> { } for (int i = 0; i < simplePropertyNames.length; i++) { String simplePropertyName = simplePropertyNames[i].trim(); - if (simplePropertyName.length() > 0) { + if (!simplePropertyName.isEmpty()) { lastSimplePropertyName = simplePropertyName; lastClass = propertyClass; try { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/StringToCollectionConverter.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/StringToCollectionConverter.java index 13cef7ece3..8b65f7fc44 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/StringToCollectionConverter.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/StringToCollectionConverter.java @@ -187,7 +187,7 @@ public class StringToCollectionConverter } builder.append(delimiter); } - if (builder.length() > 0) { + if (builder.length() != 0) { return builder.substring(0, builder.length() - delimiter.length()); } else { return builder.toString(); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowId.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowId.java index ccc010924b..d02f504d56 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowId.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowId.java @@ -73,7 +73,7 @@ public class RowId implements Serializable { builder.append(id); builder.append('/'); } - if (builder.length() > 0) { + if (builder.length() != 0) { return builder.substring(0, builder.length() - 1); } return builder.toString(); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java index 45f33eefbe..8c1282673e 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java @@ -267,7 +267,7 @@ public class FreeformQuery extends AbstractTransactionalQuery StatementHelper sh = ((FreeformStatementDelegate) delegate) .getCountStatement(); if (sh != null && sh.getQueryString() != null - && sh.getQueryString().length() > 0) { + && !sh.getQueryString().isEmpty()) { return true; } } catch (UnsupportedOperationException e) { @@ -276,7 +276,7 @@ public class FreeformQuery extends AbstractTransactionalQuery } try { String queryString = delegate.getQueryString(0, 50); - return queryString != null && queryString.length() > 0; + return queryString != null && !queryString.isEmpty(); } catch (UnsupportedOperationException e) { return false; } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractSelect.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractSelect.java index a89818222c..e89c72fa4c 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractSelect.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractSelect.java @@ -465,7 +465,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements // New option entered (and it is allowed) if (isNewItemsAllowed()) { final String newitem = (String) variables.get("newitem"); - if (newitem != null && newitem.length() > 0) { + if (newitem != null && !newitem.isEmpty()) { getNewItemHandler().addNewItem(newitem); } } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractTextField.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractTextField.java index 5fa82535bc..72e8c6dffb 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractTextField.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractTextField.java @@ -327,7 +327,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements @Override public boolean isEmpty() { - return super.isEmpty() || getValue().length() == 0; + return super.isEmpty() || getValue().isEmpty(); } /** diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Calendar.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Calendar.java index 0fea65ebce..b37c9c7e2b 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Calendar.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Calendar.java @@ -1825,7 +1825,7 @@ public class Calendar extends AbstractLegacyComponent @Override public void weekClick(String event) { - if (event.length() > 0 && event.contains("w")) { + if (!event.isEmpty() && event.contains("w")) { String[] splitted = event.split("w"); if (splitted.length == 2) { try { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java index 8a9db41624..b9960bba4f 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java @@ -188,7 +188,7 @@ public class ComboBox extends AbstractSelect } private boolean isFilteringNeeded() { - return filterstring != null && filterstring.length() > 0 + return filterstring != null && !filterstring.isEmpty() && filteringMode != FilteringMode.OFF; } @@ -762,7 +762,7 @@ public class ComboBox extends AbstractSelect } else if (isNewItemsAllowed()) { // New option entered (and it is allowed) final String newitem = (String) variables.get("newitem"); - if (newitem != null && newitem.length() > 0) { + if (newitem != null && !newitem.isEmpty()) { getNewItemHandler().addNewItem(newitem); // rebuild list filterstring = null; diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/RichTextArea.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/RichTextArea.java index 3b6d4f7b5a..1e4bf1df71 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/RichTextArea.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/RichTextArea.java @@ -294,7 +294,7 @@ public class RichTextArea extends AbstractField<String> @Override public boolean isEmpty() { - return super.isEmpty() || getValue().length() == 0; + return super.isEmpty() || getValue().isEmpty(); } @Override |