Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2969

Throw an IllegalStateException for already implemented onInitialize methods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4.9
    • 1.4.10
    • wicket
    • None

    Description

      As discussed on the devs mail list, the oninitialize method may already be implemented by some user. The Component on the next release can throw an IllegalStateException for those situations. IMO it is better than have this method called twice. I'm sending an patch with the implementation and an test for it.

      On a related note, the onInitialize javadoc says:

      • Overrides must call super# {@link #onInitialize()}

        . Usually this should be the first thing an

      • override does, much like a constructor.
        I just put that super call on the onInitialize overriding methods at the ComponentInitializationTest.

      Attachments

        1. patch.txt
          3 kB
          Pedro Santos

        Activity

          People

            Unassigned Unassigned
            pedrosans Pedro Santos
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: