Use try-with-resources
This commit is contained in:
parent
de158f9817
commit
33129ba467
|
@ -452,8 +452,9 @@ public class LexerTest {
|
||||||
@Test
|
@Test
|
||||||
public void testTrimTrailingSpacesZeroLength() throws Exception {
|
public void testTrimTrailingSpacesZeroLength() throws Exception {
|
||||||
final StringBuilder buffer = new StringBuilder("");
|
final StringBuilder buffer = new StringBuilder("");
|
||||||
final Lexer lexer = createLexer(buffer.toString(), CSVFormat.DEFAULT);
|
try (Lexer lexer = createLexer(buffer.toString(), CSVFormat.DEFAULT)) {
|
||||||
lexer.trimTrailingSpaces(buffer);
|
lexer.trimTrailingSpaces(buffer);
|
||||||
assertThat(lexer.nextToken(new Token()), matches(EOF, ""));
|
assertThat(lexer.nextToken(new Token()), matches(EOF, ""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue