8044460: Cleanup new Boolean and single character strings
Reviewed-by: pchelko, serb, rriggs
Contributed-by: otaviopolianasantana@gmail.com
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java Mon Jun 02 15:25:43 2014 +0400
+++ b/jdk/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/jdk/src/share/classes/javax/swing/JEditorPane.java Mon Jun 02 15:25:43 2014 +0400
+++ b/jdk/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/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java Mon Jun 02 15:25:43 2014 +0400
+++ b/jdk/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/jdk/src/share/classes/sun/applet/AppletClassLoader.java Mon Jun 02 15:25:43 2014 +0400
+++ b/jdk/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/jdk/src/share/classes/sun/awt/FontConfiguration.java Mon Jun 02 15:25:43 2014 +0400
+++ b/jdk/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/jdk/src/share/classes/sun/font/SunFontManager.java Mon Jun 02 15:25:43 2014 +0400
+++ b/jdk/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/jdk/src/share/classes/sun/font/Type1Font.java Mon Jun 02 15:25:43 2014 +0400
+++ b/jdk/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);