summer
summer copied to clipboard
incorrect iteration over maps
When I try to iterate over a Map<String,Map<String, Object> with the followin code, a NPE is always thrown, because the 'item' var is always an empty string(most probably null before some casting occurs) in the second 'data-repeat' attribute statement.
<ul data-repeat="${listAnnComparator.sortList(annotations.keySet())}" data-var="item">
<li data-rendered="${item != 'sections' && item != 'debugAnnotations'}">
<span>${item}</span>
<ul data-repeat="${listAnnComparator.sortList(annotations.get(item).keySet())}" data-var="item2" data-rendered="${annotations.hasNext(item)}">
Curiously, the following statement works just fine:
<ul data-repeat="${annotations.get(item).keySet().toArray()}" data-var="item2" data-rendered="${annotations.hasNext(item)}">