int interfaceNumber = interfaceList.size(); for (int i = 0; i < interfaceNumber; i++) { addClassWithHierachy(interfaceList.getType(i).getClassName());
private void addClassWithHierachy(String classBinaryName) { if (classNames.contains(classBinaryName)) { return; } try { DirectClassFile classFile = path.getClass(classBinaryName + CLASS_EXTENSION); classNames.add(classBinaryName); CstType superClass = classFile.getSuperclass(); if (superClass != null) { addClassWithHierachy(superClass.getClassType().getClassName()); } TypeList interfaceList = classFile.getInterfaces(); int interfaceNumber = interfaceList.size(); for (int i = 0; i < interfaceNumber; i++) { addClassWithHierachy(interfaceList.getType(i).getClassName()); } } catch (FileNotFoundException e) { // Ignore: The referenced type is not in the path it must be part of the libraries. } } }
/** * Returns a hashcode of the contents of the given list. This * is a static method so as to work on arbitrary {@link TypeList} * instances. * * @param list {@code non-null;} the list to inspect * @return {@code non-null;} the hash code */ public static int hashContents(TypeList list) { int size = list.size(); int hash = 0; for (int i = 0; i < size; i++) { hash = (hash * 31) + list.getType(i).hashCode(); } return hash; }
/** {@inheritDoc} */ public void addContents(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); int sz = list.size(); for (int i = 0; i < sz; i++) { typeIds.intern(list.getType(i)); } }
/** {@inheritDoc} */ public void addContents(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); int sz = list.size(); for (int i = 0; i < sz; i++) { typeIds.intern(list.getType(i)); } }
/** {@inheritDoc} */ public void addContents(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); int sz = list.size(); for (int i = 0; i < sz; i++) { typeIds.intern(list.getType(i)); } }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); int sz = list.size(); for (int i = 0; i < sz; i++) { typeIds.intern(list.getType(i)); } }
/** {@inheritDoc} */ public void addContents(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); int sz = list.size(); for (int i = 0; i < sz; i++) { typeIds.intern(list.getType(i)); } }
/** {@inheritDoc} */ public void addContents(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); int sz = list.size(); for (int i = 0; i < sz; i++) { typeIds.intern(list.getType(i)); } }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); int sz = list.size(); for (int i = 0; i < sz; i++) { typeIds.intern(list.getType(i)); } }
/** {@inheritDoc} */ public void addContents(DexFile file) { TypeIdsSection typeIds = file.getTypeIds(); int sz = list.size(); for (int i = 0; i < sz; i++) { typeIds.intern(list.getType(i)); } }
/** {@inheritDoc} */ public HashSet<Type> getCatchTypes() { HashSet<Type> result = new HashSet<Type>(20); BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); int catchSize = catches.size(); for (int j = 0; j < catchSize; j++) { result.add(catches.getType(j)); } } return result; }
/** {@inheritDoc} */ public HashSet<Type> getCatchTypes() { HashSet<Type> result = new HashSet<Type>(20); BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); int catchSize = catches.size(); for (int j = 0; j < catchSize; j++) { result.add(catches.getType(j)); } } return result; }
/** {@inheritDoc} */ public HashSet<Type> getCatchTypes() { HashSet<Type> result = new HashSet<Type>(20); BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); int catchSize = catches.size(); for (int j = 0; j < catchSize; j++) { result.add(catches.getType(j)); } } return result; }
/** {@inheritDoc} */ public HashSet<Type> getCatchTypes() { HashSet<Type> result = new HashSet<Type>(20); BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); int catchSize = catches.size(); for (int j = 0; j < catchSize; j++) { result.add(catches.getType(j)); } } return result; }
/** {@inheritDoc} */ @Override public HashSet<Type> getCatchTypes() { HashSet<Type> result = new HashSet<Type>(20); BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); int catchSize = catches.size(); for (int j = 0; j < catchSize; j++) { result.add(catches.getType(j)); } } return result; }
/** {@inheritDoc} */ public HashSet<Type> getCatchTypes() { HashSet<Type> result = new HashSet<Type>(20); BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); int catchSize = catches.size(); for (int j = 0; j < catchSize; j++) { result.add(catches.getType(j)); } } return result; }
/** {@inheritDoc} */ public HashSet<Type> getCatchTypes() { HashSet<Type> result = new HashSet<Type>(20); BasicBlockList blocks = method.getBlocks(); int size = blocks.size(); for (int i = 0; i < size; i++) { BasicBlock block = blocks.get(i); TypeList catches = block.getLastInsn().getCatches(); int catchSize = catches.size(); for (int j = 0; j < catchSize; j++) { result.add(catches.getType(j)); } } return result; }
/** * Converts a {@link TypeList} to a {@link CstArray}. * * @param types {@code non-null;} the type list * @return {@code non-null;} the corresponding array constant */ private static CstArray makeCstArray(TypeList types) { int size = types.size(); CstArray.List list = new CstArray.List(size); for (int i = 0; i < size; i++) { list.set(i, CstType.intern(types.getType(i))); } list.setImmutable(); return new CstArray(list); } }
/** * Converts a {@link TypeList} to a {@link CstArray}. * * @param types {@code non-null;} the type list * @return {@code non-null;} the corresponding array constant */ private static CstArray makeCstArray(TypeList types) { int size = types.size(); CstArray.List list = new CstArray.List(size); for (int i = 0; i < size; i++) { list.set(i, CstType.intern(types.getType(i))); } list.setImmutable(); return new CstArray(list); } }