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