# HG changeset patch # User Pavel Tisnovsky # Date 1337871309 -7200 # Node ID 8d326a855021a4a843fa92863687ccdfcd811d0d # Parent b6c8372f572305badccf7f71dd1d8c6f2ad428ef * src/ReportGenerator.java: Fixed an exception occuring when class list contains an empty line (usually at the end of file). diff -r b6c8372f5723 -r 8d326a855021 ChangeLog --- a/ChangeLog Wed May 16 10:59:45 2012 +0200 +++ b/ChangeLog Thu May 24 16:55:09 2012 +0200 @@ -1,3 +1,10 @@ +2012-05-24 Pavel Tisnovsky + + * src/ReportGenerator.java: + Fixed an exception occuring when class list + contains an empty line (usually at the end + of file). + 2012-05-16 Pavel Tisnovsky * src/ClassInfo.java: diff -r b6c8372f5723 -r 8d326a855021 src/ReportGenerator.java --- a/src/ReportGenerator.java Wed May 16 10:59:45 2012 +0200 +++ b/src/ReportGenerator.java Thu May 24 16:55:09 2012 +0200 @@ -71,7 +71,15 @@ // set of classes should be sorted Set allClasses = new TreeSet(); // add all lines read from a file to a set (and sort them) - allClasses.addAll(fileContent); + // we have to exclude all empty lines + for (String className : fileContent) + { + // add only non empty lines + if (className != null && !className.trim().isEmpty()) + { + allClasses.add(className.trim()); + } + } return allClasses; }