From: jhugunin Date: Wed, 12 Mar 2003 23:37:01 +0000 (+0000) Subject: fix for class not allowed to extend aspect and moving corresponding test out of failing X-Git-Tag: v1_1_0_RC1~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=03448a7d4363abe6cd99da99a050fecef9cf8f72;p=aspectj.git fix for class not allowed to extend aspect and moving corresponding test out of failing --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java index 522b80197..797ae15c3 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java @@ -122,6 +122,15 @@ public class AjLookupEnvironment extends LookupEnvironment { } SourceTypeBinding sourceType = s.referenceContext.binding; + // test classes don't extend aspects + if (sourceType.superclass != null) { + ResolvedTypeX parent = factory.fromEclipse(sourceType.superclass); + if (parent.isAspect() && !(dec instanceof AspectDeclaration)) { + factory.showMessage(IMessage.ERROR, "class \'" + new String(sourceType.sourceName) + + "\' can not extend aspect \'" + parent.getName() + "\'", + factory.fromEclipse(sourceType).getSourceLocation(), null); + } + } ReferenceBinding[] memberTypes = sourceType.memberTypes; for (int i = 0, length = memberTypes.length; i < length; i++) { diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index 1e192ba8a..5f477a19b 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -5711,4 +5711,11 @@ + + + + + + diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index 578f0aa75..30dfe9160 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -11,13 +11,6 @@ - - - - - - + diff --git a/tests/jimTests.xml b/tests/jimTests.xml index f4adb0f97..7c1c4af1f 100644 --- a/tests/jimTests.xml +++ b/tests/jimTests.xml @@ -1,9 +1,6 @@ - - -