fluflu icon indicating copy to clipboard operation
fluflu copied to clipboard

Cloneable semantics / promise might not be correct

Open lukaseder opened this issue 11 years ago • 1 comments

Hi Peter,

So I'll just tell you my thoughts through issues, I guess that's the easiest and most trackable way to communicate. BTW, too bad you already released 1.0.0 to Maven Central. Maybe you could add a disclaimer that fluflu doesn't (yet?) follow semantic versioning: http://semver.org/

About Cloneable, your example contains a reference to:

protected List<byte[]> b = new LinkedList<>();

This list, when cloned, will not deep-clone all the byte arrays. Note, that it works for this Set:

Set<Integer> j = new HashSet<>(); 

... because Integer is immutable.

So I think that the promise of supporting Cloneable might be a false one. What do you think?

lukaseder avatar May 04 '13 12:05 lukaseder

Perhaps the documentation should be extended a bit, but generally this is how cloning generally works in Java.

verhas avatar May 08 '13 07:05 verhas