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

rbuj robert.buj at gmail.com
Mon Sep 8 01:00:53 PDT 2014


 qadevOOo/runner/complexlib/ComplexTestCase.java |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 34a68f0aa92de05123c1e951899c08eed5a55543
Author: rbuj <robert.buj at gmail.com>
Date:   Sun Sep 7 17:43:22 2014 +0200

    qadevOOo: reuse the value of entryName.indexOf(Left Parenthesis)
    
    Change-Id: I1950275af2a063db74fef326ac0dd4e555e5170d
    Reviewed-on: https://gerrit.libreoffice.org/11323
    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 7eacef2..8d39b7c 100644
--- a/qadevOOo/runner/complexlib/ComplexTestCase.java
+++ b/qadevOOo/runner/complexlib/ComplexTestCase.java
@@ -119,12 +119,13 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
                 String entryName = subEntry.entryName;
                 Object[] parameter = null;
 
-                if (entryName.indexOf("(") != -1)
+                int posLeftParenthesis = entryName.indexOf("(");
+                if (posLeftParenthesis != -1)
                 {
-                    String sParameter = (entryName.substring(entryName.indexOf("(") + 1, entryName.indexOf(")")));
+                    String sParameter = (entryName.substring(posLeftParenthesis + 1, entryName.indexOf(")")));
                     mTestMethodName = entryName;
                     parameter = new String[] { sParameter };
-                    entryName = entryName.substring(0, entryName.indexOf("("));
+                    entryName = entryName.substring(0, posLeftParenthesis);
                     testMethod = this.getClass().getMethod(entryName, new Class[] { String.class });
                 }
                 else


More information about the Libreoffice-commits mailing list