You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Mike Hefner (JIRA)" <ji...@apache.org> on 2010/09/18 21:13:33 UTC
[jira] Created: (WICKET-3057) NPE when deleting a TreeNode with
visible children
NPE when deleting a TreeNode with visible children
--------------------------------------------------
Key: WICKET-3057
URL: https://issues.apache.org/jira/browse/WICKET-3057
Project: Wicket
Issue Type: Bug
Components: wicket, wicket-extensions
Affects Versions: 1.4.12
Environment: Mac OS X 10.4.11, Firefox 3.6.10
Reporter: Mike Hefner
When using an org.apache.wicket.extensions.markup.html.tree.Tree, deleting a currently selected TreeNode that has been expanded so that its children are visible causes a NullPointerException.
In AbstractTree.treeNodesRemoved(), each of the deleted node's children is passed to DefaultTreeState.selectNode() to ensure that they are deselected. A flaw in the logic of that method caused the deleted node to be invalidated and mistakenly marked for rendering. When the deleted node is rendered, it no longer has a parent node, causing the NullPointerException on the line:
TreeNode parent = node.getParent();
My fix was to correct the logic in DefaultTreeState.selectNode() so that passing in a currently unselected node for deselection does not affect the currently selected node. Thus, the deleted node is not invalidated and is not rendered.
Stack Trace:
java.lang.NullPointerException
at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.isNodeLast(DefaultAbstractTree.java:622)
at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.access$0(DefaultAbstractTree.java:620)
at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree$1.onComponentTagBody(DefaultAbstractTree.java:310)
at org.apache.wicket.Component.renderComponent(Component.java:2686)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2517)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
at org.apache.wicket.Component.renderComponent(Component.java:2686)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
at org.apache.wicket.Component.render(Component.java:2517)
at org.apache.wicket.Component.renderComponent(Component.java:2627)
at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:317)
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:852)
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:613)
Complete stack:
org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = indent]]
at org.apache.wicket.Component.renderComponent(Component.java:2725)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2517)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
at org.apache.wicket.Component.renderComponent(Component.java:2686)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
at org.apache.wicket.Component.render(Component.java:2517)
at org.apache.wicket.Component.renderComponent(Component.java:2627)
at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3057) NPE when deleting a TreeNode with
visible children
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912248#action_12912248 ]
Hudson commented on WICKET-3057:
--------------------------------
Integrated in Apache Wicket 1.4.x #167 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.4.x/167/])
WICKET-3057 NPE when deleting a TreeNode with visible children
> NPE when deleting a TreeNode with visible children
> --------------------------------------------------
>
> Key: WICKET-3057
> URL: https://issues.apache.org/jira/browse/WICKET-3057
> Project: Wicket
> Issue Type: Bug
> Components: wicket, wicket-extensions
> Affects Versions: 1.4.12
> Environment: Mac OS X 10.4.11, Firefox 3.6.10
> Reporter: Mike Hefner
> Assignee: Martin Grigorov
> Fix For: 1.4.13, 1.5-M3
>
> Attachments: WICKET-3057-fix.patch, WICKET-3057-Quickstart.zip
>
>
> When using an org.apache.wicket.extensions.markup.html.tree.Tree, deleting a currently selected TreeNode that has been expanded so that its children are visible causes a NullPointerException.
> In AbstractTree.treeNodesRemoved(), each of the deleted node's children is passed to DefaultTreeState.selectNode() to ensure that they are deselected. A flaw in the logic of that method caused the deleted node to be invalidated and mistakenly marked for rendering. When the deleted node is rendered, it no longer has a parent node, causing the NullPointerException on the line:
> TreeNode parent = node.getParent();
> My fix was to correct the logic in DefaultTreeState.selectNode() so that passing in a currently unselected node for deselection does not affect the currently selected node. Thus, the deleted node is not invalidated and is not rendered.
> Stack Trace:
> java.lang.NullPointerException
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.isNodeLast(DefaultAbstractTree.java:622)
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.access$0(DefaultAbstractTree.java:620)
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree$1.onComponentTagBody(DefaultAbstractTree.java:310)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.Component.renderComponent(Component.java:2627)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
> at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
> at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:317)
> 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:852)
> 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:613)
> Complete stack:
> org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = indent]]
> at org.apache.wicket.Component.renderComponent(Component.java:2725)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.Component.renderComponent(Component.java:2627)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
> at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (WICKET-3057) NPE when deleting a TreeNode with
visible children
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov reassigned WICKET-3057:
---------------------------------------
Assignee: Martin Grigorov
> NPE when deleting a TreeNode with visible children
> --------------------------------------------------
>
> Key: WICKET-3057
> URL: https://issues.apache.org/jira/browse/WICKET-3057
> Project: Wicket
> Issue Type: Bug
> Components: wicket, wicket-extensions
> Affects Versions: 1.4.12
> Environment: Mac OS X 10.4.11, Firefox 3.6.10
> Reporter: Mike Hefner
> Assignee: Martin Grigorov
> Attachments: WICKET-3057-fix.patch, WICKET-3057-Quickstart.zip
>
>
> When using an org.apache.wicket.extensions.markup.html.tree.Tree, deleting a currently selected TreeNode that has been expanded so that its children are visible causes a NullPointerException.
> In AbstractTree.treeNodesRemoved(), each of the deleted node's children is passed to DefaultTreeState.selectNode() to ensure that they are deselected. A flaw in the logic of that method caused the deleted node to be invalidated and mistakenly marked for rendering. When the deleted node is rendered, it no longer has a parent node, causing the NullPointerException on the line:
> TreeNode parent = node.getParent();
> My fix was to correct the logic in DefaultTreeState.selectNode() so that passing in a currently unselected node for deselection does not affect the currently selected node. Thus, the deleted node is not invalidated and is not rendered.
> Stack Trace:
> java.lang.NullPointerException
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.isNodeLast(DefaultAbstractTree.java:622)
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.access$0(DefaultAbstractTree.java:620)
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree$1.onComponentTagBody(DefaultAbstractTree.java:310)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.Component.renderComponent(Component.java:2627)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
> at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
> at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:317)
> 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:852)
> 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:613)
> Complete stack:
> org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = indent]]
> at org.apache.wicket.Component.renderComponent(Component.java:2725)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.Component.renderComponent(Component.java:2627)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
> at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-3057) NPE when deleting a TreeNode with
visible children
Posted by "Mike Hefner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mike Hefner updated WICKET-3057:
--------------------------------
Attachment: WICKET-3057-Quickstart.zip
WICKET-3057-fix.patch
attached Quickstart and patch
> NPE when deleting a TreeNode with visible children
> --------------------------------------------------
>
> Key: WICKET-3057
> URL: https://issues.apache.org/jira/browse/WICKET-3057
> Project: Wicket
> Issue Type: Bug
> Components: wicket, wicket-extensions
> Affects Versions: 1.4.12
> Environment: Mac OS X 10.4.11, Firefox 3.6.10
> Reporter: Mike Hefner
> Attachments: WICKET-3057-fix.patch, WICKET-3057-Quickstart.zip
>
>
> When using an org.apache.wicket.extensions.markup.html.tree.Tree, deleting a currently selected TreeNode that has been expanded so that its children are visible causes a NullPointerException.
> In AbstractTree.treeNodesRemoved(), each of the deleted node's children is passed to DefaultTreeState.selectNode() to ensure that they are deselected. A flaw in the logic of that method caused the deleted node to be invalidated and mistakenly marked for rendering. When the deleted node is rendered, it no longer has a parent node, causing the NullPointerException on the line:
> TreeNode parent = node.getParent();
> My fix was to correct the logic in DefaultTreeState.selectNode() so that passing in a currently unselected node for deselection does not affect the currently selected node. Thus, the deleted node is not invalidated and is not rendered.
> Stack Trace:
> java.lang.NullPointerException
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.isNodeLast(DefaultAbstractTree.java:622)
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.access$0(DefaultAbstractTree.java:620)
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree$1.onComponentTagBody(DefaultAbstractTree.java:310)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.Component.renderComponent(Component.java:2627)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
> at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
> at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:317)
> 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:852)
> 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:613)
> Complete stack:
> org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = indent]]
> at org.apache.wicket.Component.renderComponent(Component.java:2725)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.Component.renderComponent(Component.java:2627)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
> at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-3057) NPE when deleting a TreeNode with
visible children
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov resolved WICKET-3057.
-------------------------------------
Fix Version/s: 1.4.13
1.5-M3
Resolution: Fixed
The patch is applied with slight improvements.
Thanks!
> NPE when deleting a TreeNode with visible children
> --------------------------------------------------
>
> Key: WICKET-3057
> URL: https://issues.apache.org/jira/browse/WICKET-3057
> Project: Wicket
> Issue Type: Bug
> Components: wicket, wicket-extensions
> Affects Versions: 1.4.12
> Environment: Mac OS X 10.4.11, Firefox 3.6.10
> Reporter: Mike Hefner
> Assignee: Martin Grigorov
> Fix For: 1.4.13, 1.5-M3
>
> Attachments: WICKET-3057-fix.patch, WICKET-3057-Quickstart.zip
>
>
> When using an org.apache.wicket.extensions.markup.html.tree.Tree, deleting a currently selected TreeNode that has been expanded so that its children are visible causes a NullPointerException.
> In AbstractTree.treeNodesRemoved(), each of the deleted node's children is passed to DefaultTreeState.selectNode() to ensure that they are deselected. A flaw in the logic of that method caused the deleted node to be invalidated and mistakenly marked for rendering. When the deleted node is rendered, it no longer has a parent node, causing the NullPointerException on the line:
> TreeNode parent = node.getParent();
> My fix was to correct the logic in DefaultTreeState.selectNode() so that passing in a currently unselected node for deselection does not affect the currently selected node. Thus, the deleted node is not invalidated and is not rendered.
> Stack Trace:
> java.lang.NullPointerException
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.isNodeLast(DefaultAbstractTree.java:622)
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.access$0(DefaultAbstractTree.java:620)
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree$1.onComponentTagBody(DefaultAbstractTree.java:310)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.Component.renderComponent(Component.java:2627)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
> at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
> at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:317)
> 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:852)
> 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:613)
> Complete stack:
> org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = indent]]
> at org.apache.wicket.Component.renderComponent(Component.java:2725)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.Component.renderComponent(Component.java:2627)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
> at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3057) NPE when deleting a TreeNode with
visible children
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912250#action_12912250 ]
Hudson commented on WICKET-3057:
--------------------------------
Integrated in Apache Wicket 1.5.x #338 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.5.x/338/])
WICKET-3057 NPE when deleting a TreeNode with visible children
> NPE when deleting a TreeNode with visible children
> --------------------------------------------------
>
> Key: WICKET-3057
> URL: https://issues.apache.org/jira/browse/WICKET-3057
> Project: Wicket
> Issue Type: Bug
> Components: wicket, wicket-extensions
> Affects Versions: 1.4.12
> Environment: Mac OS X 10.4.11, Firefox 3.6.10
> Reporter: Mike Hefner
> Assignee: Martin Grigorov
> Fix For: 1.4.13, 1.5-M3
>
> Attachments: WICKET-3057-fix.patch, WICKET-3057-Quickstart.zip
>
>
> When using an org.apache.wicket.extensions.markup.html.tree.Tree, deleting a currently selected TreeNode that has been expanded so that its children are visible causes a NullPointerException.
> In AbstractTree.treeNodesRemoved(), each of the deleted node's children is passed to DefaultTreeState.selectNode() to ensure that they are deselected. A flaw in the logic of that method caused the deleted node to be invalidated and mistakenly marked for rendering. When the deleted node is rendered, it no longer has a parent node, causing the NullPointerException on the line:
> TreeNode parent = node.getParent();
> My fix was to correct the logic in DefaultTreeState.selectNode() so that passing in a currently unselected node for deselection does not affect the currently selected node. Thus, the deleted node is not invalidated and is not rendered.
> Stack Trace:
> java.lang.NullPointerException
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.isNodeLast(DefaultAbstractTree.java:622)
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.access$0(DefaultAbstractTree.java:620)
> at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree$1.onComponentTagBody(DefaultAbstractTree.java:310)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.Component.renderComponent(Component.java:2627)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
> at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
> at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:317)
> 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:852)
> 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:613)
> Complete stack:
> org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = indent]]
> at org.apache.wicket.Component.renderComponent(Component.java:2725)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440)
> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
> at org.apache.wicket.Component.renderComponent(Component.java:2686)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
> at org.apache.wicket.markup.html.tree.AbstractTree$TreeItem.onRender(AbstractTree.java:215)
> at org.apache.wicket.Component.render(Component.java:2517)
> at org.apache.wicket.Component.renderComponent(Component.java:2627)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
> at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:682)
> at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:592)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.