8044460: Cleanup new Boolean and single character strings

Reviewed-by: pchelko, serb, rriggs
This commit is contained in:
Otavio Goncalves de Santana 2014-06-03 11:18:03 -04:00 committed by Roger Riggs
parent ffed33a491
commit 333b1ed5ba
7 changed files with 11 additions and 12 deletions

View File

@ -547,7 +547,7 @@ class Metacity implements SynthConstants {
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);
}
}

View File

@ -965,7 +965,7 @@ public class JEditorPane extends JTextComponent {
// 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);

View File

@ -653,7 +653,7 @@ public final class NimbusStyle extends SynthStyle {
// 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);

View File

@ -168,7 +168,7 @@ public class AppletClassLoader extends URLClassLoader {
*/
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 @@ public class AppletClassLoader extends URLClassLoader {
// 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);

View File

@ -272,9 +272,9 @@ public abstract class FontConfiguration {
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;

View File

@ -2872,8 +2872,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
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();

View File

@ -492,7 +492,7 @@ public class Type1Font extends FileFont {
//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 @@ public class Type1Font extends FileFont {
//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);