code: public static void safeClose(Closeable obj)
     {
        try
        {
           obj.close();
        }
        catch (IOException e)
        {
           LOG.error("Error while closing " + obj, e);
        }
     }
docs: Safely close {@link Closeable} instance. Log error
  in case of exception.