diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-30 13:29:44 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-12-30 13:34:23 +0000 |
commit | 92ce735143de30f4400fd982b26c1df8cfb64d89 (patch) | |
tree | dd1b1acc06ce170736b528e3448a1b02806095c8 /xmerge | |
parent | e03bb7162b355e6d736ad48b2cc2bbbc3e166171 (diff) |
coverity#1327009 SBSC: String concatenation in loop using + operator
Change-Id: I22eddb72ffa63549ce4361ec4e691ba2ba2bff96
Diffstat (limited to 'xmerge')
-rw-r--r-- | xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java index d0957a8d5910..a5298df1926b 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/IteratorLCSAlgorithm.java @@ -66,14 +66,12 @@ public class IteratorLCSAlgorithm implements DiffAlgorithm { */ private void printDiffTable(int[][] diffTable) { - String tmpString = ""; - for (int i = 0; i < diffTable.length; i++) { + StringBuilder sb = new StringBuilder(); for (int j = 0; j < diffTable[i].length; j++) { - tmpString = tmpString + " " + diffTable[i][j] + " "; + sb.append(" ").append(diffTable[i][j]).append(" "); } - Debug.log(Debug.INFO, tmpString); - tmpString = ""; + Debug.log(Debug.INFO, sb.toString()); } } |