[ https://issues.apache.org/jira/browse/WICKET-3741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041777#comment-13041777 ]
Juergen Donnerstag commented on WICKET-3741: -------------------------------------------- I suggest a couple more changes: - "if (throwException) throw new MNE else return null".... is used probably a dozen times. A little helper will clean up the code a little bit - getAssociatedMarkup has no throwException. For consistency reasons I'd suggest to add the param. That change will also allow to remove hasAssociatedMarkup which executes partially the same code as getAssociatedMarkup - since getMarkup() was introduced with 1.5 only, I suggest to remove getMarkup() in favor of getMarkup(throwE) instead of keeping both - not sure I've seen it right, but it seems as if all exceptions are now "ignored" (return null). If that is true, than I'd change it to be "only markup not found" to return null. Invalid markup should still throw an exception and be handled as such I'll provide an updated patch soon > 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 > > > 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