You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2011/04/01 03:59:23 UTC

svn commit: r1087549 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/pop3/POP3.java main/java/org/apache/commons/net/pop3/POP3Client.java

Author: sebb
Date: Fri Apr  1 01:59:23 2011
New Revision: 1087549

URL: http://svn.apache.org/viewvc?rev=1087549&view=rev
Log:
NET-397 POP3.setState() should not be public.
Deprecated, and changed to do nothing. Added package-private method for use by POP3 classes.

Modified:
    commons/proper/net/trunk/src/changes/changes.xml
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3Client.java

Modified: commons/proper/net/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1087549&r1=1087548&r2=1087549&view=diff
==============================================================================
--- commons/proper/net/trunk/src/changes/changes.xml (original)
+++ commons/proper/net/trunk/src/changes/changes.xml Fri Apr  1 01:59:23 2011
@@ -57,6 +57,10 @@ The <action> type attribute can be add,u
 
     <body>
         <release version="3.0" date="TBA" description="TBA">
+            <action issue="NET-396" dev="sebb" type="update">
+            POP3.setState() should not be public.
+            Deprecated, and changed to do nothing. Added package-private method for use by POP3 classes.
+            </action>
             <action issue="NET-219" dev="sebb" type="update">
             Should Telnet class Exception blocks write to System.err?
             Catch blocks removed, and throws clauses added to allow caller to more easily detect and recover.

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java?rev=1087549&r1=1087548&r2=1087549&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java Fri Apr  1 01:59:23 2011
@@ -149,22 +149,31 @@ public class POP3 extends SocketClient
           new BufferedWriter(new OutputStreamWriter(_output_,
                                                     __DEFAULT_ENCODING));
         __getReply();
-        setState(AUTHORIZATION_STATE);
+        _setState(AUTHORIZATION_STATE);
     }
 
 
-    /***
-     * Sets POP3 client state.  This must be one of the
-     * <code>_STATE</code> constants.
-     * <p>
+    /**
+     * No longer used, as the state must only be changed by POP3 classes.
+     * @deprecated 3.0 DO NOT USE. Does nothing.
+     */
+    @Deprecated
+    public void xsetState(int state)
+    {
+    }
+
+
+    /**
+     * Internal method to set POP3 client state.
+     * This must be one of the <code>_STATE</code> constants.
+     *
      * @param state  The new state.
-     ***/
-    public void setState(int state)
+     */
+    void _setState(int state)
     {
         __popState = state;
     }
 
-
     /***
      * Returns the current POP3 client state.
      * <p>
@@ -210,7 +219,7 @@ public class POP3 extends SocketClient
         __writer = null;
         _lastReplyLine = null;
         _replyLines.clear();
-        setState(DISCONNECTED_STATE);
+        _setState(DISCONNECTED_STATE);
     }
 
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3Client.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3Client.java?rev=1087549&r1=1087548&r2=1087549&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3Client.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3Client.java Fri Apr  1 01:59:23 2011
@@ -139,7 +139,7 @@ public class POP3Client extends POP3
         if (sendCommand(POP3Command.PASS, password) != POP3Reply.OK)
             return false;
 
-        setState(TRANSACTION_STATE);
+        _setState(TRANSACTION_STATE);
 
         return true;
     }
@@ -208,7 +208,7 @@ public class POP3Client extends POP3
         if (sendCommand(POP3Command.APOP, buffer.toString()) != POP3Reply.OK)
             return false;
 
-        setState(TRANSACTION_STATE);
+        _setState(TRANSACTION_STATE);
 
         return true;
     }
@@ -232,7 +232,7 @@ public class POP3Client extends POP3
     public boolean logout() throws IOException
     {
         if (getState() == TRANSACTION_STATE)
-            setState(UPDATE_STATE);
+            _setState(UPDATE_STATE);
         sendCommand(POP3Command.QUIT);
         return (_replyCode == POP3Reply.OK);
     }