This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit 82db502ccc891bf76de735efdf49689eb79ceb9b
Author: Andrus Adamchik <[email protected]>
AuthorDate: Fri May 22 16:34:15 2026 -0400

    cleaner test resource management
    
    this fixes windows builds
---
 .../java/org/apache/cayenne/gen/ClassGenerationActionTest.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/cayenne-cgen/src/test/java/org/apache/cayenne/gen/ClassGenerationActionTest.java
 
b/cayenne-cgen/src/test/java/org/apache/cayenne/gen/ClassGenerationActionTest.java
index d1d613f52..39e96cee1 100644
--- 
a/cayenne-cgen/src/test/java/org/apache/cayenne/gen/ClassGenerationActionTest.java
+++ 
b/cayenne-cgen/src/test/java/org/apache/cayenne/gen/ClassGenerationActionTest.java
@@ -278,8 +278,9 @@ public class ClassGenerationActionTest extends CgenCase {
                File outFile = new File(tempFolder + "/TestClass1.java");
                assertFalse(outFile.exists());
 
-               action.openWriter(templateType);
-               assertTrue(outFile.exists());
+               try(Writer ignored = action.openWriter(templateType)) {
+                       assertTrue(outFile.exists());
+               }
 
                assertNull(action.openWriter(templateType));
        }
@@ -300,8 +301,9 @@ public class ClassGenerationActionTest extends CgenCase {
                File outFile = new File(tempFolder + "/TestClass1.java");
                assertFalse(outFile.exists());
 
-               action.openWriter(templateType);
-               assertTrue(outFile.exists());
+               try(Writer ignored = action.openWriter(templateType)) {
+                       assertTrue(outFile.exists());
+               }
 
                assertNull(action.openWriter(templateType));
 

Reply via email to