Details
-
Wish
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
Wouldn't it be useful to have a way to easily check whether some object is a deep copy of another? I.e. the two instances could be "equal" but the utility function would return "false" if they share a mutable field.
More generally, how about a function like
public SomeUtils { /** * @return true if "a" and "b" do not share any mutable field. */ public static <T> boolean areIndependent(T a, T b) { /* ... */ } // ... }
?
It seems that this could be built upon ReflectionDiffBuilder.