diff options
author | avasseur <avasseur> | 2005-10-18 15:52:50 +0000 |
---|---|---|
committer | avasseur <avasseur> | 2005-10-18 15:52:50 +0000 |
commit | 51a117846c60df84bd6b368cd2297c8ebd8f2cca (patch) | |
tree | 65651ab3536efebf3ad5fa440f76ead8068e2e93 /weaver | |
parent | ae612d9752200a3784de33ea6b79815e77aabaed (diff) | |
download | aspectj-51a117846c60df84bd6b368cd2297c8ebd8f2cca.tar.gz aspectj-51a117846c60df84bd6b368cd2297c8ebd8f2cca.zip |
due fix and test for @AJ ITD reweavable, serialization of the method delegate munger
Diffstat (limited to 'weaver')
3 files changed, 25 insertions, 15 deletions
diff --git a/weaver/src/org/aspectj/weaver/MethodDelegateTypeMunger.java b/weaver/src/org/aspectj/weaver/MethodDelegateTypeMunger.java index 797e7ae7b..26ae5b21d 100644 --- a/weaver/src/org/aspectj/weaver/MethodDelegateTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/MethodDelegateTypeMunger.java @@ -65,22 +65,31 @@ public class MethodDelegateTypeMunger extends ResolvedTypeMunger { } } + private MethodDelegateTypeMunger(ResolvedMember signature, ResolvedMember fieldDelegate, TypePattern typePattern) { + super(MethodDelegate, signature); + this.aspectFieldDelegate = fieldDelegate; + this.typePattern = typePattern; + } + public ResolvedMember getDelegate() { return aspectFieldDelegate; } public void write(DataOutputStream s) throws IOException { - ;//FIXME AVITD needed as changes public signature throw new RuntimeException("unimplemented"); + kind.write(s); + signature.write(s); + aspectFieldDelegate.write(s); + typePattern.write(s); } -// public static ResolvedTypeMunger readMethod(VersionedDataInputStream s, ISourceContext context) throws IOException { -// ResolvedMemberImpl rmi = ResolvedMemberImpl.readResolvedMember(s, context); -// Set superMethodsCalled = readSuperMethodsCalled(s); -// ISourceLocation sLoc = readSourceLocation(s); -// ResolvedTypeMunger munger = new MethodDelegateTypeMunger(rmi, superMethodsCalled); -// if (sLoc != null) munger.setSourceLocation(sLoc); -// return munger; -// } + + + public static ResolvedTypeMunger readMethod(VersionedDataInputStream s, ISourceContext context) throws IOException { + ResolvedMemberImpl signature = ResolvedMemberImpl.readResolvedMember(s, context); + ResolvedMemberImpl field = ResolvedMemberImpl.readResolvedMember(s, context); + TypePattern tp = TypePattern.read(s, context); + return new MethodDelegateTypeMunger(signature, field, tp); + } /** * Match based on given type pattern, only classes can be matched diff --git a/weaver/src/org/aspectj/weaver/NewMethodTypeMunger.java b/weaver/src/org/aspectj/weaver/NewMethodTypeMunger.java index 6f60d9965..f4fdeafca 100644 --- a/weaver/src/org/aspectj/weaver/NewMethodTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/NewMethodTypeMunger.java @@ -47,8 +47,7 @@ public class NewMethodTypeMunger extends ResolvedTypeMunger { } public static ResolvedTypeMunger readMethod(VersionedDataInputStream s, ISourceContext context) throws IOException { - - ISourceLocation sloc = null; + ISourceLocation sloc = null; ResolvedMemberImpl rmImpl = ResolvedMemberImpl.readResolvedMember(s, context); Set superMethodsCalled = readSuperMethodsCalled(s); sloc = readSourceLocation(s); diff --git a/weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java b/weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java index 06ae53554..73588f89c 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java @@ -123,10 +123,11 @@ public abstract class ResolvedTypeMunger { return NewFieldTypeMunger.readField(s, context); } else if (kind == Method) { return NewMethodTypeMunger.readMethod(s, context); - } else if (kind == Constructor) { return NewConstructorTypeMunger.readConstructor(s, context); - } else { + } else if (kind == MethodDelegate) { + return MethodDelegateTypeMunger.readMethod(s, context); + } else { throw new RuntimeException("unimplemented"); } } @@ -227,7 +228,8 @@ public abstract class ResolvedTypeMunger { case 1: return Field; case 2: return Method; case 5: return Constructor; - } + case 9: return MethodDelegate; + } throw new BCException("bad kind: " + key); } } @@ -247,7 +249,7 @@ public abstract class ResolvedTypeMunger { public static final Kind AnnotationOnType = new Kind("AnnotationOnType",8); // not serialized - public static final Kind MethodDelegate = new Kind("MethodDelegate", 9);// not serialized, @AJ ITDs + public static final Kind MethodDelegate = new Kind("MethodDelegate", 9);// serialized, @AJ ITDs public static final String SUPER_DISPATCH_NAME = "superDispatch"; |