Wicket
  1. Wicket
  2. WICKET-3741

Don't throw MarkupNotFoundException when the markup is acceptable to not be available yet

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5-RC4
    • Fix Version/s: 1.5-RC5
    • Component/s: wicket
    • Labels:
      None

      Description

      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).

      1. 3741-panel-not-registered.log
        9 kB
        Martin Grigorov
      2. wicket-3741.patch
        89 kB
        Juergen Donnerstag
      3. WICKET-3741.patch
        41 kB
        Martin Grigorov
      4. WICKET-3741.patch
        33 kB
        Martin Grigorov
      5. wicket-3741-2.patch
        3 kB
        Juergen Donnerstag

        Activity

        Juergen Donnerstag made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.5-RC5 [ 12316423 ]
        Resolution Fixed [ 1 ]
        Martin Grigorov made changes -
        Assignee Martin Grigorov [ mgrigorov ] Juergen Donnerstag [ jdonnerstag ]
        Juergen Donnerstag made changes -
        Attachment wicket-3741-2.patch [ 12481400 ]
        Juergen Donnerstag made changes -
        Attachment wicket-3741.patch [ 12481338 ]
        Martin Grigorov made changes -
        Attachment WICKET-3741.patch [ 12480645 ]
        Martin Grigorov made changes -
        Attachment 3741-panel-not-registered.log [ 12480641 ]
        Martin Grigorov made changes -
        Summary Introduce lightweight WicketRuntimeException for the cases when it can be ignored Don't throw MarkupNotFoundException when the markup is acceptable to not be available yet
        Martin Grigorov made changes -
        Attachment WICKET-3741.patch [ 12480536 ]
        Martin Grigorov made changes -
        Field Original Value New Value
        Assignee Martin Grigorov [ mgrigorov ]
        Martin Grigorov created issue -

          People

          • Assignee:
            Juergen Donnerstag
            Reporter:
            Martin Grigorov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development