code: public static InsnList loadVar(Variable variable) {
          Validate.notNull(variable);
  
          InsnList ret = new InsnList();
          switch (variable.getType().getSort()) {
              case Type.BOOLEAN:
              case Type.BYTE:
              case Type.CHAR:
              case Type.SHORT:
              case Type.INT:
                  ret.add(new VarInsnNode(Opcodes.ILOAD, variable.getIndex()));
                  break;
              case Type.LONG:
                  ret.add(new VarInsnNode(Opcodes.LLOAD, variable.getIndex()));
                  break;
              case Type.FLOAT:
                  ret.add(new VarInsnNode(Opcodes.FLOAD, variable.getIndex()));
                  break;
              case Type.DOUBLE:
                  ret.add(new VarInsnNode(Opcodes.DLOAD, variable.getIndex()));
                  break;
              case Type.OBJECT:
              case Type.ARRAY:
                  ret.add(new VarInsnNode(Opcodes.ALOAD, variable.getIndex()));
                  // If required, do it outside this method
  //                ret.add(new TypeInsnNode(Opcodes.CHECKCAST, variable.getType().getInternalName()));
                  break;
              default:
                  throw new IllegalStateException(); // should never happen, there is code in Variable/VariableTable to make sure invalid
                                                     // types aren't set
          }
  
          return ret;
      }
docs: Copies a local variable on to the stack.
  @param variable variable within the local variable table to load from
  @return instructions to load a local variable on to the stack
  @throws NullPointerException if any argument is {@code null}
  @throws IllegalArgumentException if {@code variable} has been released