Improved: Search/find in web tools - entity-engine generates an error
I blindly followed SpotBugs advice, using a "try with resource" because the
EntityListIterator was not closed. Forgetting that it's done by purpose.
Thanks: Thanks Pierre Smits for report
@@ -1232,7 +1232,8 @@ public class FormRenderer {
}
int itemIndex = -1;
if (iter instanceof EntityListIterator) {
- try (EntityListIterator eli = (EntityListIterator) iter) {
+ EntityListIterator eli = (EntityListIterator) iter;
+ try {
if (eli.getResultsSizeAfterPartialList() > 0) {
itemIndex++;
}
@@ -1240,13 +1241,11 @@ public class FormRenderer {
Debug.logError(gee, MODULE);
}
} else {
- if (iter != null) {
while (iter.hasNext()) {
itemIndex++;
break;
}
}
- }
if (itemIndex < 0) {
return false;
}
