Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.MethodGen.addLocalVariable()


           new Type[] { new ObjectType("java.io.Reader") },
           Constants.INVOKESPECIAL));

    /* Create local variable `in'
     */
    LocalVariableGen lg = mg.addLocalVariable("in",
                new ObjectType("java.io.BufferedReader"),
                null, null);
    int in = lg.getIndex();
    lg.setStart(il.append(new ASTORE(in))); // `i' valid from here

View Full Code Here


    int in = lg.getIndex();
    lg.setStart(il.append(new ASTORE(in))); // `i' valid from here

    /* Create local variable `name'
     */
    lg = mg.addLocalVariable("name", Type.STRING, null, null);
    int name = lg.getIndex();
    il.append(InstructionConstants.ACONST_NULL);
    lg.setStart(il.append(new ASTORE(name))); // `name' valid from here

    /* try { ...
View Full Code Here

      body.byte_code(il, method, cp);

      if(main) {
  ObjectType e_type = new ObjectType("java.lang.Exception");
  InstructionHandle start = il.getStart(), end, handler, end_handler;
  LocalVariableGen exc = method.addLocalVariable("$e",
                   e_type,
                   null, null);
  int slot = exc.getIndex();

  il.append(InstructionConstants.POP); pop(); // Remove last element on stack
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.