commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1436885 - in /commons/proper/net/trunk/src: main/java/org/apache/commons/net/ftp/ main/java/org/apache/commons/net/ftp/parser/ main/java/org/apache/commons/net/imap/ main/java/org/apache/commons/net/nntp/ main/java/org/apache/commons/net/s...
Date Tue, 22 Jan 2013 12:56:40 GMT
Author: ggregory
Date: Tue Jan 22 12:56:39 2013
New Revision: 1436885

URL: http://svn.apache.org/viewvc?rev=1436885&view=rev
Log:
Add final modifier to private fields.

Modified:
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFile.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/SimpleNNTPHeader.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SimpleSMTPHeader.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/Telnet.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MLSDComparison.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/io/DotTerminatedMessageReaderTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFile.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFile.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFile.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPFile.java Tue Jan
22 12:56:39 2013
@@ -63,7 +63,7 @@ public class FTPFile implements Serializ
     private long _size;
     private String _rawListing, _user, _group, _name, _link;
     private Calendar _date;
-    private boolean[] _permissions[]; // e.g. _permissions[USER_ACCESS][READ_PERMISSION]
+    private final boolean[] _permissions[]; // e.g. _permissions[USER_ACCESS][READ_PERMISSION]
 
     /*** Creates an empty FTPFile. ***/
     public FTPFile()

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
Tue Jan 22 12:56:39 2013
@@ -39,7 +39,7 @@ public class NTFTPEntryParser extends Co
     private static final String DEFAULT_DATE_FORMAT2
         = "MM-dd-yy kk:mm"; //11-09-01 18:30
 
-    private FTPTimestampParser timestampParser;
+    private final FTPTimestampParser timestampParser;
 
     /**
      * this is the regular expression used by this parser.

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java Tue Jan 22
12:56:39 2013
@@ -62,9 +62,9 @@ public class IMAP extends SocketClient
 
     protected BufferedReader _reader;
     private int _replyCode;
-    private List<String> _replyLines;
+    private final List<String> _replyLines;
 
-    private char[] _initialID = { 'A', 'A', 'A', 'A' };
+    private final char[] _initialID = { 'A', 'A', 'A', 'A' };
 
     /**
      * The default IMAPClient constructor.  Initializes the state

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java
Tue Jan 22 12:56:39 2013
@@ -43,10 +43,10 @@ import java.util.Calendar;
 
 public final class NewGroupsOrNewsQuery
 {
-    private String __date, __time;
+    private final String __date, __time;
     private StringBuffer __distributions;
     private StringBuffer __newsgroups;
-    private boolean __isGMT;
+    private final boolean __isGMT;
 
 
     /***

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/SimpleNNTPHeader.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/SimpleNNTPHeader.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/SimpleNNTPHeader.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/SimpleNNTPHeader.java
Tue Jan 22 12:56:39 2013
@@ -47,9 +47,9 @@ package org.apache.commons.net.nntp;
 
 public class SimpleNNTPHeader
 {
-    private String __subject, __from;
-    private StringBuilder __newsgroups;
-    private StringBuilder __headerFields;
+    private final String __subject, __from;
+    private final StringBuilder __newsgroups;
+    private final StringBuilder __headerFields;
     private int __newsgroupCount;
 
     /***

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SimpleSMTPHeader.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SimpleSMTPHeader.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SimpleSMTPHeader.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SimpleSMTPHeader.java
Tue Jan 22 12:56:39 2013
@@ -48,8 +48,9 @@ package org.apache.commons.net.smtp;
 
 public class SimpleSMTPHeader
 {
-    private String __subject, __from, __to;
-    private StringBuffer __headerFields, __cc;
+    private final String __subject, __from, __to;
+    private final StringBuffer __headerFields;
+    private StringBuffer __cc;
 
     /***
      * Creates a new SimpleSMTPHeader instance initialized with the given

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/Telnet.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/Telnet.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/Telnet.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/Telnet.java Tue Jan
22 12:56:39 2013
@@ -100,7 +100,7 @@ class Telnet extends SocketClient
     /***
      * Array of option handlers
      ***/
-    private TelnetOptionHandler optionHandlers[];
+    private final TelnetOptionHandler optionHandlers[];
 
     /* open TelnetOptionHandler functionality (end)*/
 
@@ -115,7 +115,7 @@ class Telnet extends SocketClient
     /***
      * monitor to wait for AYT
      ***/
