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


Java ExceptionHandler类代码示例

本文整理汇总了Java中org.jf.dexlib2.iface.ExceptionHandler的典型用法代码示例。如果您正苦于以下问题:Java ExceptionHandler类的具体用法?Java ExceptionHandler怎么用?Java ExceptionHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExceptionHandler类属于org.jf.dexlib2.iface包,在下文中一共展示了ExceptionHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compareTo

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的package包/类
@Override
public int compareTo(@Nonnull ExceptionHandler o) {
    int res;
    String exceptionType = getExceptionType();
    if (exceptionType == null) {
        if (o.getExceptionType() != null) {
            return 1;
        }
    } else {
        String otherExceptionType = o.getExceptionType();
        if (otherExceptionType == null) {
            return -1;
        }
        res = exceptionType.compareTo(o.getExceptionType());
        if (res != 0) return res;
    }
    return Ints.compare(getHandlerCodeAddress(), o.getHandlerCodeAddress());
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:19,代码来源:BaseExceptionHandler.java

示例2: addHandler

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的package包/类
public void addHandler(@Nonnull EH handler) {
    for (ExceptionHandler existingHandler: exceptionHandlers) {
        String existingType = existingHandler.getExceptionType();
        String newType = handler.getExceptionType();

        if (existingType == null) {
            if (newType == null) {
                if (existingHandler.getHandlerCodeAddress() != handler.getHandlerCodeAddress()) {
                    throw new InvalidTryException(
                            "Multiple overlapping catch all handlers with different handlers");
                }
                return;
            }
        } else if (existingType.equals(newType)) {
            // dalvik doesn't reject cases when there are multiple catches with the same exception
            // but different handlers. In practice, the first handler "wins". Since the later
            // handler will never be used, we don't add it.
            return;
        }
    }

    exceptionHandlers.add(handler);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:24,代码来源:TryListBuilder.java

示例3: addHandler

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的package包/类
public void addHandler(@Nonnull EH handler) {
    for (ExceptionHandler existingHandler: exceptionHandlers) {
        String existingType = existingHandler.getExceptionType();
        String newType = handler.getExceptionType();

        // Don't add it if we already have a handler of the same type
        if (existingType == null) {
            if (newType == null) {
                if (existingHandler.getHandlerCodeAddress() != handler.getHandlerCodeAddress()) {
                    throw new InvalidTryException(
                            "Multiple overlapping catch all handlers with different handlers");
                }
                return;
            }
        } else if (existingType.equals(newType)) {
            if (existingHandler.getHandlerCodeAddress() != handler.getHandlerCodeAddress()) {
                throw new InvalidTryException(
                        "Multiple overlapping catches for %s with different handlers", existingType);
            }
            return;
        }
    }

    exceptionHandlers.add(handler);
}
 
开发者ID:Miracle963,项目名称:zjdroid,代码行数:26,代码来源:TryListBuilder.java

示例4: usedTypes

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的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

示例5: compareTo

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的package包/类
@Override
public int compareTo( ExceptionHandler o) {
    int res;
    String exceptionType = getExceptionType();
    if (exceptionType == null) {
        if (o.getExceptionType() != null) {
            return 1;
        }
    } else {
        String otherExceptionType = o.getExceptionType();
        if (otherExceptionType == null) {
            return -1;
        }
        res = exceptionType.compareTo(o.getExceptionType());
        if (res != 0) return res;
    }
    return Ints.compare(getHandlerCodeAddress(), o.getHandlerCodeAddress());
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:19,代码来源:BaseExceptionHandler.java

示例6: addHandler

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的package包/类
public void addHandler( EH handler) {
    for (ExceptionHandler existingHandler: exceptionHandlers) {
        String existingType = existingHandler.getExceptionType();
        String newType = handler.getExceptionType();

        if (existingType == null) {
            if (newType == null) {
                if (existingHandler.getHandlerCodeAddress() != handler.getHandlerCodeAddress()) {
                    throw new InvalidTryException(
                            "Multiple overlapping catch all handlers with different handlers");
                }
                return;
            }
        } else if (existingType.equals(newType)) {
            // dalvik doesn't reject cases when there are multiple catches with the same exception
            // but different handlers. In practice, the first handler "wins". Since the later
            // handler will never be used, we don't add it.
            return;
        }
    }

    exceptionHandlers.add(handler);
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:24,代码来源:TryListBuilder.java

示例7: compare

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的package包/类
@Override
public int compare(ExceptionHandler o1, ExceptionHandler o2) {
    String exceptionType1 = o1.getExceptionType();
    if (exceptionType1 == null) {
        if (o2.getExceptionType() != null) {
            return 1;
        }
        return 0;
    } else {
        String exceptionType2 = o2.getExceptionType();
        if (exceptionType2 == null) {
            return -1;
        }
        return exceptionType1.compareTo(o2.getExceptionType());
    }
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:17,代码来源:BaseExceptionHandler.java

示例8: addHandler

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的package包/类
public void addHandler(@Nonnull EH handler) {
    for (ExceptionHandler existingHandler : exceptionHandlers) {
        String existingType = existingHandler.getExceptionType();
        String newType = handler.getExceptionType();

        // Don't add it if we already have a handler of the same type
        if (existingType == null) {
            if (newType == null) {
                if (existingHandler.getHandlerCodeAddress() != handler.getHandlerCodeAddress()) {
                    throw new InvalidTryException(
                            "Multiple overlapping catch all handlers with different handlers");
                }
                return;
            }
        } else if (existingType.equals(newType)) {
            if (existingHandler.getHandlerCodeAddress() != handler.getHandlerCodeAddress()) {
                throw new InvalidTryException(
                        "Multiple overlapping catches for %s with different handlers", existingType);
            }
            return;
        }
    }

    exceptionHandlers.add(handler);
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:26,代码来源:TryListBuilder.java

示例9: reMethodImpl

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的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

示例10: reTryCatchBlock

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的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

示例11: ImmutableMethodImplementation

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的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

示例12: of

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的package包/类
public static ImmutableExceptionHandler of(ExceptionHandler exceptionHandler) {
    if (exceptionHandler instanceof ImmutableExceptionHandler) {
        return (ImmutableExceptionHandler)exceptionHandler;
    }
    return new ImmutableExceptionHandler(
            exceptionHandler.getExceptionType(),
            exceptionHandler.getHandlerCodeAddress());
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:9,代码来源:ImmutableExceptionHandler.java

示例13: ImmutableTryBlock

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的package包/类
public ImmutableTryBlock(int startCodeAddress,
                         int codeUnitCount,
                         @Nullable List<? extends ExceptionHandler> exceptionHandlers) {
    this.startCodeAddress = startCodeAddress;
    this.codeUnitCount = codeUnitCount;
    this.exceptionHandlers = ImmutableExceptionHandler.immutableListOf(exceptionHandlers);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:8,代码来源:ImmutableTryBlock.java

示例14: of

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的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

示例15: equals

import org.jf.dexlib2.iface.ExceptionHandler; //导入依赖的package包/类
@Override
public boolean equals(@Nullable Object o) {
    if (o instanceof ExceptionHandler) {
        ExceptionHandler other = (ExceptionHandler)o;
        return Objects.equal(getExceptionType(), other.getExceptionType()) &&
               (getHandlerCodeAddress() == other.getHandlerCodeAddress());
    }
    return false;
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:10,代码来源:BaseExceptionHandler.java


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