From da464b82717f53e87d5017941041f3e9242767e8 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sat, 4 May 2024 15:50:47 -0400 Subject: [PATCH] Add Checkstyle rules --- src/conf/checkstyle.xml | 18 +++--------------- .../net/examples/mail/IMAPExportMbox.java | 2 +- .../commons/net/examples/unix/rexec.java | 3 ++- .../commons/net/examples/unix/rlogin.java | 3 ++- .../commons/net/examples/unix/rshell.java | 3 ++- .../net/ftp/parser/MLSxEntryParser.java | 2 +- .../net/ftp/parser/MVSFTPEntryParser.java | 2 +- 7 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/conf/checkstyle.xml b/src/conf/checkstyle.xml index c3e029339..407714a92 100644 --- a/src/conf/checkstyle.xml +++ b/src/conf/checkstyle.xml @@ -19,20 +19,16 @@ limitations under the License. - - - - @@ -40,18 +36,15 @@ limitations under the License. - - - @@ -59,13 +52,10 @@ limitations under the License. - - - @@ -73,14 +63,11 @@ limitations under the License. - - - diff --git a/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java b/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java index fa54cf56d..18cfa9cc3 100644 --- a/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java +++ b/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java @@ -129,7 +129,7 @@ public boolean chunkReceived(final IMAP imap) { final String line = replyStrings[i]; if (line.startsWith("Return-Path: ")) { final String[] parts = line.split(" ", 2); - if (!parts[1].equals("<>")) {// Don't replace default with blank + if (!parts[1].equals("<>")) { // Don't replace default with blank replyTo = parts[1]; if (replyTo.startsWith("<")) { if (replyTo.endsWith(">")) { diff --git a/src/main/java/org/apache/commons/net/examples/unix/rexec.java b/src/main/java/org/apache/commons/net/examples/unix/rexec.java index ec159054d..602887da4 100644 --- a/src/main/java/org/apache/commons/net/examples/unix/rexec.java +++ b/src/main/java/org/apache/commons/net/examples/unix/rexec.java @@ -63,7 +63,8 @@ public static void main(final String[] args) { try { client.disconnect(); } catch (final IOException f) { - /* ignored */} + /* ignored */ + } e.printStackTrace(); System.err.println("Could not execute command."); System.exit(1); diff --git a/src/main/java/org/apache/commons/net/examples/unix/rlogin.java b/src/main/java/org/apache/commons/net/examples/unix/rlogin.java index 4293cc6d7..83a6aa18b 100644 --- a/src/main/java/org/apache/commons/net/examples/unix/rlogin.java +++ b/src/main/java/org/apache/commons/net/examples/unix/rlogin.java @@ -70,7 +70,8 @@ public static void main(final String[] args) { try { client.disconnect(); } catch (final IOException f) { - /* ignored */} + /* ignored */ + } e.printStackTrace(); System.err.println("rlogin authentication failed."); System.exit(1); diff --git a/src/main/java/org/apache/commons/net/examples/unix/rshell.java b/src/main/java/org/apache/commons/net/examples/unix/rshell.java index 0ed9fb493..462ce6edb 100644 --- a/src/main/java/org/apache/commons/net/examples/unix/rshell.java +++ b/src/main/java/org/apache/commons/net/examples/unix/rshell.java @@ -65,7 +65,8 @@ public static void main(final String[] args) { try { client.disconnect(); } catch (final IOException f) { - /* ignored */} + /* ignored */ + } e.printStackTrace(); System.err.println("Could not execute command."); System.exit(1); diff --git a/src/main/java/org/apache/commons/net/ftp/parser/MLSxEntryParser.java b/src/main/java/org/apache/commons/net/ftp/parser/MLSxEntryParser.java index 0687b5ff9..73a51c27c 100644 --- a/src/main/java/org/apache/commons/net/ftp/parser/MLSxEntryParser.java +++ b/src/main/java/org/apache/commons/net/ftp/parser/MLSxEntryParser.java @@ -184,7 +184,7 @@ private void doUnixPerms(final FTPFile file, final String valueLowerCase) { @Override public FTPFile parseFTPEntry(final String entry) { - if (entry.startsWith(" ")) {// leading space means no facts are present + if (entry.startsWith(" ")) { // leading space means no facts are present if (entry.length() > 1) { // is there a path name? final FTPFile file = new FTPFile(); file.setRawListing(entry); diff --git a/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java b/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java index fc2bdb563..e0ec87ff4 100644 --- a/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java +++ b/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java @@ -462,7 +462,7 @@ public List preParse(final List orig) { } else if (header.indexOf("Spool Files") >= 30) { setType(JES_LEVEL_1_LIST_TYPE); super.setRegex(JES_LEVEL_1_LIST_REGEX); - } else if (header.startsWith("JOBNAME") && header.indexOf("JOBID") > 8) {// header contains JOBNAME JOBID OWNER // STATUS CLASS + } else if (header.startsWith("JOBNAME") && header.indexOf("JOBID") > 8) { // header contains JOBNAME JOBID OWNER // STATUS CLASS setType(JES_LEVEL_2_LIST_TYPE); super.setRegex(JES_LEVEL_2_LIST_REGEX); } else {