jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: svn commit: r1532157 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeImpl.java oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeEqualsTest.java
Date Tue, 15 Oct 2013 07:49:34 GMT
Hi,

On 15.10.13 2:42 , tripod@apache.org wrote:
> Author: tripod
> Date: Tue Oct 15 00:42:21 2013
> New Revision: 1532157
>
> URL: http://svn.apache.org/r1532157
> Log:
> OAK-1086 NodeTypes of successive calls to node.getPrimaryNodetypes() are not equal
>
> - implement equals and hashcode based on the CND of the node type definition.

[...]

> +    @Override
> +    public boolean equals(Object o) {
> +        if (this == o) return true;
> +        if (o instanceof NodeTypeImpl) {
> +            return getCnd().equals(((NodeTypeImpl) o).getCnd());
> +        } else if (o instanceof NodeType) {

Should we even consider this case? If so, below implementation is not 
symmetric wrt. e.g. the NodeType implementation of JR2.

I'd rather return false for unknown NodeType instances.

> +            try {
> +                return getCnd().equals(getCnd((NodeType) o));
> +            } catch (IOException e) {
> +                return false;
> +            }
> +        } else {
> +            return false;
> +        }
> +    }

Michael

Mime
View raw message