UTIL: remove dependency of Java 1.7 73/27073/1
authorgreatim <jaewon81.lim@samsung.com>
Thu, 4 Sep 2014 06:37:09 +0000 (15:37 +0900)
committergreatim <jaewon81.lim@samsung.com>
Thu, 4 Sep 2014 06:37:09 +0000 (15:37 +0900)
remove reference of AutoClosable interface

Change-Id: Id8eb154cb3839d7569feb26e667d642a0b5d8845
Signed-off-by: greatim <jaewon81.lim@samsung.com>
org.tizen.dynamicanalyzer.common/src/org/tizen/dynamicanalyzer/util/CommonUtil.java

index ff0c5bd..21cb669 100644 (file)
@@ -4,6 +4,9 @@ import java.io.Closeable;
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
 import java.lang.management.RuntimeMXBean;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
 
 public class CommonUtil {
        private static final String OS = getOS();
@@ -53,8 +56,12 @@ public class CommonUtil {
                        try {
                                if (obj instanceof Closeable) {
                                        ((Closeable) obj).close();
-                               } else if (obj instanceof AutoCloseable) {
-                                       ((AutoCloseable) obj).close();
+                               } else if (obj instanceof ResultSet) {
+                                       ((ResultSet) obj).close();
+                               } else if (obj instanceof Statement) {
+                                       ((Statement) obj).close();
+                               } else if (obj instanceof Connection) {
+                                       ((Connection) obj).close();
                                } else {
                                        Logger.error("Object is not closable");
                                }