Skip to content

Commit 8b3a212

Browse files
committed
Attempting to fix the converted output.
1 parent e0fa78b commit 8b3a212

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

java/java.source.base/src/org/netbeans/modules/java/source/save/CasualDiff.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ public static Collection<Diff> diff(Context context,
355355
}
356356

357357
td.copyTo(lineStart, start, td.printer);
358-
td.diffTree(oldTreePath, newTree, new int[] {start, bounds[1]});
358+
int diffEndPos = td.diffTree(oldTreePath, newTree, new int[] {start, bounds[1]});
359+
end = Math.max(end, diffEndPos);
359360
String resultSrc = td.printer.toString().substring(start - lineStart);
360361
if (!td.printer.reindentRegions.isEmpty()) {
361362
// must add region boundaries to tag2span, since the text may be reformatted.

java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/VarCompoundDeclarationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public void testVarCompoundDeclaration3() throws Exception {
138138
+ " switch(i){\n"
139139
+ " case 1:\n"
140140
+ " var v = 1;\n"
141-
+ " var v1 = 10;\n\n"
141+
+ " var v1 = 10;\n"
142142
+ " }\n"
143143
+ " }\n"
144144
+ "}\n";
@@ -172,7 +172,7 @@ public void testVarCompoundDeclaration4() throws Exception {
172172
+ " case 1:\n"
173173
+ " final var v = 1;\n"
174174
+ " final var v1 = 10;\n"
175-
+ " break;\n\n"
175+
+ " break;\n"
176176
+ " }\n"
177177
+ " }\n"
178178
+ "}\n";

0 commit comments

Comments
 (0)