aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/java/switch-statements/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/resources/java/switch-statements/com')
-rw-r--r--src/test/resources/java/switch-statements/com/example/SwitchStatements.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/resources/java/switch-statements/com/example/SwitchStatements.java b/src/test/resources/java/switch-statements/com/example/SwitchStatements.java
new file mode 100644
index 0000000..bebccf9
--- /dev/null
+++ b/src/test/resources/java/switch-statements/com/example/SwitchStatements.java
@@ -0,0 +1,30 @@
+package com.example;
+
+public class SwitchStatements {
+ public static int simpleReturn(String value) {
+ switch (value) {
+ case "one":
+ return 1;
+ default:
+ return 0;
+ }
+ }
+
+ public static int simpleFallthroughReturn(String value) {
+ switch (value) {
+ case "one":
+ case "two":
+ return 1;
+ default:
+ return 0;
+ }
+ }
+
+ public static int noDefaultReturn(String value) {
+ switch (value) {
+ case "one":
+ return 1;
+ }
+ return 0;
+ }
+}