Regression

org.eclipse.jdt.core.tests.compiler.regression.SwitchTest.test014 - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

Failing for the past 1 build (Since Failed#113 )
Took 0.61 sec.

Error Message

test014 - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in X.java (at line 18)\n
 case 6://WRONG\n
 ^^^^^^\n
Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n
----------\n

------------ but was ------------
X.java:8: warning: [fallthrough] possible fall-through into case\n
   case 2://OK\n
   ^\n
X.java:10: warning: [fallthrough] possible fall-through into case\n
   case 3://OK\n
   ^\n
X.java:13: warning: [fallthrough] possible fall-through into case\n
   case 4://OK\n
   ^\n
X.java:18: warning: [fallthrough] possible fall-through into case\n
   case 6://WRONG\n
   ^\n
X.java:22: warning: [fallthrough] possible fall-through into case\n
   case 7://OK\n
   ^\n
5 warnings\n

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in X.java (at line 18)\n
 case 6://WRONG\n
 ^^^^^^\n
Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n
----------]\n
> but was:<[X.java:8: warning: [fallthrough] possible fall-through into case\n
   case 2://OK\n
   ^\n
X.java:10: warning: [fallthrough] possible fall-through into case\n
   case 3://OK\n
   ^\n
X.java:13: warning: [fallthrough] possible fall-through into case\n
   case 4://OK\n
   ^\n
X.java:18: warning: [fallthrough] possible fall-through into case\n
   case 6://WRONG\n
   ^\n
X.java:22: warning: [fallthrough] possible fall-through into case\n
   case 7://OK\n
   ^\n
5 warnings]\n
>

Stacktrace

junit.framework.ComparisonFailure: 
test014 - Eclipse found error(s) but Javac only found warning(s).
----------- Expected ------------
----------\n
1. ERROR in X.java (at line 18)\n
	case 6://WRONG\n
	^^^^^^\n
Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n
----------\n

------------ but was ------------
X.java:8: warning: [fallthrough] possible fall-through into case\n
			case 2://OK\n
			^\n
X.java:10: warning: [fallthrough] possible fall-through into case\n
			case 3://OK\n
			^\n
X.java:13: warning: [fallthrough] possible fall-through into case\n
			case 4://OK\n
			^\n
X.java:18: warning: [fallthrough] possible fall-through into case\n
			case 6://WRONG\n
			^\n
X.java:22: warning: [fallthrough] possible fall-through into case\n
			case 7://OK\n
			^\n
5 warnings\n

--------- Difference is ----------
 expected:<[----------\n
1. ERROR in X.java (at line 18)\n
	case 6://WRONG\n
	^^^^^^\n
Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above\n
----------]\n
> but was:<[X.java:8: warning: [fallthrough] possible fall-through into case\n
			case 2://OK\n
			^\n
X.java:10: warning: [fallthrough] possible fall-through into case\n
			case 3://OK\n
			^\n
X.java:13: warning: [fallthrough] possible fall-through into case\n
			case 4://OK\n
			^\n
X.java:18: warning: [fallthrough] possible fall-through into case\n
			case 6://WRONG\n
			^\n
X.java:22: warning: [fallthrough] possible fall-through into case\n
			case 7://OK\n
			^\n
5 warnings]\n
>
	at org.eclipse.jdt.core.tests.compiler.regression.SwitchTest.test014(SwitchTest.java:610)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.SwitchTest#test014 - 1.8
X.java [
public class X {
	void foo1(int i) {
		switch (i) {
			case 0://OK
			case 1://OK
				System.out.println();
				//$FALL-THROUGH$
			case 2://OK
				System.out.println(); //$FALL-THROUGH$
			case 3://OK
				System.out.println();
				//$FALL-THROUGH$ - some allowed explanation
			case 4://OK
			case 5://OK
				System.out.println();
				//$FALL-THROUGH$ - not last comment, thus inoperant
				// last comment is not fall-through explanation
			case 6://WRONG
				//$FALL-THROUGH$ - useless since not leading the case
				System.out.println();
				/*$FALL-THROUGH$ - block comment, is also allowed */
			case 7://OK
				System.out.println("aa"); //$NON-NLS-1$
		}
	}
}

]


Full results sent to /tmp/genie.jdt/comptest/run.1566014584562/1.8.0_162_20190817_000312.txt

Standard Error

--- javac err: ---
X.java:8: warning: [fallthrough] possible fall-through into case
			case 2://OK
			^
X.java:10: warning: [fallthrough] possible fall-through into case
			case 3://OK
			^
X.java:13: warning: [fallthrough] possible fall-through into case
			case 4://OK
			^
X.java:18: warning: [fallthrough] possible fall-through into case
			case 6://WRONG
			^
X.java:22: warning: [fallthrough] possible fall-through into case
			case 7://OK
			^
5 warnings

----------------------------------------