[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] Generic Aspects in M4

Hello,

I tried the ExeptionHandling example in the developers notebook
(http://www.eclipse.org/aspectj/doc/next/adk15notebook/generics-inAspectJ5.html#d0e2939)
but get a strange error message:

can't determine superclass of missing type java.lang.StringBuilder
when matching pointcut ((within(de.aosd..*) && call(* doIO*(..))) &&
persingleton(de.aosd.IOExceptionHandling))
when matching shadow method-call(java.lang.StringBuilder
java.lang.StringBuilder.append(java.lang.String))
when weaving type de.aosd.IOExceptionHandling
when weaving aspects
when weaving
when batch building
BuildConfig[/home/oliver/doc/Kurs/AspectJ/www/AOP_AspectJ/examples/workspace/.metadata/.plugins/org.eclipse.ajdt.core/Kap07-2aAbstractGenerics.generated.lst]
#Files=3

The ExceptionHandling and IOExceptionHandling aspects are copied from
the developers notebook. Here the 2 classes (without comments):

public aspect IOExceptionHandling extends ExceptionHandling<IOException> {
    protected pointcut inExceptionHandlingScope() :
        call(* doIO*(..)) && within(de.aosd..*);
    protected void onException(IOException ex) {
        System.err.println("handled exception: " + ex.getMessage());
    }
}

public abstract aspect ExceptionHandling<T extends Throwable> {
    protected abstract void onException(T anException);
    protected abstract pointcut inExceptionHandlingScope();
    declare soft: T : inExceptionHandlingScope();
    after() throwing (T anException) : inExceptionHandlingScope() {
        onException(anException);
    }
}

I have no idea what the compiler wants to tell me. Could it be that
Generics in M4 is not yet fully supported?

regards
Oliver
-- 
Oliver Böhm
http://www.javatux.de