diff --git a/src/main/java/com/beust/jcommander/JCommander.java b/src/main/java/com/beust/jcommander/JCommander.java index d4cb853a..12a50d01 100644 --- a/src/main/java/com/beust/jcommander/JCommander.java +++ b/src/main/java/com/beust/jcommander/JCommander.java @@ -587,7 +587,7 @@ private List readFile(String fileName) { // Read through file one line at time. Print line # and line while ((line = bufRead.readLine()) != null) { // Allow empty lines and # comments in these at files - if (line.length() > 0 && !line.trim().startsWith("#")) { + if (!line.isEmpty() && !line.trim().startsWith("#")) { result.addAll(Arrays.asList(line.split("\\s"))); } }