Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

declare FUUID java.io.Serializable? #183

Open
drobert opened this issue Oct 8, 2019 · 3 comments
Open

declare FUUID java.io.Serializable? #183

drobert opened this issue Oct 8, 2019 · 3 comments

Comments

@drobert
Copy link

drobert commented Oct 8, 2019

Regardless of the lameness of java serialization, there some frameworks and libraries that rely on it. (My current example is using FUUID in Apache Beam.)

It would be useful if FUUID declared itself java.io.Serializable, and likely delegated its serialization to the underlying UUID. I realize the implementation of this would be Unsafe, but that's mostly the nature of java serialization anyway I suppose.

@ChristopherDavenport
Copy link
Collaborator

So my baseline is a dislike for the idea, hence a really late response that I should have written sooner. My apologies. However, I am not in the realm where I ever use java.io.Serializable so I will happily take input from others, if others think this is important enough its not a hill I will die on.

@morgen-peschke
Copy link
Contributor

Unfortunately, ScalaTest uses Java serialization, and ScalaCheck's integration includes the generated values in the ScalaTest reports, which causes trouble whenever an FUUID is parted of a generated value.

Reporter completed abruptly with an exception after receiving event: TestFailed(Ordinal(0, 3),ExceptionInInitializerError was thrown during property evaluation.
...
java.io.NotSerializableException: io.chrisdavenport.fuuid.FUUID
	at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
	at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1572)

@zarthross
Copy link

I believe this can be closed now? @ChristopherDavenport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants