Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.CPInstruction


   * @param invoke the InstructionHandle of the method call.
   * @return the callinfo containing details about the method called.
   */
  private CallInfo createCallInfo( InstructionHandle invoke ) {
   
    CPInstruction methodCall =
      (CPInstruction)invoke.getInstruction();
   
    // get infos from the constant pool:
   
    ConstantCP methodConst =
      (ConstantCP)constPoolGen.getConstant(
          methodCall.getIndex() );
   
    ConstantClass classConst =
      (ConstantClass)constPoolGen.getConstant(
        methodConst.getClassIndex() );

View Full Code Here


    class IsInnerConstructor implements InstructionFinder.CodeConstraint
    {
        public boolean checkCode(InstructionHandle[] match)
        {
            InstructionHandle ih = match[2];
            CPInstruction putfield = (CPInstruction) ih.getInstruction();
            Constant cc = cpool.getConstant(putfield.getIndex());
            if (cc.getTag() != CONSTANT_Fieldref)
                return false;
            ConstantFieldref cfield = (ConstantFieldref) cc;
            ConstantNameAndType cnt = (ConstantNameAndType) cpool.getConstant(cfield.getNameAndTypeIndex());
            if (!cnt.getName(cpool.getConstantPool()).equals("this$0"))
View Full Code Here

    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;
        }
View Full Code Here

TOP

Related Classes of org.apache.bcel.generic.CPInstruction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.