Uploaded image for project: 'Spring Modules'
  1. Spring Modules
  2. MOD-235

Remove reference to java.io.Closeable in org.springmodules.cache.impl.Element

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.6
    • Fix Version/s: 0.7
    • Component/s: CACHE
    • Labels:
      None

      Description

      By removing the reference to java.io.Closeable in org.springmodules.cache.impl.Element and adding
      two close methods for both InputStream and OutputStream allows the caching to be used with at least
      jdk 1.4. See below:

      private void close(OutputStream outputStream) {
      if (outputStream == null)

      { return; }

      try { outputStream.close(); } catch (Exception exception) { String clazz = outputStream.getClass().getName(); logger.error("Unable to close " + clazz, exception); }
      }

      private void close(InputStream inputStream) {
      if (inputStream == null) { return; }

      try

      { inputStream.close(); }

      catch (Exception exception)

      { String clazz = inputStream.getClass().getName(); logger.error("Unable to close " + clazz, exception); }

      }

      REPLACES:

      private void close(Closeable closeable) {
      if (closeable == null)

      { return; }

      try

      { closeable.close(); }

      catch (Exception exception)

      { String clazz = closeable.getClass().getName(); logger.error("Unable to close " + clazz, exception); }

      }

        Attachments

          Activity

            People

            Assignee:
            irbouho Omar Irbouh
            Reporter:
            mvermaak Martin Vermaak
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: