aboutsummaryrefslogtreecommitdiffstats
path: root/weaver/src
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-10-03 16:17:15 +0000
committeracolyer <acolyer>2005-10-03 16:17:15 +0000
commit0fae66242efd3fd91dc7ace349cdcf7e5ebc2ade (patch)
tree85dda17da70b10b31b422853d1323421a82b3a21 /weaver/src
parentc86fa6de889e521ebe8224d1a7579269c53ac357 (diff)
downloadaspectj-0fae66242efd3fd91dc7ace349cdcf7e5ebc2ade.tar.gz
aspectj-0fae66242efd3fd91dc7ace349cdcf7e5ebc2ade.zip
completes all of the MAP bar ITDs
Diffstat (limited to 'weaver/src')
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/DeclareParents.java20
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/PatternParser.java3
2 files changed, 16 insertions, 7 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java b/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java
index 0841f4dd3..2c1db8191 100644
--- a/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java
+++ b/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java
@@ -35,16 +35,18 @@ public class DeclareParents extends Declare {
private TypePattern child;
private TypePatternList parents;
private boolean isWildChild = false;
+ private boolean isExtends = true;
// private String[] typeVariablesInScope = new String[0]; // AspectJ 5 extension for generic types
- public DeclareParents(TypePattern child, List parents) {
- this(child, new TypePatternList(parents));
+ public DeclareParents(TypePattern child, List parents, boolean isExtends) {
+ this(child, new TypePatternList(parents),isExtends);
}
- private DeclareParents(TypePattern child, TypePatternList parents) {
+ private DeclareParents(TypePattern child, TypePatternList parents, boolean isExtends) {
this.child = child;
this.parents = parents;
+ this.isExtends = isExtends;
if (child instanceof WildTypePattern) isWildChild = true;
}
@@ -75,7 +77,8 @@ public class DeclareParents extends Declare {
DeclareParents ret =
new DeclareParents(
child.parameterizeWith(typeVariableBindingMap),
- parents.parameterizeWith(typeVariableBindingMap));
+ parents.parameterizeWith(typeVariableBindingMap),
+ isExtends);
ret.copyLocationFrom(this);
return ret;
}
@@ -84,7 +87,7 @@ public class DeclareParents extends Declare {
StringBuffer buf = new StringBuffer();
buf.append("declare parents: ");
buf.append(child);
- buf.append(" extends "); //extends and implements are treated equivalently
+ buf.append(isExtends ? " extends " : " implements "); //extends and implements are treated equivalently
buf.append(parents);
buf.append(";");
return buf.toString();
@@ -117,7 +120,7 @@ public class DeclareParents extends Declare {
}
public static Declare read(VersionedDataInputStream s, ISourceContext context) throws IOException {
- DeclareParents ret = new DeclareParents(TypePattern.read(s, context), TypePatternList.read(s, context));
+ DeclareParents ret = new DeclareParents(TypePattern.read(s, context), TypePatternList.read(s, context),true);
// if (s.getMajorVersion()>=AjAttribute.WeaverVersionInfo.WEAVER_VERSION_MAJOR_AJ150) {
// int numTypeVariablesInScope = s.readInt();
// ret.typeVariablesInScope = new String[numTypeVariablesInScope];
@@ -161,6 +164,11 @@ public class DeclareParents extends Declare {
return child;
}
+ // note - will always return true after deserialization, this doesn't affect weaver
+ public boolean isExtends() {
+ return this.isExtends;
+ }
+
public boolean isAdviceLike() {
return false;
}
diff --git a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java
index 8bd7ccb4b..ede05652f 100644
--- a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java
+++ b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java
@@ -202,6 +202,7 @@ public class PatternParser {
if (!(t.getString().equals("extends") || t.getString().equals("implements"))) {
throw new ParserException("extends or implements", t);
}
+ boolean isExtends = t.getString().equals("extends");
List l = new ArrayList();
do {
@@ -210,7 +211,7 @@ public class PatternParser {
//XXX somewhere in the chain we need to enforce that we have only ExactTypePatterns
- DeclareParents decp = new DeclareParents(p, l);
+ DeclareParents decp = new DeclareParents(p, l,isExtends);
return decp;
}