Package org.apache.bcel.classfile

Examples of org.apache.bcel.classfile.LocalVariableTable


                }
            }

            // Append the local variables table.
            if (printLocalVariables) {
                LocalVariableTable vt = m.getLocalVariableTable();
                if (vt != null) {
                    LocalVariable vars[] = vt.getLocalVariableTable();
                    if (vars.length > 0) {
                        String indentStr3 = indentString(indent * 3);
                        result.append(indentString(
                                indent * 2, "LocalVariableTable:"));
                        result.append(n);
View Full Code Here


                }
            }

            // Append the local variables table.
            if (printLocalVariables) {
                LocalVariableTable vt = m.getLocalVariableTable();
                if (vt != null) {
                    LocalVariable vars[] = vt.getLocalVariableTable();
                    if (vars.length > 0) {
                        String indentStr3 = indentString(indent * 3);
                        result.append(indentString(
                                indent * 2, "LocalVariableTable:"));
                        result.append(n);
View Full Code Here

        int size = lg.length;
        LocalVariable[] lv = new LocalVariable[size];
        for (int i = 0; i < size; i++) {
            lv[i] = lg[i].getLocalVariable(cp);
        }
        return new LocalVariableTable(cp.addUtf8("LocalVariableTable"), 2 + lv.length * 10, lv, cp
                .getConstantPool());
    }
View Full Code Here

        byte[] byte_code = null;
        if (il != null) {
            byte_code = il.getByteCode();
        }
        LineNumberTable lnt = null;
        LocalVariableTable lvt = null;
        /* Create LocalVariableTable and LineNumberTable attributes (for debuggers, e.g.)
         */
        if ((variable_vec.size() > 0) && !strip_attributes) {
            addCodeAttribute(lvt = getLocalVariableTable(cp));
        }
View Full Code Here

        //Here because its easier to collect the information of the
        //(possibly more than one) LocalVariableTables belonging to
        //one certain Code attribute.
        if (atts[a] instanceof LocalVariableTable){ // checks conforming to vmspec2 4.7.9

          LocalVariableTable lvt = (LocalVariableTable) atts[a];

          checkIndex(lvt, lvt.getNameIndex(), CONST_Utf8);

          String lvtname = ((ConstantUtf8) cp.getConstant(lvt.getNameIndex())).getBytes();
          if (! lvtname.equals("LocalVariableTable")){
            throw new ClassConstraintException("The LocalVariableTable attribute '"+tostring(lvt)+"' is not correctly named 'LocalVariableTable' but '"+lvtname+"'.");
          }

          Code code = obj;

          //In JustIce, the check for correct offsets into the code array is delayed to Pass 3a.
          LocalVariable[] localvariables = lvt.getLocalVariableTable();

          for (int i=0; i<localvariables.length; i++){
            checkIndex(lvt, localvariables[i].getNameIndex(), CONST_Utf8);
            String localname = ((ConstantUtf8) cp.getConstant(localvariables[i].getNameIndex())).getBytes();
            if (!validJavaIdentifier(localname)){
View Full Code Here

    /* We cannot use code.getLocalVariableTable() because there could be more
       than only one. This is a bug in BCEL. */
    Attribute[] atts = code.getAttributes();
    for (int a=0; a<atts.length; a++){
      if (atts[a] instanceof LocalVariableTable){
        LocalVariableTable lvt = (LocalVariableTable) atts[a];
        if (lvt != null){
          LocalVariable[] localVariables = lvt.getLocalVariableTable();
          for (int i=0; i<localVariables.length; i++){
            int startpc = localVariables[i].getStartPC();
            int length  = localVariables[i].getLength();
       
            if (!contains(instructionPositions, startpc)){
View Full Code Here

TOP

Related Classes of org.apache.bcel.classfile.LocalVariableTable

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.