code:   public void toCode(final List<String> lineList, final String requestID,
                       final int indentSpaces, final boolean includeProcessing)
    {
      // Create the request variable.
      final ArrayList<ToCodeArgHelper> constructorArgs =
           new ArrayList<ToCodeArgHelper>(3);
      constructorArgs.add(ToCodeArgHelper.createString(bindDN.stringValue(),
           "Bind DN"));
      constructorArgs.add(ToCodeArgHelper.createString("---redacted-password---",
           "Bind Password"));
  
      final Control[] controls = getControls();
      if (controls.length > 0)
      {
        constructorArgs.add(ToCodeArgHelper.createControlArray(controls,
             "Bind Controls"));
      }
  
      ToCodeHelper.generateMethodCall(lineList, indentSpaces, "SimpleBindRequest",
           requestID + "Request", "new SimpleBindRequest", constructorArgs);
  
  
      // Add lines for processing the request and obtaining the result.
      if (includeProcessing)
      {
        // Generate a string with the appropriate indent.
        final StringBuilder buffer = new StringBuilder();
        for (int i=0; i < indentSpaces; i++)
        {
          buffer.append(' ');
        }
        final String indent = buffer.toString();
  
        lineList.add("");
        lineList.add(indent + "try");
        lineList.add(indent + '{');
        lineList.add(indent + "  BindResult " + requestID +
             "Result = connection.bind(" + requestID + "Request);");
        lineList.add(indent + "  // The bind was processed successfully.");
        lineList.add(indent + '}');
        lineList.add(indent + "catch (LDAPException e)");
        lineList.add(indent + '{');
        lineList.add(indent + "  // The bind failed.  Maybe the following will " +
             "help explain why.");
        lineList.add(indent + "  // Note that the connection is now likely in " +
             "an unauthenticated state.");
        lineList.add(indent + "  ResultCode resultCode = e.getResultCode();");
        lineList.add(indent + "  String message = e.getMessage();");
        lineList.add(indent + "  String matchedDN = e.getMatchedDN();");
        lineList.add(indent + "  String[] referralURLs = e.getReferralURLs();");
        lineList.add(indent + "  Control[] responseControls = " +
             "e.getResponseControls();");
        lineList.add(indent + '}');
      }
    }
  