Java: Fix tests.

This commit is contained in:
Anders Schack-Mulligen
2019-06-27 13:20:03 +02:00
parent 2af3598223
commit a583f000c1
3 changed files with 4 additions and 1 deletions

View File

@@ -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()))

View File

@@ -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. |

View File

@@ -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();