diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-04 13:49:16 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-04 14:50:58 +0200 |
commit | 66c34ff3e7cb940536b7257033c097491862d04f (patch) | |
tree | 2a4dd2b90cdd52f76b239af22c315bfce868beb6 /qadevOOo/runner/util/utils.java | |
parent | java: remove some unused fields in the ODK examples (diff) | |
download | core-66c34ff3e7cb940536b7257033c097491862d04f.tar.gz core-66c34ff3e7cb940536b7257033c097491862d04f.zip |
java: remove workarounds for missing functionality pre java 1.5
Since we now require java 1.5
Change-Id: I9e195f77c81bd9447f8e29c1862c68a57846c8a3
Diffstat (limited to 'qadevOOo/runner/util/utils.java')
-rw-r--r-- | qadevOOo/runner/util/utils.java | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java index 75b808d96632..bfc8afedb0e0 100644 --- a/qadevOOo/runner/util/utils.java +++ b/qadevOOo/runner/util/utils.java @@ -629,15 +629,6 @@ public class utils { } /** - * - * This method replaces a substring with another - * - */ - public static String replacePart(String all, String toReplace, String replacement) { - return replaceAll13(all, toReplace, replacement); - } - - /** * Scan localhost for the next free port-number from a starting port * on. If the starting port is smaller than 1024, port number starts with * 10000 as default, because numbers < 1024 are never free on unix machines. @@ -767,8 +758,8 @@ public class utils { */ public static String validateAppExecutionCommand(String appExecCommand, String os) { String errorMessage = "OK"; - appExecCommand = replaceAll13(appExecCommand, "\"", ""); - appExecCommand = replaceAll13(appExecCommand, "'", ""); + appExecCommand = appExecCommand.replace("\"", ""); + appExecCommand = appExecCommand.replace("'", ""); StringTokenizer commandTokens = new StringTokenizer(appExecCommand, " \t"); String officeExecutable = ""; String officeExecCommand = "soffice"; @@ -862,27 +853,6 @@ public class utils { } /** - * String.replaceAll() is available since Java 1.4 but the runner must be buldabale with Java 1.3 - * @param originalString - * @param searchString - * @param replaceString - * @return modified string - */ - public static String replaceAll13(String originalString, String searchString, String replaceString) { - - StringBuffer changeStringBuffer = new StringBuffer(originalString); - int searchLength = searchString.length(); - int replaceLength = replaceString.length(); - int index = originalString.indexOf(searchString); - while (index != -1) { - changeStringBuffer = changeStringBuffer.replace(index, index + searchLength, replaceString); - originalString = changeStringBuffer.toString(); - index = originalString.indexOf(searchString, index + replaceLength); - } - return originalString; - } - - /** * expand macrofied strings like <CODE>${$ORIGIN/bootstrap.ini:UserInstallation}</CODE> or * <CODE>$_OS</CODE> * @param xMSF the MultiServiceFactory |