resizeContents(2);
}
final int elementNameIndex = this.constantPool.literalIndex(memberValuePair.name);
this.contents[this.contentsOffset++] = (byte) (elementNameIndex >> 8);
this.contents[this.contentsOffset++] = (byte) elementNameIndex;
MethodBinding methodBinding = memberValuePair.binding;
if (methodBinding == null) {
this.contentsOffset = startingContentsOffset;
} else {
try {
generateElementValue(memberValuePair.value, methodBinding.returnType, startingContentsOffset);
} catch(ClassCastException e) {
this.contentsOffset = startingContentsOffset;
} catch(ShouldNotImplement e) {
this.contentsOffset = startingContentsOffset;
}
}
}
} else {
this.contents[this.contentsOffset++] = 0;
this.contents[this.contentsOffset++] = 0;
}
} else if (annotation instanceof SingleMemberAnnotation) {
SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
// this is a single member annotation (one member value)
this.contents[this.contentsOffset++] = 0;
this.contents[this.contentsOffset++] = 1;
if (this.contentsOffset + 2 >= this.contents.length) {
resizeContents(2);
}
final int elementNameIndex = this.constantPool.literalIndex(VALUE);
this.contents[this.contentsOffset++] = (byte) (elementNameIndex >> 8);
this.contents[this.contentsOffset++] = (byte) elementNameIndex;
MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
if (methodBinding == null) {
this.contentsOffset = startingContentsOffset;
} else {
try {
generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType, startingContentsOffset);