diff options
author | aclement <aclement> | 2006-10-16 13:04:42 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-10-16 13:04:42 +0000 |
commit | d701aa00e0747e5b14180867bd8f3d5213c90a71 (patch) | |
tree | d6308a138509a634bc37c0b10f36251761c29130 /weaver | |
parent | 9030415d5741f7d4ac96cd055e860c7760d93d37 (diff) | |
download | aspectj-d701aa00e0747e5b14180867bd8f3d5213c90a71.tar.gz aspectj-d701aa00e0747e5b14180867bd8f3d5213c90a71.zip |
tests and fixes for 160469: handle problems
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/Advice.java | 6 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/Checker.java | 4 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/ShadowMunger.java | 24 |
3 files changed, 12 insertions, 22 deletions
diff --git a/weaver/src/org/aspectj/weaver/Advice.java b/weaver/src/org/aspectj/weaver/Advice.java index ba3bf6bca..0f5a8e7de 100644 --- a/weaver/src/org/aspectj/weaver/Advice.java +++ b/weaver/src/org/aspectj/weaver/Advice.java @@ -364,6 +364,7 @@ public abstract class Advice extends ShadowMunger { Advice munger = world.createAdviceMunger(attribute, p, signature); munger.concreteAspect = fromType; munger.bindingParameterTypes = this.bindingParameterTypes; + munger.setDeclaringType(getDeclaringType()); //System.err.println("concretizing here " + p + " with clause " + clause); return munger; } @@ -431,9 +432,4 @@ public abstract class Advice extends ShadowMunger { return concreteAspect; } - public ResolvedType getResolvedDeclaringAspect() { - // The aspect which declares this piece of advice - // is 'concreteAspect' since 'declaringType' is null - return ((concreteAspect != null) ? concreteAspect : getDeclaringType()); - } } diff --git a/weaver/src/org/aspectj/weaver/Checker.java b/weaver/src/org/aspectj/weaver/Checker.java index 6dd5fd9b0..b7990c88c 100644 --- a/weaver/src/org/aspectj/weaver/Checker.java +++ b/weaver/src/org/aspectj/weaver/Checker.java @@ -135,8 +135,4 @@ public class Checker extends ShadowMunger { return isError; } - public ResolvedType getResolvedDeclaringAspect() { - // The aspect which declares this deow is the declaring type - return getDeclaringType(); - } } diff --git a/weaver/src/org/aspectj/weaver/ShadowMunger.java b/weaver/src/org/aspectj/weaver/ShadowMunger.java index a376187a6..bffb9f45d 100644 --- a/weaver/src/org/aspectj/weaver/ShadowMunger.java +++ b/weaver/src/org/aspectj/weaver/ShadowMunger.java @@ -157,12 +157,6 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH public abstract boolean mustCheckExceptions(); /** - * Returns the ResolvedType corresponding to the aspect in which this - * shadowMunger is declared. This is different for deow's and advice. - */ - public abstract ResolvedType getResolvedDeclaringAspect(); - - /** * Creates the hierarchy for binary aspects */ public void createHierarchy() { @@ -177,7 +171,7 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH return; } - ResolvedType aspect = getResolvedDeclaringAspect(); + ResolvedType aspect = getDeclaringType(); // create the class file node IProgramElement classFileNode = new ProgramElement( @@ -261,10 +255,14 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH ResolvedMember pcd = children[i]; if (pcd instanceof ResolvedPointcutDefinition) { ResolvedPointcutDefinition rpcd = (ResolvedPointcutDefinition)pcd; + ISourceLocation sLoc = rpcd.getPointcut().getSourceLocation(); + if (sLoc == null) { + sLoc = rpcd.getSourceLocation(); + } parent.addChild(new ProgramElement( pcd.getName(), IProgramElement.Kind.POINTCUT, - getBinarySourceLocation(rpcd.getPointcut().getSourceLocation()), + getBinarySourceLocation(sLoc), pcd.getModifiers(), null, Collections.EMPTY_LIST)); @@ -341,8 +339,8 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH private ISourceLocation getBinarySourceLocation(ISourceLocation sl) { if (sl == null) return null; String sourceFileName = null; - if (getResolvedDeclaringAspect() instanceof ReferenceType) { - String s = ((ReferenceType)getResolvedDeclaringAspect()).getDelegate().getSourcefilename(); + if (getDeclaringType() instanceof ReferenceType) { + String s = ((ReferenceType)getDeclaringType()).getDelegate().getSourcefilename(); int i = s.lastIndexOf('/'); if (i != -1) { sourceFileName = s.substring(i+1); @@ -369,8 +367,8 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH */ private File getBinaryFile() { if (binaryFile == null) { - String s = getResolvedDeclaringAspect().getBinaryPath(); - File f = getResolvedDeclaringAspect().getSourceLocation().getSourceFile(); + String s = getDeclaringType().getBinaryPath(); + File f = getDeclaringType().getSourceLocation().getSourceFile(); int i = f.getPath().lastIndexOf('.'); String path = f.getPath().substring(0,i) + ".class"; binaryFile = new File(s + "!" + path); @@ -386,7 +384,7 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH */ protected boolean isBinary() { if (!checkedIsBinary) { - ResolvedType rt = getResolvedDeclaringAspect(); + ResolvedType rt = getDeclaringType(); if (rt != null) { isBinary = ((rt.getBinaryPath() == null) ? false : true); } |