/**
  * Creates a new local variable of the given type.
  *
  * @param type the type of the local variable to be created.
  * @return the identifier of the newly created local variable.
  */
 public int newLocal(final Type type) {
   Object t;
   switch (type.getSort()) {
     case Type.BOOLEAN:
     case Type.CHAR:
     case Type.BYTE:
     case Type.SHORT:
     case Type.INT:
       t = Opcodes.INTEGER;
       break;
     case Type.FLOAT:
       t = Opcodes.FLOAT;
       break;
     case Type.LONG:
       t = Opcodes.LONG;
       break;
     case Type.DOUBLE:
       t = Opcodes.DOUBLE;
       break;
     case Type.ARRAY:
       t = type.getDescriptor();
       break;
       // case Type.OBJECT:
     default:
       t = type.getInternalName();
       break;
   }
   int local = nextLocal;
   setLocalType(local, type);
   setFrameLocal(local, t);
   nextLocal += type.getSize();
   return local;
 }