summaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-05-19 20:51:44 +0000
committerjhugunin <jhugunin>2003-05-19 20:51:44 +0000
commitf8647878b30aa303580326a67e98c75b0dc553b1 (patch)
treef3b65ca3bf0f371d00ba6d79c953828912dbec7a /weaver
parentc552c812c2d82e4d5668f6194532179a487adc95 (diff)
downloadaspectj-f8647878b30aa303580326a67e98c75b0dc553b1.tar.gz
aspectj-f8647878b30aa303580326a67e98c75b0dc553b1.zip
better error message for trying declare parents on Object
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/DeclareParents.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java b/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java
index efc8bf69b..7a66631b0 100644
--- a/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java
+++ b/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java
@@ -113,12 +113,18 @@ public class DeclareParents extends Declare {
if (typePattern == TypePattern.NO) return null; // already had an error here
TypeX iType = typePattern.getExactType();
ResolvedTypeX parentType = iType.resolve(world);
+
+ if (targetType.equals(world.resolve(TypeX.OBJECT))) {
+ world.showMessage(IMessage.ERROR, "can't change the parents of java.lang.Object",
+ this.getSourceLocation(), null);
+ return null;
+ }
if (parentType.isAssignableFrom(targetType)) return null; // already a parent
if (targetType.isAssignableFrom(parentType)) {
world.showMessage(IMessage.ERROR,
- "type can not extend itself", this.getSourceLocation(), null
+ "type \'" + targetType.getName() + "\'can not extend itself", this.getSourceLocation(), null
);
return null;
}