Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-785

RAMDirectory not Serializable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1
    • 2.1
    • core/store
    • None
    • New

    Description

      The current implementation of RAMDirectory throws a NotSerializableException when trying to serialize, due to the inner class KeySet of HashMap not being serializable (god knows why)

      java.io.NotSerializableException: java.util.HashMap$KeySet
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)

      Caused by line 43:

      private Set fileNames = fileMap.keySet();

      EDIT:

      while we're at it: same goes for inner class Values

      java.io.NotSerializableException: java.util.HashMap$Values
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)

      Collection files = fileMap.values();

      Attachments

        1. ramdir.serializable.diff
          3 kB
          Chris M. Hostetter

        Activity

          People

            mikemccand Michael McCandless
            matthias.seidel Matthias Seidel
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: