Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1709

Check for "deep" copy

    XMLWordPrintableJSON

Details

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            erans Gilles Sadowski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: