Kaydet (Commit) e8ac22f3 authored tarafından rbuj's avatar rbuj Kaydeden (comit) Noel Grandin

qadevOOo: use a character literal

Change-Id: I6d3e592de64c63e66bb788b112e188ef217e7bf7
Reviewed-on: https://gerrit.libreoffice.org/11367Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 0f114c3d
......@@ -119,10 +119,10 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
String entryName = subEntry.entryName;
Object[] parameter = null;
int posLeftParenthesis = entryName.indexOf("(");
int posLeftParenthesis = entryName.indexOf('(');
if (posLeftParenthesis != -1)
{
String sParameter = (entryName.substring(posLeftParenthesis + 1, entryName.indexOf(")")));
String sParameter = (entryName.substring(posLeftParenthesis + 1, entryName.indexOf(')')));
mTestMethodName = entryName;
parameter = new String[] { sParameter };
entryName = entryName.substring(0, posLeftParenthesis);
......
......@@ -28,7 +28,7 @@ public class BuildID
String sOfficePath = "";
if (_sApp.startsWith("\""))
{
int nIdx = _sApp.indexOf("\"", 1);
int nIdx = _sApp.indexOf('"', 1);
if (nIdx == -1)
{
}
......@@ -41,7 +41,7 @@ public class BuildID
else
{
// check if a space exist, so we get all until space
int nIdx = _sApp.indexOf(" ", 1);
int nIdx = _sApp.indexOf(' ', 1);
if (nIdx == -1)
{
sOfficePath = _sApp;
......
......@@ -353,8 +353,8 @@ public class DB extends DBHelper
{
String sToken = aTokenizer.nextToken();
int nIndex = sToken.indexOf("uuid()=");
int nIndexTuettel = sToken.indexOf("'", nIndex);
int nIndexTuettel2 = sToken.lastIndexOf("'");
int nIndexTuettel = sToken.indexOf('\'', nIndex);
int nIndexTuettel2 = sToken.lastIndexOf('\'');
String sUuid = sToken.substring(nIndexTuettel + 1, nIndexTuettel2);
return sUuid;
}
......
......@@ -86,7 +86,7 @@ public class FileHelper
public static String getNameNoSuffix(String _sFilename)
{
if (_sFilename == null) return "";
int nIdx = _sFilename.lastIndexOf(".");
int nIdx = _sFilename.lastIndexOf('.');
if (nIdx > 0)
{
return _sFilename.substring(0, nIdx);
......@@ -97,7 +97,7 @@ public class FileHelper
public static String getSuffix(String _sFilename)
{
if (_sFilename == null) return "";
int nIdx = _sFilename.lastIndexOf(".");
int nIdx = _sFilename.lastIndexOf('.');
if (nIdx > 0)
{
return _sFilename.substring(nIdx );
......
......@@ -185,7 +185,7 @@ class IniFile
break;
}
int nEqual = sLine.indexOf("=");
int nEqual = sLine.indexOf('=');
if (nEqual >= 0)
{
String sKey = toLowerIfNeed(sLine.substring(0, nEqual).trim());
......@@ -205,7 +205,7 @@ class IniFile
{
return "";
}
int nEqual = sLine.indexOf("=");
int nEqual = sLine.indexOf('=');
if (nEqual >= 0)
{
String sValue = sLine.substring(nEqual + 1).trim();
......
......@@ -391,7 +391,7 @@ public class PRNCompare
// try to interpret the result, which we get as a String
try
{
int nIdx = sBack.indexOf("\n");
int nIdx = sBack.indexOf('\n');
if (nIdx > 0)
{
sBack = sBack.substring(0, nIdx);
......
......@@ -29,7 +29,7 @@ public class BuildID
// TODO: StringHelper.removeQuote?
if (_sApp.startsWith("\""))
{
int nIdx = _sApp.indexOf("\"", 1);
int nIdx = _sApp.indexOf('"', 1);
if (nIdx != -1)
{
// leave double qoute out.
......@@ -42,7 +42,7 @@ public class BuildID
if (! (_sApp.endsWith("soffice.exe") || _sApp.endsWith("soffice")))
{
// check if a space exist, so we get all until space
int nIdx = _sApp.indexOf(" ", 1);
int nIdx = _sApp.indexOf(' ', 1);
if (nIdx == -1)
{
sOfficePath = _sApp;
......
......@@ -69,10 +69,10 @@ public class FileHelper
return "";
}
int nIdx = _sFilename.lastIndexOf("\\");
int nIdx = _sFilename.lastIndexOf('\\');
if (nIdx == -1)
{
nIdx = _sFilename.lastIndexOf("/");
nIdx = _sFilename.lastIndexOf('/');
}
if (nIdx > 0)
{
......@@ -87,7 +87,7 @@ public class FileHelper
{
return "";
}
int nIdx = _sFilename.lastIndexOf(".");
int nIdx = _sFilename.lastIndexOf('.');
if (nIdx > 0)
{
return _sFilename.substring(0, nIdx);
......@@ -101,7 +101,7 @@ public class FileHelper
{
return "";
}
int nIdx = _sFilename.lastIndexOf(".");
int nIdx = _sFilename.lastIndexOf('.');
if (nIdx > 0)
{
return _sFilename.substring(nIdx );
......@@ -116,10 +116,10 @@ public class FileHelper
return "";
}
int nIdx = _sFilename.lastIndexOf("\\");
int nIdx = _sFilename.lastIndexOf('\\');
if (nIdx == -1)
{
nIdx = _sFilename.lastIndexOf("/");
nIdx = _sFilename.lastIndexOf('/');
}
if (nIdx > 0)
{
......
......@@ -240,7 +240,7 @@ public class IniFile implements Enumeration<String>
break;
}
int nEqual = sLine.indexOf("=");
int nEqual = sLine.indexOf('=');
if (nEqual >= 0)
{
String sKey = toLowerIfNeed(sLine.substring(0, nEqual).trim());
......@@ -273,7 +273,7 @@ public class IniFile implements Enumeration<String>
return j;
}
int nEqual = sLine.indexOf("=");
int nEqual = sLine.indexOf('=');
if (nEqual >= 0)
{
String sKey = toLowerIfNeed(sLine.substring(0, nEqual).trim());
......@@ -293,7 +293,7 @@ public class IniFile implements Enumeration<String>
{
return "";
}
int nEqual = sLine.indexOf("=");
int nEqual = sLine.indexOf('=');
if (nEqual >= 0)
{
String sValue = sLine.substring(nEqual + 1).trim();
......
......@@ -52,7 +52,7 @@ class NameDPIPage
if (sDPICheck.equals("DPI_"))
{
// seems to be a generated filename by us.
int nDPIStart = sNameNoSuffix.lastIndexOf("_", sNameNoSuffix.length() - 8);
int nDPIStart = sNameNoSuffix.lastIndexOf('_', sNameNoSuffix.length() - 8);
sName = sNameNoSuffix.substring(0, nDPIStart);
if (nDPIStart > 0)
{
......@@ -635,7 +635,7 @@ public class JPEGComparator extends EnhancedComplexTestCase
// try to interpret the result, which we get as a String
try
{
int nIdx = sBack.indexOf("\n");
int nIdx = sBack.indexOf('\n');
if (nIdx > 0)
{
sBack = sBack.substring(0, nIdx);
......
......@@ -75,13 +75,13 @@ public class APIDescGetter extends DescGetter
{
job = job.substring(3, job.length()).trim();
if (job.indexOf(".") < 0)
if (job.indexOf('.') < 0)
{
return null;
}
// special in case several Interfaces are given comma separated
if (job.indexOf(",") < 0)
if (job.indexOf(',') < 0)
{
DescEntry entry = getDescriptionForSingleJob(job, descPath,
debug);
......@@ -101,7 +101,7 @@ public class APIDescGetter extends DescGetter
else
{
ArrayList<String> subs = getSubInterfaces(job);
String partjob = job.substring(0, job.indexOf(",")).trim();
String partjob = job.substring(0, job.indexOf(',')).trim();
DescEntry entry = getDescriptionForSingleJob(partjob, descPath,
debug);
......@@ -345,7 +345,7 @@ public class APIDescGetter extends DescGetter
if (ifc_name.indexOf("#optional") > 0)
{
ifcDesc.isOptional = true;
ifc_name = ifc_name.substring(0, ifc_name.indexOf("#"));
ifc_name = ifc_name.substring(0, ifc_name.indexOf('#'));
}
String className = createClassName(ifc_name);
......@@ -430,7 +430,7 @@ public class APIDescGetter extends DescGetter
if (meth_name.indexOf("#optional") > 0)
{
methDesc.isOptional = true;
meth_name = meth_name.substring(0, meth_name.indexOf("#"));
meth_name = meth_name.substring(0, meth_name.indexOf('#'));
}
if (meth_name.endsWith("()"))
......@@ -452,7 +452,7 @@ public class APIDescGetter extends DescGetter
if (ifc_name.indexOf("#optional") > 0)
{
withoutHash = ifc_name.substring(0, ifc_name.indexOf("#"));
withoutHash = ifc_name.substring(0, ifc_name.indexOf('#'));
}
methDesc.longName = parent.entryName + "::" + withoutHash + "::" + meth_name;
......@@ -728,7 +728,7 @@ public class APIDescGetter extends DescGetter
{
String token = st.nextToken();
if (token.indexOf(".") < 0)
if (token.indexOf('.') < 0)
{
namesList.add(token);
}
......@@ -870,8 +870,8 @@ public class APIDescGetter extends DescGetter
(entry.indexOf("CVS") < 0) &&
!entry.endsWith("/"))
{
int startMod = entry.indexOf("/");
int endMod = entry.lastIndexOf("/");
int startMod = entry.indexOf('/');
int endMod = entry.lastIndexOf('/');
String module = entry.substring(startMod + 1, endMod);
String component = getComponentForString(
entry.substring(endMod + 1,
......@@ -912,13 +912,13 @@ public class APIDescGetter extends DescGetter
full = full.substring(0, full.length() - 4);
//cutting component
int lastdot = full.lastIndexOf(".");
int lastdot = full.lastIndexOf('.');
component = full.substring(lastdot + 1, full.length());
if (module.equals("file") || module.equals("xmloff"))
{
String withoutComponent = full.substring(0, lastdot);
int preLastDot = withoutComponent.lastIndexOf(".");
int preLastDot = withoutComponent.lastIndexOf('.');
component = withoutComponent.substring(preLastDot + 1,
withoutComponent.length()) +
"." + component;
......
......@@ -69,7 +69,7 @@ public abstract class DescGetter
String job = line.substring(3, line.length()).trim();
DescEntry aEntry;
// special in case several Interfaces are given comma separated
if (job.indexOf(",") < 0)
if (job.indexOf(',') < 0)
{
aEntry = getDescriptionForSingleJob(job, descPath,
debug);
......@@ -77,7 +77,7 @@ public abstract class DescGetter
else
{
ArrayList<String> subs = getSubInterfaces(job);
String partjob = job.substring(0, job.indexOf(",")).trim();
String partjob = job.substring(0, job.indexOf(',')).trim();
aEntry = getDescriptionForSingleJob(partjob, descPath,
debug);
......@@ -172,7 +172,7 @@ public abstract class DescGetter
{
String token = st.nextToken();
if (token.indexOf(".") < 0)
if (token.indexOf('.') < 0)
{
namesList.add(token);
}
......
......@@ -69,7 +69,7 @@ public class OutProducerFactory {
String dataProducerName = (String)param.get("DataBaseOutProducer");
if (dataProducerName == null) {
String testBaseName = (String)param.get("TestBase");
dataProducerName = testBaseName.substring(testBaseName.indexOf("_")+1);
dataProducerName = testBaseName.substring(testBaseName.indexOf('_')+1);
dataProducerName = "stats." + makeFirstCharUpperCase(dataProducerName)
+ "DataBaseOutProducer";
}
......
......@@ -51,7 +51,7 @@ public class SimpleFileOutProducer implements LogWriter {
String FileName = entry.longName + ".out";
if (!entry.EntryType.equals("component")) {
FileName = entry.longName.substring(0,
entry.longName.indexOf(":")) + ".out";
entry.longName.indexOf(':')) + ".out";
}
util.utils.make_Directories("",outpath);
File outputFile = new File(outpath, FileName);
......
......@@ -154,7 +154,7 @@ public class RegistryTools {
*/
private static String getShortKeyName(String keyName) {
if (keyName == null) return null ;
int idx = keyName.lastIndexOf("/") ;
int idx = keyName.lastIndexOf('/') ;
if (idx < 0) return keyName ;
else return keyName.substring(idx + 1) ;
}
......
......@@ -331,7 +331,7 @@ public class utils {
dir = dir.substring("file:///".length());
idx = dir.indexOf(":");
idx = dir.indexOf(':');
// is the last character a '/' or a '\'?
boolean lastCharSet = dir.endsWith("/") || dir.endsWith("\\");
......@@ -370,7 +370,7 @@ public class utils {
}
// remove leading '/' and replace others with '\' on windows machines
if (sysDir.indexOf(":") != -1) {
if (sysDir.indexOf(':') != -1) {
sysDir = sysDir.substring(1);
sysDir = sysDir.replace('/', '\\');
}
......@@ -395,7 +395,7 @@ public class utils {
}
// remove leading '/' and replace others with '\' on windows machines
if (sysDir.indexOf(":") != -1) {
if (sysDir.indexOf(':') != -1) {
sysDir = sysDir.substring(1);
sysDir = sysDir.replace('/', '\\');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment