Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-5200

DelegatePropertyWrapper should have its own implementation of isSame() method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • 4.5.x
    • 4.5.9
    • core

      Javadoc for javax.jcr.Item.isSame says:

      Returns true if this Item object (the Java object instance) represents the same actual workspace item as
      the object otherItem.
      Two Item objects represent the same workspace item if and only if all the following are true:

      • Both objects were acquired through Session objects that were created by the same Repository
        object.
      • Both objects were acquired through Session objects bound to the same repository workspace.
      • The objects are either both Node objects or both Property objects.
      • If they are Node objects, they have the same identifier.
      • If they are Property objects they have identical names and isSame is true of their parent nodes.
        This method does not compare the states of the two items. For example, if two Item objects
        representing the same actual workspace item have been retrieved through two different sessions and
        one has been modified, then this method will still return true when comparing these two objects. Note
        that if two Item objects representing the same workspace item are retrieved through the same session
        they will always reflect the same state.

      How to reproduce:

      prop = session.getNode("/demo-project").getProperty("title")
      prop2 = session.getNode("/demo-project").getProperty("title")
      
      println prop.isSame(prop2)
      

        Acceptance criteria

              Unassigned Unassigned
              rkovarik Roman Kovařík
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:

                  Bug DoR
                  Task DoD