@@ -0,0 +1,9 @@ | |||
package com.test; | |||
public interface IOption { | |||
} |
@@ -0,0 +1,17 @@ | |||
package com.test; | |||
public interface IXOption extends IOption { | |||
} |
@@ -0,0 +1,34 @@ | |||
package com.test; | |||
public interface IYOption extends IOption { | |||
} |
@@ -0,0 +1,4 @@ | |||
package com.test; | |||
public interface IZOption extends IOption { | |||
} |
@@ -0,0 +1,10 @@ | |||
package com.test; | |||
public class MyBrokenXOption implements IXOption { | |||
public MyBrokenXOption() { | |||
super(); | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
package com.test; | |||
public class MyXOption implements IXOption { | |||
public MyXOption(OptionType optionType) { | |||
super(); | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
package com.test; | |||
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"; | |||
} |
@@ -0,0 +1,9 @@ | |||
package com.test; | |||
public class OptionType { | |||
public OptionType() { | |||
super(); | |||
} | |||
} |