diff --git a/src/net/sourceforge/plantuml/project/IncompleteItem.java b/src/net/sourceforge/plantuml/project/IncompleteItem.java index 80e821281..da71ea51b 100644 --- a/src/net/sourceforge/plantuml/project/IncompleteItem.java +++ b/src/net/sourceforge/plantuml/project/IncompleteItem.java @@ -60,7 +60,7 @@ class IncompleteItem implements Item { if (caract.getNumericType() != value.getNumericType()) { throw new IllegalArgumentException(); } - if (data.containsKey(caract.getNumericType())) { + if (data.containsKey(caract)) { throw new IllegalStateException(); } data.put(caract, value); diff --git a/src/net/sourceforge/plantuml/stats/HumanDuration.java b/src/net/sourceforge/plantuml/stats/HumanDuration.java index 3bebcfda1..85ddc6da0 100644 --- a/src/net/sourceforge/plantuml/stats/HumanDuration.java +++ b/src/net/sourceforge/plantuml/stats/HumanDuration.java @@ -45,9 +45,7 @@ class HumanDuration { @Override public String toString() { - long time = duration; - final long ms = time % 1000L; - time = time / 1000; + long time = duration / 1000; final long sec = time % 60; time = time / 60; final long min = time % 60; @@ -55,15 +53,15 @@ class HumanDuration { final long hour = time % 24; final long day = time / 24; if (day > 0) { - return String.format("%dd %02dh%02dm%02ds", day, hour, min, sec, ms); + return String.format("%dd %02dh%02dm%02ds", day, hour, min, sec); } if (hour > 0) { - return String.format("%dh%02dm%02ds", hour, min, sec, ms); + return String.format("%dh%02dm%02ds", hour, min, sec); } if (min > 0) { - return String.format("%dm%02ds", min, sec, ms); + return String.format("%dm%02ds", min, sec); } - return String.format("%ds", sec, ms); + return String.format("%ds", sec); } } diff --git a/src/net/sourceforge/plantuml/suggest/SuggestEngineResult.java b/src/net/sourceforge/plantuml/suggest/SuggestEngineResult.java index 16cf41202..30ac3b990 100644 --- a/src/net/sourceforge/plantuml/suggest/SuggestEngineResult.java +++ b/src/net/sourceforge/plantuml/suggest/SuggestEngineResult.java @@ -71,13 +71,7 @@ public class SuggestEngineResult { } private static boolean sameString(String a, String b) { - if (a == null && b == null) { - return true; - } - if (a != null || b != null) { - return false; - } - return a.equals(b); + return (a == null && b == null) || (a != null && a.equals(b)); } public SuggestEngineResult(String suggestedLine) {