From 5ff0c0c283217fdb87f78e1f06c90db0af16b59f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 30 Dec 2015 14:56:20 +0000 Subject: coverity#1326973 SBSC: String concatenation in loop using + operator Change-Id: I8fb8afa2951201106443f76fde3f55ead24d43c2 --- javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'javaunohelper/com/sun/star/lib') 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)) { -- cgit