commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r929649 - in /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net: chargen/ daytime/ echo/ io/ ntp/
Date Wed, 31 Mar 2010 18:12:07 GMT
Author: sebb
Date: Wed Mar 31 18:12:07 2010
New Revision: 929649

URL: http://svn.apache.org/viewvc?rev=929649&view=rev
Log:
Make private variables final where possible

Modified:
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamAdapter.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamEvent.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamException.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/SocketInputStream.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/SocketOutputStream.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ntp/TimeInfo.java

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java?rev=929649&r1=929648&r2=929649&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java
Wed Mar 31 18:12:07 2010
@@ -64,9 +64,9 @@ public final class CharGenUDPClient exte
     /*** The default chargen port.  It is set to 19 according to RFC 864. ***/
     public static final int DEFAULT_PORT = 19;
 
-    private byte[] __receiveData;
-    private DatagramPacket __receivePacket;
-    private DatagramPacket __sendPacket;
+    private final byte[] __receiveData;
+    private final DatagramPacket __receivePacket;
+    private final DatagramPacket __sendPacket;
 
     /***
      * The default CharGenUDPClient constructor.  It initializes some internal
@@ -77,7 +77,7 @@ public final class CharGenUDPClient exte
     {
         // CharGen return packets have a maximum length of 512
         __receiveData = new byte[512];
-        __receivePacket = new DatagramPacket(__receiveData, 512);
+        __receivePacket = new DatagramPacket(__receiveData, __receiveData.length);
         __sendPacket = new DatagramPacket(new byte[0], 0);
     }
 

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java?rev=929649&r1=929648&r2=929649&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java
Wed Mar 31 18:12:07 2010
@@ -45,7 +45,7 @@ public final class DaytimeTCPClient exte
 
     // Received dates will likely be less than 64 characters.
     // This is a temporary buffer used while receiving data.
-    private char[] __buffer = new char[64];
+    private final char[] __buffer = new char[64];
 
     /***
      * The default DaytimeTCPClient constructor.  It merely sets the default

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java?rev=929649&r1=929648&r2=929649&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java
Wed Mar 31 18:12:07 2010
@@ -47,9 +47,9 @@ public final class DaytimeUDPClient exte
     /*** The default daytime port.  It is set to 13 according to RFC 867. ***/
     public static final int DEFAULT_PORT = 13;
 
-    private byte[] __dummyData = new byte[1];
+    private final byte[] __dummyData = new byte[1];
     // Received dates should be less than 256 bytes
-    private byte[] __timeData = new byte[256];
+    private final byte[] __timeData = new byte[256];
 
     /***
      * Retrieves the time string from the specified server and port and

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java?rev=929649&r1=929648&r2=929649&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java
Wed Mar 31 18:12:07 2010
@@ -45,7 +45,7 @@ public final class EchoUDPClient extends
     /*** The default echo port.  It is set to 7 according to RFC 862. ***/
     public static final int DEFAULT_PORT = 7;
 
-    private DatagramPacket __receivePacket = new DatagramPacket(new byte[0], 0);
+    private final DatagramPacket __receivePacket = new DatagramPacket(new byte[0], 0);
 
     /***
      * Sends the specified data to the specified server at the default echo

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamAdapter.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamAdapter.java?rev=929649&r1=929648&r2=929649&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamAdapter.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamAdapter.java
Wed Mar 31 18:12:07 2010
@@ -41,7 +41,7 @@ import org.apache.commons.net.util.Liste
  */
 public class CopyStreamAdapter implements CopyStreamListener
 {
-    private ListenerList internalListeners;
+    private final ListenerList internalListeners;
 
     /**
      * Creates a new copyStreamAdapter.

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamEvent.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamEvent.java?rev=929649&r1=929648&r2=929649&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamEvent.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamEvent.java
Wed Mar 31 18:12:07 2010
@@ -39,9 +39,9 @@ public class CopyStreamEvent extends Eve
      */
     public static final long UNKNOWN_STREAM_SIZE = -1;
 
-    private int bytesTransferred;
-    private long totalBytesTransferred;
-    private long streamSize;
+    private final int bytesTransferred;
+    private final long totalBytesTransferred;
+    private final long streamSize;
 
     /**
      * Creates a new CopyStreamEvent instance.

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamException.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamException.java?rev=929649&r1=929648&r2=929649&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamException.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/CopyStreamException.java
Wed Mar 31 18:12:07 2010
@@ -30,8 +30,8 @@ import java.io.IOException;
  */
 public class CopyStreamException extends IOException
 {
-    private long totalBytesTransferred;
-    private IOException ioException;
+    private final long totalBytesTransferred;
+    private final IOException ioException;
 
     /**
      * Creates a new CopyStreamException instance.

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/SocketInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/SocketInputStream.java?rev=929649&r1=929648&r2=929649&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/SocketInputStream.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/SocketInputStream.java
Wed Mar 31 18:12:07 2010
@@ -37,7 +37,7 @@ import java.net.Socket;
 
 public class SocketInputStream extends FilterInputStream
 {
-    private Socket __socket;
+    private final Socket __socket;
 
     /***
      * Creates a SocketInputStream instance wrapping an input stream and

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/SocketOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/SocketOutputStream.java?rev=929649&r1=929648&r2=929649&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/SocketOutputStream.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/SocketOutputStream.java
Wed Mar 31 18:12:07 2010
@@ -37,7 +37,7 @@ import java.net.Socket;
 
 public class SocketOutputStream extends FilterOutputStream
 {
-    private Socket __socket;
+    private final Socket __socket;
 
     /***
      * Creates a SocketOutputStream instance wrapping an output stream and

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java?rev=929649&r1=929648&r2=929649&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java
Wed Mar 31 18:12:07 2010
@@ -55,7 +55,7 @@ public class NtpV3Impl implements NtpV3P
     private static final int KEY_IDENTIFIER_INDEX = 48;
     private static final int MESSAGE_DIGEST = 54; /* len 16 bytes */
 
-    private byte[] buf = new byte[48];
+    private final byte[] buf = new byte[48];
 
     private volatile DatagramPacket dp;
 

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ntp/TimeInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ntp/TimeInfo.java?rev=929649&r1=929648&r2=929649&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ntp/TimeInfo.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ntp/TimeInfo.java
Wed Mar 31 18:12:07 2010
@@ -30,7 +30,7 @@ import java.util.List;
  */
 public class TimeInfo {
 
-    private NtpV3Packet _message;
+    private final NtpV3Packet _message;
     private List<String> _comments;
     private Long _delay;
     private Long _offset;
@@ -38,7 +38,7 @@ public class TimeInfo {
     /**
      * time at which time message packet was received by local machine
      */
-    private long _returnTime;
+    private final long _returnTime;
 
     /**
      * flag indicating that the TimeInfo details was processed and delay/offset were computed



Mime
View raw message