diff --git a/java/ql/lib/change-notes/2026-02-12-deprecate-unreachableblocks.md b/java/ql/lib/change-notes/2026-02-12-deprecate-unreachableblocks.md new file mode 100644 index 000000000000..24748cbb09ec --- /dev/null +++ b/java/ql/lib/change-notes/2026-02-12-deprecate-unreachableblocks.md @@ -0,0 +1,4 @@ +--- +category: deprecated +--- +* The `UnreachableBlocks.qll` library has been deprecated. diff --git a/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll b/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll index dfc9fc2833bd..6ac7668266ea 100644 --- a/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll +++ b/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll @@ -1,8 +1,10 @@ /** + * DEPRECATED: This module is no longer maintained, and will be removed in a future release. + * * Provides classes and predicates for identifying unreachable blocks under a "closed-world" assumption. */ overlay[local?] -module; +deprecated module; import java import semmle.code.java.controlflow.Guards diff --git a/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll b/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll index bda7f9bee740..8958ceedb324 100644 --- a/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll +++ b/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll @@ -1,5 +1,8 @@ +/** + * DEPRECATED: This module is no longer maintained, and will be removed in a future release. + */ overlay[local?] -module; +deprecated module; import java import semmle.code.java.controlflow.UnreachableBlocks diff --git a/java/ql/test/library-tests/unreachableblocks/UnreachableBlocks.expected b/java/ql/test/library-tests/unreachableblocks/UnreachableBlocks.expected deleted file mode 100644 index acf240ae3136..000000000000 --- a/java/ql/test/library-tests/unreachableblocks/UnreachableBlocks.expected +++ /dev/null @@ -1,12 +0,0 @@ -| unreachableblocks/Unreachable.java:3:14:3:24 | Exceptional Exit | -| unreachableblocks/Unreachable.java:3:14:3:24 | Exceptional Exit | -| unreachableblocks/Unreachable.java:5:14:5:19 | Exceptional Exit | -| unreachableblocks/Unreachable.java:6:14:8:3 | { ... } | -| unreachableblocks/Unreachable.java:9:21:11:3 | { ... } | -| unreachableblocks/Unreachable.java:12:22:14:3 | { ... } | -| unreachableblocks/Unreachable.java:17:3:17:9 | case ... | -| unreachableblocks/Unreachable.java:19:3:19:9 | case ... | -| unreachableblocks/Unreachable.java:24:3:24:9 | case ... | -| unreachableblocks/Unreachable.java:26:3:26:10 | case ... | -| unreachableblocks/Unreachable.java:27:3:27:10 | default | -| unreachableblocks/Unreachable.java:32:18:32:28 | Exceptional Exit | diff --git a/java/ql/test/library-tests/unreachableblocks/UnreachableBlocks.ql b/java/ql/test/library-tests/unreachableblocks/UnreachableBlocks.ql deleted file mode 100644 index b7229c059f36..000000000000 --- a/java/ql/test/library-tests/unreachableblocks/UnreachableBlocks.ql +++ /dev/null @@ -1,5 +0,0 @@ -import default -import semmle.code.java.controlflow.UnreachableBlocks - -from UnreachableBasicBlock unreachableBasicBlock -select unreachableBasicBlock diff --git a/java/ql/test/library-tests/unreachableblocks/unreachableblocks/Unreachable.java b/java/ql/test/library-tests/unreachableblocks/unreachableblocks/Unreachable.java deleted file mode 100644 index a8dc419975bf..000000000000 --- a/java/ql/test/library-tests/unreachableblocks/unreachableblocks/Unreachable.java +++ /dev/null @@ -1,35 +0,0 @@ -package unreachableblocks; - -public class Unreachable { - private boolean privateFalse = false; - public void method() { - if (false) { - // unreachable - } - if (privateFalse) { - // unreachable - } - if (methodFalse()) { - // unreachable - } - - switch (7) { - case 5: // unreachable - break; - case 6: // unreachable - System.out.println("dead"); // unreachable - case 7: - case 8: // reachable from 7 - break; // reachable - case 9: //unreachable - break; - case 10: // unreachable - default: - break; //unreachable - } - } - - private boolean methodFalse() { - return privateFalse; - } -} \ No newline at end of file