[Libreoffice-commits] core.git: qadevOOo/runner

rbuj robert.buj at gmail.com
Wed Sep 10 01:18:05 PDT 2014


 qadevOOo/runner/complexlib/ComplexTestCase.java  |    4 ++--
 qadevOOo/runner/convwatch/BuildID.java           |    4 ++--
 qadevOOo/runner/convwatch/DB.java                |    4 ++--
 qadevOOo/runner/convwatch/FileHelper.java        |    4 ++--
 qadevOOo/runner/convwatch/IniFile.java           |    4 ++--
 qadevOOo/runner/convwatch/PRNCompare.java        |    2 +-
 qadevOOo/runner/graphical/BuildID.java           |    4 ++--
 qadevOOo/runner/graphical/FileHelper.java        |   12 ++++++------
 qadevOOo/runner/graphical/IniFile.java           |    6 +++---
 qadevOOo/runner/graphical/JPEGComparator.java    |    4 ++--
 qadevOOo/runner/helper/APIDescGetter.java        |   22 +++++++++++-----------
 qadevOOo/runner/share/DescGetter.java            |    6 +++---
 qadevOOo/runner/stats/OutProducerFactory.java    |    2 +-
 qadevOOo/runner/stats/SimpleFileOutProducer.java |    2 +-
 qadevOOo/runner/util/RegistryTools.java          |    2 +-
 qadevOOo/runner/util/utils.java                  |    6 +++---
 16 files changed, 44 insertions(+), 44 deletions(-)

New commits:
commit e8ac22f3aa98e16ae7e2b26ad9a99311ba42af4b
Author: rbuj <robert.buj at gmail.com>
Date:   Tue Sep 9 23:48:11 2014 +0200

    qadevOOo: use a character literal
    
    Change-Id: I6d3e592de64c63e66bb788b112e188ef217e7bf7
    Reviewed-on: https://gerrit.libreoffice.org/11367
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/qadevOOo/runner/complexlib/ComplexTestCase.java b/qadevOOo/runner/complexlib/ComplexTestCase.java
index 8d39b7c..ff8b4fd 100644
--- a/qadevOOo/runner/complexlib/ComplexTestCase.java
+++ b/qadevOOo/runner/complexlib/ComplexTestCase.java
@@ -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);
diff --git a/qadevOOo/runner/convwatch/BuildID.java b/qadevOOo/runner/convwatch/BuildID.java
index 7f903af..6fb1687 100644
--- a/qadevOOo/runner/convwatch/BuildID.java
+++ b/qadevOOo/runner/convwatch/BuildID.java
@@ -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;
diff --git a/qadevOOo/runner/convwatch/DB.java b/qadevOOo/runner/convwatch/DB.java
index a743f8a..808c8ce 100644
--- a/qadevOOo/runner/convwatch/DB.java
+++ b/qadevOOo/runner/convwatch/DB.java
@@ -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;
                 }
diff --git a/qadevOOo/runner/convwatch/FileHelper.java b/qadevOOo/runner/convwatch/FileHelper.java
index 7668405..e9f97ef 100644
--- a/qadevOOo/runner/convwatch/FileHelper.java
+++ b/qadevOOo/runner/convwatch/FileHelper.java
@@ -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 );
diff --git a/qadevOOo/runner/convwatch/IniFile.java b/qadevOOo/runner/convwatch/IniFile.java
index eaa511a..2989727 100644
--- a/qadevOOo/runner/convwatch/IniFile.java
+++ b/qadevOOo/runner/convwatch/IniFile.java
@@ -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();
diff --git a/qadevOOo/runner/convwatch/PRNCompare.java b/qadevOOo/runner/convwatch/PRNCompare.java
index 3a9e31c..551cffb 100644
--- a/qadevOOo/runner/convwatch/PRNCompare.java
+++ b/qadevOOo/runner/convwatch/PRNCompare.java
@@ -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);
diff --git a/qadevOOo/runner/graphical/BuildID.java b/qadevOOo/runner/graphical/BuildID.java
index 3b73b33..9ce55b2 100644
--- a/qadevOOo/runner/graphical/BuildID.java
+++ b/qadevOOo/runner/graphical/BuildID.java
@@ -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;
diff --git a/qadevOOo/runner/graphical/FileHelper.java b/qadevOOo/runner/graphical/FileHelper.java
index ac47800..f496d84 100644
--- a/qadevOOo/runner/graphical/FileHelper.java
+++ b/qadevOOo/runner/graphical/FileHelper.java
@@ -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)
             {
diff --git a/qadevOOo/runner/graphical/IniFile.java b/qadevOOo/runner/graphical/IniFile.java
index c94cfb8..08cae29 100644
--- a/qadevOOo/runner/graphical/IniFile.java
+++ b/qadevOOo/runner/graphical/IniFile.java
@@ -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();
diff --git a/qadevOOo/runner/graphical/JPEGComparator.java b/qadevOOo/runner/graphical/JPEGComparator.java
index 2ea6841..a0d2891 100644
--- a/qadevOOo/runner/graphical/JPEGComparator.java
+++ b/qadevOOo/runner/graphical/JPEGComparator.java
@@ -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);
diff --git a/qadevOOo/runner/helper/APIDescGetter.java b/qadevOOo/runner/helper/APIDescGetter.java
index 6c94706..7d83ef3 100644
--- a/qadevOOo/runner/helper/APIDescGetter.java
+++ b/qadevOOo/runner/helper/APIDescGetter.java
@@ -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;
diff --git a/qadevOOo/runner/share/DescGetter.java b/qadevOOo/runner/share/DescGetter.java
index 463acc7..e9bd0d5 100644
--- a/qadevOOo/runner/share/DescGetter.java
+++ b/qadevOOo/runner/share/DescGetter.java
@@ -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);
             }
diff --git a/qadevOOo/runner/stats/OutProducerFactory.java b/qadevOOo/runner/stats/OutProducerFactory.java
index 3f60e73..cb907a4 100644
--- a/qadevOOo/runner/stats/OutProducerFactory.java
+++ b/qadevOOo/runner/stats/OutProducerFactory.java
@@ -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";
         }
diff --git a/qadevOOo/runner/stats/SimpleFileOutProducer.java b/qadevOOo/runner/stats/SimpleFileOutProducer.java
index 0f7f96d..2a0dbf6 100644
--- a/qadevOOo/runner/stats/SimpleFileOutProducer.java
+++ b/qadevOOo/runner/stats/SimpleFileOutProducer.java
@@ -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);
diff --git a/qadevOOo/runner/util/RegistryTools.java b/qadevOOo/runner/util/RegistryTools.java
index c42fb80..65eacf4 100644
--- a/qadevOOo/runner/util/RegistryTools.java
+++ b/qadevOOo/runner/util/RegistryTools.java
@@ -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) ;
     }
diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java
index 6ccc181..9a3faf4 100644
--- a/qadevOOo/runner/util/utils.java
+++ b/qadevOOo/runner/util/utils.java
@@ -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('/', '\\');
         }


More information about the Libreoffice-commits mailing list