Hi
We have tried to upgrade from Hazelcast 3.2.3 to 3.3.1.
When running our integration-tests a lot of tests are now failing, and digging a bit further into this, it seems that Predicates that used to return entries from a map, no longer does so.
(downgrading to 3.2.3 makes all tests green again)
Example.
public static Predicate isOwnerIdAndEnrollmentBefore(long ownerId, LocalDate date, Comparable... extras) {
EntryObject e = entry();
return matchesAll(e.get(OWNER_ID).equal(ownerId).and(e.get(ENROLLMENT_DATE).lessThan(date)), extras);
}
The problem is the code marked with red.
If we remove this AND clause, the predicate returns values in the map (although too many).
When using the AND clause, no values are found.
And as mentioned, this works in 3.2.3.
ENROLLMENT_DATE is a field in our pojo, a joda-time LocalDate. This is serialized as a long in the maps (with kryo).
I have tried to scan the docs / release notes for changes to date comparison / predicate builder etc, but have found nothing.
Am I missing something obvious here?
Here is the matchesAll method, I include it, but it should not affect the problem
private static Predicate matchesAll(PredicateBuilder start, Comparable... extras) {
PredicateBuilder combined = start;
EntryObject e = start == null ? entry() : start.getEntryObject();
for (Comparable value : extras) {
PredicateBuilder current;
if (value instanceof Gender) {
current = e.get("gender").equal(value);
} else if (value instanceof Category) {
current = e.get(CATEGORY).equal(value);
} else if (value instanceof Group) {
Group group = (Group) value;
if (group.equals(Young)) {
current = e.get(CATEGORY).in(YoungDairyStock_10, YoungBeefStock_11);
} else {
current = e.get(CATEGORY).in(MilkingCow_12, DualPurposeCow_13, SucklerCow_14);
}
} else {
throw new TineHzException("Matching entry for value [" + value + "] not supported");
}
combined = combined == null ? current : combined.and(current);
}
return combined;
}