aboutsummaryrefslogtreecommitdiffstats
path: root/bcel-builder
diff options
context:
space:
mode:
authorAndy Clement <aclement@gopivotal.com>2014-06-17 15:05:43 -0700
committerAndy Clement <aclement@gopivotal.com>2014-06-17 15:05:43 -0700
commitc4f9f951c35f7b7645696ffded594e2dded07476 (patch)
tree90e6dc370b5ef7cdc039de0ae5b63fcf1920b40e /bcel-builder
parent4750cace2d5d2adc817ffe1ff192027b9def283a (diff)
downloadaspectj-c4f9f951c35f7b7645696ffded594e2dded07476.tar.gz
aspectj-c4f9f951c35f7b7645696ffded594e2dded07476.zip
436531: fix for weaving when method parameters around
Diffstat (limited to 'bcel-builder')
-rw-r--r--bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java
index 9cbbbf7fb..76f1642d5 100644
--- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java
+++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java
@@ -29,6 +29,8 @@ public class MethodParameters extends Attribute {
public final static int ACCESS_FLAGS_SYNTHETIC = 0x1000;
public final static int ACCESS_FLAGS_MANDATED = 0x8000;
+ // if 'isInPackedState' then this data needs unpacking
+ private boolean isInPackedState = false;
private byte[] data;
private int[] names;
private int[] accessFlags;
@@ -37,6 +39,7 @@ public class MethodParameters extends Attribute {
super(Constants.ATTR_METHOD_PARAMETERS,index,length,cpool);
data = new byte[length];
dis.read(data,0,length);
+ isInPackedState = true;
}
private void ensureInflated() {
@@ -55,6 +58,7 @@ public class MethodParameters extends Attribute {
accessFlags[i] = dis.readUnsignedShort();
}
}
+ isInPackedState = false;
} catch (IOException ioe) {
throw new RuntimeException("Unabled to inflate type annotation data, badly formed?");
}
@@ -62,10 +66,14 @@ public class MethodParameters extends Attribute {
public void dump(DataOutputStream dos) throws IOException {
super.dump(dos);
- dos.writeByte(names.length);
- for (int i=0;i<names.length;i++) {
- dos.writeShort(names[i]);
- dos.writeShort(accessFlags[i]);
+ if (isInPackedState) {
+ dos.write(data);
+ } else {
+ dos.writeByte(names.length);
+ for (int i=0;i<names.length;i++) {
+ dos.writeShort(names[i]);
+ dos.writeShort(accessFlags[i]);
+ }
}
}