Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.GETFIELD


      iteratorIndex = cpg.addFieldref(classGen.getClassName(),
              iteratorName,
              NODE_ITERATOR_SIG);

      il.append(classGen.loadTranslet());
      il.append(new GETFIELD(iteratorIndex));
      il.append(DUP);
      il.append(new ASTORE(iter.getIndex()));
      ifBlock = il.append(new IFNONNULL(null));
      il.append(classGen.loadTranslet());
 
View Full Code Here


           Util.getJCRefType(DOM_INTF_SIG),
           null, null);
  final String className = classGen.getClassName();
  il.append(filterGen.loadTranslet());
  il.append(new CHECKCAST(cpg.addClass(className)));
  il.append(new GETFIELD(cpg.addFieldref(className,
                 DOM_FIELD, DOM_INTF_SIG)));
  il.append(new ASTORE(local.getIndex()));

  // Store the dom index in the test generator
  testGen.setDomIndex(local.getIndex());
View Full Code Here

      }

      // Use getfield if in an inner class
      if (variableClosure != null) {
    il.append(ALOAD_0);
    il.append(new GETFIELD(
        cpg.addFieldref(variableClosure.getInnerClassName(),
      var.getEscapedName(), varType.toSignature())));
      }
      else {
    // Use a load of instruction if in translet class
View Full Code Here

   
        // Feck the rest of the parameters on the stack
        il.append(new PUSH(cpg, getStylesheet().getSystemId()));
        il.append(classGen.loadTranslet());
        il.append(DUP);
        il.append(new GETFIELD(domField));
        il.append(new INVOKESTATIC(docIdx));
    }
View Full Code Here

                    System.out.println("Exception thrower location: " + location);
                }
                Instruction ins = location.getHandle().getInstruction();

                if (ins instanceof GETFIELD) {
                    GETFIELD insGetfield = (GETFIELD) ins;
                    String fieldName = insGetfield.getFieldName(cpg);
                    if (DEBUG) {
                        System.out.println("Inspecting GETFIELD of " + fieldName + " at " + location);
                    }
                    // Ignore exceptions from getfield instructions where the
                    // object reference is known not to be null
View Full Code Here

                        stringAppendState.setSawTaint(handle);
                    }

                }
            } else if (ins instanceof GETFIELD) {
                GETFIELD getfield = (GETFIELD) ins;
                String sig2 = getfield.getSignature(cpg);
                if (sig2.indexOf("java/lang/String") >= 0) {
                    stringAppendState.setSawTaint(handle);
                }
            }
        }
View Full Code Here

                            }
                        } else {
                            if (isSetter) {
                                replacement = new PUTFIELD(index);
                            } else {
                                replacement = new GETFIELD(index);
                            }
                        }
                        head.swapInstruction(replacement);
                        /*
                            if (false)
View Full Code Here

  if ((elementCount() == 1) && (elementAt(0) instanceof Text)) {
      il.append(new PUSH(cpg, ((Text)elementAt(0)).getText()));
  }
  else {
      il.append(classGen.loadTranslet());
      il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
               "stringValueHandler",
               STRING_VALUE_HANDLER_SIG)));
      il.append(DUP);
      il.append(methodGen.storeHandler());
      // translate contents with substituted handler
View Full Code Here

        variableClosure = variableClosure.getParentClosure();
    }
     
    if (variableClosure != null) {
        il.append(ALOAD_0);
        il.append(new GETFIELD(
      cpg.addFieldref(variableClosure.getInnerClassName(),
          name, signature)));
    }
    else {
        il.append(_variable.loadInstruction());
        _variable.removeReference(this);
    }
      }
      else {
    il.append(_variable.loadInstruction());
    _variable.removeReference(this);
      }
  }
  else {
      final String className = classGen.getClassName();
      il.append(classGen.loadTranslet());
      if (classGen.isExternal()) {
    il.append(new CHECKCAST(cpg.addClass(className)));
      }
      il.append(new GETFIELD(cpg.addFieldref(className,name,signature)));
  }

  if (_variable.getType() instanceof NodeSetType) {
      // The method cloneIterator() also does resetting
      final int clone = cpg.addInterfaceMethodref(NODE_ITERATOR,
View Full Code Here

               NODE_COUNTER_SIG);
  }

  // Check if field is initialized (runtime)
  il.append(classGen.loadTranslet());
  il.append(new GETFIELD(fieldIndexes[_level]));
  final BranchHandle ifBlock1 = il.append(new IFNONNULL(null));

  // Create an instance of DefaultNodeCounter
  index = cpg.addMethodref(ClassNames[_level],
         "getDefaultNodeCounter",
         "(" + TRANSLET_INTF_SIG
         + DOM_INTF_SIG
         + NODE_ITERATOR_SIG
         + ")" + NODE_COUNTER_SIG);
  il.append(classGen.loadTranslet());
  il.append(methodGen.loadDOM());
  il.append(methodGen.loadIterator());
  il.append(new INVOKESTATIC(index));
  il.append(DUP);

  // Store the node counter in the field
  il.append(classGen.loadTranslet());
  il.append(SWAP);
  il.append(new PUTFIELD(fieldIndexes[_level]));
  final BranchHandle ifBlock2 = il.append(new GOTO(null));

  // Backpatch conditionals
  ifBlock1.setTarget(il.append(classGen.loadTranslet()));
  il.append(new GETFIELD(fieldIndexes[_level]));
 
  ifBlock2.setTarget(il.append(NOP));
    }
View Full Code Here

TOP

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

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.