-    private Object aytMonitor = new Object();
+    private final Object aytMonitor = new Object();
 
     /***
      * flag for AYT

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
Tue Jan 22 12:56:39 2013
@@ -35,7 +35,7 @@ final class TelnetOutputStream extends O
 {
     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 final boolean __convertCRtoCRLF = true;
     private boolean __lastWasCR = false;
 
     TelnetOutputStream(TelnetClient client)

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
Tue Jan 22 12:56:39 2013
@@ -49,7 +49,7 @@ import junit.framework.TestCase;
 
 public class FTPClientConfigFunctionalTest extends TestCase {
 
-    private FTPClient FTP = new FTPClient();
+    private final FTPClient FTP = new FTPClient();
     private FTPClientConfig FTPConf;
 
 

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java
Tue Jan 22 12:56:39 2013
@@ -98,13 +98,13 @@ public class ListingFunctionalTest exten
     }
 
     private FTPClient client;
-    private String hostName;
-    private String invalidParserKey;
-    private String invalidPath;
-    private String validFilename;
-    private String validParserKey;
-    private String validPath;
-    private String pwdPath;
+    private final String hostName;
+    private final String invalidParserKey;
+    private final String invalidPath;
+    private final String validFilename;
+    private final String validParserKey;
+    private final String validPath;
+    private final String pwdPath;
 
     /**
      * Constructor for FTPClientTest.

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java
Tue Jan 22 12:56:39 2013
@@ -35,7 +35,7 @@ import org.apache.commons.net.ftp.FTPFil
  */
 public class FTPConfigEntryParserTest extends TestCase {
 
-    private SimpleDateFormat df = new SimpleDateFormat();
+    private final SimpleDateFormat df = new SimpleDateFormat();
 
     public void testParseFieldsOnAIX() {
 

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MLSDComparison.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MLSDComparison.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MLSDComparison.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MLSDComparison.java
Tue Jan 22 12:56:39 2013
@@ -42,7 +42,7 @@ import org.junit.Test;
  */
 public class MLSDComparison {
 
-    private Comparator<FTPFile> cmp = new Comparator<FTPFile>() {
+    private final Comparator<FTPFile> cmp = new Comparator<FTPFile>() {
         @Override
         public int compare(FTPFile o1, FTPFile o2) {
                 String n1 = o1.getName();

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/io/DotTerminatedMessageReaderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/io/DotTerminatedMessageReaderTest.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/io/DotTerminatedMessageReaderTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/io/DotTerminatedMessageReaderTest.java
Tue Jan 22 12:56:39 2013
@@ -25,8 +25,8 @@ import junit.framework.TestCase;
 public class DotTerminatedMessageReaderTest extends TestCase {
 
     private DotTerminatedMessageReader reader;
-    private StringBuilder str = new StringBuilder();
-    private char[] buf = new char[64];
+    private final StringBuilder str = new StringBuilder();
+    private final char[] buf = new char[64];
     private static final String CRLF = "\r\n";
     private static final String DOT = ".";
     private static final String EOM = CRLF+DOT+CRLF;

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java
Tue Jan 22 12:56:39 2013
@@ -62,7 +62,7 @@ extends TestCase implements TelnetNotifi
     private TestConnection ANSI;
     private TestConnection NOREAD;
 
-    private int NUM_CONNECTIONS = 4;
+    private final int NUM_CONNECTIONS = 4;
 
 
     protected int numdo = 0;

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java (original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java Tue
Jan 22 12:56:39 2013
@@ -85,14 +85,14 @@ public class TFTPServer implements Runna
     private static final int DEFAULT_TFTP_PORT = 69;
     public static enum ServerMode { GET_ONLY, PUT_ONLY, GET_AND_PUT; }
 
-    private HashSet<TFTPTransfer> transfers_ = new HashSet<TFTPTransfer>();
+    private final HashSet<TFTPTransfer> transfers_ = new HashSet<TFTPTransfer>();
     private volatile boolean shutdownServer = false;
     private TFTP serverTftp_;
     private File serverReadDirectory_;
     private File serverWriteDirectory_;
-    private int port_;
+    private final int port_;
     private Exception serverException = null;
-    private ServerMode mode_;
+    private final ServerMode mode_;
 
     /* /dev/null output stream (default) */
     private static final PrintStream nullStream = new PrintStream(
@@ -347,7 +347,7 @@ public class TFTPServer implements Runna
      */
     private class TFTPTransfer implements Runnable
     {
-        private TFTPPacket tftpPacket_;
+        private final TFTPPacket tftpPacket_;
 
         private boolean shutdownTransfer = false;
 

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java?rev=1436885&r1=1436884&r2=1436885&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java
Tue Jan 22 12:56:39 2013
@@ -50,7 +50,7 @@ public class TimeTestSimpleServer implem
     public static final int DEFAULT_PORT = 37;
 
     private ServerSocket server;
-    private int port;
+    private final int port;
     private boolean running = false;
 
     /**



Mime
View raw message