commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r962840 - in /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net: ./ ftp/ pop3/ telnet/ tftp/ time/
Date Sat, 10 Jul 2010 13:30:28 GMT
Author: sebb
Date: Sat Jul 10 13:30:27 2010
New Revision: 962840

URL: http://svn.apache.org/viewvc?rev=962840&view=rev
Log:
Make private immutable fields final

Modified:
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/PrintCommandListener.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/pop3/POP3MessageInfo.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/InvalidTelnetOptionException.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/time/TimeUDPClient.java

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/PrintCommandListener.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/PrintCommandListener.java?rev=962840&r1=962839&r2=962840&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/PrintCommandListener.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/PrintCommandListener.java
Sat Jul 10 13:30:27 2010
@@ -32,7 +32,7 @@ import org.apache.commons.net.ProtocolCo
 
 public class PrintCommandListener implements ProtocolCommandListener
 {
-    private PrintWriter __writer;
+    private final PrintWriter __writer;
 
     public PrintCommandListener(PrintWriter writer)
     {

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java?rev=962840&r1=962839&r2=962840&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java
Sat Jul 10 13:30:27 2010
@@ -35,9 +35,9 @@ import java.util.EventObject;
 
 public class ProtocolCommandEvent extends EventObject
 {
-    private int __replyCode;
-    private boolean __isCommand;
-    private String __message, __command;
+    private final int __replyCode;
+    private final boolean __isCommand;
+    private final String __message, __command;
 
     /***
      * Creates a ProtocolCommandEvent signalling a command was sent to

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java?rev=962840&r1=962839&r2=962840&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java
Sat Jul 10 13:30:27 2010
@@ -36,8 +36,8 @@ import org.apache.commons.net.util.Liste
 
 public class ProtocolCommandSupport implements Serializable
 {
-    private Object __source;
-    private ListenerList __listeners;
+    private final Object __source;
+    private final ListenerList __listeners;
 
     /***
      * Creates a ProtocolCommandSupport instant using the indicated source

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java?rev=962840&r1=962839&r2=962840&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
Sat Jul 10 13:30:27 2010
@@ -38,7 +38,7 @@ import org.apache.commons.net.util.Base6
  */
 public class FTPHTTPClient extends FTPClient {
     private final String proxyHost;
-    private int proxyPort;
+    private final int proxyPort;
     private final String proxyUsername;
     private final String proxyPassword;
     private String host;

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/pop3/POP3MessageInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/pop3/POP3MessageInfo.java?rev=962840&r1=962839&r2=962840&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/pop3/POP3MessageInfo.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/pop3/POP3MessageInfo.java
Sat Jul 10 13:30:27 2010
@@ -41,6 +41,7 @@ package org.apache.commons.net.pop3;
 
 public final class POP3MessageInfo
 {
+    // TODO - make these fields final? They are all set on construction
     public int number;
     public int size;
     public String identifier;

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/InvalidTelnetOptionException.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/InvalidTelnetOptionException.java?rev=962840&r1=962839&r2=962840&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/InvalidTelnetOptionException.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/InvalidTelnetOptionException.java
Sat Jul 10 13:30:27 2010
@@ -30,12 +30,12 @@ public class InvalidTelnetOptionExceptio
     /***
      * Option code
      ***/
-    private int optionCode = -1;
+    private final int optionCode;
 
     /***
      * Error message
      ***/
-    private String msg;
+    private final String msg;
 
     /***
      * Constructor for the exception.

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java?rev=962840&r1=962839&r2=962840&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
Sat Jul 10 13:30:27 2010
@@ -32,7 +32,8 @@ import java.io.OutputStream;
 
 final class TelnetOutputStream extends OutputStream
 {
-    private TelnetClient __client;
+    private final TelnetClient __client;
+    // TODO there does not appear to be any way to change this value - should it be a ctor
parameter?
     private boolean __convertCRtoCRLF = true;
     private boolean __lastWasCR = false;
 

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java?rev=962840&r1=962839&r2=962840&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java
Sat Jul 10 13:30:27 2010
@@ -27,7 +27,7 @@ public class TerminalTypeOptionHandler e
     /***
      * Terminal type
      ***/
-    private String termType = null;
+    private final String termType;
 
     /***
      * Terminal type option

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java?rev=962840&r1=962839&r2=962840&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java
Sat Jul 10 13:30:27 2010
@@ -68,7 +68,7 @@ public abstract class TFTPRequestPacket 
                                        };
 
     /*** The transfer mode of the request. ***/
-    private int _mode;
+    private final int _mode;
 
     /*** The filename of the request. ***/
     private final String _filename;

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/time/TimeUDPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/time/TimeUDPClient.java?rev=962840&r1=962839&r2=962840&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/time/TimeUDPClient.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/time/TimeUDPClient.java
Sat Jul 10 13:30:27 2010
@@ -56,8 +56,8 @@ public final class TimeUDPClient extends
      ***/
     public static final long SECONDS_1900_TO_1970 = 2208988800L;
 
-    private byte[] __dummyData = new byte[1];
-    private byte[] __timeData = new byte[4];
+    private final byte[] __dummyData = new byte[1];
+    private final byte[] __timeData = new byte[4];
 
     /***
      * Retrieves the time from the specified server and port and



Mime
View raw message