class IsLdcClass implements InstructionFinder.CodeConstraint
{
public boolean checkCode(InstructionHandle[] match)
{
InstructionHandle ih = match[0];
CPInstruction ldc_w = (CPInstruction) ih.getInstruction();
Constant cc = cpool.getConstant(ldc_w.getIndex());
if (cc.getTag() != CONSTANT_Class)
return false;
ih = match[1];
CPInstruction invokevirtual = (CPInstruction) ih.getInstruction();
ConstantMethodref cm = (ConstantMethodref) cpool.getConstant(invokevirtual.getIndex());
ConstantNameAndType cnt = (ConstantNameAndType) cpool.getConstant(cm.getNameAndTypeIndex());
if (!cnt.getName(cpool.getConstantPool()).equals("desiredAssertionStatus"))
return false;
return true;
}