You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ad...@apache.org on 2017/12/18 19:35:09 UTC

[33/50] [abbrv] james-project git commit: JAMES-2199 Increment lineNumber with each line read

JAMES-2199 Increment lineNumber with each line read


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/ce765509
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/ce765509
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/ce765509

Branch: refs/heads/master
Commit: ce76550936b87f096107c0bafd9cba427cdc1d2c
Parents: 8f47a5b
Author: Daniel Trebbien <dt...@gmail.com>
Authored: Fri Oct 20 14:52:48 2017 -0500
Committer: Antoine Duprat <ad...@linagora.com>
Committed: Mon Dec 18 20:31:53 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/james/mailbox/maildir/MaildirFolder.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ce765509/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirFolder.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirFolder.java b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirFolder.java
index 378e33f..980944a 100644
--- a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirFolder.java
+++ b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirFolder.java
@@ -631,13 +631,13 @@ public class MaildirFolder {
             if (line != null)
                 readUidListHeader(line);
             int lineNumber = 1;
-            while ((line = reader.readLine()) != null) {
+            for (; (line = reader.readLine()) != null; lineNumber++) {
                 if (!line.equals("")) {
                     int gap = line.indexOf(" ");
 
                     if (gap == -1) {
                         // there must be some issues in the file if no gap can be found
-                    	LOGGER.info("Corrupted entry in uid-file {} line {}", uidList, lineNumber++);
+                    	LOGGER.info("Corrupted entry in uid-file {} line {}", uidList, lineNumber);
                         continue;
                     }
                     
@@ -857,11 +857,11 @@ public class MaildirFolder {
                 ArrayList<String> lines = new ArrayList<>();
                 String line;
                 int lineNumber = 1;
-                while ((line = reader.readLine()) != null) {
+                for (; (line = reader.readLine()) != null; lineNumber++) {
                     int gap = line.indexOf(" ");
                     if (gap == -1) {
                         // there must be some issues in the file if no gap can be found
-                        LOGGER.info("Corrupted entry in uid-file {} line {}", uidList, lineNumber++);
+                        LOGGER.info("Corrupted entry in uid-file {} line {}", uidList, lineNumber);
                         continue;
                     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org