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 2011/06/03 15:30:47 UTC

[jira] [Updated] (WICKET-3741) Don't throw MarkupNotFoundException when the markup is acceptable to not be available yet

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

Juergen Donnerstag updated WICKET-3741:
---------------------------------------

    Attachment: wicket-3741.patch

I review especially the lower level stuff and added more comments. 
NO_MARKUP should only be used insight MarkupCache since ConcurrentHashMap neither allows null keys nor null value. MarkupCache / MarkupFactory "user" API should return null upon MarkupNotFound
Found problems with the markup still throw exception. Only markup not found exception should be controlled via the added attribute
All tests successfully pass
Still to be done:
- replace common boilerplate with MarkupUtils.throwException ...
- getAssociatedMarkup(throwException) is not yet implemented
- I'd like to remove the getMarkup() and getAssociatedMarkup() versions without parameter, which why they are discouraged for now. Haven't eliminated the warnings yet.
- getMarkupType() should as well get the attribuite in order to be consistent. It returning null if the parent can not be found is not very obvious in my opinion. 

> Don't throw MarkupNotFoundException when the markup is acceptable to not be available yet
> -----------------------------------------------------------------------------------------
>
>                 Key: WICKET-3741
>                 URL: https://issues.apache.org/jira/browse/WICKET-3741
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core
>    Affects Versions: 1.5-RC4
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>         Attachments: 3741-panel-not-registered.log, WICKET-3741.patch, WICKET-3741.patch, wicket-3741.patch
>
>
> Some areas in Wicket code do expensive creation of WicketRuntimeException and then just ignores it.
> The most common case is :
> at java.lang.Throwable.fillInStackTrace(Native Method)
> at java.lang.Throwable.<init>(Throwable.java:218)
> at java.lang.Exception.<init>(Exception.java:59)
> at java.lang.RuntimeException.<init>(RuntimeException.java:61)
> at org.apache.wicket.WicketRuntimeException.<init>(WicketRuntimeException.java:49)
> at org.apache.wicket.MarkupContainer.getMarkupType(MarkupContainer.java:476)
> at org.apache.wicket.markup.DefaultMarkupCacheKeyProvider.getCacheKey(DefaultMarkupCacheKeyProvider.java:85)
> at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:274)
> at org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:218)
> at org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:192)
> at org.apache.wicket.MarkupContainer.getAssociatedMarkup(MarkupContainer.java:410)
> at org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.getMarkup(PanelMarkupSourcingStrategy.java:70)
> at org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:456)
> at org.apache.wicket.Component.getMarkup(Component.java:734)
> at org.apache.wicket.MarkupContainer.add(MarkupContainer.java:173)
> ...
> and is ignored in MarkupContainer#add(). 
> Such an exception is created for every component which is added in the constructor of another component (in contrast to onInitialize() where the markup will be available).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira