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;
super(Constants.ATTR_METHOD_PARAMETERS,index,length,cpool);
data = new byte[length];
dis.read(data,0,length);
+ isInPackedState = true;
}
private void ensureInflated() {
accessFlags[i] = dis.readUnsignedShort();
}
}
+ isInPackedState = false;
} catch (IOException ioe) {
throw new RuntimeException("Unabled to inflate type annotation data, badly formed?");
}
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]);
+ }
}
}
--- /dev/null
+public class Code {
+ public void method(String string1, int param2, boolean b3) {
+ }
+ public void method2(String string1, int param2, boolean b3) {
+ }
+}
+
* @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");
<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>