Failed

org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.testBug543818b (from org.eclipse.jdt.core.tests.RunFormatterTests)

Failing for the past 1 build (Since Unstable#1 )
Took 13 ms.

Error Message

Different number of length. ----------- Expected ------------ \n public class C {\n \n  void foo() {\n   switch (a + b + c /* + d */\n     + e + f ) {\n   case 1,2,99999,5,6:\n   method1();\n    break;\n   case 999,998,997:\n   case 996,995, //\n   994:\n   method2();\n   default:\n   method3();\n   }\n \n   switch ("a" + "b" + "c" //\n     + something ) {\n   case "abc1" -> System.out.println("1");\n   case "abc2",\n   /* ??? */ "abc3","abc4" -> System.out.println("234");\n   case "abc5","abc6" -> {\n   }\n   case "abc7" -> {\n    System.out.println("7");\n    return;\n   }\n   default -> System.out.println("?");\n   }\n \n   int value = switch (ABC ) {\n   case A:\n    yield 1;\n   case B:\n   System.out.println("!!!");\n   return;\n   case BB:\n   ;\n   case C,D,E,F,G:\n   case H,I,J: {\n    System.out.println("@@@");\n    yield 3454366;\n   }\n   default:\n    yield 6;\n   };\n \n   Object value2 = switch (a.b.c.d(e.f.g.h()) ) {\n   case a -> {\n    System.out.println("aaaaaaa");\n    yield "";\n   }\n   case b + c,d.e,f("aaaaaaaaaaaa"//\n     + //\n     "bbbbbbbbb"//\n   ),(33),aaa = bbb + ccc,new int[] { 1, 2, aaa },AAA::BBB -> (Runnable) () -> f();\n   // $$$$\n   case new Object() {\n    String toString() {\n     return "";\n    }\n   } -> ABCD;\n   case null -> {\n    return null;\n   }\n   case something -> //\n    null;\n   default -> throw new RuntimeException("unsupported");\n   };\n  }\n }\n  ------------ but was ------------ \n public class C {\n \n  void foo() {\n   switch (a + b + c /* + d */\n     + e + f) {\n   case 1,2,99999,  5,6:\n    method1();\n   break;\n   case 999, 998, 997:\n   case 996, 995, //\n   994:\n    method2();\n   default:\n    method3();\n   }\n   \n   switch ("a" + "b" + "c" //\n   + something) {\n   case "abc1" -> System.out.println("1");\n   case "abc2",\n   /* ??? */   "abc3", "abc4" -> System.out.println("234");\n   case "abc5", "abc6" -> {}\n   case "abc7" -> {\n    System.out.println("7");\n    return;\n   }\n   default-> System.out.println("?");\n   }\n   \n   int value = switch(ABC) {\n   case A:\n    yield 1;\n   case B:\n    System.out.println("!!!");\n    return;\n   case BB:;\n   case C, D, E, F, G:\n   case H, I, J: {\n    System.out.println("@@@");\n    yield 3454366;\n   }\n    default: yield 6;\n   };\n   \n   Object value2 = switch(a.b.c.d(e.f.g.h())) {\n   case a -> {\n    System.out.println("aaaaaaa");\n    yield "";\n   }\n   case b + c, d.e, f("aaaaaaaaaaaa"//\n   +//\n   "bbbbbbbbb"//\n   ), (33), aaa = bbb + ccc,\n   new int[] {1, 2, aaa}, AAA::BBB -> (Runnable)()->f();\n   // $$$$\n   case new Object() { String toString() { return "";}} -> ABCD;\n   case null -> {\n   return null;\n   }\n   case something -> //\n   null;\n   default -> throw new RuntimeException("unsupported");\n   };\n  }\n }\n  --------- Difference is ----------  expected:<...+ d */\n     + e + f[ ) {\n   case 1,2,99999,5,6:\n   method1();\n    break;\n   case 999,998,997:\n   case 996,995, //\n   994:\n   method2();\n   default:\n   method3();\n   }\n \n   switch ("a" + "b" + "c" //\n     + something ) {\n   case "abc1" -> System.out.println("1");\n   case "abc2",\n   /* ??? */ "abc3","abc4" -> System.out.println("234");\n   case "abc5","abc6" -> {\n   }\n   case "abc7" -> {\n    System.out.println("7");\n    return;\n   }\n   default -> System.out.println("?");\n   }\n \n   int value = switch (ABC ) {\n   case A:\n    yield 1;\n   case B:\n   System.out.println("!!!");\n   return;\n   case BB:\n   ;\n   case C,D,E,F,G:\n   case H,I,J: {\n    System.out.println("@@@");\n    yield 3454366;\n   }\n   default:\n    yield 6;\n   };\n \n   Object value2 = switch (a.b.c.d(e.f.g.h()) ) {\n   case a -> {\n    System.out.println("aaaaaaa");\n    yield "";\n   }\n   case b + c,d.e,f("aaaaaaaaaaaa"//\n     + //\n     "bbbbbbbbb"//\n   ),(33),aaa = bbb + ccc,new int[] { 1, 2, aaa },AAA::BBB -> (Runnable) () -> f();\n   // $$$$\n   case new Object() {\n    String toString() {\n     return "";\n    }\n   } -> ABCD;\n   case null -> {\n    return null;\n   }\n   case something -> //\n  ]  null;\n   default ...> but was:<...+ d */\n     + e + f[) {\n   case 1,2,99999,  5,6:\n    method1();\n   break;\n   case 999, 998, 997:\n   case 996, 995, //\n   994:\n    method2();\n   default:\n    method3();\n   }\n   \n   switch ("a" + "b" + "c" //\n   + something) {\n   case "abc1" -> System.out.println("1");\n   case "abc2",\n   /* ??? */   "abc3", "abc4" -> System.out.println("234");\n   case "abc5", "abc6" -> {}\n   case "abc7" -> {\n    System.out.println("7");\n    return;\n   }\n   default-> System.out.println("?");\n   }\n   \n   int value = switch(ABC) {\n   case A:\n    yield 1;\n   case B:\n    System.out.println("!!!");\n    return;\n   case BB:;\n   case C, D, E, F, G:\n   case H, I, J: {\n    System.out.println("@@@");\n    yield 3454366;\n   }\n    default: yield 6;\n   };\n   \n   Object value2 = switch(a.b.c.d(e.f.g.h())) {\n   case a -> {\n    System.out.println("aaaaaaa");\n    yield "";\n   }\n   case b + c, d.e, f("aaaaaaaaaaaa"//\n   +//\n   "bbbbbbbbb"//\n   ), (33), aaa = bbb + ccc,\n   new int[] {1, 2, aaa}, AAA::BBB -> (Runnable)()->f();\n   // $$$$\n   case new Object() { String toString() { return "";}} -> ABCD;\n   case null -> {\n   return null;\n   }\n   case something -> //\n ]  null;\n   default ...>

Stacktrace

junit.framework.ComparisonFailure: Different number of length.
----------- Expected ------------
\n
public class C {\n
\n
	void foo() {\n
		switch (a + b + c /* + d */\n
				+ e + f ) {\n
		case 1,2,99999,5,6:\n
		method1();\n
			break;\n
		case 999,998,997:\n
		case 996,995, //\n
		994:\n
		method2();\n
		default:\n
		method3();\n
		}\n
\n
		switch ("a" + "b" + "c" //\n
				+ something ) {\n
		case "abc1" -> System.out.println("1");\n
		case "abc2",\n
		/* ??? */ "abc3","abc4" -> System.out.println("234");\n
		case "abc5","abc6" -> {\n
		}\n
		case "abc7" -> {\n
			System.out.println("7");\n
			return;\n
		}\n
		default -> System.out.println("?");\n
		}\n
\n
		int value = switch (ABC ) {\n
		case A:\n
			yield 1;\n
		case B:\n
		System.out.println("!!!");\n
		return;\n
		case BB:\n
		;\n
		case C,D,E,F,G:\n
		case H,I,J: {\n
			System.out.println("@@@");\n
			yield 3454366;\n
		}\n
		default:\n
			yield 6;\n
		};\n
\n
		Object value2 = switch (a.b.c.d(e.f.g.h()) ) {\n
		case a -> {\n
			System.out.println("aaaaaaa");\n
			yield "";\n
		}\n
		case b + c,d.e,f("aaaaaaaaaaaa"//\n
				+ //\n
				"bbbbbbbbb"//\n
		),(33),aaa = bbb + ccc,new int[] { 1, 2, aaa },AAA::BBB -> (Runnable) () -> f();\n
		// $$$$\n
		case new Object() {\n
			String toString() {\n
				return "";\n
			}\n
		} -> ABCD;\n
		case null -> {\n
			return null;\n
		}\n
		case something -> //\n
			null;\n
		default -> throw new RuntimeException("unsupported");\n
		};\n
	}\n
}\n

------------ but was ------------
\n
public class C {\n
\n
	void foo() {\n
		switch (a + b + c /* + d */\n
				+ e + f) {\n
		case 1,2,99999,  5,6:\n
			method1();\n
		break;\n
		case 999, 998, 997:\n
		case 996, 995, //\n
		994:\n
			method2();\n
		default:\n
			method3();\n
		}\n
		\n
		switch ("a" + "b" + "c" //\n
		+ something) {\n
		case "abc1" -> System.out.println("1");\n
		case "abc2",\n
		/* ??? */   "abc3", "abc4" -> System.out.println("234");\n
		case "abc5", "abc6" -> {}\n
		case "abc7" -> {\n
			System.out.println("7");\n
			return;\n
		}\n
		default-> System.out.println("?");\n
		}\n
		\n
		int value = switch(ABC) {\n
		case A:\n
			yield 1;\n
		case B:\n
			System.out.println("!!!");\n
			return;\n
		case BB:;\n
		case C, D, E, F, G:\n
		case H, I, J: {\n
			System.out.println("@@@");\n
			yield 3454366;\n
		}\n
			default: yield 6;\n
		};\n
		\n
		Object value2 = switch(a.b.c.d(e.f.g.h())) {\n
		case a -> {\n
			System.out.println("aaaaaaa");\n
			yield "";\n
		}\n
		case b + c, d.e, f("aaaaaaaaaaaa"//\n
		+//\n
		"bbbbbbbbb"//\n
		), (33), aaa = bbb + ccc,\n
		new int[] {1, 2, aaa}, AAA::BBB -> (Runnable)()->f();\n
		// $$$$\n
		case new Object() { String toString() { return "";}} -> ABCD;\n
		case null -> {\n
		return null;\n
		}\n
		case something -> //\n
		null;\n
		default -> throw new RuntimeException("unsupported");\n
		};\n
	}\n
}\n

--------- Difference is ----------
 expected:<...+ d */\n
				+ e + f[ ) {\n
		case 1,2,99999,5,6:\n
		method1();\n
			break;\n
		case 999,998,997:\n
		case 996,995, //\n
		994:\n
		method2();\n
		default:\n
		method3();\n
		}\n
\n
		switch ("a" + "b" + "c" //\n
				+ something ) {\n
		case "abc1" -> System.out.println("1");\n
		case "abc2",\n
		/* ??? */ "abc3","abc4" -> System.out.println("234");\n
		case "abc5","abc6" -> {\n
		}\n
		case "abc7" -> {\n
			System.out.println("7");\n
			return;\n
		}\n
		default -> System.out.println("?");\n
		}\n
\n
		int value = switch (ABC ) {\n
		case A:\n
			yield 1;\n
		case B:\n
		System.out.println("!!!");\n
		return;\n
		case BB:\n
		;\n
		case C,D,E,F,G:\n
		case H,I,J: {\n
			System.out.println("@@@");\n
			yield 3454366;\n
		}\n
		default:\n
			yield 6;\n
		};\n
\n
		Object value2 = switch (a.b.c.d(e.f.g.h()) ) {\n
		case a -> {\n
			System.out.println("aaaaaaa");\n
			yield "";\n
		}\n
		case b + c,d.e,f("aaaaaaaaaaaa"//\n
				+ //\n
				"bbbbbbbbb"//\n
		),(33),aaa = bbb + ccc,new int[] { 1, 2, aaa },AAA::BBB -> (Runnable) () -> f();\n
		// $$$$\n
		case new Object() {\n
			String toString() {\n
				return "";\n
			}\n
		} -> ABCD;\n
		case null -> {\n
			return null;\n
		}\n
		case something -> //\n
	]		null;\n
		default ...> but was:<...+ d */\n
				+ e + f[) {\n
		case 1,2,99999,  5,6:\n
			method1();\n
		break;\n
		case 999, 998, 997:\n
		case 996, 995, //\n
		994:\n
			method2();\n
		default:\n
			method3();\n
		}\n
		\n
		switch ("a" + "b" + "c" //\n
		+ something) {\n
		case "abc1" -> System.out.println("1");\n
		case "abc2",\n
		/* ??? */   "abc3", "abc4" -> System.out.println("234");\n
		case "abc5", "abc6" -> {}\n
		case "abc7" -> {\n
			System.out.println("7");\n
			return;\n
		}\n
		default-> System.out.println("?");\n
		}\n
		\n
		int value = switch(ABC) {\n
		case A:\n
			yield 1;\n
		case B:\n
			System.out.println("!!!");\n
			return;\n
		case BB:;\n
		case C, D, E, F, G:\n
		case H, I, J: {\n
			System.out.println("@@@");\n
			yield 3454366;\n
		}\n
			default: yield 6;\n
		};\n
		\n
		Object value2 = switch(a.b.c.d(e.f.g.h())) {\n
		case a -> {\n
			System.out.println("aaaaaaa");\n
			yield "";\n
		}\n
		case b + c, d.e, f("aaaaaaaaaaaa"//\n
		+//\n
		"bbbbbbbbb"//\n
		), (33), aaa = bbb + ccc,\n
		new int[] {1, 2, aaa}, AAA::BBB -> (Runnable)()->f();\n
		// $$$$\n
		case new Object() { String toString() { return "";}} -> ABCD;\n
		case null -> {\n
		return null;\n
		}\n
		case something -> //\n
]		null;\n
		default ...>
	at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(TestCase.java:266)
	at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:242)
	at org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.assertSourceEquals(AbstractJavaModelTests.java:972)
	at org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.assertSourceEquals(AbstractJavaModelTests.java:952)
	at org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.assertLineEquals(FormatterRegressionTests.java:271)
	at org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.assertLineEquals(FormatterRegressionTests.java:276)
	at org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.formatSource(FormatterRegressionTests.java:345)
	at org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.formatSource(FormatterRegressionTests.java:332)
	at org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.formatSource(FormatterRegressionTests.java:293)
	at org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.testBug543818b(FormatterRegressionTests.java:14869)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at org.eclipse.jdt.core.tests.junit.extension.TestCase.runTest(TestCase.java:957)
	at junit.framework.TestCase.runBare(TestCase.java:141)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:252)
	at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.runTest(SuiteOfTestCases.java:115)
	at junit.framework.TestSuite.run(TestSuite.java:247)
	at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.superRun(SuiteOfTestCases.java:99)
	at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite$1.protect(SuiteOfTestCases.java:87)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.run(SuiteOfTestCases.java:96)
	at junit.framework.TestSuite.runTest(TestSuite.java:252)
	at junit.framework.TestSuite.run(TestSuite.java:247)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:40)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
	at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:71)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229)
	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197)
	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
	at org.eclipse.test.EclipseTestRunner.runTests(EclipseTestRunner.java:226)
	at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:202)
	at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:53)
	at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:36)
	at org.eclipse.test.CoreTestApplication.start(CoreTestApplication.java:44)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
	at org.eclipse.core.launcher.Main.main(Main.java:44)