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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to