mirror of
https://github.com/apache/commons-csv.git
synced 2025-02-16 15:07:07 +00:00
Use try-with-resources
This commit is contained in:
parent
de158f9817
commit
33129ba467
@ -452,8 +452,9 @@ public class LexerTest {
|
||||
@Test
|
||||
public void testTrimTrailingSpacesZeroLength() throws Exception {
|
||||
final StringBuilder buffer = new StringBuilder("");
|
||||
final Lexer lexer = createLexer(buffer.toString(), CSVFormat.DEFAULT);
|
||||
lexer.trimTrailingSpaces(buffer);
|
||||
assertThat(lexer.nextToken(new Token()), matches(EOF, ""));
|
||||
try (Lexer lexer = createLexer(buffer.toString(), CSVFormat.DEFAULT)) {
|
||||
lexer.trimTrailingSpaces(buffer);
|
||||
assertThat(lexer.nextToken(new Token()), matches(EOF, ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user