Author: nextgens
Date: 2007-12-17 00:09:29 +0000 (Mon, 17 Dec 2007)
New Revision: 16633

Modified:
   trunk/freenet/src/freenet/keys/FreenetURI.java
   trunk/freenet/src/freenet/node/TextModeClientInterface.java
   trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
   trunk/freenet/src/freenet/support/StringArray.java
Log:
optimization

Modified: trunk/freenet/src/freenet/keys/FreenetURI.java
===================================================================
--- trunk/freenet/src/freenet/keys/FreenetURI.java      2007-12-16 23:34:32 UTC 
(rev 16632)
+++ trunk/freenet/src/freenet/keys/FreenetURI.java      2007-12-17 00:09:29 UTC 
(rev 16633)
@@ -240,7 +240,7 @@
                // decode keyType
                int atchar = URI.indexOf('@');
                if (atchar == -1) {
-                       throw new MalformedURLException("There is no @ in that 
URI! ("+URI.toString()+')');
+                       throw new MalformedURLException("There is no @ in that 
URI! ("+URI+')');
                } else {
                        keyType = URI.substring(0, atchar).toUpperCase().trim();
                }

Modified: trunk/freenet/src/freenet/node/TextModeClientInterface.java
===================================================================
--- trunk/freenet/src/freenet/node/TextModeClientInterface.java 2007-12-16 
23:34:32 UTC (rev 16632)
+++ trunk/freenet/src/freenet/node/TextModeClientInterface.java 2007-12-17 
00:09:29 UTC (rev 16633)
@@ -856,7 +856,7 @@
                                public void onTrace(long uid, double target, 
double nearest, double best, short htl, short counter, double location, long 
nodeUID, double[] peerLocs, long[] peerUIDs, double[] locsNotVisited, short 
forkCount, short linearCounter, String reason, long prevUID) {
                                        String msg = "Probe trace: UID="+uid+" 
target="+target+" nearest="+nearest+" best="+best+" htl="+htl+" 
counter="+counter+" linear="+linearCounter+" location="+location+"node 
UID="+nodeUID+" prev UID="+prevUID+" peer 
locs="+StringArray.toString(peerLocs)+" peer 
UIDs="+StringArray.toString(peerUIDs)+" locs not visited = 
"+StringArray.toString(locsNotVisited)+" forks: "+forkCount+" 
reason="+reason+'\n';
                                        try {
-                                               
out.write(msg.toString().getBytes());
+                                               out.write(msg.getBytes());
                                                out.flush();
                                        } catch (IOException e) {
                                                // Ignore

Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java        
2007-12-16 23:34:32 UTC (rev 16632)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java        
2007-12-17 00:09:29 UTC (rev 16633)
@@ -42,10 +42,10 @@
                        byte[] random = new byte[128];

                        r.nextBytes(random);
-                       this.readContent = new 
String(HexUtil.bytesToHex(random));
+                       this.readContent = HexUtil.bytesToHex(random);

                        r.nextBytes(random);
-                       this.writeContent = new 
String(HexUtil.bytesToHex(random));
+                       this.writeContent = HexUtil.bytesToHex(random);
                }
        }


Modified: trunk/freenet/src/freenet/support/StringArray.java
===================================================================
--- trunk/freenet/src/freenet/support/StringArray.java  2007-12-16 23:34:32 UTC 
(rev 16632)
+++ trunk/freenet/src/freenet/support/StringArray.java  2007-12-17 00:09:29 UTC 
(rev 16633)
@@ -21,7 +21,7 @@
                        StringBuffer sb = new StringBuffer();
                        for(int i=0; i<array.length; i++)
                                sb.append(array[i].toString()+'|');
-                       return '[' + sb.substring(0, sb.length() - 
1).toString() + ']';
+                       return '[' + sb.substring(0, sb.length() - 1) + ']';
                }else
                        return "";
        }
@@ -36,7 +36,7 @@
                        StringBuffer sb = new StringBuffer();
                        for(int i=0; i<array.length; i++)
                                sb.append(array[i]+'|');
-                       return '[' + sb.substring(0, sb.length() - 
1).toString() + ']';
+                       return '[' + sb.substring(0, sb.length() - 1) + ']';
                }else
                        return "";
        }


Reply via email to