diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-30 14:56:20 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-12-30 14:56:20 +0000 |
commit | 5ff0c0c283217fdb87f78e1f06c90db0af16b59f (patch) | |
tree | 73c9958b51edf084de9415d62c3cf29088acd15c /javaunohelper | |
parent | f852edc6db76ee8569374bd1997a579201a5493a (diff) |
coverity#1326973 SBSC: String concatenation in loop using + operator
Change-Id: I8fb8afa2951201106443f76fde3f55ead24d43c2
Diffstat (limited to 'javaunohelper')
-rw-r--r-- | javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java b/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java index 63ae35e7420c..e3a3a430f6e2 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java @@ -250,19 +250,21 @@ public class UnoUrl { while (true) { char c = ','; - String aKey = ""; - String aValue = ""; + StringBuffer sb = new StringBuffer(); while ((pos < paramString.length()) && ((c = paramString.charAt(pos++)) != '=')) { - aKey += c; + sb.append(c); } + String aKey = sb.toString(); + sb = new StringBuffer(); while ((pos < paramString.length()) && ((c = paramString.charAt(pos++)) != ',') && c != ';') { - aValue += c; + sb.append(c); } + String aValue = sb.toString(); if ((aKey.length() > 0) && (aValue.length() > 0)) { |