[Libreoffice-commits] core.git: xmerge/source
rbuj
robert.buj at gmail.com
Fri Aug 1 01:41:33 PDT 2014
xmerge/source/bridge/java/XMergeBridge.java | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
New commits:
commit 0a6e0840526175de78a84b95871131664f634744
Author: rbuj <robert.buj at gmail.com>
Date: Thu Jul 31 15:52:37 2014 +0200
xmerge: Use J2SE 5.0 String.{replace|contains}
Replace "String.indexOf(String str)!=-1" with String.contains(String str)
Use J2SE 5.0 String String.replace(CharSequence target, CharSequence replacement).
Format code in needsMask function.
Change-Id: I787a61c4c090f95fb3862390cc1198f7209163a3
Reviewed-on: https://gerrit.libreoffice.org/10659
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
Tested-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/xmerge/source/bridge/java/XMergeBridge.java b/xmerge/source/bridge/java/XMergeBridge.java
index 87b07a6..347c239 100644
--- a/xmerge/source/bridge/java/XMergeBridge.java
+++ b/xmerge/source/bridge/java/XMergeBridge.java
@@ -301,20 +301,19 @@ public class XMergeBridge {
}
public String needsMask(String origString){
- if (origString.indexOf("&")!=-1){
- origString=replace(origString,"&","&");
+ if (origString.contains("&")) {
+ origString = origString.replace("&","&");
}
- if (origString.indexOf("\"")!=-1){
- origString=replace(origString,"\"",""");
+ if (origString.contains("\"")) {
+ origString = origString.replace("\"",""");
}
- if (origString.indexOf("<")!=-1){
- origString=replace(origString,"<","<");
+ if (origString.contains("<")) {
+ origString = origString.replace("<","<");
}
- if (origString.indexOf(">")!=-1){
- origString=replace(origString,">",">");
+ if (origString.contains(">")) {
+ origString = origString.replace(">",">");
}
return origString;
-
}
@@ -545,7 +544,7 @@ public class XMergeBridge {
private String getPath(URI uri){
String path = uri.getPath();
String opSys=System.getProperty("os.name");
- if(opSys.indexOf("Windows")!=-1){
+ if(opSys.contains("Windows")){
path= path.replace('/','\\');
path = path.substring(1);
}
More information about the Libreoffice-commits
mailing list