diff --git a/dexlib/src/main/java/org/jf/dexlib/AnnotationDirectoryItem.java b/dexlib/src/main/java/org/jf/dexlib/AnnotationDirectoryItem.java index 4d157216..02ad386b 100644 --- a/dexlib/src/main/java/org/jf/dexlib/AnnotationDirectoryItem.java +++ b/dexlib/src/main/java/org/jf/dexlib/AnnotationDirectoryItem.java @@ -219,40 +219,49 @@ public class AnnotationDirectoryItem extends Item { out.annotate(4, "class_annotations_off:"); } - out.annotate(4, "annotated_fields_size: 0x" + Integer.toHexString(fieldAnnotations.length) + " (" + - fieldAnnotations.length + ")"); - out.annotate(4, "annotated_methods_size: 0x" + Integer.toHexString(methodAnnotations.length) + " (" + - methodAnnotations.length + ")"); - out.annotate(4, "annotated_parameters_size: 0x" + Integer.toHexString(parameterAnnotations.length) + " (" + - parameterAnnotations.length + ")"); + int length = fieldAnnotations==null?0:fieldAnnotations.length; + out.annotate(4, "annotated_fields_size: 0x" + Integer.toHexString(length) + " (" + + length + ")"); + length = methodAnnotations==null?0:methodAnnotations.length; + out.annotate(4, "annotated_methods_size: 0x" + Integer.toHexString(length) + " (" + + length + ")"); + length = parameterAnnotations==null?0:parameterAnnotations.length; + out.annotate(4, "annotated_parameters_size: 0x" + Integer.toHexString(length) + " (" + + length + ")"); + int index; + if (fieldAnnotations != null) { + index = 0; + for (int i=0; i