Bug 535086 - Problems with missing aspect instances for pertypewithin sometimes
Summary: Problems with missing aspect instances for pertypewithin sometimes
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.9.1   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 1.9.2   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-24 15:18 EDT by Andrew Clement CLA
Modified: 2019-01-14 19:11 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2018-05-24 15:18:15 EDT
Reported on the mailing list. If you use pertypewithin it can't do its job if the aspect can't see (via reflection rules) methods in the affected target.

I think the visibility needs to be raised as part of applying the pertypewithin behaviour.
Comment 1 Alexander Kriegisch CLA 2018-05-27 02:11:29 EDT
Sample code reproducing the problem:

https://dev.eclipse.org/mhonarc/lists/aspectj-users/msg15196.html
Comment 2 Andrew Clement CLA 2018-05-28 15:57:25 EDT
The changes are in. Currently you need to specify privileged on the aspect in order for it to affect types that you normally cannot see from the aspect (private ones, those in a different package that have package visibility).

When bugzilla is working properly again (and I can add versions) i'll tag this as 1.9.2 fixed.
Comment 3 Alexander Kriegisch CLA 2018-05-29 05:02:27 EDT
Where can I find a snapshot for re-testing?
Comment 4 Andrew Clement CLA 2018-05-29 11:32:24 EDT
You don't trust me it works? :)

There is a 1.9.2.BUILD-SNAPSHOT at repo.spring.io/snapshot / maven.springframework.org/snapshot maven repo
Comment 5 Alexander Kriegisch CLA 2018-05-30 09:19:31 EDT
Of course I believe you, Andy. But in Germany the old saying goes: "Trust is good, control is better." I thought you would appreciate the feedback. ;-)


I found the relevant snapshot JARs within these directories:

http://maven.springframework.org/snapshot/org/aspectj/aspectjrt/1.9.2.BUILD-SNAPSHOT/
http://maven.springframework.org/snapshot/org/aspectj/aspectjweaver/1.9.2.BUILD-SNAPSHOT/
http://maven.springframework.org/snapshot/org/aspectj/aspectjtools/1.9.2.BUILD-SNAPSHOT/

Question: Did I miss something or is there also a complete installer JAR snapshot somewhere?

I downloaded and renamed them to aspectjrt.jar etc., backed up the 1.9.1 JARs from my AspectJ installation, copied the snapshots into the installation's 'lib' directory and manually compiled the sample code from my initial mailing list post. I can confirm that now everything works as expected with private or package-protected classes.

Bottom line: quick retest successful. :-)
Comment 6 Andrew Clement CLA 2018-05-30 11:28:56 EDT
There isn't an installer dev snapshot - the automated process for producing those broke a while ago and hasn't been setup again unfortunately.
Comment 7 Andrew Clement CLA 2018-05-30 11:29:07 EDT
thanks for testing that!
Comment 8 Andrew Clement CLA 2019-01-14 19:11:05 EST
tidying up bugzilla