commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwins...@apache.org
Subject svn commit: r437157 - in /jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src: main/java/examples/ main/java/org/apache/commons/net/io/ main/java/org/apache/commons/net/nntp/ main/java/org/apache/commons/net/ntp/ test/java/org/apache/commons/net/ftp...
Date Sat, 26 Aug 2006 12:35:47 GMT
Author: rwinston
Date: Sat Aug 26 05:35:44 2006
New Revision: 437157

URL: http://svn.apache.org/viewvc?rev=437157&view=rev
Log:
Cleaned up some minor stuff (thanks FindBugs)

Modified:
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/examples/FTPSExample.java
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/io/CopyStreamAdapter.java
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/nntp/NNTPClient.java
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ntp/TimeStamp.java
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/telnet/InvalidTelnetOptionExceptionTest.java

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/examples/FTPSExample.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/examples/FTPSExample.java?rev=437157&r1=437156&r2=437157&view=diff
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/examples/FTPSExample.java
(original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/examples/FTPSExample.java
Sat Aug 26 05:35:44 2006
@@ -21,6 +21,8 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.PrintWriter;
+import java.security.NoSuchAlgorithmException;
+
 import org.apache.commons.net.ftp.FTP;
 import org.apache.commons.net.ftp.FTPConnectionClosedException;
 import org.apache.commons.net.ftp.FTPReply;
@@ -45,7 +47,7 @@
         "\t-s store file on server (upload)\n" +
         "\t-b use binary transfer mode\n";
 
-    public static final void main(String[] args)
+    public static final void main(String[] args) throws NoSuchAlgorithmException
     {
     	int base = 0;
         boolean storeFile = false, binaryTransfer = false, error = false;
@@ -74,7 +76,7 @@
         remote = args[base++];
         local = args[base];
 
-        ftps = new FTPSClient("JKS","SSL","password","0","P");
+        ftps = new FTPSClient();
         // NOTE this is necessary for FTPSClient connections
 		ftps.setReaderThread(false);
         ftps.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/io/CopyStreamAdapter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/io/CopyStreamAdapter.java?rev=437157&r1=437156&r2=437157&view=diff
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/io/CopyStreamAdapter.java
(original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/io/CopyStreamAdapter.java
Sat Aug 26 05:35:44 2006
@@ -15,7 +15,6 @@
  */
 package org.apache.commons.net.io;
 
-import java.util.Enumeration;
 import java.util.EventListener;
 
 import org.apache.commons.net.util.ListenerList;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/nntp/NNTPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/nntp/NNTPClient.java?rev=437157&r1=437156&r2=437157&view=diff
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/nntp/NNTPClient.java
(original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/nntp/NNTPClient.java
Sat Aug 26 05:35:44 2006
@@ -1215,8 +1215,8 @@
         throws IOException
     {
         return
-            __retrieveArticleInfo(new String(lowArticleNumber + "-" +
-                                             highArticleNumber));
+            __retrieveArticleInfo(lowArticleNumber + "-" +
+                                             highArticleNumber);
     }
 
     /***
@@ -1269,9 +1269,7 @@
         throws IOException
     {
         return
-            __retrieveHeader(header,
-                             new String(lowArticleNumber + "-" +
-                                        highArticleNumber));
+            __retrieveHeader(header,lowArticleNumber + "-" + highArticleNumber);
     }
 }
 

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java?rev=437157&r1=437156&r2=437157&view=diff
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java
(original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java
Sat Aug 26 05:35:44 2006
@@ -328,13 +328,13 @@
 
     private String idAsString()
     {
-        String id = "";
+        StringBuilder id = new StringBuilder();
         for (int i = 0; i <= 3; i++) {
             char c = (char) buf[REFERENCE_ID_INDEX + i];
             if (c == 0) break; // 0-terminated string
-            id = id + c;
+            id.append(c);
         }
-        return id;
+        return id.toString();
     }
 
     private String idAsHex()

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ntp/TimeStamp.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ntp/TimeStamp.java?rev=437157&r1=437156&r2=437157&view=diff
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ntp/TimeStamp.java
(original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ntp/TimeStamp.java
Sat Aug 26 05:35:44 2006
@@ -407,7 +407,7 @@
             // No cache yet, or cached formatter GC'd
             formatter = new SimpleDateFormat(NTP_DATE_FORMAT, Locale.US);
             formatter.setTimeZone(TimeZone.getDefault());
-            simpleFormatter = new SoftReference(formatter);
+            simpleFormatter = new SoftReference<DateFormat>(formatter);
         }
         Date ntpDate = getDate();
         synchronized (formatter) {
@@ -434,7 +434,7 @@
             formatter = new SimpleDateFormat(NTP_DATE_FORMAT + " 'UTC'",
                     Locale.US);
             formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
-            utcFormatter = new SoftReference(formatter);
+            utcFormatter = new SoftReference<DateFormat>(formatter);
         }
         Date ntpDate = getDate();
         synchronized (formatter) {

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java?rev=437157&r1=437156&r2=437157&view=diff
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
(original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
Sat Aug 26 05:35:44 2006
@@ -96,10 +96,10 @@
     }
 
 	
-    private TreeSet getSortedList(FTPFile[] files) {
+    private TreeSet<FTPFile> getSortedList(FTPFile[] files) {
         // create a TreeSet which will sort each element
         // as it is added.
-        TreeSet sorted = new TreeSet(new Comparator() {
+        TreeSet<FTPFile> sorted = new TreeSet<FTPFile>(new Comparator() {
 
             public int compare(Object o1, Object o2) {
                 FTPFile f1 = (FTPFile) o1;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java?rev=437157&r1=437156&r2=437157&view=diff
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java
(original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java
Sat Aug 26 05:35:44 2006
@@ -17,7 +17,6 @@
 
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
-import java.util.Date;
 
 import junit.framework.TestCase;
 
@@ -81,9 +80,7 @@
 		assertEquals(814, f.getSize());
 
 		Calendar cal = Calendar.getInstance();
-		
-		Date refDate = new Date();
-		
+				
 		cal.set(Calendar.MONTH, Calendar.MARCH);
 		cal.set(Calendar.DATE, 2);
 		cal.set(Calendar.HOUR_OF_DAY, 16);
@@ -145,8 +142,6 @@
 		assertEquals(23, f.getSize());
 
 		Calendar cal = Calendar.getInstance();
-		
-		Date refDate = new Date();
 		
 		cal.set(Calendar.MONTH, Calendar.MARCH);
 		cal.set(Calendar.DATE, 2);

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/telnet/InvalidTelnetOptionExceptionTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/telnet/InvalidTelnetOptionExceptionTest.java?rev=437157&r1=437156&r2=437157&view=diff
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/telnet/InvalidTelnetOptionExceptionTest.java
(original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/telnet/InvalidTelnetOptionExceptionTest.java
Sat Aug 26 05:35:44 2006
@@ -41,7 +41,7 @@
      ***/
     protected void setUp()
     {
-        msg1 = new String("MSG");
+        msg1 = "MSG";
         code1 = 13;
         exc1 = new InvalidTelnetOptionException(msg1, code1);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message