We get random StackOverFlowError errors in production related to performing a SubList operation. Has anyone seen something like this before and knows what could cause it?
This is the code that causes the call that causes the error:
FacesContext context = FacesContext.getCurrentInstance();
String newViewID = context.getViewRoot().getViewId();
if (newViewID != null) {
if (breadCrumbs.contains(newViewID)) {
breadCrumbs = breadCrumbs.subList(0, breadCrumbs.indexOf(newViewID) + 1);
} else {
breadCrumbs.add(newViewID);
}
}
Result:
Caused By: java.lang.StackOverflowError
at java.util.SubList$1.<init>(AbstractList.java:688)
at java.util.SubList.listIterator(AbstractList.java:687)
at java.util.SubList$1.<init>(AbstractList.java:688)
at java.util.SubList.listIterator(AbstractList.java:687)
...
source
share