Implement default annotation values and annotations of method parameters in IR binary serializer

This commit is contained in:
Alexey Andreev 2017-02-26 13:49:45 +03:00
parent 3821d29f1c
commit 17113533fc

View File

@ -195,6 +195,18 @@ public class DiskCachedClassHolderSource implements ClassHolderSource {
output.writeByte(method.getLevel().ordinal());
output.writeInt(packModifiers(method.getModifiers()));
writeAnnotations(output, method.getAnnotations());
for (AnnotationContainer parameterAnnotation : method.getParameterAnnotations()) {
writeAnnotations(output, parameterAnnotation);
}
if (method.getAnnotationDefault() != null) {
output.writeBoolean(true);
writeAnnotationValue(output, method.getAnnotationDefault());
} else {
output.writeBoolean(false);
}
if (method.getProgram() != null) {
output.writeBoolean(true);
programIO.write(method.getProgram(), output);
@ -209,6 +221,15 @@ public class DiskCachedClassHolderSource implements ClassHolderSource {
method.setLevel(accessLevels[input.readByte()]);
method.getModifiers().addAll(unpackModifiers(input.readInt()));
readAnnotations(input, method.getAnnotations());
for (int i = 0; i < method.parameterCount(); ++i) {
readAnnotations(input, method.parameterAnnotation(i));
}
if (input.readBoolean()) {
method.setAnnotationDefault(readAnnotationValue(input));
}
boolean hasProgram = input.readBoolean();
if (hasProgram) {
method.setProgram(programIO.read(input));