lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elijah Epifanov (JIRA)" <j...@apache.org>
Subject [jira] Created: (LUCENE-681) org.apache.lucene.document.Field is Serializable but doesn't have default constructor
Date Mon, 09 Oct 2006 21:41:22 GMT
org.apache.lucene.document.Field is Serializable but doesn't have default constructor
-------------------------------------------------------------------------------------

                 Key: LUCENE-681
                 URL: http://issues.apache.org/jira/browse/LUCENE-681
             Project: Lucene - Java
          Issue Type: Bug
          Components: Other
    Affects Versions: 2.0.0, 1.9, 2.0.1, 2.1
         Environment: doesn't depend on environment
            Reporter: Elijah Epifanov
            Priority: Critical


when I try to pass Document via network or do anyhing involving serialization/deserialization
I will get an exception.

the following patch should help (Field.java):

  public Field () {
  }

  private void writeObject (java.io.ObjectOutputStream out)
          throws IOException {
    out.defaultWriteObject ();
  }

  private void readObject (java.io.ObjectInputStream in)
          throws IOException, ClassNotFoundException {
    in.defaultReadObject ();
    if (name == null) {
      throw new NullPointerException ("name cannot be null");
    }
    this.name = name.intern ();        // field names are interned
  }



Maybe other classes do not conform to Serialization requirements too...


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message