The reason most people complain about Serializable is because Eclipse has the defaults WRONG. Don't set the check about missing serialVersionUID to WARNING but to IGNORE, and you'll be fine
I think part of the problem here is that Java made a bad mistake on the design. They managed to avoid "magic" names nearly everywhere except serialisation. Also the name is so long that I can never remember it - it's not worth me trying.
I agree that eclipse and netbeans shouldn't warn for this being missing by default.
--
I think part of the problem here is that Java made a bad mistake on the design. They managed to avoid "magic" names nearly everywhere except serialisation. Also the name is so long that I can never remember it - it's not worth me trying.
I agree that eclipse and netbeans shouldn't warn for this being missing by default.
On May 15, 2012 12:34 PM, "Marius Kruger" <ama...@gmail.com> wrote:
On 14 May 2012 10:00, Roel Spilker <r.sp...@topdesk.com> wrote:...The reason most people complain about Serializable is because Eclipse has the defaults WRONG. Don't set the check about missing serialVersionUID to WARNING but to IGNORE, and you'll be fineawesome thanks!--
✝ Marius
--
You received this message because you are subscribed to the Google
Groups group for http://projectlombok.org/
To post to this group, send email to project-lombok@googlegroups.com
To unsubscribe from this group, send email to
I would suggest @Externalize instead of @Serial, I mean:
- inject the "implements java.io.Extenalizable" clause
- inject the writeExternal and readExternal methods, which woudl call the right writeXXX/readXXX for every non-transient field of the class of its ObjectOutput / ObjectInput argument
As you know, the default serialization mechanism in Java since 1.1 handles classes implementing Externalizable (which in turns extends Serializable) in a way that can really-really-really faster that the default. This is a big improvement for every application that send data via JMS or RMI / EJB remoting, and so on.
And... Lombok is the perfect solution to implement Externalizable easily.
P.S: interstingly, nowadays not may people know about the Externalizable alterative to Serializable, surely because the "boilerplate" that would involve making every data class Externalizable doesn't worh it
What do you think? do web fill a suggest-for-enhacement?
Cheers
On Tue, 10 Jul 2012 23:28:33 +0200, Reinier Zwitserloot
> Wow, good catch. This is starting to be ripe for the 'weeeelll, you don't
> do this often, but if you need it, boy that's a lot of boilerplate you
> can
> toss right out'.
Why SerializedForm can't just be a Serializable, thus saving writeExternal
and readExternal? After all its fields aren't final and AFAIK
readResolve() can be used with Serializable too.
It's not what I was saying: in the code example I was referring to the
part where there is an Externalizable with *non final* variables and it's
for that part that I was referring to Serializable. To be clear, my
suggestion is the following, could this work?
6. I like the freedom to choose the proper logging framework in @Log, maybe this can be done here to choose implementing a "default" externalization, or via Kryo, or via other frameworks.
... I will leave aside the Clone stuff, but I insist that both should (could) be handled together:
On Thu, 12 Jul 2012 05:49:51 +0200, Maaartin G wrote:
> needs. With lombok it's gone, so what do we need plain Serializable for?
Safety checks? I don't recall, does Serializable check for serialVersionID?