diff --git a/src/main/java/com/reandroid/dex/data/AnnotationElement.java b/src/main/java/com/reandroid/dex/data/AnnotationElement.java index 20a22e2b2..00d88c2f1 100644 --- a/src/main/java/com/reandroid/dex/data/AnnotationElement.java +++ b/src/main/java/com/reandroid/dex/data/AnnotationElement.java @@ -33,12 +33,13 @@ public AnnotationElement() { @Override public AnnotationElementKey getKey(){ - return checkKey(new AnnotationElementKey(getName(), getValue())); + return new AnnotationElementKey(getName(), getValue()); } @Override public void setKey(Key key) { AnnotationElementKey elementKey = (AnnotationElementKey) key; setName(elementKey.getName()); + setValue(elementKey.getValue()); } public Key getValue() { DexValueBlock valueBlock = getValueBlock(); diff --git a/src/main/java/com/reandroid/dex/value/DexValueType.java b/src/main/java/com/reandroid/dex/value/DexValueType.java index 067cc7bb6..98054489c 100644 --- a/src/main/java/com/reandroid/dex/value/DexValueType.java +++ b/src/main/java/com/reandroid/dex/value/DexValueType.java @@ -274,6 +274,9 @@ public static Key createNull(TypeKey typeKey) { if (TypeKey.TYPE_F.equals(typeKey)) { return PrimitiveKey.of(0.0f); } + if (TypeKey.TYPE_I.equals(typeKey)) { + return PrimitiveKey.of(0); + } if (TypeKey.TYPE_J.equals(typeKey)) { return PrimitiveKey.of(0L); }