diff --git a/java/ql/test/library-tests/dataflow/switchexpr/TestSwitchExpr.java b/java/ql/test/library-tests/dataflow/switchexpr/TestSwitchExpr.java index 0c45863a3d22..bbb62ad0e950 100644 --- a/java/ql/test/library-tests/dataflow/switchexpr/TestSwitchExpr.java +++ b/java/ql/test/library-tests/dataflow/switchexpr/TestSwitchExpr.java @@ -22,4 +22,10 @@ void test(String s) { }; sink(x4); } + + static String f(Object x) { + return switch (x) { + case null, default -> "v"; + }; + } } diff --git a/java/ql/test/library-tests/dataflow/switchexpr/options b/java/ql/test/library-tests/dataflow/switchexpr/options index 3f12170222c7..8528adb7bbf6 100644 --- a/java/ql/test/library-tests/dataflow/switchexpr/options +++ b/java/ql/test/library-tests/dataflow/switchexpr/options @@ -1 +1 @@ -//semmle-extractor-options: --javac-args -source 14 -target 14 +//semmle-extractor-options: --javac-args -source 21 -target 21 diff --git a/java/ql/test/library-tests/dataflow/switchexpr/switchcasearrows.expected b/java/ql/test/library-tests/dataflow/switchexpr/switchcasearrows.expected index bdb4f67d988f..a4e41c9d3cea 100644 --- a/java/ql/test/library-tests/dataflow/switchexpr/switchcasearrows.expected +++ b/java/ql/test/library-tests/dataflow/switchexpr/switchcasearrows.expected @@ -1,6 +1,7 @@ exprs | TestSwitchExpr.java:9:13:9:41 | case ... | TestSwitchExpr.java:9:43:9:46 | null | | TestSwitchExpr.java:10:13:10:22 | default | TestSwitchExpr.java:10:24:10:25 | x1 | +| TestSwitchExpr.java:28:13:28:33 | case null, default | TestSwitchExpr.java:28:35:28:37 | "v" | | TestSwitchExprStmtConsistency.java:10:7:10:15 | case ... | TestSwitchExprStmtConsistency.java:10:17:10:19 | f(...) | | TestSwitchExprStmtConsistency.java:11:7:11:15 | case ... | TestSwitchExprStmtConsistency.java:11:17:11:19 | f(...) | | TestSwitchExprStmtConsistency.java:12:7:12:16 | default | TestSwitchExprStmtConsistency.java:12:18:12:20 | f(...) |