From 1d3abcb04397b521a91446ecfd3e46c9c49e0e39 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 30 Dec 2015 13:59:45 +0000 Subject: coverity#1326990 SBSC: String concatenation in loop using + operator Change-Id: I401d93ac2527409e44f908984632232768b1e4c0 --- .../tests/java/mod/_cached/CachedContentResultSetFactory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'qadevOOo') diff --git a/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java index f54370a0c0cb..89d57f1e9234 100644 --- a/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java +++ b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java @@ -95,19 +95,19 @@ public class CachedContentResultSetFactory extends TestCase { XContentIdentifierFactory ciFac = UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ; String url = util.utils.getFullTestURL("SwXTextEmbeddedObject.sxw") ; - String escUrl = "" ; + StringBuilder escUrl = new StringBuilder(); // In base URL of a JAR file in content URL all directory // separators ('/') must be replaced with escape symbol '%2F'. int idx = url.indexOf("/") ; int lastIdx = -1 ; while (idx >= 0) { - escUrl += url.substring(lastIdx + 1, idx) + "%2F" ; + escUrl.append(url.substring(lastIdx + 1, idx)).append("%2F"); lastIdx = idx ; idx = url.indexOf("/", idx + 1) ; } - escUrl += url.substring(lastIdx + 1) ; - String cntUrl = "vnd.sun.star.pkg://" + escUrl + "/" ; + escUrl.append(url.substring(lastIdx + 1)); + String cntUrl = "vnd.sun.star.pkg://" + escUrl.toString() + "/" ; XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ; -- cgit