Bug 76344 - privileged inner classes
Summary: privileged inner classes
Status: REOPENED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-15 07:05 EDT by Bruno Harbulot CLA
Modified: 2009-08-30 02:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno Harbulot CLA 2004-10-15 07:05:02 EDT
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.
Comment 1 Adrian Colyer CLA 2005-08-26 11:12:28 EDT
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.
Comment 2 Eclipse Webmaster CLA 2009-08-30 02:51:19 EDT
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.