Merged bug fix from Stable into Unstable

This commit is contained in:
Christopher Hartl 2011-11-09 15:29:14 -05:00
commit 85bffe1dca
1 changed files with 2 additions and 2 deletions

View File

@ -89,10 +89,10 @@ public class TableCodec implements ReferenceDependentFeatureCodec {
boolean isFirst = true; boolean isFirst = true;
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
System.out.println(line); System.out.println(line);
if ( isFirst && ! line.startsWith(headerDelimiter) ) { if ( isFirst && ! line.startsWith(headerDelimiter) && ! line.startsWith(commentDelimiter)) {
throw new UserException.MalformedFile("TableCodec file does not have a header"); throw new UserException.MalformedFile("TableCodec file does not have a header");
} }
isFirst &= false; isFirst &= line.startsWith(commentDelimiter);
if (line.startsWith(headerDelimiter)) { if (line.startsWith(headerDelimiter)) {
if (header.size() > 0) throw new IllegalStateException("Input table file seems to have two header lines. The second is = " + line); if (header.size() > 0) throw new IllegalStateException("Input table file seems to have two header lines. The second is = " + line);
String spl[] = line.split(delimiterRegex); String spl[] = line.split(delimiterRegex);