Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] RE: [Fwd: Re: [aspectj-users] newbie question - got around on ini tialization not supported error...]

Wes,

This sounds like fine language.  The exception handler end problem 
is one we're going to have to live with for a long time:  Essentially,
it is an implementation limitation for bytecode implementations but
not for source-level implementations.

The (pre)initialization problem is more of an engineering problem, 
though; it's possible, but a big pain to implement (and
the implementation is going to be none too quick, either).  

I'm not sure man-hours should be allocated to fixing the 
around x (pre)initialization feature until we know people need
it, but, of course, we might not know people need it until they 
have a chance to use it... 

So while there is a technical difference between the two caveats, I'm 
not sure if it'll be removed in 1.1.X.

-erik

-----Original Message-----
From: Wes Isberg [mailto:wes@xxxxxxxxxxxxxx] 
Sent: Tuesday, July 15, 2003 4:33 PM
To: Erik Hilsdale
Cc: aspectj-dev@xxxxxxxxxxx
Subject: [Fwd: Re: [aspectj-users] newbie question - got around on initialization not supported error...]


Erik -

fyi, I changed the limitations appendix of the Programming Guide to add the caveat for around advice on initializations:

----
The end of an exception handler is underdetermined in bytecode, so ajc will not implement after or around advice on handler join points.  Similarly, ajc cannot implement around advice on initialization or preinitialization join points.  In cases where ajc cannot implement advice, it will emit a compile-time error noting this as a compiler limitation.
----

If that limitation will be removed in a 1.1.X release, we can instead log the caveat as an "info" bug.

Wes

-------- Original Message --------
Subject: Re: [aspectj-users] newbie question - got around on 
initialization not supported error...
Date: Tue, 15 Jul 2003 10:49:35 -0700
From: Wes Isberg <wes@xxxxxxxxxxxxxx>
Reply-To: aspectj-users@xxxxxxxxxxx
To: aspectj-users@xxxxxxxxxxx
References: <20030715171248.1382D23F86@xxxxxxxxxxxxxxx>

Hi -

> I got a bunch of errors:
>
> D:\Projects\mj\src\mjaop\com\mediajunkies\aspect\dev\Test.java:25
around on
> initialization not supported (compiler limitation)

ajc is directing you to one of its limitations: it can't implement around advice on {pre-}initialization join points. (If/since this is the case, we should document it in the semantics appendix of the Programming Guide, as the handler case is.)

If you don't know why it's picking out those join points,
most likely you have a pointcut that picks out a bunch of
join points for your around advice, e.g.,

    Object around() : within(MyClass) {
       System.out.println("start!" + thisJoinPoint);
       try {
	return proceed();
       } finally {
           System.out.println("end!" + thisJoinPoint);
       }
    }

You can exclude {pre-}initialization and handler join points
as follows:

    Object around() : within(MyClass)
           && !initialization(MyClass.new(..))
           && !preinitialization(MyClass.new(..))
           && !handler(*) {
        ...

Or you can re-write the pointcut to pick out other kinds
of join points.

Thanks for bringing this up -
Wes

edgaryip@xxxxxxxxxxx wrote:
> Hi All,
> 
> I just started using AspectJ a week ago...tried out all the example.
> 
> When I try to use it in my project using iajc with ant, my ant setting 
> is:
> 
> <target name="compilej" depends="resources,init">
>   <iajc destdir="${build}"
> 	failonerror="off"
> 	argfiles="${mjaopSrc}/dev.lst"
> 	proceedonerror="on"
> 	verbose="off">
> 	<srcdir>
> 	  <pathelement path="${mjfSrc}" />
> 	  <pathelement path="${mjappSrc}" />
> 	</srcdir>
> 	<classpath>
> 	  <fileset dir="${build.classpath}" >
> 	    <include name="**/*.jar" />
> 	    <include name="**/*.zip" />
> 	  </fileset>
> 	</classpath>
>   </iajc>
>  </target>
> 
> 
> I got a bunch of errors:
> 
> D:\Projects\mj\src\mjaop\com\mediajunkies\aspect\dev\Test.java:25 
> around on
> initialization not supported (compiler limitation)
> D:\Projects\mj\src\mjaop\com\mediajunkies\aspect\dev\Test.java:19 around on 
> initialization not supported (compiler limitation)
> D:\Projects\mj\src\mjaop\com\mediajunkies\aspect\dev\Test.java:25 around on pre-
> initialization not supported (compiler limitation)
> D:\Projects\mj\src\mjaop\com\mediajunkies\aspect\dev\Test.java:19 around on pre-
> initialization not supported (compiler limitation)
> D:\Projects\mj\src\mjaop\com\mediajunkies\aspect\dev\Test.java:25 around on 
> initialization not supported (compiler limitation)
> D:\Projects\mj\src\mjf\com\mediajunkies\appkit\dnd\datatransfer\EOGlobalKey.java
> :7 around on initialization not supported (compiler limitation)
> ...
> 
> Am I missing something?
> 
> Thanks
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx 
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx http://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top