Closed garretwilson closed 11 months ago
I agree, sounds like an oversight to be corrected. I hope to address this later today (really busy at daytime job but maybe tonight).
As to need for java.io.Serializable
, for the longest time there were some (possibly ill-conceived, legacy) use cases related to things like Spark processing, where things like Jackson ObjectMapper
s needed to be (or was useful to have) Serializable. That's why within Jackson many entities are Serializable. I don't see that as the reason for this one at all, but just mention for sake of completeness.
And yes, due to many, many issues, use of java.io.Serializable
is definitely an anti-pattern in general.
… really busy at daytime job but maybe tonight …
I can understand that! 😅
Hey, I'll be happy to take this one. I need to set up the project for other changes we've been discussing, and it will give me some pleasure to get Serializable
out of there. If you haven't started it, I'll do it and file a pull request now.
Hey, I'll be happy to take this one.
Eep, I take that back. I assumed that I could just fork the project, build it, make the change, make sure the unit tests pass, and then file a pull request. But it looks like we have some problems; see #74. (As mentioned there, I can help with that, with a caveat.)
So for the meantime, if this builds on your system, it's probably better if you go ahead and take care of this ticket as you had indicated earlier.
I was dropping by here to fix this ticket, but I see you've already done it, and even released v1.6.0. 🎉 Thank you for your attention and quick work! I'm heading to go grab the new version now.
The most common use of
GenericType
, as explained even in its own Javadocs, is:However, for reasons I don't understand,
GenericType
implementsSerializable
. This means that in ever single usage like the above, I will need to suppress a warning related to the lack of aserialVersionUID
.Serializable
.TypeReference
does not implementSerializable
.ParameterizedTypeReference
does not implementSerializable
.TypeLiteral
does not implementSerializable
.TypeToken
which does not implementSerializable
.TypeToken
unfortunately does implementSerializable
, so at least ClassMate is not alone on this.So only ClassMate and Guava implement
Serializable
for the class with identical functionality. The rest don't. It's not clear to me how it would ever be useful.Can we remove
implements Serializable
from ClassMateGenericType<T>
? No one needs or even wantsSerializable
in 2023. There are few if any cases that anyone should be creating new code usingSerializable
, and here it just brings a headache.