diff --git a/src/fr/devinsy/logar/app/Logar.java b/src/fr/devinsy/logar/app/Logar.java index b18cfc8..620388e 100644 --- a/src/fr/devinsy/logar/app/Logar.java +++ b/src/fr/devinsy/logar/app/Logar.java @@ -351,13 +351,13 @@ public final class Logar { System.out.println("== Check sort for [" + file.getName() + "]"); LocalDateTime currentDate = null; - int count = 0; + int lineCount = 0; int badLineCount = 0; - int badGroupCount = 0; LineIterator iterator = new LineIterator(file); while (iterator.hasNext()) { String line = iterator.next(); + lineCount += 1; LocalDateTime date = getLogDate(line); if (currentDate == null) { @@ -365,34 +365,13 @@ public final class Logar } else if (date.isBefore(currentDate)) { - count += 1; + System.out.println(String.format("detected line: %d %s", lineCount, currentDate.toString())); + badLineCount += 1; } - else - { - currentDate = date; - - if (count != 0) - { - System.out.println(String.format("detected lines: %d %s", count, currentDate.toString())); - - badLineCount += count; - badGroupCount += 1; - count = 0; - } - } - } - if (count != 0) - { - System.out.println(String.format("detected lines: %d %s", count, currentDate.toString())); - - badLineCount += count; - badGroupCount += 1; - count = 0; } if (badLineCount > 0) { - System.out.println("Bad group count: " + badGroupCount); System.out.println("Bad line count: " + badLineCount); } }