Commit 780e266
authored
cleanup: remove dead exception-handling paths from closePdfResources (#472)
Both PDDocument.close() (verapdf) and StaticLayoutContainers
.closeContrastRatioConsumer() swallow exceptions internally and have no
throws clause. The accumulator pattern in closePdfResources() (capture
into closeFailure, addSuppressed, conditional re-throw) and the matching
try/catch in processFileWithResult's finally block were dead code in
practice — neither path could fire under any of the currently-imported
verapdf versions.
Route both close calls through the existing clearCleanupStep helper so
they share the same per-step isolation as the static-container resets.
The method now declares no throws and the caller's finally block
collapses to a single line.
Behaviorally equivalent: cleanup is still always invoked, per-step
isolation still prevents one failure from aborting the rest, processing
exceptions still surface unchanged. Verified locally — file descriptor
released after processFile returns (lsof shows neither the input PDF nor
verapdf's temp PDF), 566 core tests pass.
Closes #4701 parent cb2b93c commit 780e266
1 file changed
Lines changed: 10 additions & 42 deletions
File tree
- java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/processors
Lines changed: 10 additions & 42 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
83 | 82 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | 83 | | |
97 | | - | |
| 84 | + | |
| 85 | + | |
98 | 86 | | |
99 | | - | |
100 | 87 | | |
101 | 88 | | |
102 | 89 | | |
| |||
107 | 94 | | |
108 | 95 | | |
109 | 96 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 97 | | |
115 | 98 | | |
116 | 99 | | |
| |||
149 | 132 | | |
150 | 133 | | |
151 | 134 | | |
152 | | - | |
153 | 135 | | |
154 | 136 | | |
155 | 137 | | |
| |||
160 | 142 | | |
161 | 143 | | |
162 | 144 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 145 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
182 | 150 | | |
183 | 151 | | |
184 | 152 | | |
| |||
0 commit comments