Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-646

beginListItem retro-compatibility can lead to beginListItem being called with and without parameter

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 14.1-rc-1
    • 10.0
    • API
    • None
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      When a class Child that implements beginListItem both with and without the parameter inherits from a class Intermediate that implements beginListItem just without parameter and it calls the corresponding parent method (to trigger forwarding in the chain), then both methods are called. This is because the retro-compatibility check doesn't stop searching for a class implementing just the method without parameter when it encounters a class implementing both variants. Thus, the call that should just forward the call in the chain actually calls beginListItem without parameter in Child. A similar issue also happens if Child implements just the method without parameter and Intermediate implements both variants - then both variants in Intermediate are called.

      I don't know how to fix this properly, but I guess we should at least stop using the compatibility wrapper if we find a class implementing both methods before finding a class that would need the compatibility wrapper.

      Attachments

        Activity

          People

            MichaelHamann Michael Hamann
            MichaelHamann Michael Hamann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: