Hi Jeroen,
Jeroen Frijters schrieb:
Roman Kennke wrote:
Friedjof hacked up the Object de-/serialization code for improved
performance. It is now an order of magnitude faster.
Thanks. Most of it looks good. A few comments:
Thanks for looking over it.
This looks funny:
+ {System.err.println("1");
My fault. Accidentally left some debug statement in.
I think this is bad style:
+ catch (IllegalArgumentException _)
+ {
+ InvalidClassException e = new InvalidClassException
+ ("writing fields of class " + osc.forClass().getName());
+ e.initCause(_);
I would only use _ if the exception object is not used.
Yeah ok. Easy to fix.
This test is wrong:
+ || (l.getClass().getClassLoader() == null /* application loader
*/);
If an application instantiates URLClassLoader, it should still be
garbage collectable.
I think that he should consider using a cache that uses weak references
instead of this test.
AFAICS, the test is maybe a little aggressive and disallows caching for
classes that could even be cached (correct me if I'm wrong). But it
should be safe to do so (unlike, caching classes that shouldn't be
cached). I'd rather avoid dealing with WeakReferences unless really needed.
/Roman