Community
Participate
Working Groups
I20210818-1800 mac64-java11_macosx Content not as expected: is /** * * HEADER */ package pack; public final class C { /** * javadoc */ public void method() { /* a comment */ int local; } } Differs at pos 113: d() { ^/* a c expected: /** * * HEADER */ package pack; public final class C { /** * javadoc */ public void method() { /* * a comment */ int local; } } expected:<...lic void method() { [ /* * a comment ] */ int local; }...> but was:<...lic void method() { [/* a comment] */ int local; }...> org.junit.ComparisonFailure: Content not as expected: is /** * * HEADER */ package pack; public final class C { /** * javadoc */ public void method() { /* a comment */ int local; } } Differs at pos 113: d() { ^/* a c expected: /** * * HEADER */ package pack; public final class C { /** * javadoc */ public void method() { /* * a comment */ int local; } } expected:<...lic void method() { [ /* * a comment ] */ int local; }...> but was:<...lic void method() { [/* a comment] */ int local; }...> at org.junit.Assert.assertEquals(Assert.java:117) at org.eclipse.jdt.testplugin.StringAsserts.assertEqualString(StringAsserts.java:73) at org.eclipse.jdt.ui.tests.core.CoreTests.assertEqualString(CoreTests.java:34) at org.eclipse.jdt.ui.tests.core.CodeFormatterTest.testFormatElementInComment(CodeFormatterTest.java:319) ...
It passes when run locally.
@Noopur: could you please add 4.22 value to the "Version" and change this bug accordingly? Beside this, the tests fail locally for me (Linux / Java 11)
Regression from bug 466532 commit http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=bf5933129b8eb15b5b7cdefa781eacc1c4a5e3b9 Reverting the commit above fixes tests.
@Mickael: please check this, the regression is there even after the fix for bug 575872.
(In reply to Andrey Loskutov from comment #2) > @Noopur: could you please add 4.22 value to the "Version" and change this > bug accordingly? Done.
I can reproduce it locally. I ran the testFormatElementInComment and logged the arguments for setSelectedRanges: Reference, before multi-carets patch, OK: 0,0 63,0 118,0 113,15 156,-43 137,0 After multi-carets patch, KO: 0,0 63,0 118,0 113,15 141,0 141,0 I need to look at why we get (141,0) when we expect (156,-43) for proper execution. As I don't have much knowledge about the formatter (nor do I understand why is setSelectedRanges called so often during formatting), it's going to take some more time.
I assume the test selects something for format, but that is broken now, or what the formatter "sees" as selected.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/185400
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/185400 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=e57e5530453240142e96f9755a4f5b66e3a07a9e
Tests ran successfully on main build.