Failed

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

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

Error Message

Different number of length. ----------- Expected ------------ package test;\n \n public class MyTest {\n \n  void f(int a, int b) {\n   switch (a) {\n   case 1:\n    doSomething();\n    break;\n   case 2:\n   case 3:\n    doSomeOtherThing();\n    break;\n   case 4: {\n    // yield missing, oh well...\n   }\n   case 5: {\n    doSomething(55);\n    break;\n   }\n   default:\n    doNothing();\n    break;\n   }\n \n   int c = switch (b) {\n   case 444:\n    yield a + b;\n   case 555:\n   case 666:\n    doSoemthing();\n    yield 777;\n   default:\n    doSomeOtherSomething();\n    return;\n \n   };\n \n   int d = switch (c) {\n   case 1 -> 6;\n   case 2 -> {\n    int f = a + b;\n    yield f * f;\n   }\n   default -> 55;\n   };\n \n   while (true) {\n    switch (a + b + c + d) {\n    case 9:\n     doSomething();\n     continue;\n    case 10:\n     doNothing();\n     throw new RuntimeException();\n    case 11:\n    case 12:\n     doSomething(33);\n     //$FALL-THROUGH$\n    case 13:\n     fallThrougAgain();\n    case 14:\n     doSomething(switch (a * b * c * d) {\n     case 888:\n      aaa();\n      yield bbb();\n     // comment\n     case 999:\n      aaa();\n      yield bbb();\n     // comment\n     case 101010:\n      aaa();\n      yield bbb();\n \n     // comment\n     case 111111:\n      aaa();\n      yield bbb();\n \n     // comment\n     case 121212:\n      aaa();\n      yield bbb();\n \n     // comment\n \n     // comment\n     case 131313:\n      aaa();\n      yield bbb();\n     // comment\n     // comment\n     default:\n      aaa();\n      yield bbb();\n     });\n    }\n   }\n  }\n } ------------ but was ------------ package test;\n \n public class MyTest {\n \n  void f(int a, int b) {\n   switch (a) {\n   case 1:\n    doSomething();\n    break;\n \n   case 2:\n   case 3:\n    doSomeOtherThing();\n    break;\n   case 4: {\n    // yield missing, oh well...\n   }\n \n   case 5: {\n    doSomething(55);\n    break;\n   }\n   default:\n    doNothing();\n    break;\n   }\n \n   int c = switch (b) {\n   case 444:\n    yield a + b;\n \n   case 555:\n   case 666:\n    doSoemthing();\n    yield 777;\n   default:\n    doSomeOtherSomething();\n    return;\n \n   };\n \n   int d = switch (c) {\n   case 1 -> 6;\n   case 2 -> {\n    int f = a + b;\n    yield f * f;\n   }\n   default -> 55;\n   };\n \n   while (true) {\n    switch (a + b + c + d) {\n    case 9:\n     doSomething();\n     continue;\n    case 10:\n     doNothing();\n     throw new RuntimeException();\n    case 11:\n    case 12:\n     doSomething(33);\n     //$FALL-THROUGH$\n    case 13:\n     fallThrougAgain();\n    case 14:\n     doSomething(switch (a * b * c * d) {\n     case 888:\n      aaa();\n      yield bbb();\n     // comment\n     case 999:\n      aaa();\n      yield bbb();\n     // comment\n \n     case 101010:\n      aaa();\n      yield bbb();\n \n     // comment\n     case 111111:\n      aaa();\n      yield bbb();\n \n     // comment\n \n     case 121212:\n      aaa();\n      yield bbb();\n \n     // comment\n \n     // comment\n \n     case 131313:\n      aaa();\n      yield bbb();\n     // comment\n     // comment\n     default:\n      aaa();\n      yield bbb();\n     });\n    }\n   }\n  }\n } --------- Difference is ----------  expected:<...ng();\n    break;\n [  case 2:\n   case 3:\n    doSomeOtherThing();\n    break;\n   case 4: {\n    // yield missing, oh well...\n   }\n   case 5: {\n    doSomething(55);\n    break;\n   }\n   default:\n    doNothing();\n    break;\n   }\n \n   int c = switch (b) {\n   case 444:\n    yield a + b;\n   case 555:\n   case 666:\n    doSoemthing();\n    yield 777;\n   default:\n    doSomeOtherSomething();\n    return;\n \n   };\n \n   int d = switch (c) {\n   case 1 -> 6;\n   case 2 -> {\n    int f = a + b;\n    yield f * f;\n   }\n   default -> 55;\n   };\n \n   while (true) {\n    switch (a + b + c + d) {\n    case 9:\n     doSomething();\n     continue;\n    case 10:\n     doNothing();\n     throw new RuntimeException();\n    case 11:\n    case 12:\n     doSomething(33);\n     //$FALL-THROUGH$\n    case 13:\n     fallThrougAgain();\n    case 14:\n     doSomething(switch (a * b * c * d) {\n     case 888:\n      aaa();\n      yield bbb();\n     // comment\n     case 999:\n      aaa();\n      yield bbb();\n     // comment\n     case 101010:\n      aaa();\n      yield bbb();\n \n     // comment\n     case 111111:\n      aaa();\n      yield bbb();\n \n     // comment\n     case 121212:\n      aaa();\n      yield bbb();\n \n     // comment\n \n     // comment]\n     case 131313:\...> but was:<...ng();\n    break;\n [\n   case 2:\n   case 3:\n    doSomeOtherThing();\n    break;\n   case 4: {\n    // yield missing, oh well...\n   }\n \n   case 5: {\n    doSomething(55);\n    break;\n   }\n   default:\n    doNothing();\n    break;\n   }\n \n   int c = switch (b) {\n   case 444:\n    yield a + b;\n \n   case 555:\n   case 666:\n    doSoemthing();\n    yield 777;\n   default:\n    doSomeOtherSomething();\n    return;\n \n   };\n \n   int d = switch (c) {\n   case 1 -> 6;\n   case 2 -> {\n    int f = a + b;\n    yield f * f;\n   }\n   default -> 55;\n   };\n \n   while (true) {\n    switch (a + b + c + d) {\n    case 9:\n     doSomething();\n     continue;\n    case 10:\n     doNothing();\n     throw new RuntimeException();\n    case 11:\n    case 12:\n     doSomething(33);\n     //$FALL-THROUGH$\n    case 13:\n     fallThrougAgain();\n    case 14:\n     doSomething(switch (a * b * c * d) {\n     case 888:\n      aaa();\n      yield bbb();\n     // comment\n     case 999:\n      aaa();\n      yield bbb();\n     // comment\n \n     case 101010:\n      aaa();\n      yield bbb();\n \n     // comment\n     case 111111:\n      aaa();\n      yield bbb();\n \n     // comment\n \n     case 121212:\n      aaa();\n      yield bbb();\n \n     // comment\n \n     // comment\n ]\n     case 131313:\...>

Stacktrace

junit.framework.ComparisonFailure: Different number of length.
----------- Expected ------------
package test;\n
\n
public class MyTest {\n
\n
	void f(int a, int b) {\n
		switch (a) {\n
		case 1:\n
			doSomething();\n
			break;\n
		case 2:\n
		case 3:\n
			doSomeOtherThing();\n
			break;\n
		case 4: {\n
			// yield missing, oh well...\n
		}\n
		case 5: {\n
			doSomething(55);\n
			break;\n
		}\n
		default:\n
			doNothing();\n
			break;\n
		}\n
\n
		int c = switch (b) {\n
		case 444:\n
			yield a + b;\n
		case 555:\n
		case 666:\n
			doSoemthing();\n
			yield 777;\n
		default:\n
			doSomeOtherSomething();\n
			return;\n
\n
		};\n
\n
		int d = switch (c) {\n
		case 1 -> 6;\n
		case 2 -> {\n
			int f = a + b;\n
			yield f * f;\n
		}\n
		default -> 55;\n
		};\n
\n
		while (true) {\n
			switch (a + b + c + d) {\n
			case 9:\n
				doSomething();\n
				continue;\n
			case 10:\n
				doNothing();\n
				throw new RuntimeException();\n
			case 11:\n
			case 12:\n
				doSomething(33);\n
				//$FALL-THROUGH$\n
			case 13:\n
				fallThrougAgain();\n
			case 14:\n
				doSomething(switch (a * b * c * d) {\n
				case 888:\n
					aaa();\n
					yield bbb();\n
				// comment\n
				case 999:\n
					aaa();\n
					yield bbb();\n
				// comment\n
				case 101010:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
				case 111111:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
				case 121212:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
\n
				// comment\n
				case 131313:\n
					aaa();\n
					yield bbb();\n
				// comment\n
				// comment\n
				default:\n
					aaa();\n
					yield bbb();\n
				});\n
			}\n
		}\n
	}\n
}
------------ but was ------------
package test;\n
\n
public class MyTest {\n
\n
	void f(int a, int b) {\n
		switch (a) {\n
		case 1:\n
			doSomething();\n
			break;\n
\n
		case 2:\n
		case 3:\n
			doSomeOtherThing();\n
			break;\n
		case 4: {\n
			// yield missing, oh well...\n
		}\n
\n
		case 5: {\n
			doSomething(55);\n
			break;\n
		}\n
		default:\n
			doNothing();\n
			break;\n
		}\n
\n
		int c = switch (b) {\n
		case 444:\n
			yield a + b;\n
\n
		case 555:\n
		case 666:\n
			doSoemthing();\n
			yield 777;\n
		default:\n
			doSomeOtherSomething();\n
			return;\n
\n
		};\n
\n
		int d = switch (c) {\n
		case 1 -> 6;\n
		case 2 -> {\n
			int f = a + b;\n
			yield f * f;\n
		}\n
		default -> 55;\n
		};\n
\n
		while (true) {\n
			switch (a + b + c + d) {\n
			case 9:\n
				doSomething();\n
				continue;\n
			case 10:\n
				doNothing();\n
				throw new RuntimeException();\n
			case 11:\n
			case 12:\n
				doSomething(33);\n
				//$FALL-THROUGH$\n
			case 13:\n
				fallThrougAgain();\n
			case 14:\n
				doSomething(switch (a * b * c * d) {\n
				case 888:\n
					aaa();\n
					yield bbb();\n
				// comment\n
				case 999:\n
					aaa();\n
					yield bbb();\n
				// comment\n
\n
				case 101010:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
				case 111111:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
\n
				case 121212:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
\n
				// comment\n
\n
				case 131313:\n
					aaa();\n
					yield bbb();\n
				// comment\n
				// comment\n
				default:\n
					aaa();\n
					yield bbb();\n
				});\n
			}\n
		}\n
	}\n
}
--------- Difference is ----------
 expected:<...ng();\n
			break;\n
[		case 2:\n
		case 3:\n
			doSomeOtherThing();\n
			break;\n
		case 4: {\n
			// yield missing, oh well...\n
		}\n
		case 5: {\n
			doSomething(55);\n
			break;\n
		}\n
		default:\n
			doNothing();\n
			break;\n
		}\n
\n
		int c = switch (b) {\n
		case 444:\n
			yield a + b;\n
		case 555:\n
		case 666:\n
			doSoemthing();\n
			yield 777;\n
		default:\n
			doSomeOtherSomething();\n
			return;\n
\n
		};\n
\n
		int d = switch (c) {\n
		case 1 -> 6;\n
		case 2 -> {\n
			int f = a + b;\n
			yield f * f;\n
		}\n
		default -> 55;\n
		};\n
\n
		while (true) {\n
			switch (a + b + c + d) {\n
			case 9:\n
				doSomething();\n
				continue;\n
			case 10:\n
				doNothing();\n
				throw new RuntimeException();\n
			case 11:\n
			case 12:\n
				doSomething(33);\n
				//$FALL-THROUGH$\n
			case 13:\n
				fallThrougAgain();\n
			case 14:\n
				doSomething(switch (a * b * c * d) {\n
				case 888:\n
					aaa();\n
					yield bbb();\n
				// comment\n
				case 999:\n
					aaa();\n
					yield bbb();\n
				// comment\n
				case 101010:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
				case 111111:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
				case 121212:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
\n
				// comment]\n
				case 131313:\...> but was:<...ng();\n
			break;\n
[\n
		case 2:\n
		case 3:\n
			doSomeOtherThing();\n
			break;\n
		case 4: {\n
			// yield missing, oh well...\n
		}\n
\n
		case 5: {\n
			doSomething(55);\n
			break;\n
		}\n
		default:\n
			doNothing();\n
			break;\n
		}\n
\n
		int c = switch (b) {\n
		case 444:\n
			yield a + b;\n
\n
		case 555:\n
		case 666:\n
			doSoemthing();\n
			yield 777;\n
		default:\n
			doSomeOtherSomething();\n
			return;\n
\n
		};\n
\n
		int d = switch (c) {\n
		case 1 -> 6;\n
		case 2 -> {\n
			int f = a + b;\n
			yield f * f;\n
		}\n
		default -> 55;\n
		};\n
\n
		while (true) {\n
			switch (a + b + c + d) {\n
			case 9:\n
				doSomething();\n
				continue;\n
			case 10:\n
				doNothing();\n
				throw new RuntimeException();\n
			case 11:\n
			case 12:\n
				doSomething(33);\n
				//$FALL-THROUGH$\n
			case 13:\n
				fallThrougAgain();\n
			case 14:\n
				doSomething(switch (a * b * c * d) {\n
				case 888:\n
					aaa();\n
					yield bbb();\n
				// comment\n
				case 999:\n
					aaa();\n
					yield bbb();\n
				// comment\n
\n
				case 101010:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
				case 111111:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
\n
				case 121212:\n
					aaa();\n
					yield bbb();\n
\n
				// comment\n
\n
				// comment\n
]\n
				case 131313:\...>
	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.formatSourceInWorkspace(FormatterRegressionTests.java:356)
	at org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.testBug390720b(FormatterRegressionTests.java:15243)
	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)