Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bus error?




On Dec 16, 2004, at 22:37, Mike Hall wrote:

One thing about XStream that I seem to remember is that it doesn't run the
objects override serialization methods for readObject or writeObject.

You mean the two evil twins:

 private void writeObject(java.io.ObjectOutputStream out)
     throws IOException
 private void readObject(java.io.ObjectInputStream in)
     throws IOException, ClassNotFoundException;

Or the regular ones defined by java.io.Externalizable?

And this is just the start of the fun as you need to account for such nice touch of obscurantism as

 ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException;
 ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException;

Without even mentioning the hight of debilitation:

java.io.ObjectOutputStream.PutField
java.io.ObjectInputStream.GetField

Sigh...


Unless
thats changed. I was trying to figure out someway myself using XStream to
run them.

As far as XStream goes, I think that full support for Serializable is still a "work in progress". If you don't mind its byzantine XML dialect, you might want to try JSX as it offers much better handling of the default Java object serialization mechanism idiosyncrasies as practice by the Obscurantist Church of Santa Clara.


There were limitations I think though. As long as what was done
amounted to the same as the default methods. That is, nothing additional
written to or pulled from the stream, other than the object and it's fields
itself. If say it decided to save something additional for some reason it
busted what I was trying to do. In that case you had to figure out how to
either prune the serialization tree so the class would get skipped or
substitute a place holder class that would (de)serialize without the extra
code (readObject or writeObject contained).
This assumes you can re-construct the actual class from information in the
substitute class. I have some classes for this purpose that with some effort
I could usually get to work.
Again, aside from off-topic plugging myself, my thought is mainly that what
might be causing you problems is some tricky code in a
readObject/writeObject method that XStream and JSX could be missing.

Must be a really tricky one then:

# Error ID : /SourceCache/HotSpot14/HotSpot14-38/src/share/vm/runtime/os.cpp, 788

Cheers,

PA.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >bus error? (From: PA <email@hidden>)
 >Re: bus error? (From: PA <email@hidden>)
 >Re: bus error? (From: "Mike Hall" <email@hidden>)
 >Re: bus error? (From: PA <email@hidden>)
 >Re: bus error? (From: "Mike Hall" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.