mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Java: Fix tests.
This commit is contained in:
@@ -34,6 +34,7 @@ predicate serializableType(RefType t) {
|
||||
// Collection interfaces are not serializable, but their implementations are
|
||||
// likely to be.
|
||||
collectionOrMapType(t) and
|
||||
not t instanceof RawType and
|
||||
forall(RefType param | param = t.(ParameterizedType).getATypeArgument() | serializableType(param))
|
||||
or
|
||||
exists(BoundedType bt | bt = t | serializableType(bt.getUpperBoundType()))
|
||||
|
||||
@@ -13,3 +13,6 @@
|
||||
| Main.java:90:13:90:42 | ... >= ... | This expression is always true, since a string can never have negative size. |
|
||||
| Main.java:97:13:97:26 | ... >= ... | This expression is always true, since a map can never have negative size. |
|
||||
| Main.java:100:13:100:26 | ... <= ... | This expression is always true, since a map can never have negative size. |
|
||||
| Main.java:113:13:113:25 | ... >= ... | This expression is always true, since a collection can never have negative size. |
|
||||
| Main.java:114:13:114:25 | ... >= ... | This expression is always true, since a collection can never have negative size. |
|
||||
| Main.java:115:13:115:25 | ... <= ... | This expression is always true, since a map can never have negative size. |
|
||||
|
||||
@@ -110,7 +110,6 @@ public class Main {
|
||||
Boolean b;
|
||||
|
||||
// NOT OK
|
||||
// false negatives: raw collections and maps are not currently handled
|
||||
b = s.size() >= 0;
|
||||
b = a.size() >= 0;
|
||||
b = 0 <= m.size();
|
||||
|
||||
Reference in New Issue
Block a user