Skip to content

Commit a293786

Browse files
committed
Restored empt-catch-block query
1 parent 7f56a19 commit a293786

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

.codeql/custom-queries/09-cryptographic-security/empt-catch-block-detection.ql

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,13 @@
88
* @problem.severity warning
99
* @tags maintainability
1010
* error-handling
11-
* @autofix
1211
*/
1312

1413
import java
1514

16-
import semmle.code.java.Autofix
17-
1815
from CatchClause cc
1916
where
2017
cc.getBlock().getNumStmt() = 0 and
2118
not exists(Stmt s | s.getParent() = cc.getBlock()) and
2219
not cc.getVariable().getType().(RefType).hasQualifiedName("java.lang", "InterruptedException")
23-
select cc, "Blocco catch vuoto - potrebbe nascondere errori importanti",
24-
Autofix::insertAfter(cc.getBlock(), "System.err.println(\"Exception caught: \" + " + cc.getVariable().getName() + ");")
25-
20+
select cc, "Blocco catch vuoto - potrebbe nascondere errori importanti"

0 commit comments

Comments
 (0)