MCPcopy Index your code
hub / github.com/antlr/codebuff / close

Method close

output/java_guava/1.4.17/Closer.java:217–238  ·  view source on GitHub ↗

Closes all Closeable instances that have been added to this Closer. If an exception was thrown in the try block and passed to one of the exceptionThrown methods, any exceptions thrown when attempting to close a closeable will be suppressed. Otherwise, the first excepti

()

Source from the content-addressed store, hash-verified

215 */
216
217 @Override
218 public void close() throws IOException {
219 Throwable throwable = thrown;
220
221 // close closeables in LIFO order
222 while (!stack.isEmpty()) {
223 Closeable closeable = stack.removeFirst();
224 try {
225 closeable.close();
226 } catch (Throwable e) {
227 if (throwable == null) {
228 throwable = e;
229 } else {
230 suppressor.suppress(closeable, throwable, e);
231 }
232 }
233 }
234 if (thrown == null && throwable != null) {
235 Throwables.propagateIfPossible(throwable, IOException.class);
236 throw new AssertionError(throwable); // not possible
237 }
238 }
239
240 /**
241 * Suppression strategy interface.

Callers 15

writeMethod · 0.95
writeFromMethod · 0.95
isEmptyMethod · 0.95
sizeMethod · 0.95
copyToMethod · 0.95
readMethod · 0.95
contentEqualsMethod · 0.95
sliceStreamMethod · 0.95
readMethod · 0.95
mapMethod · 0.95
writeMethod · 0.95
writeLinesMethod · 0.95

Calls 4

propagateIfPossibleMethod · 0.95
isEmptyMethod · 0.65
suppressMethod · 0.65
removeFirstMethod · 0.45

Tested by

no test coverage detected