Skip to content

Commit 33129ba

Browse files
committed
Use try-with-resources
1 parent de158f9 commit 33129ba

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/test/java/org/apache/commons/csv/LexerTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,9 @@ public void testTrailingTextAfterQuote() throws Exception {
452452
@Test
453453
public void testTrimTrailingSpacesZeroLength() throws Exception {
454454
final StringBuilder buffer = new StringBuilder("");
455-
final Lexer lexer = createLexer(buffer.toString(), CSVFormat.DEFAULT);
456-
lexer.trimTrailingSpaces(buffer);
457-
assertThat(lexer.nextToken(new Token()), matches(EOF, ""));
455+
try (Lexer lexer = createLexer(buffer.toString(), CSVFormat.DEFAULT)) {
456+
lexer.trimTrailingSpaces(buffer);
457+
assertThat(lexer.nextToken(new Token()), matches(EOF, ""));
458+
}
458459
}
459460
}

0 commit comments

Comments
 (0)