当前位置: 首页>>代码示例>>Java>>正文


Java TryBlock类代码示例

本文整理汇总了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;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:23,代码来源:DexBody.java

示例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()));

}
 
开发者ID:alibaba,项目名称:atlas,代码行数:12,代码来源:MethodImplReIClassDef.java

示例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;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:12,代码来源:InsTructionsReIClassDef.java

示例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);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:10,代码来源:ImmutableMethodImplementation.java

示例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());
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:10,代码来源:ImmutableTryBlock.java

示例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;
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:10,代码来源:BaseTryBlock.java

示例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();
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:15,代码来源:TryListBuilder.java

示例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();
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:9,代码来源:BuilderClassPool.java

示例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);
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:10,代码来源:ImmutableMethodImplementation.java

示例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();
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:9,代码来源:BuilderClassPool.java

示例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;
}
 
开发者ID:DexPatcher,项目名称:dexpatcher-tool,代码行数:12,代码来源:BasicMethodImplementation.java

示例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());
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:10,代码来源:ImmutableTryBlock.java

示例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;
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:11,代码来源:BaseTryBlock.java

示例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();
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:11,代码来源:ClassPool.java

示例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();
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:15,代码来源:TryListBuilder.java


注:本文中的org.jf.dexlib2.iface.TryBlock类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。