Print warnings on a Connection to a specified PrintWriter.

@param conn Connection to print warnings from
@param pw PrintWriter to print to
353157
public static void printWarnings(Connection conn, PrintWriter pw) {
        if (conn != null) {
            try {
                printStackTrace(conn.getWarnings(), pw);
            } catch (SQLException e) {
                printStackTrace(e, pw);
            }
        }
    }
110093
public void print(PrintStream ps, String message){
        if(SUPPORTED)
            ps.print(start);
        ps.print(message);
        if(SUPPORTED)
            ps.print(END);
    }
104366
public void addConnection(WebSocketConnection conn) {
        conns.add(conn);
        for (IWebSocketDataListener listener : listeners) {
            listener.onWSConnect(conn);
        }
    }
1203189
public void write(PrintWriter output, Janitor janitor) {
        String description = "General error during " + owner.getPhaseDescription() + ": ";

        String message = cause.getMessage();
        if (message != null) {
            output.println(description + message);
        } else {
            output.println(description + cause);
        }
        output.println();

        //if (verbose) {
        cause.printStackTrace(output);
        //}
    }
1004950
public static void printDebug(final String[] pStringArray, final PrintStream pPrintStream) {

    if (pPrintStream == null) {
      System.err.println(PRINTSTREAM_IS_NULL_ERROR_MESSAGE);
      return;
    }
    if (pStringArray == null) {
      pPrintStream.println(STRINGARRAY_IS_NULL_ERROR_MESSAGE);
      return;
    }
    for (int i = 0; i < pStringArray.length; i++) {
      pPrintStream.println(pStringArray[i]);
    }
  }
587276
public void PrintCollocationStrings(PrintWriter pw){
    //ArrayList<String> strs = new ArrayList<String>();
    for(Collocation c: collocationCollector){
      String cs = c.collocationString;
      pw.println(cs+" ("+(c.span.first()+1)+","+(c.span.second()+1)+")");
    }
  }
1008286
public void printNotice(SourcePosition pos, String msg) {
        if (diagListener != null) {
            report(DiagnosticType.NOTE, pos, msg);
            return;
        }

        PrintWriter noticeWriter = getWriter(WriterKind.NOTICE);
        if (pos == null)
            noticeWriter.println(msg);
        else
            noticeWriter.println(pos + ": " + msg);
        noticeWriter.flush();
    }
658757
public void print(java.io.PrintWriter printWriter)
    {
        synchronized (flushHelper) {
            synchronized (notifyHelper) {
                synchronized (logBufferLock) {
                    printWriter.println("State Dump for:" + cclass.getName()
                                        + " logFile=" + logFile + "(java.io.RandomaccessFile)"
                                        + " fileLogHeader=" + fileLogHeader + "(FileLogHeader)"
                                        + "\n filePosition=" + filePosition + "(long)"
                                        + " filePositionSectorByte=" + filePositionSectorByte + "(byte)"
                                        + " bufferFilePosition=" + bufferFilePosition + "(long)"
                                        + " bufferSectorByte=" + bufferSectorByte + "(byte)"
                                        + " fileSpaceLeft=" + fileSpaceLeft + "(long)"
                                    );
                    printWriter.println(" firstPageToFlush=" + firstPageToFlush + "(int)"
                                        + " lastPageNotified=" + lastPageNotified + "(int)"
                                        + " nextPageToNotify=" + nextPageToNotify + "(int)"
                                        + " firstPageFilling=" + firstPageFilling + "(int)"
                                        + " lastPageFilling=" + lastPageFilling + "(int)"
                                        + "\n nextFreeByteInLogBuffer=" + nextFreeByteInLogBuffer + "(int)"
                                        + " newLogBufferPages=" + newLogBufferPages + "(int)"
                                    );
                    printWriter.println();

                    logBuffer.print(printWriter);
                } // synchronized (logBufferLock).
            } // synchronized (notifyHelper).
        } // synchronized (flushHelper).
    }
129982
public static void print(Collection<TypedDependency> dependencies, PrintWriter pw) {
    pw.println(toString(dependencies, false));
  }
