diff options
author | aclement <aclement> | 2004-08-27 11:18:01 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-08-27 11:18:01 +0000 |
commit | 5e0876580b0e95dd06ca4342e233f9a5dceb33a5 (patch) | |
tree | 6037b3a0ffe6978b3eb3427ce3a0fe1e5c63b018 /org.aspectj.ajdt.core | |
parent | b5e6307a63b0513cb058e8d6e56ff87287bdfa15 (diff) | |
download | aspectj-5e0876580b0e95dd06ca4342e233f9a5dceb33a5.tar.gz aspectj-5e0876580b0e95dd06ca4342e233f9a5dceb33a5.zip |
Fix for Bugzilla Bug 72699
Bogus error message: The abstract method ajc$pointcut$$tracingScope$a2 in type Tracing can only be defined by an abstract class
Diffstat (limited to 'org.aspectj.ajdt.core')
2 files changed, 34 insertions, 8 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java index e1c6673b7..1993e6836 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java @@ -76,14 +76,21 @@ public class PointcutDeclaration extends AjMethodDeclaration { selector = CharOperation.concat(mangledPrefix, '$', selector, '$', Integer.toHexString(sourceStart).toCharArray()); - if (Modifier.isAbstract(this.declaredModifiers) && - !(typeDec instanceof AspectDeclaration)) - { - typeDec.scope.problemReporter().signalError(sourceStart, sourceEnd, - "The abstract pointcut " + new String(declaredName) + - " can only be defined in an aspect"); - ignoreFurtherInvestigation = true; - return; + if (Modifier.isAbstract(this.declaredModifiers)) { + if (!(typeDec instanceof AspectDeclaration)) { + typeDec.scope.problemReporter().signalError(sourceStart, sourceEnd, + "The abstract pointcut " + new String(declaredName) + + " can only be defined in an aspect"); + ignoreFurtherInvestigation = true; + return; + } else if (!Modifier.isAbstract(typeDec.modifiers)) { + typeDec.scope.problemReporter().signalError(sourceStart, sourceEnd, + "The abstract pointcut " + new String(declaredName) + + " can only be defined in an abstract aspect"); + + ignoreFurtherInvestigation = true; + return; + } } if (pointcutDesignator != null) { diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java index 77457f879..5ac77b4ad 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java @@ -31,6 +31,7 @@ import org.eclipse.jdt.internal.compiler.CompilationResult; import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; import org.eclipse.jdt.internal.compiler.IProblemFactory; import org.eclipse.jdt.internal.compiler.ast.ASTNode; +import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.compiler.impl.ReferenceContext; @@ -41,6 +42,7 @@ import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; import org.eclipse.jdt.core.compiler.CharOperation; +import org.eclipse.jdt.core.compiler.IProblem; /** * Extends problem reporter to support compiler-side implementation of declare soft. @@ -221,5 +223,22 @@ public class AjProblemReporter extends ProblemReporter { if (reportIt) super.javadocMissingParamTag(arg, modifiers); } + + public void abstractMethodInAbstractClass(SourceTypeBinding type, AbstractMethodDeclaration methodDecl) { + + String abstractMethodName = new String(methodDecl.selector); + if (abstractMethodName.startsWith("ajc$pointcut")) { + // This will already have been reported, see: PointcutDeclaration.postParse() + return; + } + String[] arguments = new String[] {new String(type.sourceName()), abstractMethodName}; + super.handle( + IProblem.AbstractMethodInAbstractClass, + arguments, + arguments, + methodDecl.sourceStart, + methodDecl.sourceEnd,this.referenceContext, + this.referenceContext == null ? null : this.referenceContext.compilationResult()); + } } |