Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Error in accessing private methods from a "privileged" aspect

It will be great if you can let me know when they are available.
Thanks.

Andrew Clement <CLEMAS@xxxxxxxxxx> wrote:

For those users on Eclipse 2.1 who are using 1.1.4 I have written some scripts
that will update its internal version of AspectJ to 1.2 - I hope to make those
available very soon.

cheers,
Andy.



"rbodkin" <rbodkin@xxxxxxxxxxxxxx>
Sent by: aspectj-users-admin@xxxxxxxxxxx

17/06/2004 18:23

Please respond to
aspectj-users

To
aspectj-users@xxxxxxxxxxx
cc
Subject
Re: [aspectj-users] Error in accessing private methods from a "privileged" aspect





Hi Irum,

I tested with AspectJ 1.2 and I use AJDT 1.10 with Eclipse 3.0 M9. There are
a lot of fixes and improvements in AspectJ 1.2, so I'd suggest you use that.
If you have to stay with Ecipse 2.1, then you might consider using ant to
build inside Eclipse.

On Thu, 17 Jun 2004 10:13:52 -0700 (PDT), Irum Godil wrote
> Which versions of eclipse, ajdt and aspectJ are you using? I am
> using Eclipse 2.1.3 and AJDT 1.1.4. I also tried downloading AJDT
> 1.1.10 but it does not work with Eclipse 2.1 versions.
>  
> Thanks.
>
> Ron Bodkin <rbodkin@xxxxxxxxxxxxxx> wrote:
> body { margin: 5px;       font-size:10pt;       font-family:"Arial";
>       color: black;}p   { margin: 0px;}ol  { margin-top: 5px;      
> margin-bottom: 5px;}ul  { margin-top: 5px;      margin-bottom:
> 5px;}blockquote  { margin-top: 5px;      margin-bottom: 5px;} Hi Irum,
>
>  
>
> The following code does compile for me, so I'm surprised the
> workaround didn't work for you. If you define the aspect inside
> package a, then the bug doesn't appear to occur (although that might
> be unworkable too)
>
>  
>
> package a;
>
> public class ITD {
>     private void returnNothing(Object a) {
>     }
> }
>
>  
>
> package b;
>
> import a.*;
>
> privileged aspect B {
>   public void ITD.newFun() {
>       this.returnNothing("a");
>   }
>
> }
>
>  
>
> Ron Bodkin
>
> Chief Technology Officer
>
> New Aspects of Software
>
> o: (415) 824-4690
>
> m: (415) 509-2895
>
>  
>
>  
>
> ------------Original Message------------
>
> From: Irum Godil <softwarengineer2003@xxxxxxxxx>
>
> To: aspectj-users@xxxxxxxxxxx
>
> Date: Thu, Jun-17-2004 7:46 AM
>
> Subject: Re: [aspectj-users] Error in accessing private methods from
> a "privileged" aspect Hi Ron, Thank you for your response and for
> logging the bug. However, I am not very clear on your workaround.
> Are you saying that inside my aspect B I use the following (see the
> highlighted line). If so, I tried that and I still get the same
> problem.
>  
>
> package b;
>
> import a.*;
>
> privileged aspect B {
>
>  
>
> public void newA(Object a) {
>
> }
>
> public void A..newFun() {
>
> this.returnNothing(new String("a"));
>
> }
>
> }
>
>  
>
> If you mean that I should define "returnNothing" inside of class B,
>  then that will not really work for me. Because in the actual piece
> of code where I am having this problem, I need returnNothing to be
> visible in class A so other pieces of code not using the aspect can
> use it as well.
>
>  
>
> Is there any other workaround?
>
> thanks.
>
> Ron Bodkin <rbodkin@xxxxxxxxxxxxxx> wrote:
> body { margin: 5px;       font-size:10pt;       font-family:"Arial";
>       color: black;}p   { margin: 0px;}ol  { margin-top: 5px;      
> margin-bottom: 5px;}ul  { margin-top: 5px;      margin-bottom:
> 5px;}blockquote  { margin-top: 5px;      margin-bottom: 5px;} Hi Irum,
>
>  
>
> This is compiler bug, which I have now reported. It appears to occur
> only when you have types in different packages and are passing an
> argument with a type conversion. Fortunately, I found that you can
> workaround it using this.returnNothing() in your inter-type
> declaration. I have reported it as a bug (#67578 - see
> https://bugs..eclipse.org/bugs/show_bug.cgi?id=67578)
>
>  
>
> I also found a closely related bug that crashes the compiler (bug
> #67579).
>
>  
>
> Ron Bodkin
>
> Chief Technology Officer
>
> New Aspects of Software
>
> o: (415) 824-4690
>
> m: (415) 509-2895
>
>  
>
>  
>
> ------------Original Message------------
>
> From: Irum Godil <softwarengineer2003@xxxxxxxxx>
>
> To: aspectj-users@xxxxxxxxxxx
>
> Date: Wed, Jun-16-2004 7:30 PM
>
> Subject: [aspectj-users] Error in accessing private methods from a
> "privileged" aspect Hi, I am seeing a strange scenario and I will
> really appreciate your help in the matter. Basically, I have an
> aspect and a class. The class has a private method and I want to
> access that method in the aspect. I have imported the class' package
> and I declare my aspect to be "privileged" as well. But I keep
> getting the error:
>  
> Error   The method returnNothing(Object) from the type A is not
> visible B.java Test/b
>
> Following is the code for it:
>  
>
> package a;
>
> public class A {
>
> private void returnNothing(Object a) {
>
> }
>
> }
>
>  
>
> package b;
>
> import a.*;
>
> privileged aspect B {
>
> public void A..newFun() {
>
> returnNothing(new String("a"));
>
> }
>
> }
>
> I am not sure why is it not visible when I have declared my package
> to be privileged and also imported the package. Any help will be
> appreciated.
>
> Thanks.
>
>  
>
> ---------------------------------
> Do you Yahoo!?
> Read only the mail you want - Yahoo! Mail SpamGuard.
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail is new and improved - Check it out!
>                                  
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail - You care about security. So do we.



Ron Bodkin
Chief Technology Officer
New Aspects
m: (415) 509-2895
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users


Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.

Back to the top