Bug 257524

Summary: [formatter] Formatter breaks indentation after unreachable code in SwitchStatement
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Mateusz Matela <mateusz.matela>
Status: RESOLVED WORKSFORME QA Contact:
Severity: minor    
Priority: P5 CC: mateusz.matela
Version: 3.5   
Target Milestone: 4.14 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard: To be verified for 4.14 M3

Description Markus Keller CLA 2008-12-04 08:24:46 EST
HEAD

Format this with the Eclipse [built-in] profile:

	void m() {
		switch (1) {
		case 1:
			System.out.println("Hello");
			break;
			System.out.println("Unreachable");
			break;
		case 2:
			System.out.println("Hello3");
			return;
		default:
			System.out.println("Hell4");
			break;
	}

Result is:

	void m() {
		switch (1) {
		case 1:
			System.out.println("Hello");
			break;
		System.out.println("Unreachable");
		break;
	case 2:
		System.out.println("Hello3");
		return;
	default:
		System.out.println("Hell4");
		break;
	}

=> The unreachable statement should not outdent the following SwitchCase. Indentation for the unreachable statement itself is less important, but I would also indent that one as if it were reachable.
Comment 1 Eclipse Genie CLA 2019-11-19 20:03:38 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Mateusz Matela CLA 2019-11-20 16:54:18 EST
Could not reproduce even in Eclipse Luna.