use index of char instead of index of string, if possible

This commit is contained in:
Sebastian Sdorra
2013-01-30 10:10:20 +01:00
parent d165baffe9
commit 2d5fa22ca4
16 changed files with 17 additions and 17 deletions

View File

@@ -101,7 +101,7 @@ public class INIConfigurationReader extends AbstractReader<INIConfiguration>
else if ((section != null) &&!line.startsWith(";")
&&!line.startsWith("#"))
{
int index = line.indexOf("=");
int index = line.indexOf('=');
if (index > 0)
{

View File

@@ -84,7 +84,7 @@ public class Proxies
url = url.substring(index + 3);
}
index = url.indexOf("/");
index = url.indexOf('/');
if (index > 0)
{

View File

@@ -68,7 +68,7 @@ public class PluginVersion implements Comparable<PluginVersion>
{
this.unparsedVersion = versionString;
int index = versionString.indexOf("-");
int index = versionString.indexOf('-');
String versionPart = null;
String qualifierPart = null;

View File

@@ -115,8 +115,8 @@ public class Person implements Validateable, Serializable
{
String name = value;
String mail = null;
int s = value.indexOf("<");
int e = value.indexOf(">");
int s = value.indexOf('<');
int e = value.indexOf('>');
if ((s > 0) && (e > 0))
{

View File

@@ -59,7 +59,7 @@ public class UrlUtil
if (Util.isNotEmpty(revision))
{
int index = revision.indexOf(":");
int index = revision.indexOf(':');
if (index > 0)
{

View File

@@ -331,7 +331,7 @@ public class HttpUtil
*/
public static String removeMatrixParameter(String uri)
{
int index = uri.indexOf(";");
int index = uri.indexOf(';');
if (index > 0)
{

View File

@@ -133,7 +133,7 @@ public class RegistryUtil
if (value.startsWith("\""))
{
value = value.substring(1);
value = value.substring(0, value.indexOf("\""));
value = value.substring(0, value.indexOf('"'));
}
if (logger.isDebugEnabled())

View File

@@ -217,7 +217,7 @@ public class CGIRunner
// into exec here...
String execCmd = path;
if ((execCmd.charAt(0) != '"') && (execCmd.indexOf(" ") >= 0))
if ((execCmd.charAt(0) != '"') && (execCmd.indexOf(' ') >= 0))
{
execCmd = "\"" + execCmd + "\"";
}