gt:     int getMapEntrySize() {
context: /*
   * reserved comment block
   * DO NOT REMOVE OR ALTER!
   */
  /*
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You under the Apache License, Version 2.0
   * (the "License"); you may not use this file except in compliance with
   * the License.  You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package com.sun.org.apache.bcel.internal.classfile;
  
  import java.io.DataInput;
  import java.io.DataOutputStream;
  import java.io.IOException;
  import com.sun.org.apache.bcel.internal.Const;
  
  /**
   * This class represents a stack map entry recording the types of
   * local variables and the the of stack items at a given byte code offset.
   * See CLDC specification 5.3.1.2
   *
   * @version $Id$
   * @see     StackMap
   * @see     StackMapType
   */
  public final class StackMapEntry implements Node, Cloneable
  {
  
      private int frame_type;
      private int byte_code_offset;
      private StackMapType[] types_of_locals;
      private StackMapType[] types_of_stack_items;
      private ConstantPool constant_pool;
  
  
      /**
       * Construct object from input stream.
       *
       * @param input Input stream
       * @throws IOException
       */
      StackMapEntry(final DataInput input, final ConstantPool constantPool) throws IOException {
          this(input.readByte() & 0xFF, -1, null, null, constantPool);
  
          if (frame_type >= Const.SAME_FRAME && frame_type <= Const.SAME_FRAME_MAX) {
              byte_code_offset = frame_type - Const.SAME_FRAME;
          } else if (frame_type >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
                     frame_type <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
              byte_code_offset = frame_type - Const.SAME_LOCALS_1_STACK_ITEM_FRAME;
              types_of_stack_items = new StackMapType[1];
              types_of_stack_items[0] = new StackMapType(input, constantPool);
          } else if (frame_type == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
              byte_code_offset = input.readShort();
              types_of_stack_items = new StackMapType[1];
              types_of_stack_items[0] = new StackMapType(input, constantPool);
          } else if (frame_type >= Const.CHOP_FRAME && frame_type <= Const.CHOP_FRAME_MAX) {
              byte_code_offset = input.readShort();
          } else if (frame_type == Const.SAME_FRAME_EXTENDED) {
              byte_code_offset = input.readShort();
          } else if (frame_type >= Const.APPEND_FRAME && frame_type <= Const.APPEND_FRAME_MAX) {
              byte_code_offset = input.readShort();
              final int number_of_locals = frame_type - 251;
              types_of_locals = new StackMapType[number_of_locals];
              for (int i = 0; i < number_of_locals; i++) {
                  types_of_locals[i] = new StackMapType(input, constantPool);
              }
          } else if (frame_type == Const.FULL_FRAME) {
              byte_code_offset = input.readShort();
              final int number_of_locals = input.readShort();
              types_of_locals = new StackMapType[number_of_locals];
              for (int i = 0; i < number_of_locals; i++) {
                  types_of_locals[i] = new StackMapType(input, constantPool);
              }
              final int number_of_stack_items = input.readShort();
              types_of_stack_items = new StackMapType[number_of_stack_items];
              for (int i = 0; i < number_of_stack_items; i++) {
                  types_of_stack_items[i] = new StackMapType(input, constantPool);
              }
          } else {
              /* Can't happen */
              throw new ClassFormatException ("Invalid frame type found while parsing stack map table: " + frame_type);
          }
      }
  
      /**
       * DO NOT USE
       *
       * @param byteCodeOffset
       * @param numberOfLocals NOT USED
       * @param typesOfLocals array of {@link StackMapType}s of locals
       * @param numberOfStackItems NOT USED
       * @param typesOfStackItems array ot {@link StackMapType}s of stack items
       * @param constantPool the constant pool
       * @deprecated Since 6.0, use {@link #StackMapEntry(int, int, StackMapType[], StackMapType[], ConstantPool)}
       * instead
       */
      @java.lang.Deprecated
      public StackMapEntry(final int byteCodeOffset, final int numberOfLocals,
              final StackMapType[] typesOfLocals, final int numberOfStackItems,
              final StackMapType[] typesOfStackItems, final ConstantPool constantPool) {
          this.byte_code_offset = byteCodeOffset;
          this.types_of_locals = typesOfLocals != null ? typesOfLocals : new StackMapType[0];
          this.types_of_stack_items = typesOfStackItems != null ? typesOfStackItems : new StackMapType[0];
          this.constant_pool = constantPool;
      }
  
      /**
       * Create an instance
       *
       * @param tag the frame_type to use
       * @param byteCodeOffset
       * @param typesOfLocals array of {@link StackMapType}s of locals
       * @param typesOfStackItems array ot {@link StackMapType}s of stack items
       * @param constantPool the constant pool
       */
      public StackMapEntry(final int tag, final int byteCodeOffset,
              final StackMapType[] typesOfLocals,
              final StackMapType[] typesOfStackItems, final ConstantPool constantPool) {
          this.frame_type = tag;
          this.byte_code_offset = byteCodeOffset;
          this.types_of_locals = typesOfLocals != null ? typesOfLocals : new StackMapType[0];
          this.types_of_stack_items = typesOfStackItems != null ? typesOfStackItems : new StackMapType[0];
          this.constant_pool = constantPool;
      }
  
  
      /**
       * Dump stack map entry
       *
       * @param file Output file stream
       * @throws IOException
       */
      public final void dump( final DataOutputStream file ) throws IOException {
          file.write(frame_type);
          if (frame_type >= Const.SAME_FRAME && frame_type <= Const.SAME_FRAME_MAX) {
              // nothing to be done
          } else if (frame_type >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
                     frame_type <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
              types_of_stack_items[0].dump(file);
          } else if (frame_type == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
              file.writeShort(byte_code_offset);
              types_of_stack_items[0].dump(file);
          } else if (frame_type >= Const.CHOP_FRAME && frame_type <= Const.CHOP_FRAME_MAX) {
              file.writeShort(byte_code_offset);
          } else if (frame_type == Const.SAME_FRAME_EXTENDED) {
              file.writeShort(byte_code_offset);
          } else if (frame_type >= Const.APPEND_FRAME && frame_type <= Const.APPEND_FRAME_MAX) {
              file.writeShort(byte_code_offset);
              for (final StackMapType type : types_of_locals) {
                  type.dump(file);
              }
          } else if (frame_type == Const.FULL_FRAME) {
              file.writeShort(byte_code_offset);
              file.writeShort(types_of_locals.length);
              for (final StackMapType type : types_of_locals) {
                  type.dump(file);
              }
              file.writeShort(types_of_stack_items.length);
              for (final StackMapType type : types_of_stack_items) {
                  type.dump(file);
              }
          } else {
              /* Can't happen */
              throw new ClassFormatException ("Invalid Stack map table tag: " + frame_type);
          }
      }
  
  
      /**
       * @return String representation.
       */
      @Override
      public final String toString() {
          final StringBuilder buf = new StringBuilder(64);
          buf.append("(");
          if (frame_type >= Const.SAME_FRAME && frame_type <= Const.SAME_FRAME_MAX) {
              buf.append("SAME");
          } else if (frame_type >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
                    frame_type <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
              buf.append("SAME_LOCALS_1_STACK");
          } else if (frame_type == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
              buf.append("SAME_LOCALS_1_STACK_EXTENDED");
          } else if (frame_type >= Const.CHOP_FRAME && frame_type <= Const.CHOP_FRAME_MAX) {
              buf.append("CHOP ").append(String.valueOf(251-frame_type));
          } else if (frame_type == Const.SAME_FRAME_EXTENDED) {
              buf.append("SAME_EXTENDED");
          } else if (frame_type >= Const.APPEND_FRAME && frame_type <= Const.APPEND_FRAME_MAX) {
              buf.append("APPEND ").append(String.valueOf(frame_type-251));
          } else if (frame_type == Const.FULL_FRAME) {
              buf.append("FULL");
          } else {
              buf.append("UNKNOWN (").append(frame_type).append(")");
          }
          buf.append(", offset delta=").append(byte_code_offset);
          if (types_of_locals.length > 0) {
              buf.append(", locals={");
              for (int i = 0; i < types_of_locals.length; i++) {
                  buf.append(types_of_locals[i]);
                  if (i < types_of_locals.length - 1) {
                      buf.append(", ");
                  }
              }
              buf.append("}");
          }
          if (types_of_stack_items.length > 0) {
              buf.append(", stack items={");
              for (int i = 0; i < types_of_stack_items.length; i++) {
                  buf.append(types_of_stack_items[i]);
                  if (i < types_of_stack_items.length - 1) {
                      buf.append(", ");
                  }
              }
              buf.append("}");
          }
          buf.append(")");
          return buf.toString();
      }
  
  
      /**
       * Calculate stack map entry size
       *
       */
  