You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/09/20 19:05:05 UTC
[commons-net] 09/09: Remove redundant 'public',
'static' and 'final' keywords.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git
commit 6c57c412f16ab4e0cf9d00d84f4e3ce5a39120f9
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Sep 20 15:04:23 2020 -0400
Remove redundant 'public', 'static' and 'final' keywords.
---
.../apache/commons/net/DatagramSocketFactory.java | 6 +-
.../commons/net/ProtocolCommandListener.java | 4 +-
.../apache/commons/net/examples/mail/POP3Mail.java | 2 +-
.../commons/net/examples/ntp/TimeClient.java | 4 +-
.../commons/net/examples/telnet/WeatherTelnet.java | 2 +-
.../apache/commons/net/examples/unix/chargen.java | 4 +-
.../apache/commons/net/examples/unix/daytime.java | 4 +-
.../org/apache/commons/net/examples/unix/echo.java | 4 +-
.../apache/commons/net/examples/unix/rdate.java | 4 +-
.../apache/commons/net/examples/util/IOUtil.java | 2 +-
.../org/apache/commons/net/ftp/Configurable.java | 2 +-
.../java/org/apache/commons/net/ftp/FTPClient.java | 2 +-
.../org/apache/commons/net/ftp/FTPCommand.java | 2 +-
.../org/apache/commons/net/ftp/FTPFileFilter.java | 2 +-
.../org/apache/commons/net/ftp/FTPSCommand.java | 2 +-
.../net/ftp/parser/FTPFileEntryParserFactory.java | 4 +-
.../commons/net/ftp/parser/FTPTimestampParser.java | 6 +-
.../commons/net/imap/AuthenticatingIMAPClient.java | 2 +-
.../apache/commons/net/io/CopyStreamListener.java | 4 +-
.../commons/net/io/FromNetASCIIInputStream.java | 2 +-
src/main/java/org/apache/commons/net/io/Util.java | 14 +--
.../org/apache/commons/net/nntp/NNTPCommand.java | 2 +-
.../org/apache/commons/net/nntp/Threadable.java | 16 +--
.../org/apache/commons/net/ntp/NtpV3Packet.java | 108 ++++++++++-----------
.../commons/net/pop3/ExtendedPOP3Client.java | 2 +-
.../org/apache/commons/net/pop3/POP3Command.java | 2 +-
.../commons/net/smtp/AuthenticatingSMTPClient.java | 2 +-
.../org/apache/commons/net/smtp/SMTPCommand.java | 2 +-
.../apache/commons/net/telnet/TelnetCommand.java | 4 +-
.../commons/net/telnet/TelnetInputListener.java | 2 +-
.../net/telnet/TelnetNotificationHandler.java | 12 +--
.../org/apache/commons/net/tftp/TFTPServer.java | 2 +-
32 files changed, 116 insertions(+), 116 deletions(-)
diff --git a/src/main/java/org/apache/commons/net/DatagramSocketFactory.java b/src/main/java/org/apache/commons/net/DatagramSocketFactory.java
index 3fe8ded..1145738 100644
--- a/src/main/java/org/apache/commons/net/DatagramSocketFactory.java
+++ b/src/main/java/org/apache/commons/net/DatagramSocketFactory.java
@@ -44,7 +44,7 @@ public interface DatagramSocketFactory
*
* @throws SocketException If the socket could not be created.
***/
- public DatagramSocket createDatagramSocket() throws SocketException;
+ DatagramSocket createDatagramSocket() throws SocketException;
/***
* Creates a DatagramSocket on the local host at a specified port.
@@ -53,7 +53,7 @@ public interface DatagramSocketFactory
* @return the socket
* @throws SocketException If the socket could not be created.
***/
- public DatagramSocket createDatagramSocket(int port) throws SocketException;
+ DatagramSocket createDatagramSocket(int port) throws SocketException;
/***
* Creates a DatagramSocket at the specified address on the local host
@@ -64,6 +64,6 @@ public interface DatagramSocketFactory
* @return the socket
* @throws SocketException If the socket could not be created.
***/
- public DatagramSocket createDatagramSocket(int port, InetAddress laddr)
+ DatagramSocket createDatagramSocket(int port, InetAddress laddr)
throws SocketException;
}
diff --git a/src/main/java/org/apache/commons/net/ProtocolCommandListener.java b/src/main/java/org/apache/commons/net/ProtocolCommandListener.java
index f6d4231..0f542b7 100644
--- a/src/main/java/org/apache/commons/net/ProtocolCommandListener.java
+++ b/src/main/java/org/apache/commons/net/ProtocolCommandListener.java
@@ -45,7 +45,7 @@ public interface ProtocolCommandListener extends EventListener
*
* @param event The ProtocolCommandEvent fired.
***/
- public void protocolCommandSent(ProtocolCommandEvent event);
+ void protocolCommandSent(ProtocolCommandEvent event);
/***
* This method is invoked by a ProtocolCommandEvent source after
@@ -53,6 +53,6 @@ public interface ProtocolCommandListener extends EventListener
*
* @param event The ProtocolCommandEvent fired.
***/
- public void protocolReplyReceived(ProtocolCommandEvent event);
+ void protocolReplyReceived(ProtocolCommandEvent event);
}
diff --git a/src/main/java/org/apache/commons/net/examples/mail/POP3Mail.java b/src/main/java/org/apache/commons/net/examples/mail/POP3Mail.java
index 5a6a892..33bf350 100644
--- a/src/main/java/org/apache/commons/net/examples/mail/POP3Mail.java
+++ b/src/main/java/org/apache/commons/net/examples/mail/POP3Mail.java
@@ -38,7 +38,7 @@ import org.apache.commons.net.pop3.POP3SClient;
public final class POP3Mail
{
- public static final void printMessageInfo(final BufferedReader reader, final int id) throws IOException {
+ public static void printMessageInfo(final BufferedReader reader, final int id) throws IOException {
String from = "";
String subject = "";
String line;
diff --git a/src/main/java/org/apache/commons/net/examples/ntp/TimeClient.java b/src/main/java/org/apache/commons/net/examples/ntp/TimeClient.java
index e88000d..c0840d2 100644
--- a/src/main/java/org/apache/commons/net/examples/ntp/TimeClient.java
+++ b/src/main/java/org/apache/commons/net/examples/ntp/TimeClient.java
@@ -38,7 +38,7 @@ import org.apache.commons.net.time.TimeUDPClient;
public final class TimeClient
{
- public static final void timeTCP(final String host) throws IOException
+ public static void timeTCP(final String host) throws IOException
{
final TimeTCPClient client = new TimeTCPClient();
try {
@@ -51,7 +51,7 @@ public final class TimeClient
}
}
- public static final void timeUDP(final String host) throws IOException
+ public static void timeUDP(final String host) throws IOException
{
final TimeUDPClient client = new TimeUDPClient();
diff --git a/src/main/java/org/apache/commons/net/examples/telnet/WeatherTelnet.java b/src/main/java/org/apache/commons/net/examples/telnet/WeatherTelnet.java
index a678a28..b2cb060 100644
--- a/src/main/java/org/apache/commons/net/examples/telnet/WeatherTelnet.java
+++ b/src/main/java/org/apache/commons/net/examples/telnet/WeatherTelnet.java
@@ -38,7 +38,7 @@ import org.apache.commons.net.examples.util.IOUtil;
public final class WeatherTelnet
{
- public static final void main(final String[] args)
+ public static void main(final String[] args)
{
TelnetClient telnet;
diff --git a/src/main/java/org/apache/commons/net/examples/unix/chargen.java b/src/main/java/org/apache/commons/net/examples/unix/chargen.java
index 1f8d0f5..426ac99 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/chargen.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/chargen.java
@@ -42,7 +42,7 @@ import org.apache.commons.net.chargen.CharGenUDPClient;
public final class chargen
{
- public static final void chargenTCP(final String host) throws IOException
+ public static void chargenTCP(final String host) throws IOException
{
int lines = 100;
String line;
@@ -70,7 +70,7 @@ public final class chargen
client.disconnect();
}
- public static final void chargenUDP(final String host) throws IOException
+ public static void chargenUDP(final String host) throws IOException
{
int packets = 50;
byte[] data;
diff --git a/src/main/java/org/apache/commons/net/examples/unix/daytime.java b/src/main/java/org/apache/commons/net/examples/unix/daytime.java
index 9fd8c4a..b578dc1 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/daytime.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/daytime.java
@@ -36,7 +36,7 @@ import org.apache.commons.net.daytime.DaytimeUDPClient;
public final class daytime
{
- public static final void daytimeTCP(final String host) throws IOException
+ public static void daytimeTCP(final String host) throws IOException
{
final DaytimeTCPClient client = new DaytimeTCPClient();
@@ -47,7 +47,7 @@ public final class daytime
client.disconnect();
}
- public static final void daytimeUDP(final String host) throws IOException
+ public static void daytimeUDP(final String host) throws IOException
{
final DaytimeUDPClient client = new DaytimeUDPClient();
diff --git a/src/main/java/org/apache/commons/net/examples/unix/echo.java b/src/main/java/org/apache/commons/net/examples/unix/echo.java
index c25844e..c97d4ea 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/echo.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/echo.java
@@ -42,7 +42,7 @@ import org.apache.commons.net.echo.EchoUDPClient;
public final class echo
{
- public static final void echoTCP(final String host) throws IOException
+ public static void echoTCP(final String host) throws IOException
{
final EchoTCPClient client = new EchoTCPClient();
BufferedReader input, echoInput;
@@ -70,7 +70,7 @@ public final class echo
client.disconnect();
}
- public static final void echoUDP(final String host) throws IOException
+ public static void echoUDP(final String host) throws IOException
{
int length, count;
byte[] data;
diff --git a/src/main/java/org/apache/commons/net/examples/unix/rdate.java b/src/main/java/org/apache/commons/net/examples/unix/rdate.java
index a9debab..3c39609 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/rdate.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/rdate.java
@@ -37,7 +37,7 @@ import org.apache.commons.net.time.TimeUDPClient;
public final class rdate
{
- public static final void timeTCP(final String host) throws IOException
+ public static void timeTCP(final String host) throws IOException
{
final TimeTCPClient client = new TimeTCPClient();
@@ -48,7 +48,7 @@ public final class rdate
client.disconnect();
}
- public static final void timeUDP(final String host) throws IOException
+ public static void timeUDP(final String host) throws IOException
{
final TimeUDPClient client = new TimeUDPClient();
diff --git a/src/main/java/org/apache/commons/net/examples/util/IOUtil.java b/src/main/java/org/apache/commons/net/examples/util/IOUtil.java
index cd8738c..5b6b4a4 100644
--- a/src/main/java/org/apache/commons/net/examples/util/IOUtil.java
+++ b/src/main/java/org/apache/commons/net/examples/util/IOUtil.java
@@ -36,7 +36,7 @@ import org.apache.commons.net.io.Util;
public final class IOUtil
{
- public static final void readWrite(final InputStream remoteInput,
+ public static void readWrite(final InputStream remoteInput,
final OutputStream remoteOutput,
final InputStream localInput,
final OutputStream localOutput)
diff --git a/src/main/java/org/apache/commons/net/ftp/Configurable.java b/src/main/java/org/apache/commons/net/ftp/Configurable.java
index b04ded9..bc2bd90 100644
--- a/src/main/java/org/apache/commons/net/ftp/Configurable.java
+++ b/src/main/java/org/apache/commons/net/ftp/Configurable.java
@@ -31,5 +31,5 @@ public interface Configurable {
* <code>config</code> are somehow inadequate to configure the
* Configurable object.
*/
- public void configure(FTPClientConfig config);
+ void configure(FTPClientConfig config);
}
diff --git a/src/main/java/org/apache/commons/net/ftp/FTPClient.java b/src/main/java/org/apache/commons/net/ftp/FTPClient.java
index 19d4e2b..0d2cc99 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTPClient.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTPClient.java
@@ -3919,7 +3919,7 @@ implements Configurable
*
* @since 3.6
*/
- public static interface HostnameResolver {
+ public interface HostnameResolver {
String resolve(String hostname) throws UnknownHostException;
}
diff --git a/src/main/java/org/apache/commons/net/ftp/FTPCommand.java b/src/main/java/org/apache/commons/net/ftp/FTPCommand.java
index 757044a..0b69b92 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTPCommand.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTPCommand.java
@@ -164,7 +164,7 @@ public final class FTPCommand
* @return The FTP protcol command string corresponding to a specified
* command code.
*/
- public static final String getCommand(final int command)
+ public static String getCommand(final int command)
{
return _commands[command];
}
diff --git a/src/main/java/org/apache/commons/net/ftp/FTPFileFilter.java b/src/main/java/org/apache/commons/net/ftp/FTPFileFilter.java
index 16f9c13..86bb994 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTPFileFilter.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTPFileFilter.java
@@ -29,5 +29,5 @@ public interface FTPFileFilter {
* @param file entry to be checked for inclusion. May be <code>null</code>.
* @return <code>true</code> if the file is to be included, <code>false</code> otherwise
*/
- public boolean accept(FTPFile file);
+ boolean accept(FTPFile file);
}
diff --git a/src/main/java/org/apache/commons/net/ftp/FTPSCommand.java b/src/main/java/org/apache/commons/net/ftp/FTPSCommand.java
index a3dea83..cd0776e 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTPSCommand.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTPSCommand.java
@@ -46,7 +46,7 @@ public final class FTPSCommand {
* @return The FTPS command string corresponding to a specified
* command code.
*/
- public static final String getCommand(final int command) {
+ public static String getCommand(final int command) {
return _commands[command];
}
}
diff --git a/src/main/java/org/apache/commons/net/ftp/parser/FTPFileEntryParserFactory.java b/src/main/java/org/apache/commons/net/ftp/parser/FTPFileEntryParserFactory.java
index 9901a97..59b711a 100644
--- a/src/main/java/org/apache/commons/net/ftp/parser/FTPFileEntryParserFactory.java
+++ b/src/main/java/org/apache/commons/net/ftp/parser/FTPFileEntryParserFactory.java
@@ -37,7 +37,7 @@ public interface FTPFileEntryParserFactory
* @throws ParserInitializationException
* Thrown on any exception in instantiation
*/
- public FTPFileEntryParser createFileEntryParser(String key)
+ FTPFileEntryParser createFileEntryParser(String key)
throws ParserInitializationException;
/**
@@ -62,7 +62,7 @@ public interface FTPFileEntryParserFactory
* Thrown on any exception in instantiation
* @since 1.4
*/
- public FTPFileEntryParser createFileEntryParser(FTPClientConfig config)
+ FTPFileEntryParser createFileEntryParser(FTPClientConfig config)
throws ParserInitializationException;
}
diff --git a/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParser.java b/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParser.java
index 0f74437..c04cd44 100644
--- a/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParser.java
+++ b/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParser.java
@@ -30,11 +30,11 @@ public interface FTPTimestampParser {
/**
* the default default date format.
*/
- public static final String DEFAULT_SDF = UnixFTPEntryParser.DEFAULT_DATE_FORMAT;
+ String DEFAULT_SDF = UnixFTPEntryParser.DEFAULT_DATE_FORMAT;
/**
* the default recent date format.
*/
- public static final String DEFAULT_RECENT_SDF = UnixFTPEntryParser.DEFAULT_RECENT_DATE_FORMAT;
+ String DEFAULT_RECENT_SDF = UnixFTPEntryParser.DEFAULT_RECENT_DATE_FORMAT;
/**
* Parses the supplied datestamp parameter. This parameter typically would
@@ -47,6 +47,6 @@ public interface FTPTimestampParser {
* @throws ParseException if none of the parser mechanisms belonging to
* the implementor can parse the input.
*/
- public Calendar parseTimestamp(String timestampStr) throws ParseException;
+ Calendar parseTimestamp(String timestampStr) throws ParseException;
}
diff --git a/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java b/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
index 9f08147..c31c7b9 100644
--- a/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
+++ b/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
@@ -240,7 +240,7 @@ public class AuthenticatingIMAPClient extends IMAPSClient
/**
* The enumeration of currently-supported authentication methods.
*/
- public static enum AUTH_METHOD
+ public enum AUTH_METHOD
{
/** The standarised (RFC4616) PLAIN method, which sends the password unencrypted (insecure). */
PLAIN("PLAIN"),
diff --git a/src/main/java/org/apache/commons/net/io/CopyStreamListener.java b/src/main/java/org/apache/commons/net/io/CopyStreamListener.java
index f56b022..bbf27cd 100644
--- a/src/main/java/org/apache/commons/net/io/CopyStreamListener.java
+++ b/src/main/java/org/apache/commons/net/io/CopyStreamListener.java
@@ -48,7 +48,7 @@ public interface CopyStreamListener extends EventListener
* @param event The CopyStreamEvent fired by the copying of a block of
* bytes.
*/
- public void bytesTransferred(CopyStreamEvent event);
+ void bytesTransferred(CopyStreamEvent event);
/**
@@ -64,7 +64,7 @@ public interface CopyStreamListener extends EventListener
* This may be equal to CopyStreamEvent.UNKNOWN_STREAM_SIZE if
* the size is unknown.
*/
- public void bytesTransferred(long totalBytesTransferred,
+ void bytesTransferred(long totalBytesTransferred,
int bytesTransferred,
long streamSize);
}
diff --git a/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java b/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
index 80df25f..f825b13 100644
--- a/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
+++ b/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
@@ -59,7 +59,7 @@ public final class FromNetASCIIInputStream extends PushbackInputStream
* @return True if the NETASCII line separator differs from the local
* system line separator, false if they are the same.
***/
- public static final boolean isConversionRequired()
+ public static boolean isConversionRequired()
{
return !_noConversionRequired;
}
diff --git a/src/main/java/org/apache/commons/net/io/Util.java b/src/main/java/org/apache/commons/net/io/Util.java
index 2cd3661..32b0e68 100644
--- a/src/main/java/org/apache/commons/net/io/Util.java
+++ b/src/main/java/org/apache/commons/net/io/Util.java
@@ -87,7 +87,7 @@ public final class Util
* the CopyStreamException getTotalBytesTransferred() and
* getIOException() methods.
***/
- public static final long copyStream(final InputStream source, final OutputStream dest,
+ public static long copyStream(final InputStream source, final OutputStream dest,
final int bufferSize, final long streamSize,
final CopyStreamListener listener,
final boolean flush)
@@ -175,7 +175,7 @@ public final class Util
* the CopyStreamException getTotalBytesTransferred() and
* getIOException() methods.
***/
- public static final long copyStream(final InputStream source, final OutputStream dest,
+ public static long copyStream(final InputStream source, final OutputStream dest,
final int bufferSize, final long streamSize,
final CopyStreamListener listener)
throws CopyStreamException
@@ -207,7 +207,7 @@ public final class Util
* the CopyStreamException getTotalBytesTransferred() and
* getIOException() methods.
***/
- public static final long copyStream(final InputStream source, final OutputStream dest,
+ public static long copyStream(final InputStream source, final OutputStream dest,
final int bufferSize)
throws CopyStreamException
{
@@ -223,7 +223,7 @@ public final class Util
* @return number of bytes copied
* @throws CopyStreamException on error
***/
- public static final long copyStream(final InputStream source, final OutputStream dest)
+ public static long copyStream(final InputStream source, final OutputStream dest)
throws CopyStreamException
{
return copyStream(source, dest, DEFAULT_COPY_BUFFER_SIZE);
@@ -263,7 +263,7 @@ public final class Util
* the CopyStreamException getTotalBytesTransferred() and
* getIOException() methods.
***/
- public static final long copyReader(final Reader source, final Writer dest,
+ public static long copyReader(final Reader source, final Writer dest,
final int bufferSize, final long streamSize,
final CopyStreamListener listener)
throws CopyStreamException
@@ -332,7 +332,7 @@ public final class Util
* the CopyStreamException getTotalBytesTransferred() and
* getIOException() methods.
***/
- public static final long copyReader(final Reader source, final Writer dest,
+ public static long copyReader(final Reader source, final Writer dest,
final int bufferSize)
throws CopyStreamException
{
@@ -348,7 +348,7 @@ public final class Util
* @return number of bytes copied
* @throws CopyStreamException on error
***/
- public static final long copyReader(final Reader source, final Writer dest)
+ public static long copyReader(final Reader source, final Writer dest)
throws CopyStreamException
{
return copyReader(source, dest, DEFAULT_COPY_BUFFER_SIZE);
diff --git a/src/main/java/org/apache/commons/net/nntp/NNTPCommand.java b/src/main/java/org/apache/commons/net/nntp/NNTPCommand.java
index f98e655..8a9e219 100644
--- a/src/main/java/org/apache/commons/net/nntp/NNTPCommand.java
+++ b/src/main/java/org/apache/commons/net/nntp/NNTPCommand.java
@@ -63,7 +63,7 @@ public final class NNTPCommand
* @return The NNTP protcol command string corresponding to a specified
* command code.
***/
- public static final String getCommand(final int command)
+ public static String getCommand(final int command)
{
return _commands[command];
}
diff --git a/src/main/java/org/apache/commons/net/nntp/Threadable.java b/src/main/java/org/apache/commons/net/nntp/Threadable.java
index 2a28512..aeb408e 100644
--- a/src/main/java/org/apache/commons/net/nntp/Threadable.java
+++ b/src/main/java/org/apache/commons/net/nntp/Threadable.java
@@ -23,12 +23,12 @@ package org.apache.commons.net.nntp;
*
*/
public interface Threadable {
- public boolean isDummy();
- public String messageThreadId();
- public String[] messageThreadReferences();
- public String simplifiedSubject();
- public boolean subjectIsReply();
- public void setChild(Threadable child);
- public void setNext(Threadable next);
- public Threadable makeDummy();
+ boolean isDummy();
+ String messageThreadId();
+ String[] messageThreadReferences();
+ String simplifiedSubject();
+ boolean subjectIsReply();
+ void setChild(Threadable child);
+ void setNext(Threadable next);
+ Threadable makeDummy();
}
diff --git a/src/main/java/org/apache/commons/net/ntp/NtpV3Packet.java b/src/main/java/org/apache/commons/net/ntp/NtpV3Packet.java
index adfe370..fc327a6 100644
--- a/src/main/java/org/apache/commons/net/ntp/NtpV3Packet.java
+++ b/src/main/java/org/apache/commons/net/ntp/NtpV3Packet.java
@@ -30,95 +30,95 @@ public interface NtpV3Packet
/**
* Standard NTP UDP port
*/
- public static final int NTP_PORT = 123;
+ int NTP_PORT = 123;
- public static final int LI_NO_WARNING = 0;
- public static final int LI_LAST_MINUTE_HAS_61_SECONDS = 1;
- public static final int LI_LAST_MINUTE_HAS_59_SECONDS = 2;
- public static final int LI_ALARM_CONDITION = 3;
+ int LI_NO_WARNING = 0;
+ int LI_LAST_MINUTE_HAS_61_SECONDS = 1;
+ int LI_LAST_MINUTE_HAS_59_SECONDS = 2;
+ int LI_ALARM_CONDITION = 3;
/* mode options */
- public static final int MODE_RESERVED = 0;
- public static final int MODE_SYMMETRIC_ACTIVE = 1;
- public static final int MODE_SYMMETRIC_PASSIVE = 2;
- public static final int MODE_CLIENT = 3;
- public static final int MODE_SERVER = 4;
- public static final int MODE_BROADCAST = 5;
- public static final int MODE_CONTROL_MESSAGE = 6;
- public static final int MODE_PRIVATE = 7;
+ int MODE_RESERVED = 0;
+ int MODE_SYMMETRIC_ACTIVE = 1;
+ int MODE_SYMMETRIC_PASSIVE = 2;
+ int MODE_CLIENT = 3;
+ int MODE_SERVER = 4;
+ int MODE_BROADCAST = 5;
+ int MODE_CONTROL_MESSAGE = 6;
+ int MODE_PRIVATE = 7;
- public static final int NTP_MINPOLL = 4; // 16 seconds
- public static final int NTP_MAXPOLL = 14; // 16284 seconds
+ int NTP_MINPOLL = 4; // 16 seconds
+ int NTP_MAXPOLL = 14; // 16284 seconds
- public static final int NTP_MINCLOCK = 1;
- public static final int NTP_MAXCLOCK = 10;
+ int NTP_MINCLOCK = 1;
+ int NTP_MAXCLOCK = 10;
- public static final int VERSION_3 = 3;
- public static final int VERSION_4 = 4;
+ int VERSION_3 = 3;
+ int VERSION_4 = 4;
/* possible getType values such that other time-related protocols can
* have its information represented as NTP packets
*/
- public static final String TYPE_NTP = "NTP"; // RFC-1305/2030
- public static final String TYPE_ICMP = "ICMP"; // RFC-792
- public static final String TYPE_TIME = "TIME"; // RFC-868
- public static final String TYPE_DAYTIME = "DAYTIME"; // RFC-867
+ String TYPE_NTP = "NTP"; // RFC-1305/2030
+ String TYPE_ICMP = "ICMP"; // RFC-792
+ String TYPE_TIME = "TIME"; // RFC-868
+ String TYPE_DAYTIME = "DAYTIME"; // RFC-867
/**
* @return a datagram packet with the NTP parts already filled in
*/
- public DatagramPacket getDatagramPacket();
+ DatagramPacket getDatagramPacket();
/**
* Set the contents of this object from the datagram packet
* @param dp the packet
*/
- public void setDatagramPacket(DatagramPacket dp);
+ void setDatagramPacket(DatagramPacket dp);
/**
* @return leap indicator as defined in RFC-1305
*/
- public int getLeapIndicator();
+ int getLeapIndicator();
/**
* Set leap indicator.
* @param li - leap indicator code
*/
- public void setLeapIndicator(int li);
+ void setLeapIndicator(int li);
/**
* @return mode as defined in RFC-1305
*/
- public int getMode();
+ int getMode();
/**
* @return mode as human readable string; e.g. 3=Client
*/
- public String getModeName();
+ String getModeName();
/**
* Set mode as defined in RFC-1305
* @param mode the mode to set
*/
- public void setMode(int mode);
+ void setMode(int mode);
/**
* @return poll interval as defined in RFC-1305.
* Field range between NTP_MINPOLL and NTP_MAXPOLL.
*/
- public int getPoll();
+ int getPoll();
/**
* Set poll interval as defined in RFC-1305.
* Field range between NTP_MINPOLL and NTP_MAXPOLL.
* @param poll the interval to set
*/
- public void setPoll(int poll);
+ void setPoll(int poll);
/**
* @return precision as defined in RFC-1305
*/
- public int getPrecision();
+ int getPrecision();
/**
* Set precision as defined in RFC-1305
@@ -130,7 +130,7 @@ public interface NtpV3Packet
/**
* @return root delay as defined in RFC-1305
*/
- public int getRootDelay();
+ int getRootDelay();
/**
* Set root delay as defined in RFC-1305
@@ -142,12 +142,12 @@ public interface NtpV3Packet
/**
* @return root delay in milliseconds
*/
- public double getRootDelayInMillisDouble();
+ double getRootDelayInMillisDouble();
/**
* @return root dispersion as defined in RFC-1305
*/
- public int getRootDispersion();
+ int getRootDispersion();
/**
*
@@ -159,94 +159,94 @@ public interface NtpV3Packet
/**
* @return root dispersion in milliseconds
*/
- public long getRootDispersionInMillis();
+ long getRootDispersionInMillis();
/**
* @return root dispersion in milliseconds
*/
- public double getRootDispersionInMillisDouble();
+ double getRootDispersionInMillisDouble();
/**
* @return version as defined in RFC-1305
*/
- public int getVersion();
+ int getVersion();
/**
* Set version as defined in RFC-1305
* @param version the version to set
*/
- public void setVersion(int version);
+ void setVersion(int version);
/**
* @return stratum as defined in RFC-1305
*/
- public int getStratum();
+ int getStratum();
/**
* Set stratum as defined in RFC-1305
* @param stratum the stratum to set
*/
- public void setStratum(int stratum);
+ void setStratum(int stratum);
/**
* @return the reference id string
*/
- public String getReferenceIdString();
+ String getReferenceIdString();
/**
* @return the reference id (32-bit code) as defined in RFC-1305
*/
- public int getReferenceId();
+ int getReferenceId();
/**
* Set reference clock identifier field.
* @param refId the clock id field to set
*/
- public void setReferenceId(int refId);
+ void setReferenceId(int refId);
/**
* @return the transmit timestamp as defined in RFC-1305
*/
- public TimeStamp getTransmitTimeStamp();
+ TimeStamp getTransmitTimeStamp();
/**
* @return the reference time as defined in RFC-1305
*/
- public TimeStamp getReferenceTimeStamp();
+ TimeStamp getReferenceTimeStamp();
/**
* @return the originate time as defined in RFC-1305
*/
- public TimeStamp getOriginateTimeStamp();
+ TimeStamp getOriginateTimeStamp();
/**
* @return the receive time as defined in RFC-1305
*/
- public TimeStamp getReceiveTimeStamp();
+ TimeStamp getReceiveTimeStamp();
/**
* Set the transmit timestamp given NTP TimeStamp object.
* @param ts - timestamp
*/
- public void setTransmitTime(TimeStamp ts);
+ void setTransmitTime(TimeStamp ts);
/**
* Set the reference timestamp given NTP TimeStamp object.
* @param ts - timestamp
*/
- public void setReferenceTime(TimeStamp ts);
+ void setReferenceTime(TimeStamp ts);
/**
* Set originate timestamp given NTP TimeStamp object.
* @param ts - timestamp
*/
- public void setOriginateTimeStamp(TimeStamp ts);
+ void setOriginateTimeStamp(TimeStamp ts);
/**
* Set receive timestamp given NTP TimeStamp object.
* @param ts - timestamp
*/
- public void setReceiveTimeStamp(TimeStamp ts);
+ void setReceiveTimeStamp(TimeStamp ts);
/**
* Return type of time packet. The values (e.g. NTP, TIME, ICMP, ...)
@@ -254,6 +254,6 @@ public interface NtpV3Packet
*
* @return packet type string identifier
*/
- public String getType();
+ String getType();
}
diff --git a/src/main/java/org/apache/commons/net/pop3/ExtendedPOP3Client.java b/src/main/java/org/apache/commons/net/pop3/ExtendedPOP3Client.java
index 95b6c86..39725b4 100644
--- a/src/main/java/org/apache/commons/net/pop3/ExtendedPOP3Client.java
+++ b/src/main/java/org/apache/commons/net/pop3/ExtendedPOP3Client.java
@@ -124,7 +124,7 @@ public class ExtendedPOP3Client extends POP3SClient
/**
* The enumeration of currently-supported authentication methods.
*/
- public static enum AUTH_METHOD
+ public enum AUTH_METHOD
{
/** The standarised (RFC4616) PLAIN method, which sends the password unencrypted (insecure). */
PLAIN("PLAIN"),
diff --git a/src/main/java/org/apache/commons/net/pop3/POP3Command.java b/src/main/java/org/apache/commons/net/pop3/POP3Command.java
index 5db2acd..a378b13 100644
--- a/src/main/java/org/apache/commons/net/pop3/POP3Command.java
+++ b/src/main/java/org/apache/commons/net/pop3/POP3Command.java
@@ -83,7 +83,7 @@ public final class POP3Command
*
* @return The POP3 protocol string command corresponding to a command code.
***/
- public static final String getCommand(final int command)
+ public static String getCommand(final int command)
{
return _commands[command];
}
diff --git a/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java b/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java
index d812da1..62f895a 100644
--- a/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java
+++ b/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java
@@ -290,7 +290,7 @@ public class AuthenticatingSMTPClient extends SMTPSClient
/**
* The enumeration of currently-supported authentication methods.
*/
- public static enum AUTH_METHOD
+ public enum AUTH_METHOD
{
/** The standarised (RFC4616) PLAIN method, which sends the password unencrypted (insecure). */
PLAIN,
diff --git a/src/main/java/org/apache/commons/net/smtp/SMTPCommand.java b/src/main/java/org/apache/commons/net/smtp/SMTPCommand.java
index 853e8f8..ef31979 100644
--- a/src/main/java/org/apache/commons/net/smtp/SMTPCommand.java
+++ b/src/main/java/org/apache/commons/net/smtp/SMTPCommand.java
@@ -101,7 +101,7 @@ public final class SMTPCommand
* @return The SMTP protcol command string corresponding to a specified
* command code.
***/
- public static final String getCommand(final int command)
+ public static String getCommand(final int command)
{
return _commands[command];
}
diff --git a/src/main/java/org/apache/commons/net/telnet/TelnetCommand.java b/src/main/java/org/apache/commons/net/telnet/TelnetCommand.java
index ac4b06e..003a3a5 100644
--- a/src/main/java/org/apache/commons/net/telnet/TelnetCommand.java
+++ b/src/main/java/org/apache/commons/net/telnet/TelnetCommand.java
@@ -108,7 +108,7 @@ public final class TelnetCommand
* @param code The command code of the telnet protocol command.
* @return The string representation of the telnet protocol command.
***/
- public static final String getCommand(final int code)
+ public static String getCommand(final int code)
{
return __commandString[__FIRST_COMMAND - code];
}
@@ -120,7 +120,7 @@ public final class TelnetCommand
* @param code The command code to test.
* @return True if the command code is valid, false if not.
**/
- public static final boolean isValidCommand(final int code)
+ public static boolean isValidCommand(final int code)
{
return (code <= __FIRST_COMMAND && code >= __LAST_COMMAND);
}
diff --git a/src/main/java/org/apache/commons/net/telnet/TelnetInputListener.java b/src/main/java/org/apache/commons/net/telnet/TelnetInputListener.java
index 34bb2b6..afeeeb7 100644
--- a/src/main/java/org/apache/commons/net/telnet/TelnetInputListener.java
+++ b/src/main/java/org/apache/commons/net/telnet/TelnetInputListener.java
@@ -33,5 +33,5 @@ public interface TelnetInputListener
*
* @see TelnetClient#registerInputListener
***/
- public void telnetInputAvailable();
+ void telnetInputAvailable();
}
diff --git a/src/main/java/org/apache/commons/net/telnet/TelnetNotificationHandler.java b/src/main/java/org/apache/commons/net/telnet/TelnetNotificationHandler.java
index 19446dd..bf5f03d 100644
--- a/src/main/java/org/apache/commons/net/telnet/TelnetNotificationHandler.java
+++ b/src/main/java/org/apache/commons/net/telnet/TelnetNotificationHandler.java
@@ -32,28 +32,28 @@ public interface TelnetNotificationHandler
/***
* The remote party sent a DO command.
***/
- public static final int RECEIVED_DO = 1;
+ int RECEIVED_DO = 1;
/***
* The remote party sent a DONT command.
***/
- public static final int RECEIVED_DONT = 2;
+ int RECEIVED_DONT = 2;
/***
* The remote party sent a WILL command.
***/
- public static final int RECEIVED_WILL = 3;
+ int RECEIVED_WILL = 3;
/***
* The remote party sent a WONT command.
***/
- public static final int RECEIVED_WONT = 4;
+ int RECEIVED_WONT = 4;
/***
* The remote party sent a COMMAND.
* @since 2.2
***/
- public static final int RECEIVED_COMMAND = 5;
+ int RECEIVED_COMMAND = 5;
/***
* Callback method called when TelnetClient receives an
@@ -64,5 +64,5 @@ public interface TelnetNotificationHandler
*
* @param option_code - code of the option negotiated, or the command code itself (e.g. NOP).
***/
- public void receivedNegotiation(int negotiation_code, int option_code);
+ void receivedNegotiation(int negotiation_code, int option_code);
}
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPServer.java b/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
index edc4c82..8861faf 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
@@ -84,7 +84,7 @@ import org.apache.commons.net.io.ToNetASCIIInputStream;
public class TFTPServer implements Runnable
{
private static final int DEFAULT_TFTP_PORT = 69;
- public static enum ServerMode { GET_ONLY, PUT_ONLY, GET_AND_PUT; }
+ public enum ServerMode { GET_ONLY, PUT_ONLY, GET_AND_PUT; }
private final HashSet<TFTPTransfer> transfers_ = new HashSet<>();
private volatile boolean shutdownServer = false;