Check for nulls

git-svn-id: https://smali.googlecode.com/svn/trunk@419 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com
2009-08-25 02:33:40 +00:00
parent 3c48a886bd
commit 97da4a7699

View File

@ -219,40 +219,49 @@ public class AnnotationDirectoryItem extends Item<AnnotationDirectoryItem> {
out.annotate(4, "class_annotations_off:"); out.annotate(4, "class_annotations_off:");
} }
out.annotate(4, "annotated_fields_size: 0x" + Integer.toHexString(fieldAnnotations.length) + " (" + int length = fieldAnnotations==null?0:fieldAnnotations.length;
fieldAnnotations.length + ")"); out.annotate(4, "annotated_fields_size: 0x" + Integer.toHexString(length) + " (" +
out.annotate(4, "annotated_methods_size: 0x" + Integer.toHexString(methodAnnotations.length) + " (" + length + ")");
methodAnnotations.length + ")"); length = methodAnnotations==null?0:methodAnnotations.length;
out.annotate(4, "annotated_parameters_size: 0x" + Integer.toHexString(parameterAnnotations.length) + " (" + out.annotate(4, "annotated_methods_size: 0x" + Integer.toHexString(length) + " (" +
parameterAnnotations.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<fieldAnnotations.length; i++) {
out.annotate(0, "[" + index++ + "] field_annotation");
int index = 0; out.indent();
for (int i=0; i<fieldAnnotations.length; i++) { out.annotate(4, "field: " + fieldAnnotationFields[i].getFieldName().getStringValue() + ":" +
out.annotate(0, "[" + index++ + "] field_annotation"); fieldAnnotationFields[i].getFieldType().getTypeDescriptor());
out.annotate(4, "annotations_off: 0x" + Integer.toHexString(fieldAnnotations[i].getOffset()));
out.indent(); out.deindent();
out.annotate(4, "field: " + fieldAnnotationFields[i].getFieldName().getStringValue() + ":" + }
fieldAnnotationFields[i].getFieldType().getTypeDescriptor());
out.annotate(4, "annotations_off: 0x" + Integer.toHexString(fieldAnnotations[i].getOffset()));
out.deindent();
} }
index = 0; if (methodAnnotations != null) {
for (int i=0; i<methodAnnotations.length; i++) { index = 0;
out.annotate(0, "[" + index++ + "] method_annotation"); for (int i=0; i<methodAnnotations.length; i++) {
out.indent(); out.annotate(0, "[" + index++ + "] method_annotation");
out.annotate(4, "method: " + methodAnnotationMethods[i].getMethodString()); out.indent();
out.annotate(4, "annotations_off: 0x" + Integer.toHexString(methodAnnotations[i].getOffset())); out.annotate(4, "method: " + methodAnnotationMethods[i].getMethodString());
out.deindent(); out.annotate(4, "annotations_off: 0x" + Integer.toHexString(methodAnnotations[i].getOffset()));
out.deindent();
}
} }
index = 0; if (parameterAnnotations != null) {
for (int i=0; i<parameterAnnotations.length; i++) { index = 0;
out.annotate(0, "[" + index++ + "] parameter_annotation"); for (int i=0; i<parameterAnnotations.length; i++) {
out.indent(); out.annotate(0, "[" + index++ + "] parameter_annotation");
out.annotate(4, "method: " + parameterAnnotationMethods[i].getMethodString()); out.indent();
out.annotate(4, "annotations_off: 0x" + Integer.toHexString(parameterAnnotations[i].getOffset())); out.annotate(4, "method: " + parameterAnnotationMethods[i].getMethodString());
out.annotate(4, "annotations_off: 0x" + Integer.toHexString(parameterAnnotations[i].getOffset()));
}
} }
} }