aboutsummaryrefslogtreecommitdiffstats
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
parent4750cace2d5d2adc817ffe1ff192027b9def283a (diff)
downloadaspectj-c4f9f951c35f7b7645696ffded594e2dded07476.tar.gz
aspectj-c4f9f951c35f7b7645696ffded594e2dded07476.zip
436531: fix for weaving when method parameters around
-rw-r--r--bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java16
-rw-r--r--lib/bcel/bcel-src.zipbin326237 -> 326310 bytes
-rw-r--r--lib/bcel/bcel-verifier.jarbin161556 -> 161556 bytes
-rw-r--r--lib/bcel/bcel.jarbin285387 -> 285458 bytes
-rw-r--r--tests/bugs181/436531/Azpect.java4
-rw-r--r--tests/bugs181/436531/Code.classbin0 -> 379 bytes
-rw-r--r--tests/bugs181/436531/Code.java7
-rw-r--r--tests/bugs181/436531/code.jarbin0 -> 582 bytes
-rw-r--r--tests/src/org/aspectj/systemtest/ajc181/Ajc181Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc181/ajc181.xml4
10 files changed, 31 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]);
+ }
}
}
diff --git a/lib/bcel/bcel-src.zip b/lib/bcel/bcel-src.zip
index 090f7083a..d6745a981 100644
--- a/lib/bcel/bcel-src.zip
+++ b/lib/bcel/bcel-src.zip
Binary files differ
diff --git a/lib/bcel/bcel-verifier.jar b/lib/bcel/bcel-verifier.jar
index c407530cf..1863f1ece 100644
--- a/lib/bcel/bcel-verifier.jar
+++ b/lib/bcel/bcel-verifier.jar
Binary files differ
diff --git a/lib/bcel/bcel.jar b/lib/bcel/bcel.jar
index 20e2af40c..2db4a9983 100644
--- a/lib/bcel/bcel.jar
+++ b/lib/bcel/bcel.jar
Binary files differ
diff --git a/tests/bugs181/436531/Azpect.java b/tests/bugs181/436531/Azpect.java
new file mode 100644
index 000000000..f9b70ed82
--- /dev/null
+++ b/tests/bugs181/436531/Azpect.java
@@ -0,0 +1,4 @@
+public aspect Azpect {
+ before(): execution(* method(..)) {}
+}
+
diff --git a/tests/bugs181/436531/Code.class b/tests/bugs181/436531/Code.class
new file mode 100644
index 000000000..75248e095
--- /dev/null
+++ b/tests/bugs181/436531/Code.class
Binary files differ
diff --git a/tests/bugs181/436531/Code.java b/tests/bugs181/436531/Code.java
new file mode 100644
index 000000000..dfd1f3c39
--- /dev/null
+++ b/tests/bugs181/436531/Code.java
@@ -0,0 +1,7 @@
+public class Code {
+ public void method(String string1, int param2, boolean b3) {
+ }
+ public void method2(String string1, int param2, boolean b3) {
+ }
+}
+
diff --git a/tests/bugs181/436531/code.jar b/tests/bugs181/436531/code.jar
new file mode 100644
index 000000000..ecb454330
--- /dev/null
+++ b/tests/bugs181/436531/code.jar
Binary files differ
diff --git a/tests/src/org/aspectj/systemtest/ajc181/Ajc181Tests.java b/tests/src/org/aspectj/systemtest/ajc181/Ajc181Tests.java
index 5c298300e..57ed6b6df 100644
--- a/tests/src/org/aspectj/systemtest/ajc181/Ajc181Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc181/Ajc181Tests.java
@@ -21,6 +21,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
* @author Andy Clement
*/
public class Ajc181Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+ public void testParameterNamesAttribute_436531() {
+ runTest("parameter names attribute");
+ }
public void testVariableNotInitialized_431976() {
runTest("variable not initialized");
diff --git a/tests/src/org/aspectj/systemtest/ajc181/ajc181.xml b/tests/src/org/aspectj/systemtest/ajc181/ajc181.xml
index 5d091ca8c..1a8b1acfc 100644
--- a/tests/src/org/aspectj/systemtest/ajc181/ajc181.xml
+++ b/tests/src/org/aspectj/systemtest/ajc181/ajc181.xml
@@ -2,6 +2,10 @@
<suite>
+ <ajc-test dir="bugs181/436531" title="parameter names attribute">
+ <compile options="-1.8" files="Azpect.java" inpath="code.jar"/>
+ </ajc-test>
+
<ajc-test dir="bugs181/431976" title="variable not initialized">
<compile options="-1.8" files="AbstractDependencyInjectionAspect.aj"/>
</ajc-test>