Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-24613

Backward-compatibility aspect for the Include macro (missing-reference check) is never woven

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      The AspectJ backward-compatibility aspect IncludeMacroCompatibilityAspect is meant to restore the legacy behaviour of the include macro: when no reference (or deprecated document) parameter is given, it should throw a MacroExecutionException ("You must specify a 'reference' parameter pointing to the entity to include.").

      The advice is never woven: AspectJ reports advice ... has not been applied [Xlint:adviceDidNotMatch], so the legacy check never runs. Two reasons:

      • The pointcut uses call(* IncludeMacro.execute(..)). A call() pointcut only matches call sites located inside the woven classes, but the actual call to IncludeMacro.execute(..) happens in the macro-transformation code, outside this module's woven scope. It therefore matches nothing.
      • The pointcut binds a single argument (args(parameters)) whereas IncludeMacro.execute takes three arguments, so it could not have matched the real method signature anyway.

      Found while promoting AspectJ Xlint warnings to errors so that a non-woven backward-compatibility advice fails the build (XCOMMONS-3728).

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: