Commit ec3b71e5 authored by Skylot's avatar Skylot

core: don't hardcode attributes count

parent f7303881
...@@ -22,17 +22,12 @@ import jadx.core.dex.trycatch.SplitterBlockAttr; ...@@ -22,17 +22,12 @@ import jadx.core.dex.trycatch.SplitterBlockAttr;
/** /**
* Attribute types enumeration, * Attribute types enumeration,
* uses generic type for omit cast after in 'AttributeStorage.get' method * uses generic type for omit cast after 'AttributeStorage.get' method
* *
* @param <T> attribute class implementation * @param <T> attribute class implementation
*/ */
public class AType<T extends IAttribute> { public class AType<T extends IAttribute> {
private AType() {
}
public static final int FIELDS_COUNT = 18;
public static final AType<AttrList<JumpInfo>> JUMP = new AType<AttrList<JumpInfo>>(); public static final AType<AttrList<JumpInfo>> JUMP = new AType<AttrList<JumpInfo>>();
public static final AType<AttrList<LoopInfo>> LOOP = new AType<AttrList<LoopInfo>>(); public static final AType<AttrList<LoopInfo>> LOOP = new AType<AttrList<LoopInfo>>();
......
...@@ -24,7 +24,7 @@ public class AttributeStorage { ...@@ -24,7 +24,7 @@ public class AttributeStorage {
public AttributeStorage() { public AttributeStorage() {
flags = EnumSet.noneOf(AFlag.class); flags = EnumSet.noneOf(AFlag.class);
attributes = new IdentityHashMap<AType<?>, IAttribute>(AType.FIELDS_COUNT); attributes = new IdentityHashMap<AType<?>, IAttribute>();
} }
public void add(AFlag flag) { public void add(AFlag flag) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment