> What do you mean wint traverse parents? The only thing i don't do is the
> traversing and call the read/writeobject
> when they are there.
> But for the rest all the fields are stored that are not static and not
> transient of the complete object.

Cool. I tested a little bit and saw your stuff works for anon/ local
classes.



because there is nothing special about that. an inner class differences is
only
that i under the hood generates a field to the parent. And that is just a
reference already saved
so it is just a handle.



Take a look at SerializableChecker$HandleTable, which I basically
copied from ObjectOutputStream. That's what you should use instead of
the hasmap you're using as you're looking for system hash rather then
what the object thinks it's identity should be like. It's not only way
cheaper to do that, but it also shields against problems that can
arise when objects have a hashcode implementation that e.g. depends on
a hibernate session being available and current. But anyway, the speed



argument alone is more than worth it.



ahh yes i already thought about that.. :)
what i do now is even better compression because if an object says it is
content equal
then i only do one. The problem is that that is the case for immutable
objects
especially string. I really don't want to print "Eelco" and "Eelco" twice
into the buffer
There i really want content equals (The same goes for all the Number
classes, but those are handled
already specially)

So i will make it identity equal for all objects except String


> JBossSer does exactly the same. And i have now idea how  anybody that
writes
> custom serialization can do it any other way. Thats just not possible.
> Because thats the only way to set final fields (reflection can't do that
> since 1.2)
> And we in wicket uses final fields all the time. I am very curious how
for
> example
> xml serialization or other kinds are really doing this..

I've searched around for it, and it doesn't seem to be a license
violation. And as you said, many others, including JBoss, use Unsafe.

Related read: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6379948



hmm there is a workaround, but for that you need really All Permissions to
be set for the wicket application.
thats not always workable for wicket..


johan

Reply via email to