close StringReader in parsePath

not sure there's any real need but technically correct
This commit is contained in:
Havoc Pennington 2011-11-10 15:36:11 -05:00
parent d46b068eaf
commit cfff60131e

View File

@ -512,9 +512,13 @@ final class Parser {
static Path parsePath(String path) {
StringReader reader = new StringReader(path);
Iterator<Token> tokens = Tokenizer.tokenize(apiOrigin, reader);
tokens.next(); // drop START
return parsePathExpression(tokens, apiOrigin);
try {
Iterator<Token> tokens = Tokenizer.tokenize(apiOrigin, reader);
tokens.next(); // drop START
return parsePathExpression(tokens, apiOrigin);
} finally {
reader.close();
}
}
}