--- /dev/null
+abstract aspect Base {
+
+ public final pointcut foo() : execution(* *(..));
+
+}
+
+aspect Sub extends Base {
+
+ public pointcut foo() : execution(* *(..)) && args(String);
+
+}
\ No newline at end of file
runTest("void field type in pointcut expression");
}
+ public void testPointcutOverriding() {
+ runTest("overriding final pointcut from super-aspect");
+ }
+
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {
<message line="3" kind="error" text="fields cannot have a void type"/>
</compile>
</ajc-test>
+
+ <ajc-test dir="bugs150" pr="86057" title="overriding final pointcut from super-aspect">
+ <compile files="pr86057.aj">
+ <message line="9" kind="error" text="can't override final pointcut Base.foo()"/>
+ </compile>
+ </ajc-test>
<ajc-test dir="bugs150" pr="78707" title="before returning advice not allowed!">
<compile files="pr78707.aj">
/**
* @return true if the override is legal
+ * note: calling showMessage with two locations issues TWO messages, not ONE message
+ * with an additional source location.
*/
public boolean checkLegalOverride(ResolvedMember parent, ResolvedMember child) {
//System.err.println("check: " + child.getDeclaringType() + " overrides " + parent.getDeclaringType());
+ if (Modifier.isFinal(parent.getModifiers())) {
+ world.showMessage(Message.ERROR,
+ WeaverMessages.format(WeaverMessages.CANT_OVERRIDE_FINAL_MEMBER,parent),
+ child.getSourceLocation(),null);
+ return false;
+ }
+
if (!parent.getReturnType().equals(child.getReturnType())) {
world.showMessage(IMessage.ERROR,
WeaverMessages.format(WeaverMessages.ITD_RETURN_TYPE_MISMATCH,parent,child),
public static final String ITD_MEMBER_CONFLICT = "itdMemberConflict";
public static final String ITD_NON_EXPOSED_IMPLEMENTOR = "itdNonExposedImplementor";
public static final String ITD_ABSTRACT_MUST_BE_PUBLIC_ON_INTERFACE = "itdAbstractMustBePublicOnInterface";
+ public static final String CANT_OVERRIDE_FINAL_MEMBER = "cantOverrideFinalMember";
public static final String NON_VOID_RETURN = "nonVoidReturn";
public static final String INCOMPATIBLE_RETURN_TYPE="incompatibleReturnType";
returnTypeMismatch=can''t override {0} with {1} return types don''t match
paramTypeMismatch=can''t override {0} with {1} parameter types don''t match
visibilityReduction=can''t override {0} with {1} visibility is reduced
+cantOverrideFinalMember=can''t override final {0}
doesntThrow=overriden method doesn't throw {0}
overriddenStatic={0} cannot override {1}; overridden method is static
overridingStatic={0} cannot override {1}; overriding method is static