Community
Participate
Working Groups
Hello, I'd like to suggest that the "privileged" keyword also applies to calls from inner classes within a privileged aspect. I've been using aspects for multithreading and I've got inner classes implementing "Runnable" that are calling private methods of other classes. For example: public class ComputationalClass { private void compute (int min, int max) { for (int i=min; i<=max; i++) { /* ... */ } } /* ... */ } public privileged aspect MultiThread { private final class ComputeRunner implements Runnable { private final ComputationalClass compClass ; /* ... */ public void run() { compClass.myCompute(min, max) ; } } private void ComputationalClass.myCompute (int min, int max) { compute(min, max) ; } /* Then, an "around" piece of advice can intercept calls to ComputationalClass.compute(int, int) and "replace" them by running several ComputerRunners on several Threads. */ } Ideally, it would be better not to need to write the inter-type declaration ("myCompute"), and give the inner class privileged access to ComputationalClass.compute as well. Could a feature like this be envisaged in a future release of AspectJ (although this would change the language specifications)? Bruno.
We're not going to get to this in AJ 1.5.0. Marking as "LATER" for consideration in 1.5.1 and future release planning.
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.