Kaydet (Commit) 1d3abcb0 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1326990 SBSC: String concatenation in loop using + operator

Change-Id: I401d93ac2527409e44f908984632232768b1e4c0
üst 09da6a11
......@@ -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) ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment