Github user LosD commented on a diff in the pull request:

    https://github.com/apache/metamodel/pull/78#discussion_r47408874
  
    --- Diff: core/src/main/java/org/apache/metamodel/util/FileHelper.java ---
    @@ -263,40 +259,16 @@ public static void safeClose(Object... objects) {
                         }
                     }
     
    -                if (obj instanceof Closeable) {
    +                if (obj instanceof AutoCloseable) {
                         try {
    -                        ((Closeable) obj).close();
    -                    } catch (IOException e) {
    -                        if (debugEnabled) {
    -                            logger.debug("Closing Closeable failed", e);
    -                        }
    -                    }
    -                } else if (obj instanceof Connection) {
    -                    try {
    -                        ((Connection) obj).close();
    -                    } catch (Exception e) {
    -                        if (debugEnabled) {
    -                            logger.debug("Closing Connection failed", e);
    -                        }
    -                    }
    -                } else if (obj instanceof Statement) {
    -                    try {
    -                        ((Statement) obj).close();
    -                    } catch (Exception e) {
    -                        if (debugEnabled) {
    -                            logger.debug("Closing Statement failed", e);
    -                        }
    -                    }
    -                } else if (obj instanceof ResultSet) {
    -                    try {
    -                        ((ResultSet) obj).close();
    +                        ((AutoCloseable) obj).close();
    --- End diff --
    
    :+1: Nice!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to