Wicket
  1. Wicket
  2. WICKET-4114

Mark getRequestCycleProvider in Application final

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 6.0.0-beta1
    • Component/s: wicket
    • Labels:
      None

      Description

      A Developer should not be able to override getRequestCycleProvider, as this breaks some Functionality in BaseWicketTester, and to find out what goes wrong can be timeconsuming and can cause headaches.

      BaseWicketTester does the following:
      application.setRequestCycleProvider(new TestRequestCycleProvider(
      application.getRequestCycleProvider()));

      TestRequestCycleProvider provides the ability to force a certain RequestHandler (for example to Render a page used for BaseWicketTester#startPage,
      this ignores the normal Process to resolve a RequestHandler.
      If you override Application#getRequestCycleProvider, the Test will fail as Wicket will resolve the last RequestMapper in the Chain which is typically the HomePageMapper.

      You Test will fail, and you might have real problems to find out whats going on, as I had last night.
      Therefore I strongly recommend to mark #getRequestCycleProvider final. A developer has still the possibility to set a RequestCycleProvider with #setRequestCycleProvider, so we do not lose anything here.

      Thanks

      Martin Dilger

        Activity

        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Resolution Fixed [ 1 ]
        Martin Grigorov made changes -
        Fix Version/s 1.6.0 [ 12315431 ]
        Hide
        Martin Grigorov added a comment -

        It is trivial, but it is possible that someone already overrides it and this change will break her application in bug fix release...
        Scheduling it for 1.6.0.

        Show
        Martin Grigorov added a comment - It is trivial, but it is possible that someone already overrides it and this change will break her application in bug fix release... Scheduling it for 1.6.0.
        Martin Dilger made changes -
        Field Original Value New Value
        Attachment 0001-WICKET-4114-Mark-getRequestCycleProvider-as-final.patch [ 12498292 ]
        Martin Dilger created issue -

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Martin Dilger
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development