Sorry if I've come
to this late and am missing some
context.... I typed in your program, added some missing types and added
a type that broke the rule:
-------------8<---------------
public aspect OptionAspect {
interface IBadOptionSubtype {};
declare parents : (IOption+ && !IOption &&
!IXOption && !IYOption && !IZOption) &&
!hasmethod(new(OptionType))
implements IBadOptionSubtype;
declare error : staticinitialization(IOption+ &&
IBadOptionSubtype+)
: "IOption implementations must provide a constructor which
accepts an OptionType";
}
interface IOption {}
interface IXOption extends IOption {}
interface IYOption extends IOption {}
interface IZOption extends IOption {}
class OptionType {}
class MyXOption implements IXOption {
public MyXOption(OptionType type) { }
}
class MyBrokenOption implements IXOption {
}
-----------------8<----------------
I then compiled it:
C:\aspectj1.5>ajc -XhasMember -showWeaveInfo OptionAspect.java
Extending interface set for type 'MyBrokenOption' (
OptionAspect.java) to include 'OptionAspect$IBadOptionSubtype'
(OptionAspect.java)
C:\aspectj1.5\OptionAspect.java:24 [error] IOption implementations must
provide a constructor which accepts an OptionType
class MyBrokenOption implements IXOption {
^^^^^^^^^^^^^
staticinitialization(void MyBrokenOption.<clinit>())
see also: C:\aspectj1.5\OptionAspect.java:8::0
1 error
-showWeaveInfo just shows me which is being marked as a bad option. My
correct class that implements the ctor is not flagged and my broken one
that doesn't implement it is marked with the declare error. Now I
presume I must have made some incorrect assumption in my definition of
the missing types since its working ok for me...
Andy.
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users