changeset 10147:b481f0ea5200

8044460: Cleanup new Boolean and single character strings Reviewed-by: pchelko, serb, rriggs Contributed-by: otaviopolianasantana@gmail.com
author rriggs
date Tue, 03 Jun 2014 11:18:03 -0400
parents 535f335f0a7d
children 6d4b3a9ca33d
files src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java src/share/classes/javax/swing/JEditorPane.java src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java src/share/classes/sun/applet/AppletClassLoader.java src/share/classes/sun/awt/FontConfiguration.java src/share/classes/sun/font/SunFontManager.java src/share/classes/sun/font/Type1Font.java
diffstat 7 files changed, 11 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Mon Jun 02 15:25:43 2014 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Tue Jun 03 11:18:03 2014 -0400
@@ -547,7 +547,7 @@
                             i = strLowerCase.indexOf("<stringvalue>", i);
                             if (i > 0) {
                                 i += "<stringvalue>".length();
-                                int i2 = str.indexOf("<", i);
+                                int i2 = str.indexOf('<', i);
                                 return str.substring(i, i2);
                             }
                         }
--- a/src/share/classes/javax/swing/JEditorPane.java	Mon Jun 02 15:25:43 2014 +0400
+++ b/src/share/classes/javax/swing/JEditorPane.java	Tue Jun 03 11:18:03 2014 -0400
@@ -965,7 +965,7 @@
         // The type could have optional info is part of it,
         // for example some charset info.  We need to strip that
         // of and save it.
-        int parm = type.indexOf(";");
+        int parm = type.indexOf(';');
         if (parm > -1) {
             // Save the paramList.
             String paramList = type.substring(parm);
--- a/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java	Mon Jun 02 15:25:43 2014 +0400
+++ b/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java	Tue Jun 03 11:18:03 2014 -0400
@@ -653,7 +653,7 @@
 
         // strip off the prefix, if there is one.
         String fullKey = key.toString();
-        String partialKey = fullKey.substring(fullKey.indexOf(".") + 1);
+        String partialKey = fullKey.substring(fullKey.indexOf('.') + 1);
 
         Object obj = null;
         int xstate = getExtendedState(ctx, v);
--- a/src/share/classes/sun/applet/AppletClassLoader.java	Mon Jun 02 15:25:43 2014 +0400
+++ b/src/share/classes/sun/applet/AppletClassLoader.java	Tue Jun 03 11:18:03 2014 -0400
@@ -168,7 +168,7 @@
      */
     protected Class findClass(String name) throws ClassNotFoundException {
 
-        int index = name.indexOf(";");
+        int index = name.indexOf(';');
         String cookie = "";
         if(index != -1) {
                 cookie = name.substring(index, name.length());
@@ -608,7 +608,7 @@
 
         // deal with URL rewriting
         String cookie = null;
-        int index = name.indexOf(";");
+        int index = name.indexOf(';');
         if(index != -1) {
                 cookie = name.substring(index, name.length());
                 name = name.substring(0, index);
--- a/src/share/classes/sun/awt/FontConfiguration.java	Mon Jun 02 15:25:43 2014 +0400
+++ b/src/share/classes/sun/awt/FontConfiguration.java	Tue Jun 03 11:18:03 2014 -0400
@@ -272,9 +272,9 @@
             if (configFile != null) {
                 return configFile;
             }
-            int decimalPointIndex = osVersion.indexOf(".");
+            int decimalPointIndex = osVersion.indexOf('.');
             if (decimalPointIndex != -1) {
-                osMajorVersion = osVersion.substring(0, osVersion.indexOf("."));
+                osMajorVersion = osVersion.substring(0, osVersion.indexOf('.'));
                 configFile = findImpl(baseName + "." + osName + "." + osMajorVersion);
                 if (configFile != null) {
                     return configFile;
--- a/src/share/classes/sun/font/SunFontManager.java	Mon Jun 02 15:25:43 2014 +0400
+++ b/src/share/classes/sun/font/SunFontManager.java	Tue Jun 03 11:18:03 2014 -0400
@@ -2872,8 +2872,7 @@
                 new java.security.PrivilegedAction<Object>() {
                         public Object run() {
                             SecurityManager sm = System.getSecurityManager();
-                            return new Boolean
-                                (sm instanceof sun.applet.AppletSecurity);
+                            return sm instanceof sun.applet.AppletSecurity;
                         }
                     });
         return appletSM.booleanValue();
--- a/src/share/classes/sun/font/Type1Font.java	Mon Jun 02 15:25:43 2014 +0400
+++ b/src/share/classes/sun/font/Type1Font.java	Tue Jun 03 11:18:03 2014 -0400
@@ -492,7 +492,7 @@
 
         //Conversion: Expand abbreviations in style portion (everything after '-'),
         //            replace '-' with space and insert missing spaces
-        pos = name.indexOf("-");
+        pos = name.indexOf('-');
         if (pos >= 0) {
             res =  expandName(name.substring(0, pos), false);
             res += " " + expandName(name.substring(pos+1), true);
@@ -513,8 +513,8 @@
         //Conversion: Truncate style portion (everything after '-')
         //            and insert missing spaces
 
-        if (tmp.indexOf("-") > 0) {
-            tmp = tmp.substring(0, tmp.indexOf("-"));
+        if (tmp.indexOf('-') > 0) {
+            tmp = tmp.substring(0, tmp.indexOf('-'));
         }
 
         return expandName(tmp, false);