summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-11-21 09:22:45 +0000
committeraclement <aclement>2005-11-21 09:22:45 +0000
commit490749300499a9dac9d290d32cb56ef37e13d74e (patch)
treed03ac636b0caa48d458aa96bc3565656e1d98905
parent5440ef30e462c7cb77dbb75c1f90317ab9edc8a9 (diff)
downloadaspectj-490749300499a9dac9d290d32cb56ef37e13d74e.tar.gz
aspectj-490749300499a9dac9d290d32cb56ef37e13d74e.zip
test and fix for 114875
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java10
-rw-r--r--tests/multiIncremental/pr114875/base/Base.java16
-rw-r--r--tests/multiIncremental/pr114875/inc1/Sub.java17
-rw-r--r--tests/multiIncremental/pr114875/inc2/Base.java16
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java11
5 files changed, 66 insertions, 4 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
index f5855ba63..ab320a187 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
@@ -240,10 +240,12 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor {
TypeBinding parentBinding = parentRef.resolvedType;
if (parentBinding instanceof SourceTypeBinding) {
SourceTypeBinding parentSTB = (SourceTypeBinding) parentBinding;
- TypeDeclaration parentDecl = parentSTB.scope.referenceContext;
- if (isAspect(parentDecl) && !Modifier.isAbstract(parentDecl.modifiers)) {
- typeDecl.scope.problemReporter().signalError(typeDecl.sourceStart,typeDecl.sourceEnd,"cannot extend a concrete aspect");
- }
+ if (parentSTB.scope!=null) { // scope is null if its a binarytypebinding (in AJ world, thats a subclass of SourceTypeBinding)
+ TypeDeclaration parentDecl = parentSTB.scope.referenceContext;
+ if (isAspect(parentDecl) && !Modifier.isAbstract(parentDecl.modifiers)) {
+ typeDecl.scope.problemReporter().signalError(typeDecl.sourceStart,typeDecl.sourceEnd,"cannot extend a concrete aspect");
+ }
+ }
}
}
diff --git a/tests/multiIncremental/pr114875/base/Base.java b/tests/multiIncremental/pr114875/base/Base.java
new file mode 100644
index 000000000..e74954380
--- /dev/null
+++ b/tests/multiIncremental/pr114875/base/Base.java
@@ -0,0 +1,16 @@
+package com.aspectj.test;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+
+@Aspect
+public abstract class Base {
+
+ @Pointcut //
+ abstract void method();
+
+
+ public static void main(String args[]){
+ }
+}
diff --git a/tests/multiIncremental/pr114875/inc1/Sub.java b/tests/multiIncremental/pr114875/inc1/Sub.java
new file mode 100644
index 000000000..42d011b35
--- /dev/null
+++ b/tests/multiIncremental/pr114875/inc1/Sub.java
@@ -0,0 +1,17 @@
+package com.aspectj.test;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+
+@Aspect
+public class Sub extends Base{
+
+ @Pointcut( "execution(* com.aspectj.test.Base.main(..))" )
+ void method(){};
+
+ @Before("method()")
+ public void test(){
+
+ }
+}
diff --git a/tests/multiIncremental/pr114875/inc2/Base.java b/tests/multiIncremental/pr114875/inc2/Base.java
new file mode 100644
index 000000000..e74954380
--- /dev/null
+++ b/tests/multiIncremental/pr114875/inc2/Base.java
@@ -0,0 +1,16 @@
+package com.aspectj.test;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+
+@Aspect
+public abstract class Base {
+
+ @Pointcut //
+ abstract void method();
+
+
+ public static void main(String args[]){
+ }
+}
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
index 7cb951e1a..f31b19a9f 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
@@ -289,6 +289,17 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
build("PR92837");
}
+ public void testPr114875() {
+ initialiseProject("pr114875");
+ build("pr114875");
+ alter("pr114875","inc1");
+ build("pr114875");
+ checkWasntFullBuild();
+ alter("pr114875","inc2");
+ build("pr114875");
+ checkWasntFullBuild();
+ }
+
/* public void testPr111779() {
super.VERBOSE=true;
initialiseProject("PR111779");