diff options
Diffstat (limited to 'src/test/resources/com/puppycrawl/tools/checkstyle/checks/descendanttoken/InputDescendantTokenMissingSwitchDefault.java')
-rw-r--r-- | src/test/resources/com/puppycrawl/tools/checkstyle/checks/descendanttoken/InputDescendantTokenMissingSwitchDefault.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/descendanttoken/InputDescendantTokenMissingSwitchDefault.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/descendanttoken/InputDescendantTokenMissingSwitchDefault.java new file mode 100644 index 000000000..1f977b1de --- /dev/null +++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/descendanttoken/InputDescendantTokenMissingSwitchDefault.java @@ -0,0 +1,22 @@ +package com.puppycrawl.tools.checkstyle.checks.descendanttoken; + +public class InputDescendantTokenMissingSwitchDefault { + public void foo() { + int i = 1; + switch (i) { + case 1: i++; break; + case 2: i--; break; + default: return; + } + } +} + +class bad_test { + public void foo() { + int i = 1; + switch (i) { + case 1: i++; break; + case 2: i--; break; + } + } +} |