jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [jira] Created: (JCR-9) Version.isSame(Object) not working
Date Fri, 15 Oct 2004 12:15:51 GMT

  A new issue has been created in JIRA.

View the issue:

Here is an overview of the issue:
        Key: JCR-9
    Summary: Version.isSame(Object) not working
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Jackrabbit

   Reporter: Felix Meschberger

    Created: Fri, 15 Oct 2004 5:15 AM
    Updated: Fri, 15 Oct 2004 5:15 AM
Environment: Jackrabbit SVN revision 54847

Version interface is implemented (on the frontend) by the VersionImpl class (extending NodeWrapper),
which delegates to an internal NodeImpl class, which in turn extends ItemImpl.

Say you have :
      Node node = // at Version 1.0
      Version version = // retrieved as 1.0 for the node
      Version baseVersion = node.getBaseVersion()

You now expect
even if
      baseVersion != version

This fails, because VersionImpl delegates the isSame call to its delegatee, thus above call
      ((VersionImpl) baseVersion).delegatee.isSame(version)
where this method is implemented by the ItemImpl class from which the delegatee NodeImpl extends.

That latter implementation ItemImpl.isSame() only returns true if the other is an ItemImpl,
too. But this is not the case because VersionImpl is a Version, NodeWrapper, Node but not
an ItemImpl.

Probably the best solution would be for NodeImpl.isSame() to check whether the otherItem is
a NodeWrapper und use ((NodeWrapper) otherItem).delegatee as the otherItem for the delegatee

On another track: ItemImpl.isSame() should probably do a fast check whether the otherItem
is actually the same instance to prevent type checks...

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

View raw message