439926
private static void generateToCManagedConnection(Map<String, TraceEvent> events, FileWriter fw)
      throws Exception
   {
      writeString(fw, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"");
      writeEOL(fw);
      writeString(fw, "                      \"http://www.w3.org/TR/html4/loose.dtd\">");
      writeEOL(fw);

      writeString(fw, "<html>");
      writeEOL(fw);

      writeString(fw, "<head>");
      writeEOL(fw);

      writeString(fw, "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\">");
      writeEOL(fw);

      writeString(fw, "<title>Reference: ManagedConnection</title>");
      writeEOL(fw);

      writeString(fw, "</head>");
      writeEOL(fw);

      writeString(fw, "<body style=\"background: #D7D7D7;\">");
      writeEOL(fw);

      writeString(fw, "<h1>Reference: ManagedConnection</h1>");
      writeEOL(fw);

      writeString(fw, "<table>");
      writeEOL(fw);
      
      writeString(fw, "<tr>");
      writeEOL(fw);

      writeString(fw, "<td><b>ManagedConnection</b></td>");
      writeEOL(fw);

      writeString(fw, "<td><b>ConnectionListener</b></td>");
      writeEOL(fw);

      writeString(fw, "<td><b>ManagedConnectionPool</b></td>");
      writeEOL(fw);

      writeString(fw, "<td><b>Pool</b></td>");
      writeEOL(fw);

      writeString(fw, "</tr>");
      writeEOL(fw);

      for (Map.Entry<String, TraceEvent> entry : events.entrySet())
      {
         TraceEvent te = entry.getValue();

         writeString(fw, "<tr>");
         writeEOL(fw);

         writeString(fw, "<td><a href=\"" + te.getPool() + "/" + te.getConnectionListener() + "/index.html\">" +
                     te.getPayload1() + "</a></td>");
         writeEOL(fw);
         
         writeString(fw, "<td><a href=\"" + te.getPool() + "/" + te.getConnectionListener() + "/index.html\">" +
                     te.getConnectionListener() + "</a></td>");
         writeEOL(fw);
         
         writeString(fw, "<td>" + te.getManagedConnectionPool() + "</td>");
         writeEOL(fw);
      
         writeString(fw, "<td><a href=\"" + te.getPool() + "/index.html\">" + te.getPool() + "</a></td>");
         writeEOL(fw);
      
         writeString(fw, "</tr>");
         writeEOL(fw);
      }

      writeString(fw, "</table>");
      writeEOL(fw);

      writeString(fw, "<p>");
      writeEOL(fw);

      writeString(fw, "<a href=\"index.html\">Back</a>");
      writeEOL(fw);

      writeString(fw, "</body>");
      writeEOL(fw);

      writeString(fw, "</html>");
      writeEOL(fw);
   }
1075832
public void printWarning( Declaration d, String id, Object... args )
    {
        addWarning( d, id, args );
    }
12049
@Override
    public void warn(String format, Object arg) {
        if (logger.isWarnEnabled()) {
            FormattingTuple ft = MessageFormatter.format(format, arg);
            logger.warn(ft.getMessage(), ft.getThrowable());
        }
    }
240050
public void writeWarningResult(int line, String value) {
        logger.debug("Write Warning result => line:{} value:{}", line, value);
        writeValue(resultColumnName, line, value);
    }
1083613
public static void printCommandInfo(Command command, PrintWriter pw) {
    String description =
        String.format("%s: %s", command.getCommandName(), command.getDescription());
    int width = 80;
    try {
      width = TerminalFactory.get().getWidth();
    } catch (Exception e) {
      // In case the terminal factory failed to decide terminal type, use default width
    }

    HELP_FORMATTER.printWrapped(pw, width, description);
    HELP_FORMATTER.printUsage(pw, width, command.getUsage());
    if (command.getOptions().getOptions().size() > 0) {
      HELP_FORMATTER.printOptions(pw, width, command.getOptions(), HELP_FORMATTER.getLeftPadding(),
          HELP_FORMATTER.getDescPadding());
    }
  }
378181
public void removeConnection(WebSocketConnection conn) {
        if (conn != null) {
            WebSocketScope scope = getScope(conn);
            if (scope != null) {
                scope.removeConnection(conn);
                if (!scope.isValid()) {
                    // scope is not valid. delete this.
                    removeWebSocketScope(scope);
                }
            }
        }
    }
1152277
public static void figureOutConnect(PrintStream w, Object... comps) {
        // add all the components via Proxy.
        List<ComponentAccess> l = new ArrayList<ComponentAccess>();
        for (Object c : comps) {
            l.add(new ComponentAccess(c));
        }

        // find all out slots
        for (ComponentAccess cp_out : l) {
            w.println("// connect " + objName(cp_out));
            // over all input slots.
            for (Access fout : cp_out.outputs()) {
                String s = "   out2in(" + objName(cp_out) + ", \"" + fout.getField().getName() + "\"";
                for (ComponentAccess cp_in : l) {
                    // skip if it is the same component.
                    if (cp_in == cp_out) {
                        continue;
                    }
                    // out points to in
                    for (Access fin : cp_in.inputs()) {
                        // name equivalence enought for now.
                        if (fout.getField().getName().equals(fin.getField().getName())) {
                            s = s + ", " + objName(cp_in);
                        }
                    }
                }
                w.println(s + ");");
            }
            w.println();
        }
    }
384092
public void printWarning(SourcePosition pos, String msg) {
        if (diagListener != null) {
            report(DiagnosticType.WARNING, pos, msg);
            return;
        }

        if (nwarnings < MaxWarnings) {
            String prefix = (pos == null) ? programName : pos.toString();
            PrintWriter warnWriter = getWriter(WriterKind.WARNING);
            warnWriter.println(prefix +  ": " + getText("javadoc.warning") +" - " + msg);
            warnWriter.flush();
            nwarnings++;
        }
    }