Skip to content

Commit 542aaf6

Browse files
joaodinissfclaude
andcommitted
fix: use try-with-resources in IssueCodeValueTest
Fixes PMD UseTryWithResources violation for ByteArrayInputStream. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 01ac135 commit 542aaf6

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/generator/IssueCodeValueTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,8 @@ public void testIssueCodeValue() throws Exception {
9292

9393
// ACT
9494
List<JavaSource> compiledClassesList;
95-
ByteArrayInputStream sourceStream = new ByteArrayInputStream(source.getBytes(StandardCharsets.UTF_8));
96-
try {
95+
try (ByteArrayInputStream sourceStream = new ByteArrayInputStream(source.getBytes(StandardCharsets.UTF_8))) {
9796
compiledClassesList = generateAndCompile(sourceStream);
98-
} finally {
99-
sourceStream.close();
10097
}
10198

10299
// ASSERT

0 commit comments

Comments
 (0)