There are 7 updates, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-f58807cd-1275-4da4-ba53-bf4ab3034f09 XWIKI-24613 Closed

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

 
View issue   ยท   Add comment
 

7 updates

 
cid:jira-generated-image-avatar-94468f70-5c52-4f31-9b66-d68c588c23e9 Changes by Vincent Massol on 23/Jul/26 23:30
 
Documentation in Release Notes: N/A
Documentation: 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 \ ).

Assignee: Vincent Massol
Resolution: Fixed
Status: Open Closed
Labels: regression
 
 

1 comment

 
cid:jira-generated-image-avatar-94468f70-5c52-4f31-9b66-d68c588c23e9 Vincent Massol on 23/Jul/26 23:39
 

Need to decide if we merge on older branches.