Details
-
Type: Bug
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 1.5.2
-
Component/s: ICE-Components
-
Labels:None
-
Environment:Operating System: Windows XP
Platform: PC
Description
a client ran into the following NPE:
Caused by: java.lang.NullPointerException
at
com.icesoft.faces.component.selectinputtext.SelectInputText.populateItemList(SelectInputText.java:239)
at
com.icesoft.faces.component.selectinputtext.SelectInputText.broadcast(SelectInputText.java:255)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:269)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:363)
at
com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:98)
... 32 more
They were using a session-scoped bean with concurrentDOMViews and setting the
list temporarily to null. We should check for null like so:
void populateItemList() {
if (getSelectFacet() != null) {
//facet being used on jsf page, so get the list from the value binding
itemList = getListValue();
} else {
//selectItem or selectItems has been used on jsf page, so get the
selectItems
itemList = Util.getSelectItems(FacesContext.getCurrentInstance(),
this);
}
if( itemList != null ){
Iterator items = itemList.iterator();
SelectItem item = null;
itemMap.clear();
while (items.hasNext()) {
item = (SelectItem) items.next();
itemMap.put(item.getLabel(), item);
}
}
}
Caused by: java.lang.NullPointerException
at
com.icesoft.faces.component.selectinputtext.SelectInputText.populateItemList(SelectInputText.java:239)
at
com.icesoft.faces.component.selectinputtext.SelectInputText.broadcast(SelectInputText.java:255)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:269)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:363)
at
com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:98)
... 32 more
They were using a session-scoped bean with concurrentDOMViews and setting the
list temporarily to null. We should check for null like so:
void populateItemList() {
if (getSelectFacet() != null) {
//facet being used on jsf page, so get the list from the value binding
itemList = getListValue();
} else {
//selectItem or selectItems has been used on jsf page, so get the
selectItems
itemList = Util.getSelectItems(FacesContext.getCurrentInstance(),
this);
}
if( itemList != null ){
Iterator items = itemList.iterator();
SelectItem item = null;
itemMap.clear();
while (items.hasNext()) {
item = (SelectItem) items.next();
itemMap.put(item.getLabel(), item);
}
}
}
Activity
Philip Breau
created issue -
Icefaces Administrator
made changes -
Field | Original Value | New Value |
---|---|---|
issue.field.bugzillaimportkey | 1336 | 12532 |
Ken Fyten
made changes -
Priority | Major [ 3 ] | Minor [ 4 ] |
Adnan Durrani
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Fix Version/s | 1.6DR#1 [ 10035 ] | |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Fix Version/s | 1.6 [ 10031 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee | Adnan Durrani [ adnan.durrani ] |
The NullPointerException has been caught, which let application to execute and developer to know about it.
Fixed have -r 13330