diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-10-20 10:10:02 +0200 |
---|---|---|
committer | Péter Török <31210544+torok-peter@users.noreply.github.com> | 2017-10-20 11:10:02 +0300 |
commit | a9c83ba07e4dec90eb7d6e332b91adde9613ebb4 (patch) | |
tree | 7907a6c389ae740572197d949e27c6fd3c25491c /compatibility-client | |
parent | 0a26d0e44169f9643e7d30ba370b8ecbbe128a56 (diff) | |
download | vaadin-framework-a9c83ba07e4dec90eb7d6e332b91adde9613ebb4.tar.gz vaadin-framework-a9c83ba07e4dec90eb7d6e332b91adde9613ebb4.zip |
Use .toLowerCase and .toUpperCase(Locale.ROOT) (#10182)
* Use .toLowerCase and .toUpperCase(Locale.ROOT)
* Spaces
* add spaces after if(
Diffstat (limited to 'compatibility-client')
3 files changed, 17 insertions, 12 deletions
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java index bbbf33f5a4..0d1830e829 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java @@ -21,6 +21,7 @@ import java.util.Collection; import java.util.Date; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Set; import com.google.gwt.aria.client.Roles; @@ -934,7 +935,7 @@ public class VFilterSelect extends Composite private void setTdWidth(Node parent, int width) { for (int i = 0; i < parent.getChildCount(); i++) { Node child = parent.getChild(i); - if ("td".equals(child.getNodeName().toLowerCase())) { + if ("td".equals(child.getNodeName().toLowerCase(Locale.ROOT))) { ((Element) child).getStyle().setWidth(width, Unit.PX); } else { setTdWidth(child, width); @@ -1204,10 +1205,11 @@ public class VFilterSelect extends Composite } } else if (item != null && !"".equals(lastFilter) && (filteringmode == FilteringMode.CONTAINS - ? item.getText().toLowerCase() - .contains(lastFilter.toLowerCase()) - : item.getText().toLowerCase() - .startsWith(lastFilter.toLowerCase()))) { + ? item.getText().toLowerCase(Locale.ROOT).contains( + lastFilter.toLowerCase(Locale.ROOT)) + : item.getText().toLowerCase(Locale.ROOT) + .startsWith(lastFilter + .toLowerCase(Locale.ROOT)))) { doItemAction(item, true); } else { // currentSuggestion has key="" for nullselection diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java index af255c4e5b..16817fd82d 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java @@ -23,6 +23,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.logging.Level; @@ -5904,8 +5905,8 @@ public class VScrollTable extends FlowPanel TooltipInfo info = null; final Element targetTdOrTr = getTdOrTr(target); - if (targetTdOrTr != null && "td" - .equals(targetTdOrTr.getTagName().toLowerCase())) { + if (targetTdOrTr != null && "td".equals( + targetTdOrTr.getTagName().toLowerCase(Locale.ROOT))) { TableCellElement td = (TableCellElement) targetTdOrTr .cast(); info = cellToolTips.get(td); @@ -7593,7 +7594,7 @@ public class VScrollTable extends FlowPanel && row.rowKey == lastEmphasized.overkey) { String stylename = ROWSTYLEBASE + lastEmphasized.dropLocation.toString() - .toLowerCase(); + .toLowerCase(Locale.ROOT); VScrollTableRow.setStyleName(row.getElement(), stylename, false); lastEmphasized = null; @@ -7614,8 +7615,8 @@ public class VScrollTable extends FlowPanel for (Widget w : scrollBody.renderedRows) { VScrollTableRow row = (VScrollTableRow) w; if (details != null && details.overkey == row.rowKey) { - String stylename = ROWSTYLEBASE - + details.dropLocation.toString().toLowerCase(); + String stylename = ROWSTYLEBASE + details.dropLocation + .toString().toLowerCase(Locale.ROOT); VScrollTableRow.setStyleName(row.getElement(), stylename, true); lastEmphasized = details; diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/combobox/ComboBoxConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/combobox/ComboBoxConnector.java index b3b4405a1b..e064eb9dad 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/combobox/ComboBoxConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/combobox/ComboBoxConnector.java @@ -17,6 +17,7 @@ package com.vaadin.v7.client.ui.combobox; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; @@ -202,8 +203,9 @@ public class ComboBoxConnector extends AbstractFieldConnector } } - if ((getWidget().waitingForFilteringResponse && getWidget().lastFilter - .toLowerCase().equals(uidl.getStringVariable("filter"))) + if ((getWidget().waitingForFilteringResponse + && getWidget().lastFilter.toLowerCase(Locale.ROOT) + .equals(uidl.getStringVariable("filter"))) || popupOpenAndCleared) { getWidget().suggestionPopup.showSuggestions( |