]> source.dussan.org Git - vaadin-framework.git/commitdiff
Replace single character Strings with character literals
authorPer-Åke Minborg <minborg@speedment.com>
Fri, 28 Oct 2016 15:34:28 +0000 (08:34 -0700)
committerPekka Hyvönen <pekka@vaadin.com>
Wed, 2 Nov 2016 15:07:20 +0000 (15:07 +0000)
Change-Id: I80b73b653e97904605dc62484a7448f3bfbf721a

server/src/main/java/com/vaadin/server/LocaleService.java
server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java
server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java
server/src/main/java/com/vaadin/ui/Embedded.java
server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java
server/src/main/java/com/vaadin/util/FileTypeResolver.java

index 457f014dc5b64f1bd586009d2502a2aaacd7f500..98bbc8275a1b66114b700a8f8de28d38ff8bb558 100644 (file)
@@ -168,11 +168,11 @@ public class LocaleService implements Serializable {
         }
         final String df = ((SimpleDateFormat) dateFormat).toPattern();
 
-        int timeStart = df.indexOf("H");
+        int timeStart = df.indexOf('H');
         if (timeStart < 0) {
-            timeStart = df.indexOf("h");
+            timeStart = df.indexOf('h');
         }
-        final int ampm_first = df.indexOf("a");
+        final int ampm_first = df.indexOf('a');
         // E.g. in Korean locale AM/PM is before h:mm
         // TODO should take that into consideration on client-side as well,
         // now always h:mm a
index fe950b4318e5c5fde34222012e2d6b6aa54e3d7a..92684a689e9dfd90c5130ce377dfbbc4413b7715 100644 (file)
@@ -152,7 +152,7 @@ public class SASSAddonImportFileCreator {
 
             // Convention is to name the mixin after the stylesheet. Strip
             // .scss from filename
-            String mixin = file.substring(file.lastIndexOf("/") + 1,
+            String mixin = file.substring(file.lastIndexOf('/') + 1,
                     file.length() - ".scss".length());
 
             foundMixins.add(mixin);
@@ -170,11 +170,11 @@ public class SASSAddonImportFileCreator {
 
         try {
             // Try to parse path for better readability
-            path = path.substring(path.lastIndexOf(":") + 1,
-                    path.lastIndexOf("!"));
+            path = path.substring(path.lastIndexOf(':') + 1,
+                    path.lastIndexOf('!'));
 
             // Extract jar archive filename
-            path = path.substring(path.lastIndexOf("/") + 1);
+            path = path.substring(path.lastIndexOf('/') + 1);
 
         } catch (Exception e) {
             // Parsing failed but no worries, we then use whatever
index 42320cb02fafe89445d541049093d9cd2ddcd3eb..9bc01e7ce255a11efd18e8d4d55af3e7af37c0d9 100644 (file)
@@ -211,7 +211,7 @@ public class ClassPathExplorer {
                 // remove the .gwt.xml extension
                 String classname = file.substring(0, file.length() - 8);
                 String packageName = locationString
-                    .substring(locationString.lastIndexOf("/") + 1);
+                    .substring(locationString.lastIndexOf('/') + 1);
                 classname = packageName + "." + classname;
                 if (!WidgetSetBuilder.isWidgetset(classname)) {
                     // Only return widgetsets and not GWT modules to avoid
index e4dcee096fda125542d54805a12ec8c5382a0689..4d4c3472b59ff071c6b66d440760e8da5c31fe47 100644 (file)
@@ -451,7 +451,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent {
 
             if (mt.equals("image/svg+xml")) {
                 type = TYPE_OBJECT;
-            } else if ((mt.substring(0, mt.indexOf("/"))
+            } else if ((mt.substring(0, mt.indexOf('/'))
                     .equalsIgnoreCase("image"))) {
                 type = TYPE_IMAGE;
             } else {
index 023d54c7f436de018becaf8a563231a8ccc457d9..41b2e851f3762347798d81f8ece822ac63bf6dde 100644 (file)
@@ -134,7 +134,7 @@ public class ColorPickerPreview extends CssLayout implements HasValue<Color> {
 
                 } else if (value.startsWith("rgb")) {
                     // RGB color format rgb/rgba(255,255,255,0.1)
-                    String[] colors = value.substring(value.indexOf("(") + 1,
+                    String[] colors = value.substring(value.indexOf('(') + 1,
                             value.length() - 1).split(",");
 
                     int red = Integer.parseInt(colors[0]);
@@ -150,7 +150,7 @@ public class ColorPickerPreview extends CssLayout implements HasValue<Color> {
 
                 } else if (value.startsWith("hsl")) {
                     // HSL color format hsl/hsla(100,50%,50%,1.0)
-                    String[] colors = value.substring(value.indexOf("(") + 1,
+                    String[] colors = value.substring(value.indexOf('(') + 1,
                             value.length() - 1).split(",");
 
                     int hue = Integer.parseInt(colors[0]);
index da0d3df8534b57864631e4044cc94b6151369b1d..39da3da890539964fb919ee1fd4fef35aef10cfa 100644 (file)
@@ -254,9 +254,9 @@ public class FileTypeResolver implements Serializable {
         }
 
         // Calculates the extension of the file
-        int dotIndex = fileName.indexOf(".");
-        while (dotIndex >= 0 && fileName.indexOf(".", dotIndex + 1) >= 0) {
-            dotIndex = fileName.indexOf(".", dotIndex + 1);
+        int dotIndex = fileName.indexOf('.');
+        while (dotIndex >= 0 && fileName.indexOf('.', dotIndex + 1) >= 0) {
+            dotIndex = fileName.indexOf('.', dotIndex + 1);
         }
         dotIndex++;