You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a reproducer Eclipse project (created in Eclipse 2023-06), please adjust absolute path to aop.xml in .settings/org.eclipse.ajdt.core.prefs: SO_AJ_ITDXmlConfigured_76854550.zip
Outside Eclipse, just unzip the project, enter the base directory and try this (example for Windows CMD shell):
$ del /s /q bin\*
(...)
$ ajc -cp "C:\Program Files\Java\AspectJ\lib\aspectjrt.jar" -8 -d bin -xmlConfigured aop.xml src\org\acme\MyOtherPanel.java src\de\scrum_master\app\Application.java src\de\scrum_master\app\MyTargetPanel.java src\de\scrum_master\aspect\MyAspect.aj
(...)
$ java -ea -cp "C:\Program Files\Java\AspectJ\lib\aspectjrt.jar;bin" de.scrum_master.app.Application
Exception in thread "main" java.lang.AssertionError: out-of-scope class parent should not have been altered by aspect
at de.scrum_master.app.Application.main(Application.java:18)
The assertion fails, because ITD did have an effect on the out-of-scope class. It would pass after we extend XML config scoping for AJC to respect ITD targets, too.
<aspectj>
<aspects>
<aspectname="de.scrum_master.aspect.MyAspect"scope="de.scrum_master.app..*" />
<!-- other aspects go here, with or without scope -->
</aspects>
</aspectj>
packagede.scrum_master.app;
importjavax.swing.JPanel;
importorg.acme.MyOtherPanel;
importde.scrum_master.aspect.MyAspect;
publicclassApplication {
publicstaticvoidmain(String[] args) {
assertMyTargetPanel.getMeaningOfLife() != 42
: "in-scope class method result should have been altered by aspect";
assertMyOtherPanel.getMeaningOfLife() == 42
: "out-of-scope class method result should not have been altered by aspect";
assertMyTargetPanel.class.getSuperclass().equals(MyAspect.MyPanel.class)
: "in-scope class parent should have been altered by aspect";
assertMyOtherPanel.class.getSuperclass().equals(JPanel.class)
: "out-of-scope class parent should not have been altered by aspect";
}
}
@aclement, I do not even dare to ask you to implement this, but I would be glad for advice about how to tackle this.
The text was updated successfully, but these errors were encountered:
As described at the end of my Stack Overflow answer and also in my Bugzilla 455014 comment, something like
has no effect on ITD, only on regular pointcuts.
Here is a reproducer Eclipse project (created in Eclipse 2023-06), please adjust absolute path to aop.xml in .settings/org.eclipse.ajdt.core.prefs:
SO_AJ_ITDXmlConfigured_76854550.zip
Outside Eclipse, just unzip the project, enter the base directory and try this (example for Windows CMD shell):
The assertion fails, because ITD did have an effect on the out-of-scope class. It would pass after we extend XML config scoping for AJC to respect ITD targets, too.
For reference, here is the complete code:
@aclement, I do not even dare to ask you to implement this, but I would be glad for advice about how to tackle this.
The text was updated successfully, but these errors were encountered: