Skip to content

Commit 078c17d

Browse files
committed
Merge some string literals
1 parent 200dccd commit 078c17d

File tree

7 files changed

+14
-11
lines changed

7 files changed

+14
-11
lines changed

src/main/java/org/apache/commons/net/examples/Main.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ public static void main(final String[] args) throws Throwable {
5656
if (args.length == 0) {
5757
if (Thread.currentThread().getStackTrace().length > 2) { // called by Maven
5858
System.out.println(
59-
"Usage: mvn -q exec:java -Dexec.arguments=<alias or" + " exampleClass>,<exampleClass parameters> (comma-separated, no spaces)");
60-
System.out.println("Or : mvn -q exec:java -Dexec.args=\"<alias" + " or exampleClass> <exampleClass parameters>\" (space separated)");
59+
"Usage: mvn -q exec:java -Dexec.arguments=<alias or exampleClass>,<exampleClass parameters> (comma-separated, no spaces)");
60+
System.out.println("Or : mvn -q exec:java -Dexec.args=\"<alias or exampleClass> <exampleClass parameters>\" (space separated)");
6161
} else if (fromJar()) {
6262
System.out.println("Usage: java -jar commons-net-examples-m.n.jar <alias or exampleClass> <exampleClass parameters>");
6363
} else {
6464
System.out
65-
.println("Usage: java -cp target/classes org.apache.commons.net.examples.Main" + " <alias or exampleClass> <exampleClass parameters>");
65+
.println("Usage: java -cp target/classes org.apache.commons.net.examples.Main <alias or exampleClass> <exampleClass parameters>");
6666
}
6767
@SuppressWarnings("unchecked") // property names are Strings
6868
final List<String> l = (List<String>) Collections.list(fp.propertyNames());

src/main/java/org/apache/commons/net/examples/ftp/FTPClientExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public final class FTPClientExample {
7979
+ "\t-U - save unparseable responses\n"
8080
+ "\t-w msec - wait time for keep-alive reply (setControlKeepAliveReplyTimeout)\n"
8181
+ "\t-T all|valid|none - use one of the built-in TrustManager implementations (none = JVM default)\n"
82-
+ "\t-y format - set default date format string\n"
82+
+ "\t-y format - set default date format string\n"
8383
+ "\t-Y format - set recent date format string\n"
8484
+ "\t-Z timezone - set the server time zone for parsing LIST responses\n"
8585
+ "\t-z timezone - set the time zone for displaying MDTM, LIST, MLSD, MLST responses\n"

src/main/java/org/apache/commons/net/examples/ftp/TFTPExample.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
*/
4343
public final class TFTPExample {
4444
// @formatter:off
45-
static final String USAGE = "Usage: TFTPExample [options] hostname localfile remotefile\n\n"
45+
static final String USAGE = "Usage: TFTPExample [options] hostname localfile remotefile\n\n"
4646
+ "hostname - The name of the remote host [:port]\n"
47-
+ "localfile - The name of the local file to send or the name to use for\n"
47+
+ "localfile - The name of the local file to send or the name to use for\n"
4848
+ "\tthe received file\n"
49-
+ "remotefile - The name of the remote file to receive or the name for\n"
49+
+ "remotefile - The name of the remote file to receive or the name for\n"
5050
+ "\tthe remote server to use to name the local file being sent.\n\n"
5151
+ "options: (The default is to assume -r -b)\n"
5252
+ "\t-t timeout in seconds (default 60s)\n"

src/main/java/org/apache/commons/net/examples/mail/IMAPImportMbox.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static void main(final String[] args) throws IOException {
8585
if (args.length < 2) {
8686
System.err.println("Usage: IMAPImportMbox imap[s]://user:password@host[:port]/folder/path <mboxfile> [selectors]");
8787
System.err
88-
.println("\tWhere: a selector is a list of numbers/number ranges - 1,2,3-10" + " - or a list of strings to match in the initial From line");
88+
.println("\tWhere: a selector is a list of numbers/number ranges - 1,2,3-10 - or a list of strings to match in the initial From line");
8989
System.exit(1);
9090
}
9191

src/main/java/org/apache/commons/net/examples/ntp/NTPClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static void processResponse(final TimeInfo info) {
101101
System.out.println(" mode: " + message.getModeName() + " (" + message.getMode() + ")");
102102
final int poll = message.getPoll();
103103
// poll value typically btwn MINPOLL (4) and MAXPOLL (14)
104-
System.out.println(" poll: " + (poll <= 0 ? 1 : (int) Math.pow(2, poll)) + " seconds" + " (2 ** " + poll + ")");
104+
System.out.println(" poll: " + (poll <= 0 ? 1 : (int) Math.pow(2, poll)) + " seconds (2 ** " + poll + ")");
105105
final double disp = message.getRootDispersionInMillisDouble();
106106
System.out.println(" rootdelay=" + numberFormat.format(message.getRootDelayInMillisDouble()) + ", rootdispersion(ms): " + numberFormat.format(disp));
107107

src/main/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParser.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public class EnterpriseUnixFTPEntryParser extends RegexFTPFileEntryParserImpl {
4545
/**
4646
* this is the regular expression used by this parser.
4747
*/
48+
// @formatter:off
4849
private static final String REGEX = "(([\\-]|[A-Z])([\\-]|[A-Z])([\\-]|[A-Z])([\\-]|[A-Z])([\\-]|[A-Z])"
49-
+ "([\\-]|[A-Z])([\\-]|[A-Z])([\\-]|[A-Z])([\\-]|[A-Z])([\\-]|[A-Z]))" + "(\\S*)\\s*" // 12
50+
+ "([\\-]|[A-Z])([\\-]|[A-Z])([\\-]|[A-Z])([\\-]|[A-Z])([\\-]|[A-Z]))"
51+
+ "(\\S*)\\s*" // 12
5052
+ "(\\S+)\\s*" // 13
5153
+ "(\\S*)\\s*" // 14 user
5254
+ "(\\d*)\\s*" // 15 group
@@ -60,6 +62,7 @@ public class EnterpriseUnixFTPEntryParser extends RegexFTPFileEntryParserImpl {
6062
// 21 [01]\d or 2[0123] hour + ':'
6163
// 22 [012345]\d = minute
6264
+ "(\\S*)(\\s*.*)"; // 23 name
65+
// @formatter:on
6366

6467
/**
6568
* The sole constructor for a EnterpriseUnixFTPEntryParser object.

src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ public void setVersion(final int version) {
589589
*/
590590
@Override
591591
public String toString() {
592-
return "[" + "version:" + getVersion() + ", mode:" + getMode() + ", poll:" + getPoll() + ", precision:" + getPrecision() + ", delay:" + getRootDelay()
592+
return "[version:" + getVersion() + ", mode:" + getMode() + ", poll:" + getPoll() + ", precision:" + getPrecision() + ", delay:" + getRootDelay()
593593
+ ", dispersion(ms):" + getRootDispersionInMillisDouble() + ", id:" + getReferenceIdString() + ", xmitTime:"
594594
+ getTransmitTimeStamp().toDateString() + " ]";
595595
}

0 commit comments

Comments
 (0)