diff options
author | jhugunin <jhugunin> | 2003-03-11 23:46:51 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-03-11 23:46:51 +0000 |
commit | fd1560a8a1c91d1b65c738d4e9163d93700d1f00 (patch) | |
tree | 79e8faae79285850656b6b64632ed5900568db03 /org.aspectj.ajdt.core/src | |
parent | d6b8b38cd0a707741788f8d4fae3850b213f50a4 (diff) | |
download | aspectj-fd1560a8a1c91d1b65c738d4e9163d93700d1f00.tar.gz aspectj-fd1560a8a1c91d1b65c738d4e9163d93700d1f00.zip |
fixing Bug 31724
declare warning/error emitted without context
and generally providing better error context information
Diffstat (limited to 'org.aspectj.ajdt.core/src')
3 files changed, 21 insertions, 5 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java index 01ed6dcc2..2e0630f6c 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java @@ -18,6 +18,7 @@ import org.aspectj.ajdt.internal.compiler.ast.InterTypeConstructorDeclaration; import org.aspectj.ajdt.internal.compiler.ast.InterTypeDeclaration; import org.aspectj.ajdt.internal.compiler.ast.InterTypeFieldDeclaration; import org.aspectj.ajdt.internal.compiler.ast.InterTypeMethodDeclaration; +import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.SourceLocation; import org.aspectj.weaver.Member; import org.aspectj.weaver.Shadow; @@ -65,7 +66,7 @@ public class EclipseShadow extends Shadow { return world.fromBinding(enclosingMethod.binding.declaringClass); } - public SourceLocation getSourceLocation() { + public ISourceLocation getSourceLocation() { //XXX need to fill this in ASAP return null; } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java index dbb985ab0..abee60abf 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java @@ -16,6 +16,7 @@ package org.aspectj.ajdt.internal.compiler.lookup; import java.util.*; import org.aspectj.ajdt.internal.compiler.ast.*; +import org.aspectj.ajdt.internal.core.builder.EclipseSourceContext; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; import org.aspectj.weaver.*; @@ -54,6 +55,10 @@ public class EclipseSourceType extends ResolvedTypeX.ConcreteName { this.factory = factory; this.binding = binding; this.declaration = declaration; + + resolvedTypeX.setSourceContext(new EclipseSourceContext(declaration.compilationResult)); + resolvedTypeX.setStartPos(declaration.sourceStart); + resolvedTypeX.setEndPos(declaration.sourceEnd); } @@ -195,10 +200,10 @@ public class EclipseSourceType extends ResolvedTypeX.ConcreteName { // return crosscuttingMembers; // } - public ISourceLocation getSourceLocation() { - TypeDeclaration dec = binding.scope.referenceContext; - return new EclipseSourceLocation(dec.compilationResult, dec.sourceStart, dec.sourceEnd); - } +// public ISourceLocation getSourceLocation() { +// TypeDeclaration dec = binding.scope.referenceContext; +// return new EclipseSourceLocation(dec.compilationResult, dec.sourceStart, dec.sourceEnd); +// } public boolean isInterface() { return binding.isInterface(); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java index f54ebc1a1..fd107e77a 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java @@ -13,8 +13,11 @@ package org.aspectj.ajdt.internal.core.builder; +import java.io.File; + import org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceLocation; import org.aspectj.bridge.ISourceLocation; +import org.aspectj.bridge.SourceLocation; import org.aspectj.weaver.IHasPosition; import org.aspectj.weaver.ISourceContext; import org.eclipse.jdt.internal.compiler.CompilationResult; @@ -29,9 +32,16 @@ public class EclipseSourceContext implements ISourceContext { this.result = result; } + private File getSourceFile() { + return new File(new String(result.fileName)); + } public ISourceLocation makeSourceLocation(IHasPosition position) { return new EclipseSourceLocation(result, position.getStart(), position.getEnd()); } + public ISourceLocation makeSourceLocation(int line) { + return new SourceLocation(getSourceFile(), line); + } + } |