Skip to content

Commit

Permalink
Fix EOFException in CustomTokenizer #813
Browse files Browse the repository at this point in the history
  • Loading branch information
ignazio1977 committed Feb 18, 2019
1 parent b6cf6d8 commit e14adb0
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,18 @@ public Token getNextToken() {
default:
return readTextualToken(c);
}
} catch (@SuppressWarnings("unused") EOFException e) {
return makeToken(EOF, "");
} catch (IOException e) {
LOGGER.warn("Error reading from functional stream", e);
LOGGER.warn("IOException reading from functioanl stream", e);
return makeToken(EOF, "");
}
}
}

private void skipComment() throws IOException {
for (char c = readChar(); c != '\n'; c = readChar()) {
// read to end of line
}
}

Expand Down Expand Up @@ -107,7 +110,7 @@ private Token readFullIRI() {
}
}
} catch (IOException e) {
LOGGER.warn("Error reading from functional stream", e);
LOGGER.warn("IOException reading from functioanl stream", e);
return makeToken(ERROR, "<");
}
}
Expand Down Expand Up @@ -147,15 +150,12 @@ private Token readTextualToken(char input) throws IOException {
default:
buf.append(c);
}
} catch (EOFException e) {
LOGGER.trace("End of file reached", e);
} catch (@SuppressWarnings("unused") EOFException eof) {
break;
}
}
String s = buf.toString();
if (colonIndex >= 0) {
// System.out.println("colonIndex >=0 - so expect abbreviated IRI from "
// + buf);
if (colonIndex == s.length() - 1) {
return makeToken(PNAME_NS, s);
} else {
Expand Down

0 comments on commit e14adb0

Please sign in to comment.