本文整理汇总了Java中org.apache.bcel.Constants.LDC属性的典型用法代码示例。如果您正苦于以下问题:Java Constants.LDC属性的具体用法?Java Constants.LDC怎么用?Java Constants.LDC使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.bcel.Constants
的用法示例。
在下文中一共展示了Constants.LDC属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isPEI
/**
* Return whether or not the given instruction can throw exceptions.
*
* @param handle the instruction
* @return true if the instruction can throw an exception, false otherwise
*/
private boolean isPEI(InstructionHandle handle) {
Instruction ins = handle.getInstruction();
short opcode = ins.getOpcode();
if (!(ins instanceof ExceptionThrower))
return false;
// Return instructions can throw exceptions only if the method is synchronized
if (ins instanceof ReturnInstruction && !methodGen.isSynchronized())
return false;
// We're really not interested in exceptions that could hypothetically be
// thrown by static field accesses.
if (NO_STATIC_FIELD_EXCEPTIONS &&
(opcode == Constants.GETSTATIC || opcode == Constants.PUTSTATIC))
return false;
// Exceptions from LDC instructions seem a bit far fetched as well.
if (NO_LOAD_CONSTANT_EXCEPTIONS &&
(opcode == Constants.LDC || opcode == Constants.LDC_W || opcode == Constants.LDC2_W))
return false;
return true;
}