diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-30 14:15:41 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-12-30 14:15:41 +0000 |
commit | 933b541684203539300f5a10149934c8380f190a (patch) | |
tree | e00bfbfeb801b9d7135d4f67573d9acd69bbc9d4 /qadevOOo/tests | |
parent | 90867ff483d511ac966de17a171f8a6204b9d2e6 (diff) |
coverity#1326986 SBSC: String concatenation in loop using + operator
Change-Id: Id41f84e66a3f1b85f5003a7f3aa58c88f74158a7
Diffstat (limited to 'qadevOOo/tests')
-rw-r--r-- | qadevOOo/tests/java/ifc/i18n/_XCollator.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/qadevOOo/tests/java/ifc/i18n/_XCollator.java b/qadevOOo/tests/java/ifc/i18n/_XCollator.java index 48a3d7f50204..a9eece7f7bcc 100644 --- a/qadevOOo/tests/java/ifc/i18n/_XCollator.java +++ b/qadevOOo/tests/java/ifc/i18n/_XCollator.java @@ -408,12 +408,14 @@ public class _XCollator extends MultiMethodTest { */ public String toUnicode(String str) { char[] chars = str.toCharArray() ; - String res = "" ; + StringBuilder res = new StringBuilder(); for (int i = 0; i < chars.length; i++) { - if (i != 0) res += "," ; - res += Integer.toHexString(chars[i]) ; + if (i != 0) { + res.append(","); + } + res.append(Integer.toHexString(chars[i])); } - return res ; + return res.toString(); } } |