本文整理了Java中org.apache.bcel.generic.NEW.getIndex()
方法的一些代码示例,展示了NEW.getIndex()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NEW.getIndex()
方法的具体详情如下:
包路径:org.apache.bcel.generic.NEW
类名称:NEW
方法名:getIndex
暂无
代码示例来源:origin: bcel/bcel
/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
public void visitNEW(NEW o){
indexValid(o, o.getIndex());
Constant c = cpg.getConstant(o.getIndex());
if (! (c instanceof ConstantClass)){
constraintViolated(o, "Expecting a CONSTANT_Class operand, but found a '"+c+"'.");
}
else{
ConstantUtf8 cutf8 = (ConstantUtf8) (cpg.getConstant( ((ConstantClass) c).getNameIndex() ));
Type t = Type.getType("L"+cutf8.getBytes()+";");
if (t instanceof ArrayType){
constraintViolated(o, "NEW must not be used to create an array.");
}
}
}
代码示例来源:origin: org.apache.bcel/bcel
/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
@Override
public void visitNEW(final NEW o) {
indexValid(o, o.getIndex());
final Constant c = cpg.getConstant(o.getIndex());
if (! (c instanceof ConstantClass)) {
constraintViolated(o, "Expecting a CONSTANT_Class operand, but found a '"+c+"'.");
}
else{
final ConstantUtf8 cutf8 = (ConstantUtf8) (cpg.getConstant( ((ConstantClass) c).getNameIndex() ));
final Type t = Type.getType("L"+cutf8.getBytes()+";");
if (t instanceof ArrayType) {
constraintViolated(o, "NEW must not be used to create an array.");
}
}
}
内容来源于网络,如有侵权,请联系作者删除!