You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Juergen Donnerstag (JIRA)" <ji...@apache.org> on 2010/01/17 19:27:54 UTC

[jira] Resolved: (WICKET-2671) Enclosure causes Nullpointer exception

     [ https://issues.apache.org/jira/browse/WICKET-2671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juergen Donnerstag resolved WICKET-2671.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4.6
         Assignee: Juergen Donnerstag

fixed in 1.4

Enclosure implementation in 1.5 is completly different.

> Enclosure causes Nullpointer exception
> --------------------------------------
>
>                 Key: WICKET-2671
>                 URL: https://issues.apache.org/jira/browse/WICKET-2671
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Sven Rienstra
>            Assignee: Juergen Donnerstag
>            Priority: Critical
>             Fix For: 1.4.6
>
>
> There is a bug in DirectChildTagIterator which causes a Nullpointer exception with the following stack trace:
> Caused by: java.lang.NullPointerException
> 	at org.apache.wicket.markup.html.internal.DirectChildTagIterator.findNext(DirectChildTagIterator.java:115)
> 	at org.apache.wicket.markup.html.internal.DirectChildTagIterator.next(DirectChildTagIterator.java:85)
> 	at org.apache.wicket.markup.html.internal.Enclosure.ensureAllChildrenPresent(Enclosure.java:236)
> 	at org.apache.wicket.markup.html.internal.Enclosure.onComponentTagBody(Enclosure.java:169)
> 	at org.apache.wicket.Component.renderComponent(Component.java:2619)
> 	... 106 more
> The problem is in this code fragment:
> while (markupStream.hasMore())
> {
> 	final MarkupElement cursor = markupStream.next();
>         if (cursor.closes(parent))
> markupStream.hasMore() checks if the currentindex is available to retrieve, while markupStream.next() doesn't retrieve the currentindex, but tries to retrieve the currentindex + 1 element. The right function to get the current element is markupStream.get(). 
> To fix this, it should be like this:
> while (markupStream.hasMore())
> 		{
> 			final MarkupElement cursor = markupStream.get();
> 			markupStream.next();
> 			if (cursor.closes(parent))
> The best fix is imo to make next() in MarkupStream a void method, which will prevent this in the future.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.