Changeset abc23e9


Ignore:
Timestamp:
Jul 1, 2009 4:00:43 PM (12 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
59105a9
Parents:
055cd99
Message:
Files:
198 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/BitField.java

    r055cd99 rabc23e9  
    141141  {
    142142    // Not very efficient
    143     StringBuffer sb = new StringBuffer("BitField(");
     143    StringBuilder sb = new StringBuilder("BitField(");
    144144    sb.append(size).append(")[");
    145145    for (int i = 0; i < size; i++)
  • apps/i2psnark/java/src/org/klomp/snark/MetaInfo.java

    r055cd99 rabc23e9  
    363363  private static String hexencode(byte[] bs)
    364364  {
    365     StringBuffer sb = new StringBuffer(bs.length*2);
     365    StringBuilder sb = new StringBuilder(bs.length*2);
    366366    for (int i = 0; i < bs.length; i++)
    367367      {
     
    433433  {
    434434    Map info = createInfoMap();
    435     StringBuffer buf = new StringBuffer(128);
     435    StringBuilder buf = new StringBuilder(128);
    436436    buf.append("info: ");
    437437    for (Iterator iter = info.entrySet().iterator(); iter.hasNext(); ) {
  • apps/i2psnark/java/src/org/klomp/snark/PeerID.java

    r055cd99 rabc23e9  
    191191    boolean leading_zeros = true;
    192192
    193     StringBuffer sb = new StringBuffer(bs.length*2);
     193    StringBuilder sb = new StringBuilder(bs.length*2);
    194194    for (int i = 0; i < bs.length; i++)
    195195      {
  • apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java

    r055cd99 rabc23e9  
    374374  public static String urlencode(byte[] bs)
    375375  {
    376     StringBuffer sb = new StringBuffer(bs.length*3);
     376    StringBuilder sb = new StringBuilder(bs.length*3);
    377377    for (int i = 0; i < bs.length; i++)
    378378      {
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r055cd99 rabc23e9  
    760760        out.write("port: <input type=\"text\" name=\"i2cpPort\" value=\"" +
    761761                  + _manager.util().getI2CPPort() + "\" size=\"5\" maxlength=\"5\" /> <br />\n");
    762         StringBuffer opts = new StringBuffer(64);
     762        StringBuilder opts = new StringBuilder(64);
    763763        Map options = new TreeMap(_manager.util().getI2CPOptions());
    764764        for (Iterator iter = options.entrySet().iterator(); iter.hasNext(); ) {
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java

    r055cd99 rabc23e9  
    180180            in = s.getInputStream();
    181181            String line, method = null, host = null, destination = null, restofline = null;
    182             StringBuffer newRequest = new StringBuffer();
     182            StringBuilder newRequest = new StringBuilder();
    183183            int ahelper = 0;
    184184            while (true) {
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java

    r055cd99 rabc23e9  
    241241            InputReader reader = new InputReader(s.getInputStream());
    242242            String line, method = null, protocol = null, host = null, destination = null;
    243             StringBuffer newRequest = new StringBuffer();
     243            StringBuilder newRequest = new StringBuilder();
    244244            int ahelper = 0;
    245245            while ((line = reader.readLine(method)) != null) {
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java

    r055cd99 rabc23e9  
    7272            InputStream in = socket.getInputStream();
    7373
    74             StringBuffer command = new StringBuffer(128);
     74            StringBuilder command = new StringBuilder(128);
    7575            Properties headers = readHeaders(in, command);
    7676            headers.setProperty(HASH_HEADER, socket.getPeerDestination().calculateHash().toBase64());
     
    304304    }
    305305
    306     private String formatHeaders(Properties headers, StringBuffer command) {
    307         StringBuffer buf = new StringBuffer(command.length() + headers.size() * 64);
     306    private String formatHeaders(Properties headers, StringBuilder command) {
     307        StringBuilder buf = new StringBuilder(command.length() + headers.size() * 64);
    308308        buf.append(command.toString().trim()).append("\r\n");
    309309        for (Iterator iter = headers.keySet().iterator(); iter.hasNext(); ) {
     
    316316    }
    317317   
    318     private Properties readHeaders(InputStream in, StringBuffer command) throws IOException {
     318    private Properties readHeaders(InputStream in, StringBuilder command) throws IOException {
    319319        Properties headers = new Properties();
    320         StringBuffer buf = new StringBuffer(128);
     320        StringBuilder buf = new StringBuilder(128);
    321321       
    322322        boolean ok = DataHelper.readLine(in, command);
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java

    r055cd99 rabc23e9  
    8383            i2ps = createI2PSocket(dest);
    8484            i2ps.setReadTimeout(readTimeout);
    85             StringBuffer expectedPong = new StringBuffer();
     85            StringBuilder expectedPong = new StringBuilder();
    8686            Thread in = new I2PThread(new IrcInboundFilter(s,i2ps, expectedPong), "IRC Client " + __clientId + " in");
    8787            in.start();
     
    122122        private Socket local;
    123123        private I2PSocket remote;
    124         private StringBuffer expectedPong;
     124        private StringBuilder expectedPong;
    125125               
    126         IrcInboundFilter(Socket _local, I2PSocket _remote, StringBuffer pong) {
     126        IrcInboundFilter(Socket _local, I2PSocket _remote, StringBuilder pong) {
    127127            local=_local;
    128128            remote=_remote;
     
    196196            private Socket local;
    197197            private I2PSocket remote;
    198             private StringBuffer expectedPong;
     198            private StringBuilder expectedPong;
    199199               
    200             IrcOutboundFilter(Socket _local, I2PSocket _remote, StringBuffer pong) {
     200            IrcOutboundFilter(Socket _local, I2PSocket _remote, StringBuilder pong) {
    201201                local=_local;
    202202                remote=_remote;
     
    267267     */
    268268   
    269     public String inboundFilter(String s, StringBuffer expectedPong) {
     269    public String inboundFilter(String s, StringBuilder expectedPong) {
    270270       
    271271        String field[]=s.split(" ",4);
     
    354354    }
    355355   
    356     public String outboundFilter(String s, StringBuffer expectedPong) {
     356    public String outboundFilter(String s, StringBuilder expectedPong) {
    357357       
    358358        String field[]=s.split(" ",3);
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCServer.java

    r055cd99 rabc23e9  
    136136    /** keep reading until we see USER or SERVER */
    137137    private String filterRegistration(InputStream in, String newHostname) throws IOException {
    138         StringBuffer buf = new StringBuffer(128);
     138        StringBuilder buf = new StringBuilder(128);
    139139        int lineCount = 0;
    140140       
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java

    r055cd99 rabc23e9  
    212212                long totalTime = 0;
    213213                int cnt = countPing ? CPING_COUNT : PING_COUNT;
    214                 StringBuffer pingResults = new StringBuffer(2 * cnt + destination.length() + 3);
     214                StringBuilder pingResults = new StringBuilder(2 * cnt + destination.length() + 3);
    215215                for (int i = 0; i < cnt; i++) {
    216216                    boolean sent;
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java

    r055cd99 rabc23e9  
    386386    public String getI2CPPort() { return _config.getProperty("i2cpPort"); }
    387387    public String getClientOptions() {
    388         StringBuffer opts = new StringBuffer(64);
     388        StringBuilder opts = new StringBuilder(64);
    389389        for (Iterator iter = _config.keySet().iterator(); iter.hasNext(); ) {
    390390            String key = (String)iter.next();
     
    448448    }
    449449   
    450     public void getSummary(StringBuffer buf) {
     450    public void getSummary(StringBuilder buf) {
    451451        String type = getType();
    452452        if ("httpclient".equals(type))
     
    462462    }
    463463   
    464     private void getHttpClientSummary(StringBuffer buf) {
     464    private void getHttpClientSummary(StringBuilder buf) {
    465465        String description = getDescription();
    466466        if ( (description != null) && (description.trim().length() > 0) )
     
    483483    }
    484484   
    485     private void getClientSummary(StringBuffer buf) {
     485    private void getClientSummary(StringBuilder buf) {
    486486        String description = getDescription();
    487487        if ( (description != null) && (description.trim().length() > 0) )
     
    500500    }
    501501   
    502     private void getServerSummary(StringBuffer buf) {
     502    private void getServerSummary(StringBuilder buf) {
    503503        String description = getDescription();
    504504        if ( (description != null) && (description.trim().length() > 0) )
     
    511511    }
    512512   
    513     private void getHttpServerSummary(StringBuffer buf) {
     513    private void getHttpServerSummary(StringBuilder buf) {
    514514        String description = getDescription();
    515515        if ( (description != null) && (description.trim().length() > 0) )
     
    523523    }
    524524   
    525     private void getOptionSummary(StringBuffer buf) {
     525    private void getOptionSummary(StringBuilder buf) {
    526526        String opts = getClientOptions();
    527527        if ( (opts != null) && (opts.length() > 0) )
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelControllerGroup.java

    r055cd99 rabc23e9  
    246246        }
    247247       
    248         StringBuffer buf = new StringBuffer(1024);
     248        StringBuilder buf = new StringBuilder(1024);
    249249        for (Iterator iter = map.keySet().iterator(); iter.hasNext(); ) {
    250250            String key = (String)iter.next();
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java

    r055cd99 rabc23e9  
    124124
    125125    private String readString(DataInputStream in) throws IOException {
    126         StringBuffer sb = new StringBuffer(16);
     126        StringBuilder sb = new StringBuilder(16);
    127127        char c;
    128128        while ((c = (char) (in.readByte() & 0xff)) != 0)
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java

    r055cd99 rabc23e9  
    224224            Properties opts = getOptions(tun);
    225225            if (opts == null) return "";
    226             StringBuffer buf = new StringBuffer(64);
     226            StringBuilder buf = new StringBuilder(64);
    227227            int i = 0;
    228228            for (Iterator iter = opts.keySet().iterator(); iter.hasNext(); ) {
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java

    r055cd99 rabc23e9  
    303303            return "";
    304304       
    305         StringBuffer buf = new StringBuffer(512);
     305        StringBuilder buf = new StringBuilder(512);
    306306        if (_action != null) {
    307307            try {
     
    928928   
    929929    private String getMessages(List msgs) {
    930         StringBuffer buf = new StringBuffer(128);
     930        StringBuilder buf = new StringBuilder(128);
    931931        getMessages(msgs, buf);
    932932        return buf.toString();
    933933    }
    934     private void getMessages(List msgs, StringBuffer buf) {
     934    private void getMessages(List msgs, StringBuilder buf) {
    935935        if (msgs == null) return;
    936936        for (int i = 0; i < msgs.size(); i++) {
  • apps/jetty/java/src/org/mortbay/http/I2PRequestLog.java

    r055cd99 rabc23e9  
    8989                return;
    9090
    91             StringBuffer buf = new StringBuffer(160);
     91            StringBuilder buf = new StringBuilder(160);
    9292           
    9393            String addr = request.getField("X-I2P-DestHash");
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigAdvancedHelper.java

    r055cd99 rabc23e9  
    1111   
    1212    public String getSettings() {
    13         StringBuffer buf = new StringBuffer(4*1024);
     13        StringBuilder buf = new StringBuilder(4*1024);
    1414        Set names = _context.router().getConfigSettings();
    1515        TreeSet sortedNames = new TreeSet(names);
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java

    r055cd99 rabc23e9  
    1414   
    1515    public String getForm1() {
    16         StringBuffer buf = new StringBuffer(1024);
     16        StringBuilder buf = new StringBuilder(1024);
    1717        buf.append("<table border=\"1\">\n");
    1818        buf.append("<tr><th>Client</th><th>Run at Startup?</th><th>Start Now</th><th>Class and arguments</th></tr>\n");
     
    3030
    3131    public String getForm2() {
    32         StringBuffer buf = new StringBuffer(1024);
     32        StringBuilder buf = new StringBuilder(1024);
    3333        buf.append("<table border=\"1\">\n");
    3434        buf.append("<tr><th>WebApp</th><th>Run at Startup?</th><th>Start Now</th><th>Description</th></tr>\n");
     
    4747    }
    4848
    49     private void renderForm(StringBuffer buf, String index, String name, boolean urlify, boolean enabled, boolean ro, String desc) {
     49    private void renderForm(StringBuilder buf, String index, String name, boolean urlify, boolean enabled, boolean ro, String desc) {
    5050        buf.append("<tr><td>");
    5151        if (urlify && enabled) {
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHelper.java

    r055cd99 rabc23e9  
    3030    }
    3131    public String getLogLevelTable() {
    32         StringBuffer buf = new StringBuffer(32*1024);
     32        StringBuilder buf = new StringBuilder(32*1024);
    3333        Properties limits = _context.logManager().getLimits();
    3434        TreeSet sortedLogs = new TreeSet();
     
    5252    public String getDefaultLogLevelBox() {
    5353        String cur = _context.logManager().getDefaultLimit();
    54         StringBuffer buf = new StringBuffer(128);
     54        StringBuilder buf = new StringBuilder(128);
    5555        buf.append("<select name=\"defaultloglevel\">\n");
    5656       
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java

    r055cd99 rabc23e9  
    191191   
    192192    private static String getBurstFactor(int numSeconds, String name) {
    193         StringBuffer buf = new StringBuffer(256);
     193        StringBuilder buf = new StringBuilder(256);
    194194        buf.append("<select name=\"").append(name).append("\">\n");
    195195        boolean found = false;
     
    221221    public String getSharePercentageBox() {
    222222        int pct = (int) (100 * _context.router().getSharePercentage());
    223         StringBuffer buf = new StringBuffer(256);
     223        StringBuilder buf = new StringBuilder(256);
    224224        buf.append("<select style=\"text-align: right;\" name=\"sharePercentage\">\n");
    225225        boolean found = false;
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigRestartBean.java

    r055cd99 rabc23e9  
    7272    /** @param s value,label,... pairs */
    7373    private static String buttons(String url, String nonce, String s) {
    74         StringBuffer buf = new StringBuffer(128);
     74        StringBuilder buf = new StringBuilder(128);
    7575        StringTokenizer tok = new StringTokenizer(s, ",");
    7676        buf.append("<form action=\"").append(url).append("\" method=\"GET\">\n");
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHandler.java

    r055cd99 rabc23e9  
    103103        }
    104104       
    105         StringBuffer stats = new StringBuffer();
     105        StringBuilder stats = new StringBuilder();
    106106        for (int i = 0; i < _stats.size(); i++) {
    107107            stats.append((String)_stats.get(i));
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHelper.java

    r055cd99 rabc23e9  
    1414   
    1515    public String getForm() {
    16         StringBuffer buf = new StringBuffer(1024);
     16        StringBuilder buf = new StringBuilder(1024);
    1717        buf.append("<table border=\"1\">\n");
    1818        TunnelPoolSettings exploratoryIn = _context.tunnelManager().getInboundSettings();
     
    5555    private static final int MAX_VARIANCE = 2;
    5656    private static final int MIN_NEG_VARIANCE = -1;
    57     private void renderForm(StringBuffer buf, int index, String prefix, String name, TunnelPoolSettings in, TunnelPoolSettings out) {
     57    private void renderForm(StringBuilder buf, int index, String prefix, String name, TunnelPoolSettings in, TunnelPoolSettings out) {
    5858
    5959        buf.append("<tr><th colspan=\"3\"><a name=\"").append(prefix).append("\">");
     
    180180    }
    181181
    182     private void renderOptions(StringBuffer buf, int min, int max, int now, String prefix, String name) {
     182    private void renderOptions(StringBuilder buf, int min, int max, int now, String prefix, String name) {
    183183        for (int i = min; i <= max; i++) {
    184184            buf.append("<option value=\"").append(i).append("\" ");
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java

    r055cd99 rabc23e9  
    5959        } catch (NumberFormatException nfe) {}
    6060
    61         StringBuffer buf = new StringBuffer(256);
     61        StringBuilder buf = new StringBuilder(256);
    6262        buf.append("<select name=\"refreshFrequency\">");
    6363        for (int i = 0; i < PERIODS.length; i++) {
     
    7878        String policy = _context.getProperty(ConfigUpdateHandler.PROP_UPDATE_POLICY, ConfigUpdateHandler.DEFAULT_UPDATE_POLICY);
    7979       
    80         StringBuffer buf = new StringBuffer(256);
     80        StringBuilder buf = new StringBuilder(256);
    8181        buf.append("<select name=\"updatePolicy\">");
    8282       
  • apps/routerconsole/java/src/net/i2p/router/web/ContentHelper.java

    r055cd99 rabc23e9  
    4646            return "";
    4747        else {
    48             StringBuffer sb = new StringBuffer(str.length()+11);
     48            StringBuilder sb = new StringBuilder(str.length()+11);
    4949            sb.append("<pre>");
    5050            for (int i=0; i < str.length(); i++) {
  • apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java

    r055cd99 rabc23e9  
    8888        if (_errors.size() <= 0 && _notices.size() <= 0)
    8989            return "";
    90         StringBuffer buf = new StringBuffer(512);
     90        StringBuilder buf = new StringBuilder(512);
    9191        buf.append("<div class=\"messages\" id=\"messages\"><p>");
    9292        if (_errors.size() > 0) {
     
    179179            return "";
    180180        } else {
    181             StringBuffer buf = new StringBuffer(512);
     181            StringBuilder buf = new StringBuilder(512);
    182182            buf.append("<ul>\n");
    183183            for (int i = 0; i < source.size(); i++) {
  • apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java

    r055cd99 rabc23e9  
    4747    private String formatMessages(List msgs) {
    4848        boolean colorize = Boolean.valueOf(_context.getProperty("routerconsole.logs.color")).booleanValue();
    49         StringBuffer buf = new StringBuffer(16*1024);
     49        StringBuilder buf = new StringBuilder(16*1024);
    5050        buf.append("<ul>");
    5151        buf.append("<code>\n");
  • apps/routerconsole/java/src/net/i2p/router/web/NavHelper.java

    r055cd99 rabc23e9  
    2828   
    2929    public String getClientAppLinks() {
    30         StringBuffer buf = new StringBuffer(1024);
     30        StringBuilder buf = new StringBuilder(1024);
    3131        for (Iterator iter = _apps.keySet().iterator(); iter.hasNext(); ) {
    3232            String name = (String)iter.next();
  • apps/routerconsole/java/src/net/i2p/router/web/NewsFetcher.java

    r055cd99 rabc23e9  
    145145        try {
    146146            in = new FileInputStream(_newsFile);
    147             StringBuffer buf = new StringBuffer(128);
     147            StringBuilder buf = new StringBuilder(128);
    148148            while (DataHelper.readLine(in, buf)) {
    149149                int index = buf.indexOf(VERSION_PREFIX);
  • apps/routerconsole/java/src/net/i2p/router/web/ServiceManager.java

    r055cd99 rabc23e9  
    5151//        InputStream  StdoutStream = _shellCommand.getInputStream();
    5252//        InputStream  StderrStream = _shellCommand.getErrorStream();
    53         StringBuffer result       = null;
     53        StringBuilder result       = null;
    5454
    5555        if (_shellCommand.executeAndWait(command))
  • apps/routerconsole/java/src/net/i2p/router/web/StatSummarizer.java

    r055cd99 rabc23e9  
    8888        }
    8989        // add new ones
    90         StringBuffer buf = new StringBuffer();
     90        StringBuilder buf = new StringBuilder();
    9191        for (int i = 0; i < newSpecs.size(); i++) {
    9292            Rate r = (Rate)newSpecs.get(i);
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java

    r055cd99 rabc23e9  
    345345        Collections.sort(clients, new AlphaComparator());
    346346       
    347         StringBuffer buf = new StringBuffer(512);
     347        StringBuilder buf = new StringBuilder(512);
    348348        buf.append("<u><b>Local destinations</b></u><br />");
    349349       
  • apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java

    r055cd99 rabc23e9  
    157157        }
    158158        public void bytesTransferred(long alreadyTransferred, int currentWrite, long bytesTransferred, long bytesRemaining, String url) {
    159             StringBuffer buf = new StringBuffer(64);
     159            StringBuilder buf = new StringBuilder(64);
    160160            buf.append("<b>Updating</b> ");
    161161            double pct = ((double)alreadyTransferred + (double)currentWrite) /
  • apps/sam/java/src/net/i2p/sam/SAMUtils.java

    r055cd99 rabc23e9  
    156156        Properties props = new Properties();
    157157       
    158         StringBuffer value = new StringBuffer();
     158        StringBuilder value = new StringBuilder();
    159159        for (int i = 0; i < ntoks; ++i) {
    160160            token = tok.nextToken();
  • apps/streaming/java/src/net/i2p/client/streaming/Connection.java

    r055cd99 rabc23e9  
    900900                        _log.warn("Closing connection due to inactivity");
    901901                    if (_log.shouldLog(Log.DEBUG)) {
    902                         StringBuffer buf = new StringBuffer(128);
     902                        StringBuilder buf = new StringBuilder(128);
    903903                        buf.append("last sent was: ").append(_context.clock().now() - _lastSendTime);
    904904                        buf.append("ms ago, last received was: ").append(_context.clock().now()-_lastReceivedOn);
     
    935935        @Override
    936936    public String toString() {
    937         StringBuffer buf = new StringBuffer(128);
     937        StringBuilder buf = new StringBuilder(128);
    938938        buf.append("[Connection ");
    939939        if (_receiveStreamId > 0)
  • apps/streaming/java/src/net/i2p/client/streaming/ConnectionOptions.java

    r055cd99 rabc23e9  
    476476        @Override
    477477    public String toString() {
    478         StringBuffer buf = new StringBuffer(128);
     478        StringBuilder buf = new StringBuilder(128);
    479479        buf.append("conDelay=").append(_connectDelay);
    480480        buf.append(" maxSize=").append(_maxMessageSize);
  • apps/streaming/java/src/net/i2p/client/streaming/MessageInputStream.java

    r055cd99 rabc23e9  
    175175        synchronized (_dataLock) {
    176176            if (_log.shouldLog(Log.DEBUG)) {
    177                 StringBuffer buf = new StringBuffer(128);
     177                StringBuilder buf = new StringBuilder(128);
    178178                buf.append("Close received, ready bytes: ");
    179179                long available = 0;
  • apps/streaming/java/src/net/i2p/client/streaming/Packet.java

    r055cd99 rabc23e9  
    599599        @Override
    600600    public String toString() {
    601         StringBuffer str = formatAsString();
     601        StringBuilder str = formatAsString();
    602602        return str.toString();
    603603    }
    604604   
    605     protected StringBuffer formatAsString() {
    606         StringBuffer buf = new StringBuffer(64);
     605    protected StringBuilder formatAsString() {
     606        StringBuilder buf = new StringBuilder(64);
    607607        buf.append(toId(_sendStreamId));
    608608        //buf.append("<-->");
     
    630630   
    631631    private final String toFlagString() {
    632         StringBuffer buf = new StringBuffer(32);
     632        StringBuilder buf = new StringBuilder(32);
    633633        if (isFlagSet(FLAG_CLOSE)) buf.append(" CLOSE");
    634634        if (isFlagSet(FLAG_DELAY_REQUESTED)) buf.append(" DELAY ").append(_optionDelay);
  • apps/streaming/java/src/net/i2p/client/streaming/PacketHandler.java

    r055cd99 rabc23e9  
    113113    void displayPacket(Packet packet, String prefix, String suffix) {
    114114        if (!_log.shouldLog(Log.INFO)) return;
    115         StringBuffer buf = new StringBuffer(256);
     115        StringBuilder buf = new StringBuilder(256);
    116116        synchronized (_fmt) {
    117117            buf.append(_fmt.format(new Date()));
     
    199199                        if (_log.shouldLog(Log.ERROR)) {
    200200                            Set cons = _manager.listConnections();
    201                             StringBuffer buf = new StringBuffer(512);
     201                            StringBuilder buf = new StringBuilder(512);
    202202                            buf.append("Received a packet on the wrong stream: ");
    203203                            buf.append(packet);
     
    276276                }
    277277                if (_log.shouldLog(Log.DEBUG)) {
    278                     StringBuffer buf = new StringBuffer(128);
     278                    StringBuilder buf = new StringBuilder(128);
    279279                    Set cons = _manager.listConnections();
    280280                    for (Iterator iter = cons.iterator(); iter.hasNext(); ) {
  • apps/streaming/java/src/net/i2p/client/streaming/PacketLocal.java

    r055cd99 rabc23e9  
    134134   
    135135        @Override
    136     public StringBuffer formatAsString() {
    137         StringBuffer buf = super.formatAsString();
     136    public StringBuilder formatAsString() {
     137        StringBuilder buf = super.formatAsString();
    138138       
    139139        Connection con = _connection;
  • apps/susidns/src/java/src/i2p/susi/dns/ConfigBean.java

    r055cd99 rabc23e9  
    8484                File file = new File( configFileName );
    8585                if( file != null && file.isFile() ) {
    86                         StringBuffer buf = new StringBuffer();
     86                        StringBuilder buf = new StringBuilder();
    8787                        BufferedReader br = null;
    8888                        try {
  • apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java

    r055cd99 rabc23e9  
    8787                File file = new File( getFileName() );
    8888                if( file != null && file.isFile() ) {
    89                         StringBuffer buf = new StringBuffer();
     89                        StringBuilder buf = new StringBuilder();
    9090                        BufferedReader br = null;
    9191                        try {
  • apps/susimail/src/src/i2p/susi/webmail/Mail.java

    r055cd99 rabc23e9  
    143143                return ok;
    144144        }
    145         public static void appendRecipients( StringBuffer buf, ArrayList recipients, String prefix )
     145        public static void appendRecipients( StringBuilder buf, ArrayList recipients, String prefix )
    146146        {
    147147                for( Iterator it = recipients.iterator(); it.hasNext(); ) {
  • apps/susimail/src/src/i2p/susi/webmail/WebMail.java

    r055cd99 rabc23e9  
    445445                        boolean prepareAttachment = false;
    446446                        String reason = "";
    447                         StringBuffer body = null;
     447                        StringBuilder body = null;
    448448                       
    449449                        String ident = quoteHTML(
     
    486486                                                ReadBuffer decoded = e.decode( mailPart.buffer.content, mailPart.beginBody, mailPart.end - mailPart.beginBody );
    487487                                                BufferedReader reader = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( decoded.content, decoded.offset, decoded.length ), charset ) );
    488                                                 body = new StringBuffer();
     488                                                body = new StringBuilder();
    489489                                                String line;
    490490                                                while( ( line = reader.readLine() ) != null ) {
     
    783783                                                         * extract additional recipients
    784784                                                         */
    785                                                         StringBuffer buf = new StringBuffer();
     785                                                        StringBuilder buf = new StringBuilder();
    786786                                                        String pad = "";
    787787                                                        if( mail.to != null ) {
     
    14301430
    14311431                if( ok ) {
    1432                         StringBuffer body = new StringBuffer();
     1432                        StringBuilder body = new StringBuilder();
    14331433                        body.append( "From: " + from + "\r\n" );
    14341434                        Mail.appendRecipients( body, toList, "To: " );
  • apps/susimail/src/src/i2p/susi/webmail/encoding/Base64.java

    r055cd99 rabc23e9  
    7171        private String encode( InputStream in ) throws IOException, EncodingException
    7272        {
    73                 StringBuffer strBuf = new StringBuffer();
     73                StringBuilder strBuf = new StringBuilder();
    7474               
    7575                int buf[] = new int[3];
  • apps/susimail/src/src/i2p/susi/webmail/encoding/HeaderLine.java

    r055cd99 rabc23e9  
    5656        private String encode(InputStream in) throws IOException
    5757        {
    58                 StringBuffer out = new StringBuffer();
     58                StringBuilder out = new StringBuilder();
    5959                int l = 0, buffered = 0, tmp[] = new int[BUFSIZE];
    6060                boolean quoting = false;
  • apps/susimail/src/src/i2p/susi/webmail/encoding/QuotedPrintable.java

    r055cd99 rabc23e9  
    7070        private static int BUFSIZE = 2;
    7171        private String encode( InputStream in ) throws EncodingException, IOException {
    72                 StringBuffer out = new StringBuffer();
     72                StringBuilder out = new StringBuilder();
    7373                int l = 0;
    7474                int read = 0, buffered = 0, tmp[] = new int[BUFSIZE];
  • core/java/src/com/nettgryppa/security/HashCash.java

    r055cd99 rabc23e9  
    324324      return "";
    325325     
    326     StringBuffer result = new StringBuffer();
     326    StringBuilder result = new StringBuilder();
    327327    List<String> tempList;
    328328    boolean first = true;
  • core/java/src/freenet/support/CPUInformation/CPUID.java

    r055cd99 rabc23e9  
    7575    {
    7676        CPUIDResult c = doCPUID(0);
    77         StringBuffer sb= new StringBuffer(13);
     77        StringBuilder sb= new StringBuilder(13);
    7878        sb.append((char)( c.EBX        & 0xFF));
    7979        sb.append((char)((c.EBX >> 8)  & 0xFF));
  • core/java/src/net/i2p/client/naming/PetName.java

    r055cd99 rabc23e9  
    125125    @Override
    126126    public String toString() {
    127         StringBuffer buf = new StringBuffer(256);
     127        StringBuilder buf = new StringBuilder(256);
    128128        if (_name != null) buf.append(_name.trim());
    129129        buf.append(':');
  • core/java/src/net/i2p/crypto/ElGamalEngine.java

    r055cd99 rabc23e9  
    131131                         (dbytes.length > 257 ? 257 : dbytes.length));
    132132        /*
    133         StringBuffer buf = new StringBuffer(1024);
     133        StringBuilder buf = new StringBuilder(1024);
    134134        buf.append("Timing\n");
    135135        buf.append("0-1: ").append(t1 - t0).append('\n');
  • core/java/src/net/i2p/crypto/SHA1Test.java

    r055cd99 rabc23e9  
    180180 
    181181    private static final String toHex(final byte[] bytes) {
    182         StringBuffer buf = new StringBuffer(bytes.length * 2);
     182        StringBuilder buf = new StringBuilder(bytes.length * 2);
    183183        for (int i = 0; i < bytes.length; i++) {
    184184            if ((i & 3) == 0 && i != 0)
  • core/java/src/net/i2p/crypto/TransientSessionKeyManager.java

    r055cd99 rabc23e9  
    453453        int remaining = 0;
    454454        long now = _context.clock().now();
    455         StringBuffer buf = null;
    456         StringBuffer bufSummary = null;
     455        StringBuilder buf = null;
     456        StringBuilder bufSummary = null;
    457457        if (_log.shouldLog(Log.DEBUG)) {
    458             buf = new StringBuffer(128);
     458            buf = new StringBuilder(128);
    459459            buf.append("Expiring inbound: ");
    460             bufSummary = new StringBuffer(1024);
     460            bufSummary = new StringBuilder(1024);
    461461        }
    462462        synchronized (_inboundTagSets) {
     
    501501
    502502    public String renderStatusHTML() {
    503         StringBuffer buf = new StringBuffer(1024);
     503        StringBuilder buf = new StringBuilder(1024);
    504504        buf.append("<h2>Inbound sessions</h2>");
    505505        buf.append("<table border=\"1\">");
  • core/java/src/net/i2p/crypto/TrustedUpdate.java

    r055cd99 rabc23e9  
    256256
    257257    private static final String sanitize(String versionString) {
    258         StringBuffer versionStringBuffer = new StringBuffer(versionString);
    259 
    260         for (int i = 0; i < versionStringBuffer.length(); i++) {
    261             if (VALID_VERSION_CHARS.indexOf(versionStringBuffer.charAt(i)) == -1) {
    262                 versionStringBuffer.deleteCharAt(i);
     258        StringBuilder versionStringBuilder = new StringBuilder(versionString);
     259
     260        for (int i = 0; i < versionStringBuilder.length(); i++) {
     261            if (VALID_VERSION_CHARS.indexOf(versionStringBuilder.charAt(i)) == -1) {
     262                versionStringBuilder.deleteCharAt(i);
    263263                i--;
    264264            }
    265265        }
    266266
    267         return versionStringBuffer.toString();
     267        return versionStringBuilder.toString();
    268268    }
    269269
     
    329329     */
    330330    public String getTrustedKeysString() {
    331         StringBuffer buf = new StringBuffer(1024);
     331        StringBuilder buf = new StringBuilder(1024);
    332332        for (int i = 0; i < _trustedKeys.size(); i++) {
    333333            // If something already buffered, first add line break.
  • core/java/src/net/i2p/data/Address.java

    r055cd99 rabc23e9  
    7474    @Override
    7575    public String toString() {
    76         StringBuffer buf = new StringBuffer(64);
     76        StringBuilder buf = new StringBuilder(64);
    7777        buf.append("[Address: ");
    7878        buf.append("\n\tHostname: ").append(getHostname());
  • core/java/src/net/i2p/data/Base32.java

    r055cd99 rabc23e9  
    138138
    139139    public static String encode(byte[] source) {
    140         StringBuffer buf = new StringBuffer((source.length + 7) * 8 / 5);
     140        StringBuilder buf = new StringBuilder((source.length + 7) * 8 / 5);
    141141        encodeBytes(source, buf);
    142142        return buf.toString();
     
    150150     * @param source The data to convert
    151151     */
    152     private static void encodeBytes(byte[] source, StringBuffer out) {
     152    private static void encodeBytes(byte[] source, StringBuilder out) {
    153153        int usedbits = 0;
    154154        for (int i = 0; i < source.length; ) {
  • core/java/src/net/i2p/data/Base64.java

    r055cd99 rabc23e9  
    331331    } // end encode3to4
    332332
    333     private static void encode3to4(byte[] source, int srcOffset, int numSigBytes, StringBuffer buf, byte alpha[]) {
     333    private static void encode3to4(byte[] source, int srcOffset, int numSigBytes, StringBuilder buf, byte alpha[]) {
    334334        //           1         2         3 
    335335        // 01234567890123456789012345678901 Bit position
     
    395395        if (len + off > source.length)
    396396            throw new ArrayIndexOutOfBoundsException("Trying to encode too much!  source.len=" + source.length + " off=" + off + " len=" + len);
    397         StringBuffer buf = new StringBuffer(len * 4 / 3);
     397        StringBuilder buf = new StringBuilder(len * 4 / 3);
    398398        if (useStandardAlphabet)
    399399            encodeBytes(source, off, len, false, buf, ALPHABET);
     
    447447
    448448    private static String encodeBytes(byte[] source, int off, int len, boolean breakLines) {
    449         StringBuffer buf = new StringBuffer( (len*4)/3 );
     449        StringBuilder buf = new StringBuilder( (len*4)/3 );
    450450        encodeBytes(source, off, len, breakLines, buf, ALPHABET);
    451451        return buf.toString();
     
    461461     * @since 1.4
    462462     */
    463     private static void encodeBytes(byte[] source, int off, int len, boolean breakLines, StringBuffer out, byte alpha[]) {
     463    private static void encodeBytes(byte[] source, int off, int len, boolean breakLines, StringBuilder out, byte alpha[]) {
    464464        //int len43 = len * 4 / 3;
    465465        //byte[] outBuff = new byte[(len43) // Main 4:3
  • core/java/src/net/i2p/data/Certificate.java

    r055cd99 rabc23e9  
    150150    @Override
    151151    public String toString() {
    152         StringBuffer buf = new StringBuffer(64);
     152        StringBuilder buf = new StringBuilder(64);
    153153        buf.append("[Certificate: type: ");
    154154        if (getCertificateType() == CERTIFICATE_TYPE_NULL)
  • core/java/src/net/i2p/data/DataHelper.java

    r055cd99 rabc23e9  
    197197     */
    198198    public static String toString(Properties options) {
    199         StringBuffer buf = new StringBuffer();
     199        StringBuilder buf = new StringBuilder();
    200200        if (options != null) {
    201201            for (Iterator iter = options.keySet().iterator(); iter.hasNext();) {
     
    274274     */
    275275    public static String toString(Collection col) {
    276         StringBuffer buf = new StringBuffer();
     276        StringBuilder buf = new StringBuilder();
    277277        if (col != null) {
    278278            for (Iterator iter = col.iterator(); iter.hasNext();) {
     
    297297    public static String toString(byte buf[], int len) {
    298298        if (buf == null) buf = EMPTY_BUFFER;
    299         StringBuffer out = new StringBuffer();
     299        StringBuilder out = new StringBuilder();
    300300        if (len > buf.length) {
    301301            for (int i = 0; i < len - buf.length; i++)
     
    303303        }
    304304        for (int i = 0; i < buf.length && i < len; i++) {
    305             StringBuffer temp = new StringBuffer(Integer.toHexString(buf[i]));
     305            StringBuilder temp = new StringBuilder(Integer.toHexString(buf[i]));
    306306            while (temp.length() < 2) {
    307307                temp.insert(0, '0');
    308308            }
    309             temp = new StringBuffer(temp.substring(temp.length() - 2));
     309            temp = new StringBuilder(temp.substring(temp.length() - 2));
    310310            out.append(temp.toString());
    311311        }
     
    776776     * Read a newline delimited line from the stream, returning the line (without
    777777     * the newline), or null if EOF reached before the newline was found
     778     * Warning - strips \n but not \r
    778779     */
    779780    public static String readLine(InputStream in) throws IOException { return readLine(in, (Sha256Standalone)null); }
    780     /** update the hash along the way */
     781
     782    /**
     783     * update the hash along the way
     784     * Warning - strips \n but not \r
     785     */
    781786    public static String readLine(InputStream in, Sha256Standalone hash) throws IOException {
    782         StringBuffer buf = new StringBuffer(128);
     787        StringBuilder buf = new StringBuilder(128);
    783788        boolean ok = readLine(in, buf, hash);
    784789        if (ok)
     
    787792            return null;
    788793    }
     794
    789795    /**
    790796     * Read in a line, placing it into the buffer (excluding the newline).
     797     * Warning - strips \n but not \r
     798     * @deprecated use StringBuilder version
    791799     *
    792800     * @return true if the line was read, false if eof was reached before a
     
    796804        return readLine(in, buf, null);
    797805    }
    798     /** update the hash along the way */
     806
     807    /**
     808     * update the hash along the way
     809     * Warning - strips \n but not \r
     810     * @deprecated use StringBuilder version
     811     */
    799812    public static boolean readLine(InputStream in, StringBuffer buf, Sha256Standalone hash) throws IOException {
    800813        int c = -1;
     
    809822        else
    810823            return true;
     824    }
     825   
     826    /**
     827     * Read in a line, placing it into the buffer (excluding the newline).
     828     * Warning - strips \n but not \r
     829     *
     830     * @return true if the line was read, false if eof was reached before a
     831     *              newline was found
     832     */
     833    public static boolean readLine(InputStream in, StringBuilder buf) throws IOException {
     834        return readLine(in, buf, null);
     835    }
     836
     837    /**
     838     * update the hash along the way
     839     * Warning - strips \n but not \r
     840     */
     841    public static boolean readLine(InputStream in, StringBuilder buf, Sha256Standalone hash) throws IOException {
     842        int c = -1;
     843        while ( (c = in.read()) != -1) {
     844            if (hash != null) hash.update((byte)c);
     845            if (c == '\n')
     846                break;
     847            buf.append((char)c);
     848        }
     849        return c != -1;
    811850    }
    812851   
  • core/java/src/net/i2p/data/Destination.java

    r055cd99 rabc23e9  
    146146    @Override
    147147    public String toString() {
    148         StringBuffer buf = new StringBuffer(128);
     148        StringBuilder buf = new StringBuilder(128);
    149149        buf.append("[Destination: ");
    150150        buf.append("\n\tHash: ").append(calculateHash().toBase64());
  • core/java/src/net/i2p/data/Hash.java

    r055cd99 rabc23e9  
    105105            if (_log.shouldLog(Log.DEBUG)) {
    106106                // explicit buffer, since the compiler can't guess how long it'll be
    107                 StringBuffer buf = new StringBuffer(128);
     107                StringBuilder buf = new StringBuilder(128);
    108108                buf.append("miss [").append(cached).append("] from ");
    109109                buf.append(DataHelper.toHexString(getData())).append(" to ");
     
    114114            if (_log.shouldLog(Log.DEBUG)) {
    115115                // explicit buffer, since the compiler can't guess how long it'll be
    116                 StringBuffer buf = new StringBuffer(128);
     116                StringBuilder buf = new StringBuilder(128);
    117117                buf.append("hit from ");
    118118                buf.append(DataHelper.toHexString(getData())).append(" to ");
     
    156156    public String toString() {
    157157        if (_stringified == null) {
    158             StringBuffer buf = new StringBuffer(64);
     158            StringBuilder buf = new StringBuilder(64);
    159159            buf.append("[Hash: ");
    160160            if (_data == null) {
  • core/java/src/net/i2p/data/Lease.java

    r055cd99 rabc23e9  
    148148    @Override
    149149    public String toString() {
    150         StringBuffer buf = new StringBuffer(128);
     150        StringBuilder buf = new StringBuilder(128);
    151151        buf.append("[Lease: ");
    152152        buf.append("\n\tEnd Date: ").append(getEndDate());
  • core/java/src/net/i2p/data/LeaseSet.java

    r055cd99 rabc23e9  
    356356    @Override
    357357    public String toString() {
    358         StringBuffer buf = new StringBuffer(128);
     358        StringBuilder buf = new StringBuilder(128);
    359359        buf.append("[LeaseSet: ");
    360360        buf.append("\n\tDestination: ").append(getDestination());
  • core/java/src/net/i2p/data/Payload.java

    r055cd99 rabc23e9  
    109109    public String toString() {
    110110        if (true) return "[Payload]";
    111         StringBuffer buf = new StringBuffer(128);
     111        StringBuilder buf = new StringBuilder(128);
    112112        buf.append("[Payload: ");
    113113        if (getUnencryptedData() != null)
  • core/java/src/net/i2p/data/PrivateKey.java

    r055cd99 rabc23e9  
    7878    @Override
    7979    public String toString() {
    80         StringBuffer buf = new StringBuffer(64);
     80        StringBuilder buf = new StringBuilder(64);
    8181        buf.append("[PrivateKey: ");
    8282        if (_data == null) {
  • core/java/src/net/i2p/data/PrivateKeyFile.java

    r055cd99 rabc23e9  
    264264
    265265    public String toString() {
    266         StringBuffer s = new StringBuffer(128);
     266        StringBuilder s = new StringBuilder(128);
    267267        s.append("Dest: ");
    268268        s.append(this.dest != null ? this.dest.toBase64() : "null");
  • core/java/src/net/i2p/data/PublicKey.java

    r055cd99 rabc23e9  
    8080    @Override
    8181    public String toString() {
    82         StringBuffer buf = new StringBuffer(64);
     82        StringBuilder buf = new StringBuilder(64);
    8383        buf.append("[PublicKey: ");
    8484        if (_data == null) {
  • core/java/src/net/i2p/data/RouterAddress.java

    r055cd99 rabc23e9  
    139139    @Override
    140140    public String toString() {
    141         StringBuffer buf = new StringBuffer(64);
     141        StringBuilder buf = new StringBuilder(64);
    142142        buf.append("[RouterAddress: ");
    143143        buf.append("\n\tTransportStyle: ").append(getTransportStyle());
  • core/java/src/net/i2p/data/RouterIdentity.java

    r055cd99 rabc23e9  
    110110    @Override
    111111    public String toString() {
    112         StringBuffer buf = new StringBuffer(64);
     112        StringBuilder buf = new StringBuilder(64);
    113113        buf.append("[RouterIdentity: ");
    114114        buf.append("\n\tHash: ").append(getHash().toBase64());
  • core/java/src/net/i2p/data/RouterInfo.java

    r055cd99 rabc23e9  
    383383                return;
    384384            } else {
    385                 StringBuffer buf = new StringBuffer(caps);
     385                StringBuilder buf = new StringBuilder(caps);
    386386                while ( (idx = buf.indexOf(""+cap)) != -1)
    387387                    buf.deleteCharAt(idx);
     
    556556    public String toString() {
    557557        if (_stringified != null) return _stringified;
    558         StringBuffer buf = new StringBuffer(5*1024);
     558        StringBuilder buf = new StringBuilder(5*1024);
    559559        buf.append("[RouterInfo: ");
    560560        buf.append("\n\tIdentity: ").append(getIdentity());
  • core/java/src/net/i2p/data/SessionKey.java

    r055cd99 rabc23e9  
    8585    public String toString() {
    8686        if (true) return super.toString();
    87         StringBuffer buf = new StringBuffer(64);
     87        StringBuilder buf = new StringBuilder(64);
    8888        buf.append("[SessionKey: ");
    8989        if (_data == null) {
  • core/java/src/net/i2p/data/Signature.java

    r055cd99 rabc23e9  
    7070    @Override
    7171    public String toString() {
    72         StringBuffer buf = new StringBuffer(64);
     72        StringBuilder buf = new StringBuilder(64);
    7373        buf.append("[Signature: ");
    7474        if (_data == null) {
  • core/java/src/net/i2p/data/SigningPrivateKey.java

    r055cd99 rabc23e9  
    7676    @Override
    7777    public String toString() {
    78         StringBuffer buf = new StringBuffer(64);
     78        StringBuilder buf = new StringBuilder(64);
    7979        buf.append("[SigningPrivateKey: ");
    8080        if (_data == null) {
  • core/java/src/net/i2p/data/SigningPublicKey.java

    r055cd99 rabc23e9  
    7575    @Override
    7676    public String toString() {
    77         StringBuffer buf = new StringBuffer(64);
     77        StringBuilder buf = new StringBuilder(64);
    7878        buf.append("[SigningPublicKey: ");
    7979        if (_data == null) {
  • core/java/src/net/i2p/data/VerifiedDestination.java

    r055cd99 rabc23e9  
    156156    @Override
    157157    public String toString() {
    158         StringBuffer buf = new StringBuffer(128);
     158        StringBuilder buf = new StringBuilder(128);
    159159        buf.append(super.toString());
    160160        buf.append("\n\tVerified Certificate? ").append(verifyCert(true));
  • core/java/src/net/i2p/data/i2cp/BandwidthLimitsMessage.java

    r055cd99 rabc23e9  
    9292    @Override
    9393    public String toString() {
    94         StringBuffer buf = new StringBuffer();
     94        StringBuilder buf = new StringBuilder();
    9595        buf.append("[BandwidthLimitsMessage");
    9696        buf.append("\n\tIn: ").append(data[0]);
  • core/java/src/net/i2p/data/i2cp/CreateLeaseSetMessage.java

    r055cd99 rabc23e9  
    129129    @Override
    130130    public String toString() {
    131         StringBuffer buf = new StringBuffer();
     131        StringBuilder buf = new StringBuilder();
    132132        buf.append("[CreateLeaseSetMessage: ");
    133133        buf.append("\n\tLeaseSet: ").append(getLeaseSet());
  • core/java/src/net/i2p/data/i2cp/CreateSessionMessage.java

    r055cd99 rabc23e9  
    8585    @Override
    8686    public String toString() {
    87         StringBuffer buf = new StringBuffer();
     87        StringBuilder buf = new StringBuilder();
    8888        buf.append("[CreateSessionMessage: ");
    8989        buf.append("\n\tConfig: ").append(getSessionConfig());
  • core/java/src/net/i2p/data/i2cp/DestLookupMessage.java

    r055cd99 rabc23e9  
    6868
    6969    public String toString() {
    70         StringBuffer buf = new StringBuffer();
     70        StringBuilder buf = new StringBuilder();
    7171        buf.append("[DestLookupMessage: ");
    7272        buf.append("\n\tHash: ").append(_hash);
  • core/java/src/net/i2p/data/i2cp/DestReplyMessage.java

    r055cd99 rabc23e9  
    7070
    7171    public String toString() {
    72         StringBuffer buf = new StringBuffer();
     72        StringBuilder buf = new StringBuilder();
    7373        buf.append("[DestReplyMessage: ");
    7474        buf.append("\n\tDestination: ").append(_dest);
  • core/java/src/net/i2p/data/i2cp/DestroySessionMessage.java

    r055cd99 rabc23e9  
    8181    @Override
    8282    public String toString() {
    83         StringBuffer buf = new StringBuffer();
     83        StringBuilder buf = new StringBuilder();
    8484        buf.append("[DestroySessionMessage: ");
    8585        buf.append("\n\tSessionId: ").append(getSessionId());
  • core/java/src/net/i2p/data/i2cp/DisconnectMessage.java

    r055cd99 rabc23e9  
    7777    @Override
    7878    public String toString() {
    79         StringBuffer buf = new StringBuffer();
     79        StringBuilder buf = new StringBuilder();
    8080        buf.append("[DisconnectMessage: ");
    8181        buf.append("\n\tReason: ").append(getReason());
  • core/java/src/net/i2p/data/i2cp/GetBandwidthLimitsMessage.java

    r055cd99 rabc23e9  
    5050    @Override
    5151    public String toString() {
    52         StringBuffer buf = new StringBuffer();
     52        StringBuilder buf = new StringBuilder();
    5353        buf.append("[GetBandwidthLimitsMessage]");
    5454        return buf.toString();
  • core/java/src/net/i2p/data/i2cp/GetDateMessage.java

    r055cd99 rabc23e9  
    5353    @Override
    5454    public String toString() {
    55         StringBuffer buf = new StringBuffer();
     55        StringBuilder buf = new StringBuilder();
    5656        buf.append("[GetDateMessage]");
    5757        return buf.toString();
  • core/java/src/net/i2p/data/i2cp/MessagePayloadMessage.java

    r055cd99 rabc23e9  
    124124    @Override
    125125    public String toString() {
    126         StringBuffer buf = new StringBuffer();
     126        StringBuilder buf = new StringBuilder();
    127127        buf.append("[MessagePayloadMessage: ");
    128128        buf.append("\n\tSessionId: ").append(getSessionId());
  • core/java/src/net/i2p/data/i2cp/MessageStatusMessage.java

    r055cd99 rabc23e9  
    169169    @Override
    170170    public String toString() {
    171         StringBuffer buf = new StringBuffer();
     171        StringBuilder buf = new StringBuilder();
    172172        buf.append("[MessageStatusMessage: ");
    173173        buf.append("\n\tSessionId: ").append(getSessionId());
  • core/java/src/net/i2p/data/i2cp/ReceiveMessageBeginMessage.java

    r055cd99 rabc23e9  
    103103    @Override
    104104    public String toString() {
    105         StringBuffer buf = new StringBuffer();
     105        StringBuilder buf = new StringBuilder();
    106106        buf.append("[ReceiveMessageBeginMessage: ");
    107107        buf.append("\n\tSessionId: ").append(getSessionId());
  • core/java/src/net/i2p/data/i2cp/ReceiveMessageEndMessage.java

    r055cd99 rabc23e9  
    8787    @Override
    8888    public String toString() {
    89         StringBuffer buf = new StringBuffer();
     89        StringBuilder buf = new StringBuilder();
    9090        buf.append("[ReceiveMessageEndMessage: ");
    9191        buf.append("\n\tSessionId: ").append(getSessionId());
  • core/java/src/net/i2p/data/i2cp/ReconfigureSessionMessage.java

    r055cd99 rabc23e9  
    9494    @Override
    9595    public String toString() {
    96         StringBuffer buf = new StringBuffer();
     96        StringBuilder buf = new StringBuilder();
    9797        buf.append("[ReconfigureSessionMessage: ");
    9898        buf.append("\n\tSessionId: ").append(getSessionId());
  • core/java/src/net/i2p/data/i2cp/ReportAbuseMessage.java

    r055cd99 rabc23e9  
    124124    @Override
    125125    public String toString() {
    126         StringBuffer buf = new StringBuffer();
     126        StringBuilder buf = new StringBuilder();
    127127        buf.append("[ReportAbuseMessage: ");
    128128        buf.append("\n\tSessionID: ").append(getSessionId());
  • core/java/src/net/i2p/data/i2cp/RequestLeaseSetMessage.java

    r055cd99 rabc23e9  
    144144    @Override
    145145    public String toString() {
    146         StringBuffer buf = new StringBuffer();
     146        StringBuilder buf = new StringBuilder();
    147147        buf.append("[RequestLeaseMessage: ");
    148148        buf.append("\n\tSessionId: ").append(getSessionId());
  • core/java/src/net/i2p/data/i2cp/SendMessageExpiresMessage.java

    r055cd99 rabc23e9  
    105105    @Override
    106106    public String toString() {
    107         StringBuffer buf = new StringBuffer();
     107        StringBuilder buf = new StringBuilder();
    108108        buf.append("[SendMessageMessage: ");
    109109        buf.append("\n\tSessionId: ").append(getSessionId());
  • core/java/src/net/i2p/data/i2cp/SendMessageMessage.java

    r055cd99 rabc23e9  
    150150    @Override
    151151    public String toString() {
    152         StringBuffer buf = new StringBuffer();
     152        StringBuilder buf = new StringBuilder();
    153153        buf.append("[SendMessageMessage: ");
    154154        buf.append("\n\tSessionId: ").append(getSessionId());
  • core/java/src/net/i2p/data/i2cp/SessionConfig.java

    r055cd99 rabc23e9  
    219219    @Override
    220220    public String toString() {
    221         StringBuffer buf = new StringBuffer("[SessionConfig: ");
     221        StringBuilder buf = new StringBuilder("[SessionConfig: ");
    222222        buf.append("\n\tDestination: ").append(getDestination());
    223223        buf.append("\n\tSignature: ").append(getSignature());
  • core/java/src/net/i2p/data/i2cp/SessionStatusMessage.java

    r055cd99 rabc23e9  
    9797    @Override
    9898    public String toString() {
    99         StringBuffer buf = new StringBuffer();
     99        StringBuilder buf = new StringBuilder();
    100100        buf.append("[SessionStatusMessage: ");
    101101        buf.append("\n\tSessionId: ").append(getSessionId());
  • core/java/src/net/i2p/data/i2cp/SetDateMessage.java

    r055cd99 rabc23e9  
    8080    @Override
    8181    public String toString() {
    82         StringBuffer buf = new StringBuffer();
     82        StringBuilder buf = new StringBuilder();
    8383        buf.append("[SetDateMessage");
    8484        buf.append("\n\tDate: ").append(getDate());
  • core/java/src/net/i2p/stat/PersistenceHelper.java

    r055cd99 rabc23e9  
    1010    private final static String NL = System.getProperty("line.separator");
    1111
    12     public final static void add(StringBuffer buf, String prefix, String name, String description, double value) {
     12    public final static void add(StringBuilder buf, String prefix, String name, String description, double value) {
    1313        buf.append("# ").append(prefix).append(name).append(NL);
    1414        buf.append("# ").append(description).append(NL);
     
    1616    }
    1717
    18     public final static void add(StringBuffer buf, String prefix, String name, String description, long value) {
     18    public final static void add(StringBuilder buf, String prefix, String name, String description, long value) {
    1919        buf.append("# ").append(prefix).append(name).append(NL);
    2020        buf.append("# ").append(description).append(NL);
  • core/java/src/net/i2p/stat/Rate.java

    r055cd99 rabc23e9  
    364364    }
    365365
    366     public void store(String prefix, StringBuffer buf) throws IOException {
     366    public void store(String prefix, StringBuilder buf) throws IOException {
    367367        PersistenceHelper.add(buf, prefix, ".period", "Number of milliseconds in the period", _period);
    368368        PersistenceHelper.add(buf, prefix, ".creationDate",
     
    455455    @Override
    456456    public String toString() {
    457         StringBuffer buf = new StringBuffer(2048);
     457        StringBuilder buf = new StringBuilder(2048);
    458458        buf.append("\n\t total value: ").append(getLastTotalValue());
    459459        buf.append("\n\t highest total value: ").append(getExtremeTotalValue());
     
    495495        }
    496496        rate.coalesce();
    497         StringBuffer buf = new StringBuffer(1024);
     497        StringBuilder buf = new StringBuilder(1024);
    498498        try {
    499499            rate.store("rate.test", buf);
  • core/java/src/net/i2p/stat/RateStat.java

    r055cd99 rabc23e9  
    9494    @Override
    9595    public String toString() {
    96         StringBuffer buf = new StringBuffer(4096);
     96        StringBuilder buf = new StringBuilder(4096);
    9797        buf.append(getGroupName()).append('.').append(getName()).append(": ").append(getDescription()).append('\n');
    9898        long periods[] = getPeriods();
     
    122122
    123123    public void store(OutputStream out, String prefix) throws IOException {
    124         StringBuffer buf = new StringBuffer(1024);
     124        StringBuilder buf = new StringBuilder(1024);
    125125        buf.append(NL);
    126126        buf.append("################################################################################").append(NL);
  • core/java/src/net/i2p/stat/SimpleStatDumper.java

    r055cd99 rabc23e9  
    1515        if (!_log.shouldLog(logLevel)) return;
    1616
    17         StringBuffer buf = new StringBuffer(4 * 1024);
     17        StringBuilder buf = new StringBuilder(4 * 1024);
    1818        dumpFrequencies(context, buf);
    1919        dumpRates(context, buf);
     
    2121    }
    2222
    23     private static void dumpFrequencies(I2PAppContext ctx, StringBuffer buf) {
     23    private static void dumpFrequencies(I2PAppContext ctx, StringBuilder buf) {
    2424        Set frequencies = new TreeSet(ctx.statManager().getFrequencyNames());
    2525        for (Iterator iter = frequencies.iterator(); iter.hasNext();) {
     
    4141    }
    4242
    43     private static void dumpRates(I2PAppContext ctx, StringBuffer buf) {
     43    private static void dumpRates(I2PAppContext ctx, StringBuilder buf) {
    4444        Set rates = new TreeSet(ctx.statManager().getRateNames());
    4545        for (Iterator iter = rates.iterator(); iter.hasNext();) {
     
    6060    }
    6161
    62     static void dumpRate(Rate curRate, StringBuffer buf) {
     62    static void dumpRate(Rate curRate, StringBuilder buf) {
    6363        buf.append(curRate.toString());
    6464    }
  • core/java/src/net/i2p/time/Timestamper.java

    r055cd99 rabc23e9  
    198198                if (Math.abs(delta - expectedDelta) > MAX_VARIANCE) {
    199199                    if (_log.shouldLog(Log.ERROR)) {
    200                         StringBuffer err = new StringBuffer(96);
     200                        StringBuilder err = new StringBuilder(96);
    201201                        err.append("SNTP client variance exceeded at query ").append(i);
    202202                        err.append(".  expected = ");
     
    215215        stampTime(now);
    216216        if (_log.shouldLog(Log.DEBUG)) {
    217             StringBuffer buf = new StringBuffer(64);
     217            StringBuilder buf = new StringBuilder(64);
    218218            buf.append("Deltas: ");
    219219            for (int i = 0; i < found.length; i++)
  • core/java/src/net/i2p/util/BufferedRandomSource.java

    r055cd99 rabc23e9  
    219219    }
    220220    private static final String toString(byte data[]) {
    221         StringBuffer buf = new StringBuffer(data.length * 9);
     221        StringBuilder buf = new StringBuilder(data.length * 9);
    222222        for (int i = 0; i < data.length; i++) {
    223223            for (int j = 0; j < 8; j++) {
  • core/java/src/net/i2p/util/EepGet.java

    r055cd99 rabc23e9  
    208208    private static String sanitize(String name) {
    209209        name = name.replace('/', '_');
    210         StringBuffer buf = new StringBuffer(name);
     210        StringBuilder buf = new StringBuilder(name);
    211211        for (int i = 0; i < name.length(); i++)
    212212            if (_safeChars.indexOf(buf.charAt(i)) == -1)
     
    293293                        long timeToSend = now - _lastComplete;
    294294                        if (timeToSend > 0) {
    295                             StringBuffer buf = new StringBuffer(50);
     295                            StringBuilder buf = new StringBuilder(50);
    296296                            buf.append(" ");
    297297                            if ( bytesRemaining > 0 ) {
     
    354354                System.out.println("== ETag: " + _etag);           
    355355            if (transferred > 0) {
    356                 StringBuffer buf = new StringBuffer(50);
     356                StringBuilder buf = new StringBuilder(50);
    357357                buf.append("== Transfer rate: ");
    358358                double kbps = (1000.0d*(double)(transferred)/((double)timeToSend*1024.0d));
     
    382382            System.out.println("== Transfer time: " + DataHelper.formatDuration(timeToSend));
    383383            double kbps = (timeToSend > 0 ? (1000.0d*(double)(bytesTransferred)/((double)timeToSend*1024.0d)) : 0);
    384             StringBuffer buf = new StringBuffer(50);
     384            StringBuilder buf = new StringBuilder(50);
    385385            buf.append("== Transfer rate: ");
    386386            synchronized (_kbps) {
     
    628628    private void readHeaders() throws IOException {
    629629        String key = null;
    630         StringBuffer buf = new StringBuffer(32);
     630        StringBuilder buf = new StringBuilder(32);
    631631
    632632        boolean read = DataHelper.readLine(_proxyIn, buf);
     
    739739   
    740740    private long readChunkLength() throws IOException {
    741         StringBuffer buf = new StringBuffer(8);
     741        StringBuilder buf = new StringBuilder(8);
    742742        int nl = 0;
    743743        while (true) {
     
    894894   
    895895    private String getRequest() throws IOException {
    896         StringBuffer buf = new StringBuffer(512);
     896        StringBuilder buf = new StringBuilder(512);
    897897        boolean post = false;
    898898        if ( (_postData != null) && (_postData.length() > 0) )
  • core/java/src/net/i2p/util/EepPost.java

    r055cd99 rabc23e9  
    185185   
    186186    private String getHeader(boolean isProxy, String path, String host, int port, String separator, long length) {
    187         StringBuffer buf = new StringBuffer(512);
     187        StringBuilder buf = new StringBuilder(512);
    188188        buf.append("POST ");
    189189        if (isProxy) {
     
    213213        byte separator[] = new byte[32];  // 2^-128 chance of this being a problem
    214214        I2PAppContext.getGlobalContext().random().nextBytes(separator);
    215         StringBuffer sep = new StringBuffer(48);
     215        StringBuilder sep = new StringBuilder(48);
    216216        for (int i = 0; i < separator.length; i++)
    217217            sep.append((char)((int)'a' + (int)(separator[i]&0x0F))).append((char)((int)'a' + (int)((separator[i] >>> 4) & 0x0F)));
  • core/java/src/net/i2p/util/FileUtil.java

    r055cd99 rabc23e9  
    161161                }
    162162            }
    163             StringBuffer buf = new StringBuffer(lines.size() * 80);
     163            StringBuilder buf = new StringBuilder(lines.size() * 80);
    164164            for (int i = 0; i < lines.size(); i++)
    165165                buf.append((String)lines.get(i)).append('\n');
  • core/java/src/net/i2p/util/LogManager.java

    r055cd99 rabc23e9  
    547547   
    548548    private String createConfig() {
    549         StringBuffer buf = new StringBuffer(8*1024);
     549        StringBuilder buf = new StringBuilder(8*1024);
    550550        buf.append(PROP_FORMAT).append('=').append(new String(_format)).append('\n');
    551551        buf.append(PROP_DATEFORMAT).append('=').append(_dateFormatPattern).append('\n');
  • core/java/src/net/i2p/util/LogRecordFormatter.java

    r055cd99 rabc23e9  
    3131        if (rec.getThrowable() != null)
    3232            size += 512;
    33         StringBuffer buf = new StringBuffer(size);
     33        StringBuilder buf = new StringBuilder(size);
    3434        char format[] = manager.getFormat();
    3535        for (int i = 0; i < format.length; ++i) {
     
    9494
    9595    private static String toString(String str, int size) {
    96         StringBuffer buf = new StringBuffer();
     96        StringBuilder buf = new StringBuilder();
    9797        if (str == null) str = "";
    9898        if (str.length() > size) str = str.substring(str.length() - size);
  • core/java/src/net/i2p/util/LogWriter.java

    r055cd99 rabc23e9  
    239239    private static final String replace(String pattern, int num) {
    240240        char c[] = pattern.toCharArray();
    241         StringBuffer buf = new StringBuffer();
     241        StringBuilder buf = new StringBuilder();
    242242        for (int i = 0; i < c.length; i++) {
    243243            if ( (c[i] != '#') && (c[i] != '@') )
  • core/java/src/net/i2p/util/SimpleTimer.java

    r055cd99 rabc23e9  
    234234                    _occurredTime = now;
    235235                    if (_occurredEventCount > 2500) {
    236                         StringBuffer buf = new StringBuffer(128);
     236                        StringBuilder buf = new StringBuilder(128);
    237237                        buf.append("Too many simpleTimerJobs (").append(_occurredEventCount);
    238238                        buf.append(") in a second!");
  • core/java/src/net/i2p/util/SocketTimeout.java

    r055cd99 rabc23e9  
    5959    @Override
    6060    public String toString() {
    61         StringBuffer buf = new StringBuffer();
     61        StringBuilder buf = new StringBuilder();
    6262        buf.append("started on ");
    6363        buf.append(ts(_startTime));
  • core/java/src/org/xlattice/crypto/filters/BloomSHA1.java

    r055cd99 rabc23e9  
    213213    // DEBUG METHODS
    214214    public static String keyToString(byte[] key) {
    215         StringBuffer sb = new StringBuffer().append(key[0]);
     215        StringBuilder sb = new StringBuilder().append(key[0]);
    216216        for (int i = 1; i < key.length; i++) {
    217217            sb.append(".").append(Integer.toString(key[i], 16));
     
    221221    /** convert 64-bit integer to hex String */
    222222    public static String ltoh (long i) {
    223         StringBuffer sb = new StringBuffer().append("#")
     223        StringBuilder sb = new StringBuilder().append("#")
    224224                                .append(Long.toString(i, 16));
    225225        return sb.toString();
     
    228228    /** convert 32-bit integer to String */
    229229    public static String itoh (int i) {
    230         StringBuffer sb = new StringBuffer().append("#")
     230        StringBuilder sb = new StringBuilder().append("#")
    231231                                .append(Integer.toString(i, 16));
    232232        return sb.toString();
  • core/java/test/net/i2p/crypto/HMACSHA256Bench.java

    r055cd99 rabc23e9  
    7171       
    7272                byte[] smess = new String("abc").getBytes();
    73                 StringBuffer buf = new StringBuffer();
     73                StringBuilder buf = new StringBuilder();
    7474                for (int x = 0; x < 2*1024; x++) {
    7575                        buf.append("a");
    7676                }
    7777                byte[] mmess = buf.toString().getBytes(); // new String("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq").getBytes();
    78                 buf = new StringBuffer();
     78                buf = new StringBuilder();
    7979                for (int x = 0; x < 10000; x++) {
    8080                        buf.append("a");
  • core/java/test/net/i2p/crypto/SHA1HashTest.java

    r055cd99 rabc23e9  
    134134 
    135135    private final String toHex(final byte[] bytes) {
    136         StringBuffer buf = new StringBuffer(bytes.length * 2);
     136        StringBuilder buf = new StringBuilder(bytes.length * 2);
    137137        for (int i = 0; i < bytes.length; i++) {
    138138            if ((i & 3) == 0 && i != 0)
  • core/java/test/net/i2p/crypto/SHA256Bench.java

    r055cd99 rabc23e9  
    5858       
    5959                byte[] smess = new String("abc").getBytes();
    60                 StringBuffer buf = new StringBuffer();
     60                StringBuilder buf = new StringBuilder();
    6161                for (int x = 0; x < 10*1024; x++) {
    6262                        buf.append("a");
    6363                }
    6464                byte[] mmess = buf.toString().getBytes(); // new String("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq").getBytes();
    65                 buf = new StringBuffer();
     65                buf = new StringBuilder();
    6666                for (int x = 0; x < 1000000; x++) {
    6767                        buf.append("a");
  • core/java/test/net/i2p/stat/RateTest.java

    r055cd99 rabc23e9  
    1414        }
    1515        rate.coalesce();
    16         StringBuffer buf = new StringBuffer(1024);
     16        StringBuilder buf = new StringBuilder(1024);
    1717       
    1818        rate.store("rate.test", buf);
  • router/java/src/net/i2p/data/i2np/DataMessage.java

    r055cd99 rabc23e9  
    107107    @Override
    108108    public String toString() {
    109         StringBuffer buf = new StringBuffer();
     109        StringBuilder buf = new StringBuilder();
    110110        buf.append("[DataMessage: ");
    111111        buf.append("\n\tData: ").append(DataHelper.toString(getData(), 64));
  • router/java/src/net/i2p/data/i2np/DatabaseLookupMessage.java

    r055cd99 rabc23e9  
    239239    @Override
    240240    public String toString() {
    241         StringBuffer buf = new StringBuffer();
     241        StringBuilder buf = new StringBuilder();
    242242        buf.append("[DatabaseLookupMessage: ");
    243243        buf.append("\n\tSearch Key: ").append(getSearchKey());
  • router/java/src/net/i2p/data/i2np/DatabaseSearchReplyMessage.java

    r055cd99 rabc23e9  
    132132    @Override
    133133    public String toString() {
    134         StringBuffer buf = new StringBuffer();
     134        StringBuilder buf = new StringBuilder();
    135135        buf.append("[DatabaseSearchReplyMessage: ");
    136136        buf.append("\n\tSearch Key: ").append(getSearchKey());
  • router/java/src/net/i2p/data/i2np/DatabaseStoreMessage.java

    r055cd99 rabc23e9  
    261261    @Override
    262262    public String toString() {
    263         StringBuffer buf = new StringBuffer();
     263        StringBuilder buf = new StringBuilder();
    264264        buf.append("[DatabaseStoreMessage: ");
    265265        buf.append("\n\tExpiration: ").append(getMessageExpiration());
  • router/java/src/net/i2p/data/i2np/DateMessage.java

    r055cd99 rabc23e9  
    7171    @Override
    7272    public String toString() {
    73         StringBuffer buf = new StringBuffer();
     73        StringBuilder buf = new StringBuilder();
    7474        buf.append("[DateMessage: ");
    7575        buf.append("Now: ").append(_now);
  • router/java/src/net/i2p/data/i2np/DeliveryInstructions.java

    r055cd99 rabc23e9  
    378378    @Override
    379379    public String toString() {
    380         StringBuffer buf = new StringBuffer(128);
     380        StringBuilder buf = new StringBuilder(128);
    381381        buf.append("[DeliveryInstructions: ");
    382382        buf.append("\n\tDelivery mode: ");
  • router/java/src/net/i2p/data/i2np/DeliveryStatusMessage.java

    r055cd99 rabc23e9  
    8383    @Override
    8484    public String toString() {
    85         StringBuffer buf = new StringBuffer();
     85        StringBuilder buf = new StringBuilder();
    8686        buf.append("[DeliveryStatusMessage: ");
    8787        buf.append("\n\tMessage ID: ").append(getMessageId());
  • router/java/src/net/i2p/data/i2np/GarlicClove.java

    r055cd99 rabc23e9  
    108108   
    109109    public void writeBytes(OutputStream out) throws DataFormatException, IOException {
    110         StringBuffer error = null;
     110        StringBuilder error = null;
    111111        if (_instructions == null) {
    112             if (error == null) error = new StringBuffer();
     112            if (error == null) error = new StringBuilder();
    113113            error.append("No instructions ");
    114114        }
    115115        if (_msg == null) {
    116             if (error == null) error = new StringBuffer();
     116            if (error == null) error = new StringBuilder();
    117117            error.append("No message ");
    118118        }
    119119        if (_cloveId < 0) {
    120             if (error == null) error = new StringBuffer();
     120            if (error == null) error = new StringBuilder();
    121121            error.append("CloveID < 0 [").append(_cloveId).append("] ");
    122122        }
    123123        if (_expiration == null) {
    124             if (error == null) error = new StringBuffer();
     124            if (error == null) error = new StringBuilder();
    125125            error.append("Expiration is null ");
    126126        }
    127127        if (_certificate == null) {
    128             if (error == null) error = new StringBuffer();
     128            if (error == null) error = new StringBuilder();
    129129            error.append("Certificate is null ");
    130130        }
     
    211211    @Override
    212212    public String toString() {
    213         StringBuffer buf = new StringBuffer(128);
     213        StringBuilder buf = new StringBuilder(128);
    214214        buf.append("[GarlicClove: ");
    215215        buf.append("\n\tInstructions: ").append(getInstructions());
  • router/java/src/net/i2p/data/i2np/GarlicMessage.java

    r055cd99 rabc23e9  
    9191    @Override
    9292    public String toString() {
    93         StringBuffer buf = new StringBuffer();
     93        StringBuilder buf = new StringBuilder();
    9494        buf.append("[GarlicMessage: ");
    9595        buf.append("\n\tData length: ").append(getData().length).append(" bytes");
  • router/java/src/net/i2p/data/i2np/TunnelCreateMessage.java

    r055cd99 rabc23e9  
    264264    @Override
    265265    public String toString() {
    266         StringBuffer buf = new StringBuffer();
     266        StringBuilder buf = new StringBuilder();
    267267        buf.append("[TunnelCreateMessage: ");
    268268        buf.append("\n\tNext Router: ").append(getNextRouter());
  • router/java/src/net/i2p/data/i2np/TunnelCreateStatusMessage.java

    r055cd99 rabc23e9  
    109109    @Override
    110110    public String toString() {
    111         StringBuffer buf = new StringBuffer();
     111        StringBuilder buf = new StringBuilder();
    112112        buf.append("[TunnelCreateStatusMessage: ");
    113113        buf.append("\n\tTunnel ID: ").append(getReceiveTunnelId());
  • router/java/src/net/i2p/data/i2np/TunnelDataMessage.java

    r055cd99 rabc23e9  
    140140    @Override
    141141    public String toString() {
    142         StringBuffer buf = new StringBuffer();
     142        StringBuilder buf = new StringBuilder();
    143143        buf.append("[TunnelDataMessage:");
    144144        buf.append(" MessageId: ").append(getUniqueId());
  • router/java/src/net/i2p/data/i2np/TunnelGatewayMessage.java

    r055cd99 rabc23e9  
    132132    @Override
    133133    public String toString() {
    134         StringBuffer buf = new StringBuffer();
     134        StringBuilder buf = new StringBuilder();
    135135        buf.append("[TunnelGatewayMessage:");
    136136        buf.append(" Tunnel ID: ").append(getTunnelId());
  • router/java/src/net/i2p/router/Blocklist.java

    r055cd99 rabc23e9  
    189189        try {
    190190            in = new FileInputStream(BLFile);
    191             StringBuffer buf = new StringBuffer(128);
     191            StringBuilder buf = new StringBuilder(128);
    192192            while (DataHelper.readLine(in, buf) && count < maxSize) {
    193193                Entry e = parse(buf, true);
     
    268268    }
    269269
    270     private Entry parse(StringBuffer buf, boolean bitch) {
     270    private Entry parse(StringBuilder buf, boolean bitch) {
    271271        byte[] ip1;
    272272        byte[] ip2;
     
    379379        try {
    380380            in = new FileInputStream(BLFile);
    381             StringBuffer buf = new StringBuffer(128);
     381            StringBuilder buf = new StringBuilder(128);
    382382            while (DataHelper.readLine(in, buf)) {
    383383                lines++;
     
    629629
    630630    private static String toStr(long entry) {
    631         StringBuffer buf = new StringBuffer(32);
     631        StringBuilder buf = new StringBuilder(32);
    632632        for (int i = 7; i >= 0; i--) {
    633633            buf.append((entry >> (8*i)) & 0xff);
     
    641641
    642642    private static String toStr(int ip) {
    643         StringBuffer buf = new StringBuffer(16);
     643        StringBuilder buf = new StringBuilder(16);
    644644        for (int i = 3; i >= 0; i--) {
    645645            buf.append((ip >> (8*i)) & 0xff);
     
    720720            try {
    721721                in = new FileInputStream(BLFile);
    722                 StringBuffer buf = new StringBuffer(128);
     722                StringBuilder buf = new StringBuilder(128);
    723723                // assume the file is unsorted, so go through the whole thing
    724724                while (DataHelper.readLine(in, buf)) {
  • router/java/src/net/i2p/router/ClientTunnelSettings.java

    r055cd99 rabc23e9  
    4747    @Override
    4848    public String toString() {
    49         StringBuffer buf = new StringBuffer();
     49        StringBuilder buf = new StringBuilder();
    5050        Properties p = new Properties();
    5151        writeToProperties(p);
  • router/java/src/net/i2p/router/JobImpl.java

    r055cd99 rabc23e9  
    3636    @Override
    3737    public String toString() {
    38         StringBuffer buf = new StringBuffer(128);
     38        StringBuilder buf = new StringBuilder(128);
    3939        buf.append(super.toString());
    4040        buf.append(": Job ").append(_id).append(": ").append(getName());
  • router/java/src/net/i2p/router/JobQueue.java

    r055cd99 rabc23e9  
    246246        }
    247247        if (_log.shouldLog(Log.WARN)) {
    248             StringBuffer buf = new StringBuffer(1024);
     248            StringBuilder buf = new StringBuilder(1024);
    249249            buf.append("current jobs: \n");
    250250            for (Iterator iter = _queueRunners.values().iterator(); iter.hasNext(); ) {
     
    588588        }
    589589       
    590         StringBuffer str = new StringBuffer(128);
     590        StringBuilder str = new StringBuilder(128);
    591591        str.append("<!-- after queueRunner sync: states: ");
    592592        for (int i = 0; states != null && i < states.length; i++)
     
    607607        out.flush();
    608608       
    609         StringBuffer buf = new StringBuffer(32*1024);
     609        StringBuilder buf = new StringBuilder(32*1024);
    610610        buf.append("<h2>JobQueue</h2>");
    611611        buf.append("# runners: ").append(numRunners).append(" [states=");
     
    668668   
    669669    /** render the HTML for the job stats */
    670     private void getJobStats(StringBuffer buf) {
     670    private void getJobStats(StringBuilder buf) {
    671671        buf.append("<table border=\"1\">\n");
    672672        buf.append("<tr><th>Job</th><th>Runs</th>");
  • router/java/src/net/i2p/router/JobStats.java

    r055cd99 rabc23e9  
    7878    @Override
    7979    public String toString() {
    80         StringBuffer buf = new StringBuffer();
     80        StringBuilder buf = new StringBuilder();
    8181        buf.append("Over ").append(getRuns()).append(" runs, job <b>").append(getName()).append("</b> took ");
    8282        buf.append(getTotalTime()).append("ms (").append(getAvgTime()).append("ms/").append(getMaxTime()).append("ms/");
  • router/java/src/net/i2p/router/MessageHistory.java

    r055cd99 rabc23e9  
    145145    public void requestTunnelCreate(TunnelId createTunnel, TunnelId outTunnel, Hash peerRequested, Hash nextPeer, TunnelId replyTunnel, Hash replyThrough) {
    146146        if (!_doLog) return;
    147         StringBuffer buf = new StringBuffer(128);
     147        StringBuilder buf = new StringBuilder(128);
    148148        buf.append(getPrefix());
    149149        buf.append("request [").append(getName(peerRequested)).append("] to create tunnel [");
     
    170170    public void receiveTunnelCreate(TunnelId createTunnel, Hash nextPeer, Date expire, boolean ok, Hash sourceRoutePeer) {
    171171        if (!_doLog) return;
    172         StringBuffer buf = new StringBuffer(128);
     172        StringBuilder buf = new StringBuilder(128);
    173173        buf.append(getPrefix());
    174174        buf.append("receive tunnel create [").append(createTunnel.getTunnelId()).append("] ");
     
    188188        if (!_doLog) return;
    189189        if (tunnel == null) return;
    190         StringBuffer buf = new StringBuffer(128);
     190        StringBuilder buf = new StringBuilder(128);
    191191        buf.append(getPrefix());
    192192        buf.append("joining as [").append(state);
     
    204204        if (!_doLog) return;
    205205        if (tunnel == null) return;
    206         StringBuffer buf = new StringBuffer(128);
     206        StringBuilder buf = new StringBuilder(128);
    207207        buf.append(getPrefix());
    208208        buf.append("joining as [").append(state);
     
    243243        if (!_doLog) return;
    244244        if (tunnel == null) return;
    245         StringBuffer buf = new StringBuffer(128);
     245        StringBuilder buf = new StringBuilder(128);
    246246        buf.append(getPrefix());
    247247        buf.append("failing tunnel [").append(tunnel.getTunnelId()).append("]");
     
    259259        if (!_doLog) return;
    260260        if (tunnel == null) return;
    261         StringBuffer buf = new StringBuffer(128);
     261        StringBuilder buf = new StringBuilder(128);
    262262        buf.append(getPrefix());
    263263        buf.append("tunnel ").append(tunnel).append(" tested ok after ").append(timeToTest).append("ms");
     
    272272        if (!_doLog) return;
    273273        if ( (tunnel == null) || (peer == null) ) return;
    274         StringBuffer buf = new StringBuffer(128);
     274        StringBuilder buf = new StringBuilder(128);
    275275        buf.append(getPrefix());
    276276        buf.append("tunnel [").append(tunnel.getTunnelId()).append("] was rejected by [");
     
    284284        if (!_doLog) return;
    285285        if (peer == null) return;
    286         StringBuffer buf = new StringBuffer(128);
     286        StringBuilder buf = new StringBuilder(128);
    287287        buf.append(getPrefix());
    288288        buf.append("tunnel participation rejected by [");
     
    299299        if (!_doLog) return;
    300300        if ( (tunnel == null) || (peer == null) ) return;
    301         StringBuffer buf = new StringBuffer(128);
     301        StringBuilder buf = new StringBuilder(128);
    302302        buf.append(getPrefix());
    303303        buf.append("tunnel [").append(tunnel.getTunnelId()).append("] timed out on [");
     
    315315    public void droppedTunnelMessage(TunnelId id, long msgId, Date expiration, Hash from) {
    316316        if (!_doLog) return;
    317         StringBuffer buf = new StringBuffer(128);
     317        StringBuilder buf = new StringBuilder(128);
    318318        buf.append(getPrefix());
    319319        buf.append("dropped message ").append(msgId).append(" for unknown tunnel [").append(id.getTunnelId());
     
    329329        if (!_doLog) return;
    330330        if (message == null) return;
    331         StringBuffer buf = new StringBuffer(512);
     331        StringBuilder buf = new StringBuilder(512);
    332332        buf.append(getPrefix());
    333333        buf.append("dropped [").append(message.getClass().getName()).append("] ").append(message.getUniqueId());
     
    343343    public void droppedInboundMessage(long messageId, Hash from, String info) {
    344344        if (!_doLog) return;
    345         StringBuffer buf = new StringBuffer(512);
     345        StringBuilder buf = new StringBuilder(512);
    346346        buf.append(getPrefix());
    347347        buf.append("dropped inbound message ").append(messageId);
     
    365365        if (!_doLog) return;
    366366        if (sentMessage == null) return;
    367         StringBuffer buf = new StringBuffer(512);
     367        StringBuilder buf = new StringBuilder(512);
    368368        buf.append(getPrefix());
    369369        buf.append("timed out waiting for a reply to [").append(sentMessage.getMessageType());
     
    384384    public void messageProcessingError(long messageId, String messageType, String error) {
    385385        if (!_doLog) return;
    386         StringBuffer buf = new StringBuffer(128);
     386        StringBuilder buf = new StringBuilder(128);
    387387        buf.append(getPrefix());
    388388        buf.append("Error processing [").append(messageType).append("] [").append(messageId).append("] failed with [").append(error).append("]");
     
    421421        if (!_doLog) return;
    422422        if (false) return;
    423         StringBuffer buf = new StringBuffer(256);
     423        StringBuilder buf = new StringBuilder(256);
    424424        buf.append(getPrefix());
    425425        buf.append("send [").append(messageType).append("] message [").append(messageId).append("] ");
     
    449449        if (!_doLog) return;
    450450        if (false) return;
    451         StringBuffer buf = new StringBuffer(256);
     451        StringBuilder buf = new StringBuilder(256);
    452452        buf.append(getPrefix());
    453453        buf.append("receive [").append(messageType).append("] with id [").append(messageId).append("] ");
     
    471471    public void wrap(String bodyMessageType, long bodyMessageId, String containerMessageType, long containerMessageId) {
    472472        if (!_doLog) return;
    473         StringBuffer buf = new StringBuffer(128);
     473        StringBuilder buf = new StringBuilder(128);
    474474        buf.append(getPrefix());
    475475        buf.append("Wrap message [").append(bodyMessageType).append("] id [").append(bodyMessageId).append("] ");
     
    484484    public void receivePayloadMessage(long messageId) {
    485485        if (!_doLog) return;
    486         StringBuffer buf = new StringBuffer(64);
     486        StringBuilder buf = new StringBuilder(64);
    487487        buf.append(getPrefix());
    488488        buf.append("Receive payload message [").append(messageId).append("]");
     
    499499    public void sendPayloadMessage(long messageId, boolean successfullySent, long timeToSend) {
    500500        if (!_doLog) return;
    501         StringBuffer buf = new StringBuffer(128);
     501        StringBuilder buf = new StringBuilder(128);
    502502        buf.append(getPrefix());
    503503        buf.append("Send payload message in [").append(messageId).append("] in [").append(timeToSend).append("] successfully? ").append(successfullySent);
     
    508508        if (!_doLog) return;
    509509        if (messageId == -1) throw new IllegalArgumentException("why are you -1?");
    510         StringBuffer buf = new StringBuffer(48);
     510        StringBuilder buf = new StringBuilder(48);
    511511        buf.append(getPrefix());
    512512        buf.append("Receive fragment ").append(fragmentId).append(" in ").append(messageId);
     
    517517        if (!_doLog) return;
    518518        if (messageId == -1) throw new IllegalArgumentException("why are you -1?");
    519         StringBuffer buf = new StringBuffer(48);
     519        StringBuilder buf = new StringBuilder(48);
    520520        buf.append(getPrefix());
    521521        buf.append("Receive fragmented message completely: ").append(messageId);
     
    525525        if (!_doLog) return;
    526526        if (messageId == -1) throw new IllegalArgumentException("why are you -1?");
    527         StringBuffer buf = new StringBuffer(48);
     527        StringBuilder buf = new StringBuilder(48);
    528528        buf.append(getPrefix());
    529529        buf.append("Fragmented message dropped: ").append(messageId);
     
    534534        if (!_doLog) return;
    535535        //if (messageId == -1) throw new IllegalArgumentException("why are you -1?");
    536         StringBuffer buf = new StringBuffer(48);
     536        StringBuilder buf = new StringBuilder(48);
    537537        buf.append(getPrefix());
    538538        buf.append("Break message ").append(messageId).append(" into fragments: ").append(numFragments);
     
    546546        if (!_doLog) return;
    547547        //if (messageId == -1) throw new IllegalArgumentException("why are you -1?");
    548         StringBuffer buf = new StringBuffer(48);
     548        StringBuilder buf = new StringBuilder(48);
    549549        buf.append(getPrefix());
    550550        buf.append("Break message ").append(messageId).append(" into fragments: ").append(numFragments);
     
    560560        if (!_doLog) return;
    561561        if (msgId == -1) throw new IllegalArgumentException("why are you -1?");
    562         StringBuffer buf = new StringBuffer(48);
     562        StringBuilder buf = new StringBuilder(48);
    563563        buf.append(getPrefix());
    564564        buf.append("Dropped data message ").append(msgId).append(" for unknown tunnel ").append(tunnelId);
     
    568568        if (!_doLog) return;
    569569        if (msgId == -1) throw new IllegalArgumentException("why are you -1?");
    570         StringBuffer buf = new StringBuffer(48);
     570        StringBuilder buf = new StringBuilder(48);
    571571        buf.append(getPrefix());
    572572        buf.append("Dropped gateway message ").append(msgId).append(" for unknown tunnel ").append(tunnelId);
     
    586586   
    587587    private final String getPrefix() {
    588         StringBuffer buf = new StringBuffer(48);
     588        StringBuilder buf = new StringBuilder(48);
    589589        buf.append(getTime(_context.clock().now()));
    590590        buf.append(' ').append(_localIdent).append(": ");
  • router/java/src/net/i2p/router/MultiRouterBuilder.java

    r055cd99 rabc23e9  
    7878    }
    7979    private static void buildStartupScriptNix(String args[]) {
    80         StringBuffer buf = new StringBuffer(4096);
     80        StringBuilder buf = new StringBuilder(4096);
    8181        buf.append("#!/bin/sh\n");
    8282        buf.append("export CP=.; for LIB in lib/* ; do export CP=$CP:$LIB ; done\n");
     
    107107        baseDir.mkdirs();
    108108        File cfgFile = new File(baseDir, "router.config");
    109         StringBuffer buf = new StringBuffer(8*1024);
     109        StringBuilder buf = new StringBuilder(8*1024);
    110110        buf.append("router.profileDir=").append(baseDir.getPath()).append("/peerProfiles\n");
    111111        buf.append("router.historyFilename=").append(baseDir.getPath()).append("/messageHistory.txt\n");
  • router/java/src/net/i2p/router/OutNetMessage.java

    r055cd99 rabc23e9  
    288288        if (_message != null) {
    289289            if (_log.shouldLog(Log.WARN)) {
    290                 StringBuffer buf = new StringBuffer(1024);
     290                StringBuilder buf = new StringBuilder(1024);
    291291                buf.append("Undiscarded ").append(_messageSize).append("byte ");
    292292                buf.append(_messageType).append(" message created ");
     
    305305    @Override
    306306    public String toString() {
    307         StringBuffer buf = new StringBuffer(128);
     307        StringBuilder buf = new StringBuilder(128);
    308308        buf.append("[OutNetMessage contains ");
    309309        if (_message == null) {
     
    335335    }
    336336   
    337     private void renderTimestamps(StringBuffer buf) {
     337    private void renderTimestamps(StringBuilder buf) {
    338338        if (_log.shouldLog(Log.INFO)) {
    339339            synchronized (this) {
  • router/java/src/net/i2p/router/PersistentKeyRing.java

    r055cd99 rabc23e9  
    6767    @Override
    6868    public void renderStatusHTML(Writer out) throws IOException {
    69         StringBuffer buf = new StringBuffer(1024);
     69        StringBuilder buf = new StringBuilder(1024);
    7070        buf.append("\n<table border=\"1\"><tr><th align=\"left\">Destination Hash<th align=\"left\">Name or Dest.<th align=\"left\">Session Key</tr>");
    7171        for (Entry<Hash, SessionKey> e : entrySet()) {
  • router/java/src/net/i2p/router/Router.java

    r055cd99 rabc23e9  
    590590                   "<hr />\n");
    591591
    592         StringBuffer buf = new StringBuffer(32*1024);
     592        StringBuilder buf = new StringBuilder(32*1024);
    593593       
    594594        if ( (_routerInfo != null) && (_routerInfo.getIdentity() != null) )
     
    763763   
    764764    private static int MAX_MSG_LENGTH = 120;
    765     private static final void appendLogMessage(StringBuffer buf, String msg) {
     765    private static final void appendLogMessage(StringBuilder buf, String msg) {
    766766        // disable this code for the moment because i think it
    767767        // looks ugly (on the router console)
     
    805805    /** main-ish method for testing appendLogMessage */
    806806    private static final void testAppendLog() {
    807         StringBuffer buf = new StringBuffer(1024);
     807        StringBuilder buf = new StringBuilder(1024);
    808808        Router.appendLogMessage(buf, "hi\nhow are you\nh0h0h0");
    809809        System.out.println("line: [" + buf.toString() + "]");
     
    10061006        try {
    10071007            fos = new FileOutputStream(_configFilename);
    1008             StringBuffer buf = new StringBuffer(8*1024);
     1008            StringBuilder buf = new StringBuilder(8*1024);
    10091009            synchronized (_config) {
    10101010                TreeSet ordered = new TreeSet(_config.keySet());
  • router/java/src/net/i2p/router/RouterContext.java

    r055cd99 rabc23e9  
    269269    @Override
    270270    public String toString() {
    271         StringBuffer buf = new StringBuffer(512);
     271        StringBuilder buf = new StringBuilder(512);
    272272        buf.append("RouterContext: ").append(super.toString()).append('\n');
    273273        buf.append(_router).append('\n');
  • router/java/src/net/i2p/router/Shitlist.java

    r055cd99 rabc23e9  
    253253
    254254    public void renderStatusHTML(Writer out) throws IOException {
    255         StringBuffer buf = new StringBuffer(1024);
     255        StringBuilder buf = new StringBuilder(1024);
    256256        buf.append("<h2>Shitlist</h2>");
    257257        Map<Hash, Entry> entries = new TreeMap(new HashComparator());
  • router/java/src/net/i2p/router/StatisticsManager.java

    r055cd99 rabc23e9  
    201201   
    202202    private String renderRate(Rate rate, boolean fudgeQuantity) {
    203         StringBuffer buf = new StringBuffer(128);
     203        StringBuilder buf = new StringBuilder(128);
    204204        buf.append(num(rate.getAverageValue())).append(';');
    205205        buf.append(num(rate.getExtremeAverageValue())).append(';');
     
    260260   
    261261    private String renderRate(Rate rate, double fudgeQuantity) {
    262         StringBuffer buf = new StringBuffer(128);
     262        StringBuilder buf = new StringBuilder(128);
    263263        buf.append(num(rate.getAverageValue())).append(';');
    264264        buf.append(num(rate.getExtremeAverageValue())).append(';');
  • router/java/src/net/i2p/router/TunnelPoolSettings.java

    r055cd99 rabc23e9  
    188188    @Override
    189189    public String toString() {
    190         StringBuffer buf = new StringBuffer();
     190        StringBuilder buf = new StringBuilder();
    191191        Properties p = new Properties();
    192192        writeToProperties("", p);
  • router/java/src/net/i2p/router/admin/AdminRunner.java

    r055cd99 rabc23e9  
    7474   
    7575    private void reply(OutputStream out, String content) throws IOException {
    76         StringBuffer reply = new StringBuffer(10240);
     76        StringBuilder reply = new StringBuilder(10240);
    7777        reply.append("HTTP/1.1 200 OK\n");
    7878        reply.append("Connection: close\n");
     
    9191   
    9292    private void replyText(OutputStream out, String content) throws IOException {
    93         StringBuffer reply = new StringBuffer(10240);
     93        StringBuilder reply = new StringBuilder(10240);
    9494        reply.append("HTTP/1.1 200 OK\n");
    9595        reply.append("Connection: close\n");
  • router/java/src/net/i2p/router/admin/StatsGenerator.java

    r055cd99 rabc23e9  
    2929   
    3030    public void generateStatsPage(Writer out) throws IOException {
    31         StringBuffer buf = new StringBuffer(16*1024);
     31        StringBuilder buf = new StringBuilder(16*1024);
    3232        buf.append("<h1>Router statistics</h1><hr />");
    3333        buf.append("<form action=\"/oldstats.jsp\">");
     
    9595    }
    9696   
    97     private void renderFrequency(String name, StringBuffer buf) {
     97    private void renderFrequency(String name, StringBuilder buf) {
    9898        FrequencyStat freq = _context.statManager().getFrequency(name);
    9999        buf.append("<i>");
     
    131131    }
    132132   
    133     private void renderRate(String name, StringBuffer buf) {
     133    private void renderRate(String name, StringBuilder buf) {
    134134        RateStat rate = _context.statManager().getRate(name);
    135135        String d = rate.getDescription();
     
    224224    }
    225225   
    226     private static void renderPeriod(StringBuffer buf, long period, String name) {
     226    private static void renderPeriod(StringBuilder buf, long period, String name) {
    227227        buf.append("<b>");
    228228        buf.append(DataHelper.formatDuration(period));
  • router/java/src/net/i2p/router/client/ClientManager.java

    r055cd99 rabc23e9  
    388388   
    389389    public void renderStatusHTML(Writer out) throws IOException {
    390         StringBuffer buf = new StringBuffer(8*1024);
     390        StringBuilder buf = new StringBuilder(8*1024);
    391391        buf.append("<u><b>Local destinations</b></u><br />");
    392392       
  • router/java/src/net/i2p/router/message/CloveSet.java

    r055cd99 rabc23e9  
    4545    @Override
    4646    public String toString() {
    47         StringBuffer buf = new StringBuffer(128);
     47        StringBuilder buf = new StringBuilder(128);
    4848        buf.append("{");
    4949        for (int i = 0; i < _cloves.size(); i++) {
  • router/java/src/net/i2p/router/message/GarlicConfig.java

    r055cd99 rabc23e9  
    159159    @Override
    160160    public String toString() {
    161         StringBuffer buf = new StringBuffer();
     161        StringBuilder buf = new StringBuilder();
    162162        buf.append("<garlicConfig>").append(NL);
    163163        buf.append("<certificate>").append(getCertificate()).append("</certificate>").append(NL);
  • router/java/src/net/i2p/router/message/PayloadGarlicConfig.java

    r055cd99 rabc23e9  
    3636    @Override
    3737    protected String getSubData() {
    38         StringBuffer buf = new StringBuffer();
     38        StringBuilder buf = new StringBuilder();
    3939        buf.append("<payloadMessage>").append(_payload).append("</payloadMessage>");
    4040        return buf.toString();
  • router/java/src/net/i2p/router/networkdb/kademlia/KBucketImpl.java

    r055cd99 rabc23e9  
    331331    @Override
    332332    public String toString() {
    333         StringBuffer buf = new StringBuffer(1024);
     333        StringBuilder buf = new StringBuilder(1024);
    334334        buf.append("KBucketImpl: ");
    335335        synchronized (_entries) {
     
    381381   
    382382    private static void testRand() {
    383         StringBuffer buf = new StringBuffer(2048);
     383        StringBuilder buf = new StringBuilder(2048);
    384384        int low = 1;
    385385        int high = 3;
     
    417417    private static void testRand2() {
    418418        Log log = I2PAppContext.getGlobalContext().logManager().getLog(KBucketImpl.class);
    419         StringBuffer buf = new StringBuffer(1024*1024*16);
     419        StringBuilder buf = new StringBuilder(1024*1024*16);
    420420        int low = 1;
    421421        int high = 200;
     
    453453    private final static String toString(byte b[]) {
    454454        if (true) return DataHelper.toHexString(b);
    455         StringBuffer buf = new StringBuffer(b.length);
     455        StringBuilder buf = new StringBuilder(b.length);
    456456        for (int i = 0; i < b.length; i++) {
    457457            buf.append(toString(b[i]));
     
    462462   
    463463    private final static String toString(byte b) {
    464         StringBuffer buf = new StringBuffer(8);
     464        StringBuilder buf = new StringBuilder(8);
    465465        for (int i = 7; i >= 0; i--) {
    466466            boolean bb = (0 != (b & (1<<i)));
  • router/java/src/net/i2p/router/networkdb/kademlia/KBucketSet.java

    r055cd99 rabc23e9  
    142142    public String toString() {
    143143        BigInteger us = new BigInteger(1, _us.getData());
    144         StringBuffer buf = new StringBuffer(1024);
     144        StringBuilder buf = new StringBuilder(1024);
    145145        buf.append("Bucket set rooted on: ").append(us.toString()).append(" (aka ").append(us.toString(2)).append("): \n");
    146146        for (int i = 0; i < NUM_BUCKETS; i++) {
     
    160160        else
    161161            System.arraycopy(b, Hash.HASH_LENGTH-b.length, val, 0, val.length);
    162         StringBuffer buf = new StringBuffer(KEYSIZE_BITS);
     162        StringBuilder buf = new StringBuilder(KEYSIZE_BITS);
    163163        for (int i = 0; i < val.length; i++) {
    164164            for (int j = 7; j >= 0; j--) {
  • router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java

    r055cd99 rabc23e9  
    911911    @Override
    912912    public void renderRouterInfoHTML(Writer out, String routerPrefix) throws IOException {
    913         StringBuffer buf = new StringBuffer(4*1024);
     913        StringBuilder buf = new StringBuilder(4*1024);
    914914        buf.append("<h2>Network Database RouterInfo Lookup</h2>\n");
    915915        if (".".equals(routerPrefix)) {
     
    939939    @Override
    940940    public void renderLeaseSetHTML(Writer out) throws IOException {
    941         StringBuffer buf = new StringBuffer(4*1024);
     941        StringBuilder buf = new StringBuilder(4*1024);
    942942        buf.append("<h2>Network Database Contents</h2>\n");
    943943        buf.append("<a href=\"netdb.jsp\">View RouterInfo</a>");
     
    993993        if (full)
    994994            size *= 4;
    995         StringBuffer buf = new StringBuffer(size);
     995        StringBuilder buf = new StringBuilder(size);
    996996        out.write("<h2>Network Database Contents</h2>\n");
    997997        if (!_initialized) {
     
    10741074    }
    10751075   
    1076     private void renderRouterInfo(StringBuffer buf, RouterInfo info, boolean isUs, boolean full) {
     1076    private void renderRouterInfo(StringBuilder buf, RouterInfo info, boolean isUs, boolean full) {
    10771077        String hash = info.getIdentity().getHash().toBase64();
    10781078        buf.append("<a name=\"").append(hash.substring(0, 6)).append("\" />");
  • router/java/src/net/i2p/router/networkdb/kademlia/SearchState.java

    r055cd99 rabc23e9  
    169169    @Override
    170170    public String toString() {
    171         StringBuffer buf = new StringBuffer(256);
     171        StringBuilder buf = new StringBuilder(256);
    172172        buf.append("Searching for ").append(_searchKey);
    173173        buf.append(" ");
  • router/java/src/net/i2p/router/networkdb/kademlia/StoreMessageSelector.java

    r055cd99 rabc23e9  
    5858    @Override
    5959    public String toString() {
    60         StringBuffer rv = new StringBuffer(64);
     60        StringBuilder rv = new StringBuilder(64);
    6161        rv.append("Waiting for netDb confirm from ").append(_peer.toBase64()).append(", found? ");
    6262        rv.append(_found).append(" waiting for ").append(_waitingForId);
  • router/java/src/net/i2p/router/networkdb/kademlia/StoreState.java

    r055cd99 rabc23e9  
    150150    @Override
    151151    public String toString() {
    152         StringBuffer buf = new StringBuffer(256);
     152        StringBuilder buf = new StringBuilder(256);
    153153        buf.append("Storing ").append(_key);
    154154        buf.append(" ");
  • router/java/src/net/i2p/router/networkdb/kademlia/TransientDataStore.java

    r055cd99 rabc23e9  
    148148    @Override
    149149    public String toString() {
    150         StringBuffer buf = new StringBuffer();
     150        StringBuilder buf = new StringBuilder();
    151151        buf.append("Transient DataStore: ").append(_data.size()).append("\nKeys: ");
    152152        for (Map.Entry<Hash, DataStructure> e : _data.entrySet()) {
  • router/java/src/net/i2p/router/peermanager/DBHistory.java

    r055cd99 rabc23e9  
    166166   
    167167    public void store(OutputStream out) throws IOException {
    168         StringBuffer buf = new StringBuffer(512);
     168        StringBuilder buf = new StringBuilder(512);
    169169        buf.append(NL);
    170170        buf.append("#################").append(NL);
     
    187187    }
    188188   
    189     private void add(StringBuffer buf, String name, long val, String description) {
     189    private void add(StringBuilder buf, String name, long val, String description) {
    190190        buf.append("# ").append(name.toUpperCase()).append(NL).append("# ").append(description).append(NL);
    191191        buf.append("dbHistory.").append(name).append('=').append(val).append(NL).append(NL);
  • router/java/src/net/i2p/router/peermanager/PeerProfile.java

    r055cd99 rabc23e9  
    298298           
    299299            if (_log.shouldLog(Log.DEBUG) ) {
    300                 StringBuffer buf = new StringBuffer(128);
     300                StringBuilder buf = new StringBuilder(128);
    301301                buf.append("Updating 1m throughput after ").append(size).append(" to ");
    302302                for (int i = 0; i < THROUGHPUT_COUNT; i++)
     
    510510        ProfilePersistenceHelper helper = new ProfilePersistenceHelper(ctx);
    511511        try { Thread.sleep(5*1000); } catch (InterruptedException e) {}
    512         StringBuffer buf = new StringBuffer(1024);
     512        StringBuilder buf = new StringBuilder(1024);
    513513        for (int i = 0; i < args.length; i++) {
    514514            PeerProfile profile = helper.readProfile(new File(args[i]));
  • router/java/src/net/i2p/router/peermanager/PeerTestJob.java

    r055cd99 rabc23e9  
    225225        @Override
    226226        public String toString() {
    227             StringBuffer buf = new StringBuffer(64);
     227            StringBuilder buf = new StringBuilder(64);
    228228            buf.append("Test peer ").append(_peer.toBase64().substring(0,4));
    229229            buf.append(" with nonce ").append(_nonce);
  • router/java/src/net/i2p/router/peermanager/ProfileManagerImpl.java

    r055cd99 rabc23e9  
    305305            if (prof == null) continue;
    306306           
    307             StringBuffer buf = new StringBuffer(64);
     307            StringBuilder buf = new StringBuilder(64);
    308308           
    309309            buf.append("status: ");
  • router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java

    r055cd99 rabc23e9  
    677677            /*****
    678678            if (_log.shouldLog(Log.DEBUG)) {
    679                 StringBuffer buf = new StringBuffer(512);
     679                StringBuilder buf = new StringBuilder(512);
    680680                for (Iterator iter = _strictCapacityOrder.iterator(); iter.hasNext(); ) {
    681681                    PeerProfile prof = (PeerProfile)iter.next();
  • router/java/src/net/i2p/router/peermanager/ProfileOrganizerRenderer.java

    r055cd99 rabc23e9  
    5757        int integrated = 0;
    5858        int failing = 0;
    59         StringBuffer buf = new StringBuffer(16*1024);
     59        StringBuilder buf = new StringBuilder(16*1024);
    6060        buf.append("<h2>Peer Profiles</h2>\n");
    6161        buf.append("<p>Showing ").append(order.size()).append(" recent profiles, hiding ").append(peers.size()-order.size()).append(" older profiles</p>");
  • router/java/src/net/i2p/router/peermanager/ProfilePersistenceHelper.java

    r055cd99 rabc23e9  
    9090        }
    9191       
    92         StringBuffer buf = new StringBuffer(512);
     92        StringBuilder buf = new StringBuilder(512);
    9393        buf.append("########################################################################").append(NL);
    9494        buf.append("# profile for ").append(profile.getPeer().toBase64()).append(NL);
  • router/java/src/net/i2p/router/peermanager/TunnelHistory.java

    r055cd99 rabc23e9  
    132132   
    133133    public void store(OutputStream out) throws IOException {
    134         StringBuffer buf = new StringBuffer(512);
     134        StringBuilder buf = new StringBuilder(512);
    135135        buf.append(NL);
    136136        buf.append("#################").append(NL);
     
    151151    }
    152152   
    153     private void add(StringBuffer buf, String name, long val, String description) {
     153    private void add(StringBuilder buf, String name, long val, String description) {
    154154        buf.append("# ").append(name.toUpperCase()).append(NL).append("# ").append(description).append(NL);
    155155        buf.append("tunnels.").append(name).append('=').append(val).append(NL).append(NL);
  • router/java/src/net/i2p/router/startup/ClientAppConfig.java

    r055cd99 rabc23e9  
    100100        try {
    101101            fos = new FileOutputStream(cfgFile);
    102             StringBuffer buf = new StringBuffer(2048);
     102            StringBuilder buf = new StringBuilder(2048);
    103103            for(int i = 0; i < apps.size(); i++) {
    104104                ClientAppConfig app = (ClientAppConfig) apps.get(i);
  • router/java/src/net/i2p/router/startup/LoadClientAppsJob.java

    r055cd99 rabc23e9  
    6565        if (args != null) {
    6666            char data[] = args.toCharArray();
    67             StringBuffer buf = new StringBuffer(32);
     67            StringBuilder buf = new StringBuilder(32);
    6868            boolean isQuoted = false;
    6969            for (int i = 0; i < data.length; i++) {
     
    7575                            if (str.length() > 0)
    7676                                argList.add(str);
    77                             buf = new StringBuffer(32);
     77                            buf = new StringBuilder(32);
    7878                        } else {
    7979                            isQuoted = true;
     
    9090                            if (str.length() > 0)
    9191                                argList.add(str);
    92                             buf = new StringBuffer(32);
     92                            buf = new StringBuilder(32);
    9393                        }
    9494                        break;
  • router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java

    r055cd99 rabc23e9  
    449449    public String renderPeerHTML(Hash peer) {
    450450        String h = peer.toBase64().substring(0, 4);
    451         StringBuffer buf = new StringBuffer(128);
     451        StringBuilder buf = new StringBuilder(128);
    452452        String c = getCountry(peer);
    453453        if (c != null) {
  • router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java

    r055cd99 rabc23e9  
    200200    void setOutboundBurstBytes(int bytes) { _maxOutboundBurst = bytes; }
    201201   
    202     StringBuffer getStatus() {
    203         StringBuffer rv = new StringBuffer(64);
     202    StringBuilder getStatus() {
     203        StringBuilder rv = new StringBuilder(64);
    204204        rv.append("Available: ").append(_availableInbound).append('/').append(_availableOutbound).append(' ');
    205205        rv.append("Max: ").append(_maxInbound).append('/').append(_maxOutbound).append(' ');
     
    619619    public void renderStatusHTML(Writer out) throws IOException {
    620620        long now = now();
    621         StringBuffer buf = new StringBuffer(4096);
     621        StringBuilder buf = new StringBuilder(4096);
    622622        buf.append("<p><b id=\"bwlim\">Limiter Status:</b><br />").append(getStatus().toString()).append("</p>\n");
    623623        buf.append("<p><b>Pending bandwidth requests:</b><ul>");
  • router/java/src/net/i2p/router/transport/GeoIP.java

    r055cd99 rabc23e9  
    141141        try {
    142142            in = new FileInputStream(GeoFile);
    143             StringBuffer buf = new StringBuffer(128);
     143            StringBuilder buf = new StringBuilder(128);
    144144            while (DataHelper.readLine(in, buf)) {
    145145                try {
     
    203203        try {
    204204            in = new FileInputStream(GeoFile);
    205             StringBuffer buf = new StringBuffer(128);
     205            StringBuilder buf = new StringBuilder(128);
    206206            while (DataHelper.readLine(in, buf) && idx < search.length) {
    207207                try {
  • router/java/src/net/i2p/router/transport/TransportImpl.java

    r055cd99 rabc23e9  
    365365            level = Log.WARN;
    366366        if (_log.shouldLog(level)) {
    367             StringBuffer buf = new StringBuffer(128);
     367            StringBuilder buf = new StringBuilder(128);
    368368            buf.append("Message received: ").append(inMsg.getClass().getName());
    369369            buf.append(" / ").append(inMsg.getUniqueId());
  • router/java/src/net/i2p/router/transport/TransportManager.java

    r055cd99 rabc23e9  
    487487            t.renderStatusHTML(out, urlBase, sortFlags);
    488488        }
    489         StringBuffer buf = new StringBuffer(4*1024);
     489        StringBuilder buf = new StringBuilder(4*1024);
    490490        buf.append("<p><b>Router Transport Addresses:</b><br /><pre>\n");
    491491        for (int i = 0; i < _transports.size(); i++) {
  • router/java/src/net/i2p/router/transport/ntcp/EstablishState.java

    r055cd99 rabc23e9  
    663663    @Override
    664664    public String toString() {
    665         StringBuffer buf = new StringBuffer(64);
     665        StringBuilder buf = new StringBuilder(64);
    666666        buf.append("est").append(System.identityHashCode(this));
    667667        if (_con.isInbound()) buf.append(" inbound");
  • router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java

    r055cd99 rabc23e9  
    644644        long totalRecv = 0;
    645645
    646         StringBuffer buf = new StringBuffer(512);
     646        StringBuilder buf = new StringBuilder(512);
    647647        buf.append("<p><b id=\"ntcpcon\">NTCP connections: ").append(peers.size());
    648648        buf.append(" limit: ").append(getMaxConnections());
  • router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java

    r055cd99 rabc23e9  
    182182       
    183183        if (_log.shouldLog(Log.DEBUG)) {
    184             StringBuffer buf = new StringBuffer(128);
     184            StringBuilder buf = new StringBuilder(128);
    185185            buf.append("Signing sessionCreated:");
    186186            buf.append(" ReceivedX: ").append(Base64.encode(_receivedX));
     
    334334    @Override
    335335    public String toString() {           
    336         StringBuffer buf = new StringBuffer(128);
     336        StringBuilder buf = new StringBuilder(128);
    337337        buf.append(super.toString());
    338338        if (_receivedX != null)
  • router/java/src/net/i2p/router/transport/udp/InboundMessageState.java

    r055cd99 rabc23e9  
    141141        @Override
    142142        public String toString() {
    143             StringBuffer buf = new StringBuffer(64);
     143            StringBuilder buf = new StringBuilder(64);
    144144            buf.append("Partial ACK of ");
    145145            buf.append(_bitfieldMessageId);
     
    166166    @Override
    167167    public String toString() {
    168         StringBuffer buf = new StringBuffer(32);
     168        StringBuilder buf = new StringBuilder(32);
    169169        buf.append("Message: ").append(_messageId);
    170170        if (isComplete()) {
  • router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java

    r055cd99 rabc23e9  
    292292        boolean valid = _context.dsa().verifySignature(_receivedSignature, signed, _remotePeer.getSigningPublicKey());
    293293        if (!valid || _log.shouldLog(Log.DEBUG)) {
    294             StringBuffer buf = new StringBuffer(128);
     294            StringBuilder buf = new StringBuilder(128);
    295295            buf.append("Signed sessionCreated:");
    296296            buf.append(" AliceIP: ").append(Base64.encode(_aliceIP));
  • router/java/src/net/i2p/router/transport/udp/OutboundMessageState.java

    r055cd99 rabc23e9  
    296296        short sends[] = _fragmentSends;
    297297        ByteArray messageBuf = _messageBuf;
    298         StringBuffer buf = new StringBuffer(64);
     298        StringBuilder buf = new StringBuilder(64);
    299299        buf.append("Message ").append(_messageId);
    300300        if (sends != null)
  • router/java/src/net/i2p/router/transport/udp/PacketBuilder.java

    r055cd99 rabc23e9  
    6262        UDPPacket packet = UDPPacket.acquire(_context, false);
    6363
    64         StringBuffer msg = null;
     64        StringBuilder msg = null;
    6565        boolean acksIncluded = false;
    6666        if (_log.shouldLog(Log.INFO)) {
    67             msg = new StringBuffer(128);
     67            msg = new StringBuilder(128);
    6868            msg.append("Send to ").append(peer.getRemotePeer().toBase64());
    6969            msg.append(" msg ").append(state.getMessageId()).append(":").append(fragment);
     
    220220        UDPPacket packet = UDPPacket.acquire(_context, false);
    221221       
    222         StringBuffer msg = null;
     222        StringBuilder msg = null;
    223223        if (_log.shouldLog(Log.DEBUG)) {
    224             msg = new StringBuffer(128);
     224            msg = new StringBuilder(128);
    225225            msg.append("building ACK packet to ").append(peer.getRemotePeer().toBase64().substring(0,6));
    226226        }
     
    380380       
    381381        if (_log.shouldLog(Log.DEBUG)) {
    382             StringBuffer buf = new StringBuffer(128);
     382            StringBuilder buf = new StringBuilder(128);
    383383            buf.append("Sending sessionCreated:");
    384384            buf.append(" AliceIP: ").append(Base64.encode(sentIP));
  • router/java/src/net/i2p/router/transport/udp/PacketHandler.java

    r055cd99 rabc23e9  
    9494
    9595    String getHandlerStatus() {
    96         StringBuffer rv = new StringBuffer();
     96        StringBuilder rv = new StringBuilder();
    9797        int size = _handlers.size();
    9898        rv.append("Handlers: ").append(size);
     
    325325            _state = 31;
    326326            if ( (state != null) && (_log.shouldLog(Log.DEBUG)) ) {
    327                 StringBuffer buf = new StringBuffer(128);
     327                StringBuilder buf = new StringBuilder(128);
    328328                buf.append("Attempting to receive a packet on a known inbound state: ");
    329329                buf.append(state);
     
    363363            _state = 35;
    364364            if ( (state != null) && (_log.shouldLog(Log.DEBUG)) ) {
    365                 StringBuffer buf = new StringBuffer(128);
     365                StringBuilder buf = new StringBuilder(128);
    366366                buf.append("Attempting to receive a packet on a known outbound state: ");
    367367                buf.append(state);
     
    471471                        UDPPacketReader.DataReader dr = reader.getDataReader();
    472472                        if (_log.shouldLog(Log.INFO)) {
    473                             StringBuffer msg = new StringBuffer();
     473                            StringBuilder msg = new StringBuilder();
    474474                            msg.append("Receive ").append(System.identityHashCode(packet));
    475475                            msg.append(" from ").append(state.getRemotePeer().toBase64()).append(" ").append(state.getRemoteHostId());
  • router/java/src/net/i2p/router/transport/udp/PeerState.java

    r055cd99 rabc23e9  
    15561556    @Override
    15571557    public String toString() {
    1558         StringBuffer buf = new StringBuffer(64);
     1558        StringBuilder buf = new StringBuilder(64);
    15591559        buf.append(_remoteHostId.toString());
    15601560        if (_remotePeer != null)
  • router/java/src/net/i2p/router/transport/udp/PeerTestState.java

    r055cd99 rabc23e9  
    9999    @Override
    100100    public synchronized String toString() {
    101         StringBuffer buf = new StringBuffer(512);
     101        StringBuilder buf = new StringBuilder(512);
    102102        buf.append("Role: ");
    103103        if (_ourRole == ALICE) buf.append("Alice");
  • router/java/src/net/i2p/router/transport/udp/RemoteHostId.java

    r055cd99 rabc23e9  
    6161    }
    6262    public static String toString(byte ip[]) {
    63         StringBuffer buf = new StringBuffer(ip.length+5);
     63        StringBuilder buf = new StringBuilder(ip.length+5);
    6464        for (int i = 0; i < ip.length; i++) {
    6565            buf.append(ip[i]&0xFF);
  • router/java/src/net/i2p/router/transport/udp/UDPAddress.java

    r055cd99 rabc23e9  
    4343    @Override
    4444    public String toString() {
    45         StringBuffer rv = new StringBuffer(64);
     45        StringBuilder rv = new StringBuilder(64);
    4646        if (_introHosts != null) {
    4747            for (int i = 0; i < _introHosts.length; i++) {
  • router/java/src/net/i2p/router/transport/udp/UDPPacket.java

    r055cd99 rabc23e9  
    169169
    170170            if (_log.shouldLog(Log.DEBUG)) {
    171                 StringBuffer str = new StringBuffer(128);
     171                StringBuilder str = new StringBuilder(128);
    172172                str.append(_packet.getLength()).append(" byte packet received, payload length ");
    173173                str.append(payloadLength);
     
    238238    public String toString() {
    239239        verifyNotReleased();
    240         StringBuffer buf = new StringBuffer(64);
     240        StringBuilder buf = new StringBuilder(64);
    241241        buf.append(_packet.getLength());
    242242        buf.append(" byte packet with ");
  • router/java/src/net/i2p/router/transport/udp/UDPPacketReader.java

    r055cd99 rabc23e9  
    130130    }
    131131   
    132     public void toRawString(StringBuffer buf) {
     132    public void toRawString(StringBuilder buf) {
    133133        if (_message != null)
    134134            buf.append(Base64.encode(_message, _payloadBeginOffset, _payloadLength));
     
    402402        @Override
    403403        public String toString() {
    404             StringBuffer buf = new StringBuffer(256);
     404            StringBuilder buf = new StringBuilder(256);
    405405            long msAgo = _context.clock().now() - readTimestamp()*1000;
    406406            buf.append("Data packet sent ").append(msAgo).append("ms ago ");
     
    464464        }
    465465       
    466         public void toRawString(StringBuffer buf) {
     466        public void toRawString(StringBuilder buf) {
    467467            UDPPacketReader.this.toRawString(buf);
    468468            buf.append(" payload: ");
     
    507507        @Override
    508508        public String toString() {
    509             StringBuffer buf = new StringBuffer(64);
     509            StringBuilder buf = new StringBuilder(64);
    510510            buf.append("Read partial ACK of ");
    511511            buf.append(getMessageId());
  • router/java/src/net/i2p/router/transport/udp/UDPReceiver.java

    r055cd99 rabc23e9  
    165165        _context.statManager().addRateData("udp.droppedInbound", queueSize, headPeriod);
    166166        if (_log.shouldLog(Log.WARN)) {
    167             StringBuffer msg = new StringBuffer();
     167            StringBuilder msg = new StringBuilder();
    168168            msg.append("Dropping inbound packet with ");
    169169            msg.append(queueSize);
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    r055cd99 rabc23e9  
    761761        if (_log.shouldLog(Log.WARN)) {
    762762            long now = _context.clock().now();
    763             StringBuffer buf = new StringBuffer(4096);
     763            StringBuilder buf = new StringBuilder(4096);
    764764            long timeSinceSend = now - peer.getLastSendTime();
    765765            long timeSinceRecv = now - peer.getLastReceiveTime();
     
    12831283        OutNetMessage m = msg.getMessage();
    12841284        PeerState p = msg.getPeer();
    1285         StringBuffer buf = new StringBuffer(64);
     1285        StringBuilder buf = new StringBuilder(64);
    12861286        buf.append(" lifetime: ").append(msg.getLifetime());
    12871287        buf.append(" sends: ").append(sends);
     
    17281728    }
    17291729   
    1730     private void appendSortLinks(StringBuffer buf, String urlBase, int sortFlags, String descr, int ascending) {
     1730    private void appendSortLinks(StringBuilder buf, String urlBase, int sortFlags, String descr, int ascending) {
    17311731        if (sortFlags == ascending) {
    17321732            buf.append(" <a href=\"").append(urlBase).append("?sort=").append(0-ascending);
     
    17641764        int numPeers = 0;
    17651765       
    1766         StringBuffer buf = new StringBuffer(512);
     1766        StringBuilder buf = new StringBuilder(512);
    17671767        buf.append("<p><b id=\"udpcon\">UDP connections: ").append(peers.size());
    17681768        buf.append(" limit: ").append(getMaxConnections());
  • router/java/src/net/i2p/router/tunnel/BatchedPreprocessor.java

    r055cd99 rabc23e9  
    6666    @Override
    6767    public boolean preprocessQueue(List pending, TunnelGateway.Sender sender, TunnelGateway.Receiver rec) {
    68         StringBuffer timingBuf = null;
     68        StringBuilder timingBuf = null;
    6969        if (_log.shouldLog(Log.DEBUG)) {
    7070            _log.debug("Preprocess queue with " + pending.size() + " to send");
    71             timingBuf = new StringBuffer(128);
     71            timingBuf = new StringBuilder(128);
    7272            timingBuf.append("Preprocess with " + pending.size() + " to send. ");
    7373        }
     
    247247        if (_log.shouldLog(Log.INFO)) {
    248248            long highestDelay = 0;
    249             StringBuffer buf = new StringBuffer();
     249            StringBuilder buf = new StringBuilder();
    250250            buf.append(_name).append(": ");
    251251            buf.append(title);
     
    287287       
    288288        if (offset <= 0) {
    289             StringBuffer buf = new StringBuffer(128);
     289            StringBuilder buf = new StringBuilder(128);
    290290            buf.append("wtf, written offset is ").append(offset);
    291291            buf.append(" for ").append(startAt).append(" through ").append(sendThrough);
  • router/java/src/net/i2p/router/tunnel/FragmentedMessage.java

    r055cd99 rabc23e9  
    276276    @Override
    277277    public String toString() {
    278         StringBuffer buf = new StringBuffer(128);
     278        StringBuilder buf = new StringBuilder(128);
    279279        buf.append("Fragments for ").append(_messageId).append(": ");
    280280        for (int i = 0; i <= _highFragmentNum; i++) {
  • router/java/src/net/i2p/router/tunnel/HopConfig.java

    r055cd99 rabc23e9  
    138138    @Override
    139139    public String toString() {
    140         StringBuffer buf = new StringBuffer(64);
     140        StringBuilder buf = new StringBuilder(64);
    141141        if (_receiveTunnelId != null) {
    142142            buf.append("recv on ");
  • router/java/src/net/i2p/router/tunnel/TrivialPreprocessor.java

    r055cd99 rabc23e9  
    4444    public boolean preprocessQueue(List pending, TunnelGateway.Sender sender, TunnelGateway.Receiver rec) {
    4545        long begin = System.currentTimeMillis();
    46         StringBuffer buf = null;
     46        StringBuilder buf = null;
    4747        if (_log.shouldLog(Log.DEBUG)) {
    48             buf = new StringBuffer(256);
     48            buf = new StringBuilder(256);
    4949            buf.append("Trivial preprocessing of ").append(pending.size()).append(" ");
    5050        }
  • router/java/src/net/i2p/router/tunnel/TunnelCreatorConfig.java

    r055cd99 rabc23e9  
    167167    public String toString() {
    168168        // H0:1235-->H1:2345-->H2:2345
    169         StringBuffer buf = new StringBuffer(128);
     169        StringBuilder buf = new StringBuilder(128);
    170170        if (_isInbound)
    171171            buf.append("inbound");
  • router/java/src/net/i2p/router/tunnel/TunnelGateway.java

    r055cd99 rabc23e9  
    239239        @Override
    240240        public String toString() {
    241             StringBuffer buf = new StringBuffer(64);
     241            StringBuilder buf = new StringBuilder(64);
    242242            buf.append("Message ").append(_messageId).append(" on ");
    243243            buf.append(TunnelGateway.this.toString());
  • router/java/src/net/i2p/router/tunnel/TunnelParticipant.java

    r055cd99 rabc23e9  
    222222    public String toString() {
    223223        if (_config != null) {
    224             StringBuffer buf = new StringBuffer(64);
     224            StringBuilder buf = new StringBuilder(64);
    225225            buf.append("participant at ").append(_config.toString());
    226226            return buf.toString();
  • router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java

    r055cd99 rabc23e9  
    207207        PooledTunnelCreatorConfig cfg = null;
    208208        List building = _exec.locked_getCurrentlyBuilding();
    209         StringBuffer buf = null;
     209        StringBuilder buf = null;
    210210        synchronized (building) {
    211211            for (int i = 0; i < building.size(); i++) {
     
    218218            }
    219219            if ( (cfg == null) && (_log.shouldLog(Log.DEBUG)) )
    220                 buf = new StringBuffer(building.toString());
     220                buf = new StringBuilder(building.toString());
    221221        }
    222222       
  • router/java/src/net/i2p/router/tunnel/pool/TestJob.java

    r055cd99 rabc23e9  
    253253        @Override
    254254        public String toString() {
    255             StringBuffer rv = new StringBuffer(64);
     255            StringBuilder rv = new StringBuilder(64);
    256256            rv.append("Testing tunnel ").append(_cfg.toString()).append(" waiting for ");
    257257            rv.append(_id).append(" found? ").append(_found);
     
    285285        @Override
    286286        public String toString() {
    287             StringBuffer rv = new StringBuffer(64);
     287            StringBuilder rv = new StringBuilder(64);
    288288            rv.append("Testing tunnel ").append(_cfg.toString());
    289289            rv.append(" successful after ").append(_successTime);
     
    311311        @Override
    312312        public String toString() {
    313             StringBuffer rv = new StringBuffer(64);
     313            StringBuilder rv = new StringBuilder(64);
    314314            rv.append("Testing tunnel ").append(_cfg.toString());
    315315            rv.append(" timed out");
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPeerSelector.java

    r055cd99 rabc23e9  
    130130       
    131131        if (log.shouldLog(Log.INFO)) {
    132             StringBuffer buf = new StringBuffer();
     132            StringBuilder buf = new StringBuilder();
    133133            if (settings.getDestinationNickname() != null)
    134134                buf.append("peers for ").append(settings.getDestinationNickname());
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java

    r055cd99 rabc23e9  
    893893                return "Outbound exploratory pool";
    894894        } else {
    895             StringBuffer rv = new StringBuffer(32);
     895            StringBuilder rv = new StringBuilder(32);
    896896            if (_settings.isInbound())
    897897                rv.append("Inbound client pool for ");
Note: See TracChangeset for help on using the changeset viewer.