Author: sebb
Date: Sun Mar 27 14:11:36 2011
New Revision: 1085941
URL: http://svn.apache.org/viewvc?rev=1085941&view=rev
Log:
Use getCommand rather than direct indexing of array
Modified:
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/imap/IMAPCommand.java
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=1085941&r1=1085940&r2=1085941&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
Sun Mar 27 14:11:36 2011
@@ -335,7 +335,7 @@ public class IMAP extends SocketClient
*/
public int sendCommandWithID(String commandID, int command, String args)
throws IOException
{
- return sendCommandWithID(commandID, IMAPCommand._commands[command],
args);
+ return sendCommandWithID(commandID, IMAPCommand.getCommand(command),
args);
}
/**
@@ -349,7 +349,7 @@ public class IMAP extends SocketClient
**/
public int sendCommandWithID(String commandID, int command) throws
IOException
{
- return sendCommandWithID(commandID, IMAPCommand._commands[command],
null);
+ return sendCommandWithID(commandID, IMAPCommand.getCommand(command),
null);
}
/**
@@ -386,7 +386,7 @@ public class IMAP extends SocketClient
*/
public int sendCommand(int command, String args) throws IOException
{
- return sendCommandWithID(generateCommandID(),
IMAPCommand._commands[command], args);
+ return sendCommandWithID(generateCommandID(),
IMAPCommand.getCommand(command), args);
}
/**
@@ -399,7 +399,7 @@ public class IMAP extends SocketClient
**/
public int sendCommand(int command) throws IOException
{
- return sendCommandWithID(generateCommandID(),
IMAPCommand._commands[command], null);
+ return sendCommandWithID(generateCommandID(),
IMAPCommand.getCommand(command), null);
}
/**
@@ -436,7 +436,7 @@ public class IMAP extends SocketClient
*/
public int sendUntaggedCommand(int command, String args) throws IOException
{
- return sendCommandWithID(null, IMAPCommand._commands[command], args);
+ return sendCommandWithID(null, IMAPCommand.getCommand(command), args);
}
/**
@@ -449,7 +449,7 @@ public class IMAP extends SocketClient
**/
public int sendUntaggedCommand(int command) throws IOException
{
- return sendCommandWithID(null, IMAPCommand._commands[command], null);
+ return sendCommandWithID(null, IMAPCommand.getCommand(command), null);
}
/**
Modified:
commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPCommand.java
URL:
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPCommand.java?rev=1085941&r1=1085940&r2=1085941&view=diff
==============================================================================
---
commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPCommand.java
(original)
+++
commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPCommand.java
Sun Mar 27 14:11:36 2011
@@ -75,7 +75,7 @@ public class IMAPCommand
- static final String[] _commands = {
+ private static final String[] _commands = {
"CAPABILITY",
"NOOP",
"LOGOUT",