Skip to content

Commit 8e2b56c

Browse files
committed
Java: Include count in messages.
1 parent a09e479 commit 8e2b56c

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

java/ql/src/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ module Consistency {
3232
n instanceof RelevantNode and
3333
c = count(n.getEnclosingCallable()) and
3434
c != 1 and
35-
if c > 1
36-
then msg = "Node does not have unique enclosing callable."
37-
else msg = "Node is missing an enclosing callable."
35+
msg = "Node should have one enclosing callable but has " + c + "."
3836
)
3937
}
4038

@@ -43,9 +41,7 @@ module Consistency {
4341
n instanceof RelevantNode and
4442
c = count(n.getTypeBound()) and
4543
c != 1 and
46-
if c > 1
47-
then msg = "Node does not have unique type bound."
48-
else msg = "Node is missing a type bound."
44+
msg = "Node should have one type bound but has " + c + "."
4945
)
5046
}
5147

@@ -54,9 +50,7 @@ module Consistency {
5450
n instanceof RelevantNode and
5551
c = count(getErasedRepr(n.getTypeBound())) and
5652
c != 1 and
57-
if c > 1
58-
then msg = "Node does not have unique type representation."
59-
else msg = "Node is missing a type representation."
53+
msg = "Node should have one type representation but has " + c + "."
6054
)
6155
}
6256

@@ -107,9 +101,7 @@ module Consistency {
107101
exists(int c |
108102
c = count(n.getPreUpdateNode()) and
109103
c != 1 and
110-
if c > 1
111-
then msg = "PostUpdateNode does not have unique pre-update node."
112-
else msg = "PostUpdateNode is missing a pre-update node."
104+
msg = "PostUpdateNode should have one pre-update node but has " + c + "."
113105
)
114106
}
115107

0 commit comments

Comments
 (0)