[JBoss JIRA] Created: (RF-10189) Comparator doesn't consider null values
by Lukas Fryc (JIRA)
Comparator doesn't consider null values
---------------------------------------
Key: RF-10189
URL: https://issues.jboss.org/browse/RF-10189
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: component-tables
Affects Versions: 4.0.0.Milestone5
Environment: * RichFaces 4.0.0-SNAPSHOT r.20958
* Metamer 4.0.0-SNAPSHOT r.20964
* Mojarra 2.0.3-b05
* JBoss AS 6.0.0.Final
* OpenJDK Runtime Environment 1.6.0_20-b20 @ Linux
* Firefox 3.6.13 @ Linux x86_64
Reporter: Lukas Fryc
See also [Steps to Reproduce] to reproduce it in Metamer.
I have model which contains null values in one column and when I want to sort by such column, I want to let RichFaces consider it and sort it on the end of the.
The java.lang.Comparable itself [1] states that the NullPointerException should be thrown when comparing object to null value.
However for user convenience, it will be better to handle null values in consistent way to avoid necessity for defining custom comparator.
[1] http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html
java.lang.NullPointerException
at java.util.Date.getMillisOf(Date.java:956)
at java.util.Date.compareTo(Date.java:976)
at java.util.Date.compareTo(Date.java:129)
at org.richfaces.model.ArrangeableModel.compareSortByValues(ArrangeableModel.java:328)
at org.richfaces.model.ArrangeableModel.compare(ArrangeableModel.java:309)
at org.richfaces.model.ArrangeableModel.access$200(ArrangeableModel.java:52)
at org.richfaces.model.ArrangeableModel$2.compare(ArrangeableModel.java:262)
at java.util.Arrays.mergeSort(Arrays.java:1283)
at java.util.Arrays.mergeSort(Arrays.java:1294)
at java.util.Arrays.mergeSort(Arrays.java:1294)
at java.util.Arrays.mergeSort(Arrays.java:1295)
at java.util.Arrays.mergeSort(Arrays.java:1294)
at java.util.Arrays.mergeSort(Arrays.java:1294)
at java.util.Arrays.sort(Arrays.java:1223)
at java.util.Collections.sort(Collections.java:176)
at org.richfaces.model.ArrangeableModel.sort(ArrangeableModel.java:260)
at org.richfaces.model.ArrangeableModel.arrange(ArrangeableModel.java:214)
at org.richfaces.component.UIDataTableBase.createExtendedDataModel(UIDataTableBase.java:170)
at org.richfaces.component.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:560)
at org.richfaces.component.UIDataAdaptor.getRowCount(UIDataAdaptor.java:607)
at org.richfaces.renderkit.AbstractTableRenderer.encodeTableRows(AbstractTableRenderer.java:147)
at org.richfaces.renderkit.AbstractTableRenderer.doEncodeChildren(AbstractTableRenderer.java:209)
at org.richfaces.renderkit.RendererBase.encodeChildren(RendererBase.java:157)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1643)
at org.richfaces.renderkit.DataTableRenderer.encodeRow(DataTableRenderer.java:183)
at org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:62)
at org.ajax4jsf.model.SequenceDataModel.walk(SequenceDataModel.java:109)
at org.richfaces.component.UIDataAdaptor.walk(UIDataAdaptor.java:918)
at org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:72)
at org.richfaces.renderkit.AbstractTableRenderer.encodeRows(AbstractTableRenderer.java:102)
at org.richfaces.renderkit.AbstractRowsRenderer.processRows(AbstractRowsRenderer.java:80)
at org.richfaces.renderkit.AbstractTableRenderer.encodeTableRows(AbstractTableRenderer.java:159)
at org.richfaces.renderkit.AbstractTableRenderer.doEncodeChildren(AbstractTableRenderer.java:209)
at org.richfaces.renderkit.RendererBase.encodeChildren(RendererBase.java:157)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1643)
at org.richfaces.context.ExtendedPartialViewContextImpl$RenderVisitCallback.visit(ExtendedPartialViewContextImpl.java:517)
at org.richfaces.context.BaseExtendedVisitContext.invokeVisitCallback(BaseExtendedVisitContext.java:480)
at org.richfaces.component.UIDataAdaptor.visitTree(UIDataAdaptor.java:1343)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at javax.faces.component.UIForm.visitTree(UIForm.java:331)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
at org.richfaces.context.ExtendedPartialViewContextImpl.processPartialRenderPhase(ExtendedPartialViewContextImpl.java:284)
at org.richfaces.context.ExtendedPartialViewContextImpl.processPartial(ExtendedPartialViewContextImpl.java:206)
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:968)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1643)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:378)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:269)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.richfaces.tests.metamer.TestIdentityFilter.doFilter(TestIdentityFilter.java:93)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:636)
Jan 12, 2011 2:28:15 PM org.richfaces.context.ExtendedPartialViewContextImpl$RenderVisitCallback logException
SEVERE: null
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[JBoss JIRA] Created: (RF-10503) Metamer - Collapsible Sub Table - sample throws NPE
by Lukas Fryc (JIRA)
Metamer - Collapsible Sub Table - sample throws NPE
---------------------------------------------------
Key: RF-10503
URL: https://issues.jboss.org/browse/RF-10503
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.0.Milestone6
Environment: http://localhost:8080/metamer/faces/components/richCollapsiblePanel/simpl...
RichFaces 4.0.0.20110209-M6 r.21581
Metamer 4.0.0.20110209-M6
Apache MyFaces JSF-2.0 Core Impl 2.0.3
JBoss AS 6.0.0.Final
OpenJDK Runtime Environment 1.6.0_20-b20 @Linux
Chrome 9.0.597.94 @ Linux x86_64
Reporter: Lukas Fryc
javax.faces.FacesException: java.lang.NullPointerException
at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(ExceptionHandlerImpl.java:241)
at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:156)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:258)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
at org.richfaces.tests.metamer.TestIdentityFilter.doFilter(TestIdentityFilter.java:93)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.NullPointerException
at org.richfaces.renderkit.html.CollapsiblePanelRenderer.encodeEmptyChild(CollapsiblePanelRenderer.java:205)
at org.richfaces.renderkit.html.CollapsiblePanelRenderer.doEncodeChildren(CollapsiblePanelRenderer.java:175)
at org.richfaces.renderkit.RendererBase.encodeChildren(RendererBase.java:157)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:488)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:537)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:520)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:541)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:520)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:92)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:519)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:626)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1320)
at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
... 23 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months