Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Intertype Questions after porting to 1.1.1

Paul,

One small note. There is a reasonable work-around (maybe Eric's phrasing didn't give the most complete explanation) available. As I recall, you could define a normal Java interface, Reservation, then define an interface ReservationHelper that extends Reservation, then use an ITD on ReservationHelper (not Reservation) and use declare parents: ReservationImpl implements ReservationHelper.

Re: your use case for inappropriate use of default constructors, you might advice in your aspect that throws an exception if you're calling the advice from outside the cflow of initialization. You might also make the constructor private (if Castor is able to invoke private constructors using AccessibleObject).

Ron Bodkin
Chief Technology Officer
New Aspects of Software
m: (415) 509-2895

> ------------Original Message------------
> From: Paul Christmann <paul@xxxxxxxxxxxxxxxxx>
> To: aspectj-users@xxxxxxxxxxx
> Date: Tue, Feb-10-2004 9:45 AM
> Subject: Re: [aspectj-users] Intertype Questions after porting to 1.1.1
> 
> Wes Isberg wrote:
> > Hi Paul -
> > 
> > Thanks for upgrading!
> 
> Glad to.  Sorry it took us so long! :)
> 
> > In reverse order:
> > 
> > - Use the iajc task, not Ajc10, if you can.
> >   (though results *should* be the same)
> 
> Definitely.  I only used Ajc10 while trying to verify whether the 
> behavior I was seeing existed in earlier releases or not.
> 
> > - Please do submit a bug for the reflective-invocation of
> > the constructor defined by the aspect (presumably publicly);
> > it will at least result in a doc clarification.  Try it
> > first with the latest compiler.
> 
> Will do.
> 
> > - Is Reservation an interface?  
> 
> I've tried it with Reservation as an interface, and found that the only 
> way I could get my test code to work was:
> a) Reservation interface included the method, and
> b) My Object in the TestCase was a Reservation object:
> 
>      Reservation res = new ReservationImpl(argsGoHere);
> 
> If I wrote:
> 
>      ReservationImpl res = new ReservationImpl(argsGoHere);
> 
> I still got the same behavior - I couldn't access the introduced method, 
> even though it was declared on the interface that ReservationImpl 
> implemented.  As I read the rest of your email, I think you say that I 
> should expect what I did encounter - at least with 1.1.1 as released.
> 
> But I'm not going to look any further than this given that:
> a) both you and Ron indicated that there was a known bug that has been 
> fixed in CVS Head, which I'm (unfortunately) not going to get to look at 
> soon, and
> b) I've found a perfectly reasonable work around - I actually didn't 
> need the intertype declarations, and could just move the methods onto 
> the affected class.
> 
> > Hope this helps!
> > Wes
> 
> Definitely did, and thank you as well for the prompt response!
> 
> -- 
> PC
> 
> Paul Christmann
> Prior Artisans, LLC
> mailto:paul@xxxxxxxxxxxxxxxxx
> 504-587-9072
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> 


Back to the top