Skip to content

C#: deprecate/delete some unused code #10584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,3 @@ predicate alwaysNotNullCallable(Callable c) {
forex(Expr e | c.canReturn(e) | e instanceof NonNullExpr)
)
}

/** Holds if callable 'c' always throws an exception. */
predicate alwaysThrowsCallable(Callable c) {
finalCallable(c) and
(
forex(ControlFlow::Node pre | pre = c.getExitPoint().getAPredecessor() |
pre.getElement() instanceof ThrowElement
)
or
exists(CIL::Method m | m.matchesHandle(c) | CR::alwaysThrowsMethod(m))
)
}

/** Holds if callable `c` always throws exception `ex`. */
predicate alwaysThrowsException(Callable c, Class ex) {
finalCallable(c) and
(
forex(ControlFlow::Node pre | pre = c.getExitPoint().getAPredecessor() |
pre.getElement().(ThrowElement).getThrownExceptionType() = ex
)
or
exists(CIL::Method m, CIL::Type t | m.matchesHandle(c) |
CR::alwaysThrowsException(m, t) and t.matchesHandle(ex)
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import csharp
private import semmle.code.csharp.frameworks.system.security.cryptography.SymmetricAlgorithm

/** Array of type Byte */
class ByteArray extends ArrayType {
deprecated class ByteArray extends ArrayType {
ByteArray() { getElementType() instanceof ByteType }
}

Expand Down