mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[patch]: IDEA-142061 Applying patch deletes blank lines
* use StringUtil.join instead of manual appending; * fix empty sting appending: because when first element is empty string then stringBuilder.length remain 0 and line separator was not added;
This commit is contained in:
committed by
Nadya Zabrodina
parent
515b8c878d
commit
b1b845ffe2
+3
-3
@@ -989,10 +989,10 @@ public class GenericPatchApplier {
|
||||
}
|
||||
|
||||
private void linesToSb(final StringBuilder sb, final List<String> list) {
|
||||
for (String s : list) {
|
||||
if (sb.length() > 0) sb.append('\n');
|
||||
sb.append(s);
|
||||
if (sb.length() > 0 && !list.isEmpty()) {
|
||||
sb.append("\n");
|
||||
}
|
||||
StringUtil.join(list, "\n", sb);
|
||||
}
|
||||
|
||||
// indexes are passed inclusive
|
||||
|
||||
Reference in New Issue
Block a user