Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
blob: a509cd72990c62e757d8051628ba1f6adcd66769 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class IndentationSwitchCaseBug {
	
	public static void IBreakIndentation() {
		// Runnable with correct indentation
		new Runnable() {
			public void run() {
				// Do nothing
			}
		};
		
		int i = 5;
		
		switch (i) {
		case 0:
			// Indentation works right here
			break;
		case 1:
			// Runnable with bugged indentation due to case
			new Runnable() {
				public void run() {
					// Do nothing
				}
			};
			// You can see the indentation gets bugged when a runnable
			// is used inside a switch-case statemente
			
			break;
		}
		
		i = 7;
		System.out.println(i);
	}
}

Back to the top