DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42789>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42789





------- Additional Comments From [EMAIL PROTECTED]  2007-07-05 20:47 -------
We have 2 options here I think:

1) Ignore the problem - if we do this, we should log the exception so that the
loading of the preferences at least appears inside Chainsaws own log panel. 
Currently there's a TODO to log it instead of printStackTrace().  

2) Introduce a version number in the serialization file.  During the
saveSettingsEvent, at the end of the current set of objects being saved, write a
version #.  This number can be read back and used to determine whether the next
object is likely to have been serialzide.  You could do something like:


..(previous deserializationstuff)
Vector v = null;
int versionNumber=0
try{
  int versionNumber = in.readInt();
  
}catch(Exception e){
  // no versionNumber found, might want to be specific about the Exception
  // caught here to make sure it's only End of Stream events.
}

// now we know where at a point that has introduced the versionNumber
if(versionNumber>0){
    v = in.readObject();
} 
if (versionNumber>1){
        // ... some other future serialized data structure
}

..etc

In the saveSettings event, we can start writing a version # at the end of the
current list, but before you add the Vector (and other objects if needed).

Does that make sense?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to