本文整理汇总了Java中org.jf.dexlib2.iface.TryBlock类的典型用法代码示例。如果您正苦于以下问题:Java TryBlock类的具体用法?Java TryBlock怎么用?Java TryBlock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TryBlock类属于org.jf.dexlib2.iface包,在下文中一共展示了TryBlock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: usedTypes
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
/**
* Return the types that are used in this body.
*/
public Set<Type> usedTypes() {
Set<Type> types = new HashSet<Type>();
for (DexlibAbstractInstruction i : instructions)
types.addAll(i.introducedTypes());
if(tries!=null) {
for (TryBlock<? extends ExceptionHandler> tryItem : tries) {
List<? extends ExceptionHandler> hList = tryItem.getExceptionHandlers();
for (ExceptionHandler handler: hList) {
String exType = handler.getExceptionType();
if (exType == null) // for handler which capture all Exceptions
continue;
types.add(DexType.toSoot(exType));
}
}
}
return types;
}
示例2: reMethodImpl
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
@Override
protected MethodImplementation reMethodImpl(MethodImplementation methodImplementation) {
if (methodImplementation == null){
return null;
}
Iterable<? extends Instruction> instructions = methodImplementation.getInstructions();
Iterable<? extends DebugItem> debugItems = methodImplementation.getDebugItems();
List<? extends TryBlock<? extends ExceptionHandler>> tryBlocks = methodImplementation.getTryBlocks();
return new ImmutableMethodImplementation(methodImplementation.getRegisterCount(), reInstructions(instructions), reTryCatchBlock(methodImplementation.getTryBlocks()), reDebugItem(methodImplementation.getDebugItems()));
}
示例3: reTryCatchBlock
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
@Override
protected List<? extends TryBlock<? extends ExceptionHandler>> reTryCatchBlock(List<? extends TryBlock<? extends ExceptionHandler>> tryBlocks) {
if (tryBlocks == null || tryBlocks.size() == 0) {
return null;
}
List<ImmutableTryBlock> newTryCatchBlocks = new ArrayList<ImmutableTryBlock>();
for (TryBlock<? extends ExceptionHandler> tryBlock : tryBlocks) {
newTryCatchBlocks.add(ImmutableTryBlock.of(tryBlock));
}
return newTryCatchBlocks;
}
示例4: ImmutableMethodImplementation
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
public ImmutableMethodImplementation(int registerCount,
@Nullable Iterable<? extends Instruction> instructions,
@Nullable List<? extends TryBlock<? extends ExceptionHandler>> tryBlocks,
@Nullable Iterable<? extends DebugItem> debugItems) {
this.registerCount = registerCount;
this.instructions = ImmutableInstruction.immutableListOf(instructions);
this.tryBlocks = ImmutableTryBlock.immutableListOf(tryBlocks);
this.debugItems = ImmutableDebugItem.immutableListOf(debugItems);
}
示例5: of
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
public static ImmutableTryBlock of(TryBlock<? extends ExceptionHandler> tryBlock) {
if (tryBlock instanceof ImmutableTryBlock) {
return (ImmutableTryBlock)tryBlock;
}
return new ImmutableTryBlock(
tryBlock.getStartCodeAddress(),
tryBlock.getCodeUnitCount(),
tryBlock.getExceptionHandlers());
}
示例6: equals
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
@Override public boolean equals(Object o) {
if (o instanceof TryBlock) {
TryBlock other = (TryBlock)o;
return getStartCodeAddress() == other.getStartCodeAddress() &&
getCodeUnitCount() == other.getCodeUnitCount() &&
getExceptionHandlers().equals(other.getExceptionHandlers());
}
return false;
}
示例7: massageTryBlocks
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
public static <EH extends ExceptionHandler> List<TryBlock<EH>> massageTryBlocks(
List<? extends TryBlock<? extends EH>> tryBlocks) {
TryListBuilder<EH> tlb = new TryListBuilder<EH>();
for (TryBlock<? extends EH> tryBlock: tryBlocks) {
int startAddress = tryBlock.getStartCodeAddress();
int endAddress = startAddress + tryBlock.getCodeUnitCount();
for (EH exceptionHandler: tryBlock.getExceptionHandlers()) {
tlb.addHandler(startAddress, endAddress, exceptionHandler);
}
}
return tlb.getTryBlocks();
}
示例8: getTryBlocks
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
@Nonnull @Override
public List<? extends TryBlock<? extends ExceptionHandler>> getTryBlocks(@Nonnull BuilderMethod builderMethod) {
MethodImplementation impl = builderMethod.getImplementation();
if (impl == null) {
return ImmutableList.of();
}
return impl.getTryBlocks();
}
示例9: ImmutableMethodImplementation
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
public ImmutableMethodImplementation(int registerCount,
Iterable<? extends Instruction> instructions,
List<? extends TryBlock<? extends ExceptionHandler>> tryBlocks,
Iterable<? extends DebugItem> debugItems) {
this.registerCount = registerCount;
this.instructions = ImmutableInstruction.immutableListOf(instructions);
this.tryBlocks = ImmutableTryBlock.immutableListOf(tryBlocks);
this.debugItems = ImmutableDebugItem.immutableListOf(debugItems);
}
示例10: getTryBlocks
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
@Override
public List<? extends TryBlock<? extends ExceptionHandler>> getTryBlocks( BuilderMethod builderMethod) {
MethodImplementation impl = builderMethod.getImplementation();
if (impl == null) {
return ImmutableList.of();
}
return impl.getTryBlocks();
}
示例11: BasicMethodImplementation
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
public BasicMethodImplementation(
int registerCount,
Iterable<? extends Instruction> instructions,
List<? extends TryBlock<? extends ExceptionHandler>> tryBlocks,
Iterable<? extends DebugItem> debugItems
) {
this.registerCount = registerCount;
this.instructions = instructions;
this.tryBlocks = tryBlocks;
this.debugItems = debugItems;
}
示例12: of
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
public static ImmutableTryBlock of(TryBlock<? extends ExceptionHandler> tryBlock) {
if (tryBlock instanceof ImmutableTryBlock) {
return (ImmutableTryBlock) tryBlock;
}
return new ImmutableTryBlock(
tryBlock.getStartCodeAddress(),
tryBlock.getCodeUnitCount(),
tryBlock.getExceptionHandlers());
}
示例13: equals
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
if (o instanceof TryBlock) {
TryBlock other = (TryBlock) o;
return getStartCodeAddress() == other.getStartCodeAddress() &&
getCodeUnitCount() == other.getCodeUnitCount() &&
getExceptionHandlers().equals(other.getExceptionHandlers());
}
return false;
}
示例14: getTryBlocks
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
@Nonnull
@Override
public List<? extends TryBlock<? extends ExceptionHandler>> getTryBlocks(
@Nonnull PoolMethod method) {
MethodImplementation impl = method.getImplementation();
if (impl != null) {
return impl.getTryBlocks();
}
return ImmutableList.of();
}
示例15: massageTryBlocks
import org.jf.dexlib2.iface.TryBlock; //导入依赖的package包/类
public static <EH extends ExceptionHandler> List<TryBlock<EH>> massageTryBlocks(
List<? extends TryBlock<? extends EH>> tryBlocks) {
TryListBuilder<EH> tlb = new TryListBuilder<EH>();
for (TryBlock<? extends EH> tryBlock : tryBlocks) {
int startAddress = tryBlock.getStartCodeAddress();
int endAddress = startAddress + tryBlock.getCodeUnitCount();
for (EH exceptionHandler : tryBlock.getExceptionHandlers()) {
tlb.addHandler(startAddress, endAddress, exceptionHandler);
}
}
return tlb.getTryBlocks();
}