Skip to content

Commit acfcc4b

Browse files
committed
update two more queries to better follow the style-guide
1 parent 7d643e4 commit acfcc4b

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

java/ql/src/Likely Bugs/Statements/PartiallyMaskedCatch.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ where
106106
else multiCatchMsg = ""
107107
select try.getCatchClause(second),
108108
"This catch-clause is unreachable" + multiCatchMsg + "; it is masked $@.",
109-
try.getCatchClause(first), "here for exceptions of type '" + masking.getName() + "'"
109+
try.getCatchClause(first), "by a previous catch-clause for exceptions of type '" + masking.getName() + "'"

java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,5 @@ where
120120
not probablyNeverEscapes(r) and
121121
// The synchronized methods on `Throwable` are not interesting.
122122
not call1.getCallee().getDeclaringType() instanceof TypeThrowable
123-
select call2,
124-
"This uses the state of $@ which is checked $@. But these are not jointly synchronized.", r,
125-
r.getName(), call1, "here"
123+
select call2, "This uses the state of $@ which $@. But these are not jointly synchronized.", r,
124+
r.getName(), call1, "is checked at a previous call"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
| PartiallyMaskedCatchTest.java:16:5:16:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:12:5:12:24 | catch (...) | here for exceptions of type 'ExceptionB' |
2-
| PartiallyMaskedCatchTest.java:16:5:16:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:14:5:14:24 | catch (...) | here for exceptions of type 'ExceptionA' |
3-
| PartiallyMaskedCatchTest.java:26:5:26:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:22:5:22:47 | catch (...) | here for exceptions of type 'ExceptionB' |
4-
| PartiallyMaskedCatchTest.java:26:5:26:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:24:5:24:43 | catch (...) | here for exceptions of type 'ExceptionA' |
5-
| PartiallyMaskedCatchTest.java:36:5:36:44 | catch (...) | This catch-clause is unreachable for type IOException; it is masked $@. | PartiallyMaskedCatchTest.java:32:5:32:47 | catch (...) | here for exceptions of type 'ExceptionB' |
6-
| PartiallyMaskedCatchTest.java:36:5:36:44 | catch (...) | This catch-clause is unreachable for type IOException; it is masked $@. | PartiallyMaskedCatchTest.java:34:5:34:51 | catch (...) | here for exceptions of type 'ExceptionA' |
1+
| PartiallyMaskedCatchTest.java:16:5:16:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:12:5:12:24 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionB' |
2+
| PartiallyMaskedCatchTest.java:16:5:16:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:14:5:14:24 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionA' |
3+
| PartiallyMaskedCatchTest.java:26:5:26:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:22:5:22:47 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionB' |
4+
| PartiallyMaskedCatchTest.java:26:5:26:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:24:5:24:43 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionA' |
5+
| PartiallyMaskedCatchTest.java:36:5:36:44 | catch (...) | This catch-clause is unreachable for type IOException; it is masked $@. | PartiallyMaskedCatchTest.java:32:5:32:47 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionB' |
6+
| PartiallyMaskedCatchTest.java:36:5:36:44 | catch (...) | This catch-clause is unreachable for type IOException; it is masked $@. | PartiallyMaskedCatchTest.java:34:5:34:51 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionA' |
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| Test.java:13:4:13:10 | act(...) | This uses the state of $@ which is checked $@. But these are not jointly synchronized. | Test.java:10:32:10:41 | r | r | Test.java:12:7:12:18 | getState(...) | here |
2-
| Test.java:20:4:20:10 | act(...) | This uses the state of $@ which is checked $@. But these are not jointly synchronized. | Test.java:17:32:17:42 | r | r | Test.java:19:7:19:18 | getState(...) | here |
3-
| Test.java:27:4:27:10 | act(...) | This uses the state of $@ which is checked $@. But these are not jointly synchronized. | Test.java:24:19:24:28 | r | r | Test.java:26:7:26:18 | getState(...) | here |
4-
| Test.java:35:5:35:11 | act(...) | This uses the state of $@ which is checked $@. But these are not jointly synchronized. | Test.java:31:19:31:28 | r | r | Test.java:34:8:34:19 | getState(...) | here |
1+
| Test.java:13:4:13:10 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:10:32:10:41 | r | r | Test.java:12:7:12:18 | getState(...) | is checked at a previous call |
2+
| Test.java:20:4:20:10 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:17:32:17:42 | r | r | Test.java:19:7:19:18 | getState(...) | is checked at a previous call |
3+
| Test.java:27:4:27:10 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:24:19:24:28 | r | r | Test.java:26:7:26:18 | getState(...) | is checked at a previous call |
4+
| Test.java:35:5:35:11 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:31:19:31:28 | r | r | Test.java:34:8:34:19 | getState(...) | is checked at a previous call |

0 commit comments

Comments
 (0)