Till Westmann has uploaded a new change for review. https://asterix-gerrit.ics.uci.edu/2400
Change subject: [NO ISSUE] Cleanup CleanupUtils ...................................................................... [NO ISSUE] Cleanup CleanupUtils - user model changes: no - storage format changes: no - interface changes: no Change-Id: I6ac0a4bd5e29ecb9196b803d0d984bfc9564719b --- M hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/CleanupUtils.java 1 file changed, 11 insertions(+), 14 deletions(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/00/2400/1 diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/CleanupUtils.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/CleanupUtils.java index a67c133..0491c99 100644 --- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/CleanupUtils.java +++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/CleanupUtils.java @@ -32,20 +32,17 @@ } public static Throwable destroy(Throwable root, IDestroyable... destroyables) { - for (int i = 0; i < destroyables.length; i++) { - if (destroyables[i] != null) { - IDestroyable destroyable = destroyables[i]; - if (destroyable != null) { + for (IDestroyable destroyable : destroyables) { + if (destroyable != null) { + try { + destroyable.destroy(); + } catch (Throwable th) { // NOSONAR. Had to be done to satisfy contracts try { - destroyable.destroy(); - } catch (Throwable th) { // NOSONAR. Had to be done to satisfy contracts - try { - LOGGER.log(Level.WARN, "Failure destroying a destroyable resource", th); - } catch (Throwable ignore) { - // Do nothing - } - root = ExceptionUtils.suppress(root, th); + LOGGER.log(Level.WARN, "Failure destroying a destroyable resource", th); + } catch (Throwable loggingFailure) { // NOSONAR + // Do nothing } + root = ExceptionUtils.suppress(root, th); } } } @@ -69,7 +66,7 @@ } catch (Throwable th) { // NOSONAR Will be re-thrown try { LOGGER.log(Level.WARN, "Failure closing a closeable resource", th); - } catch (Throwable loggingFailure) { + } catch (Throwable loggingFailure) { // NOSONAR // Do nothing } root = ExceptionUtils.suppress(root, th); @@ -93,7 +90,7 @@ } catch (Throwable th) { // NOSONAR Will be re-thrown try { LOGGER.log(Level.WARN, "Failure failing " + writer.getClass().getSimpleName(), th); - } catch (Throwable loggingFailure) { + } catch (Throwable loggingFailure) { // NOSONAR // Do nothing } root.addSuppressed(th); -- To view, visit https://asterix-gerrit.ics.uci.edu/2400 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ac0a4bd5e29ecb9196b803d0d984bfc9564719b Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Till Westmann <ti...@apache.org>