Essentially I was sometimes getting a stack trace exception
at com.google.common.collect.Sets$2.contains(Sets.java:655)
at com.google.common.collect.Sets$2.contains(Sets.java:655)
The offending code looked like this (NOT THE ACTUAL CODE)
for (SomeObject m : this) {
commonTypes = Sets.intersection(commonTypes, m.getSet());
}
This would cause problems, it seemed to be related to this loop being executed a lot. Over 10 000 times, though the set sizes where never greater than 20 or so. Anyway this code fixed it.
for (SomeObject m : this) {
Set<AttrType> tempTypes = Sets.intersection(commonTypes, m.getSet());
commonTypes = new HashSet<>();
commonTypes.addAll(tempTypes );
}
No comments:
Post a Comment