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
The following commit(s) were added to refs/heads/master by this push:
new f5524f00a fix PropertyListSerializationTest file handle leak on Windows
f5524f00a is described below
commit f5524f00a609e6093d221301cd532830e6a633d9
Author: Andrus Adamchik <[email protected]>
AuthorDate: Fri May 22 17:51:51 2026 -0400
fix PropertyListSerializationTest file handle leak on Windows
Parser(File) left the FileInputStream open after parsing, preventing
@TempDir cleanup on Windows (file locked by another process).
Open the stream explicitly in propertyListFromFile so it is closed
via try-with-resources after parsing completes.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
---
.../org/apache/cayenne/wocompat/PropertyListSerialization.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git
a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/PropertyListSerialization.java
b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/PropertyListSerialization.java
index 197686bae..0ce8804e2 100644
---
a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/PropertyListSerialization.java
+++
b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/PropertyListSerialization.java
@@ -63,7 +63,15 @@ public class PropertyListSerialization {
throw new FileNotFoundException("No such file: " + f);
}
- return new Parser(f, factory).propertyList();
+ // Use explicit stream so it is closed after parsing;
Parser(File) leaves the stream open,
+ // which prevents temp-directory cleanup on Windows.
+ try (InputStream in = new java.io.FileInputStream(f)) {
+ return new Parser(in, factory).propertyList();
+ } catch (FileNotFoundException e) {
+ throw e;
+ } catch (IOException e) {
+ throw new CayenneRuntimeException("Error reading plist:
" + f, e);
+ }
}
/**