Skip to content

Commit 13aeb02

Browse files
committed
uber - fix from TBUILD-30 to close copied file streams
1 parent 74db0c2 commit 13aeb02

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Changelog
22
===========
33

4+
* next
5+
* uber - fix from TBUILD-30 to close copied file streams
46
* v0.9.1 27ff8a4 on Jan 13, 2023
57
* uber - TBUILD-35 Fix error on exploding jar with / entry
68
* uber - TBUILD-30 Apply exclusions and conflict handlers for local and git libs

src/main/clojure/clojure/tools/build/tasks/uber.clj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,14 @@
190190
(loop [[^File f & restf] fs, the-state state]
191191
(if f
192192
(let [is (when (.isFile f) (jio/input-stream f))
193-
path (.toString (.relativize source-path (.toPath f)))
194-
source-time (FileTime/fromMillis (.lastModified f))
195-
out-file (jio/file out-dir path)]
196-
(recur restf (explode1 is path (.isDirectory f) source-time out-file lib context the-state)))
193+
new-state (try
194+
(let [path (.toString (.relativize source-path (.toPath f)))
195+
source-time (FileTime/fromMillis (.lastModified f))
196+
out-file (jio/file out-dir path)]
197+
(explode1 is path (.isDirectory f) source-time out-file lib context the-state))
198+
(finally
199+
(when is (.close ^InputStream is))))]
200+
(recur restf new-state))
197201
the-state)))
198202

199203
:else

0 commit comments

Comments
 (0)