jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konrad Windszus (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (JCRVLT-81) FilterSet.equals is returning true for filter sets with distinct roots
Date Sun, 21 Dec 2014 18:54:13 GMT

    [ https://issues.apache.org/jira/browse/JCRVLT-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14255238#comment-14255238
] 

Konrad Windszus edited comment on JCRVLT-81 at 12/21/14 6:54 PM:
-----------------------------------------------------------------

{{FilterSet.equals}} might also throw NPEs in case entries is null (e.g. if {{seal}} was never
called)


was (Author: kwin):
{{FilterSet.equals}} might also throw NPEs in case entries is null.

> FilterSet.equals is returning true for filter sets with distinct roots
> ----------------------------------------------------------------------
>
>                 Key: JCRVLT-81
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-81
>             Project: Jackrabbit FileVault
>          Issue Type: Bug
>    Affects Versions: 3.1.14
>            Reporter: Konrad Windszus
>
> Currently FilterSet equals will return true if either the instances are the same or all
entries are the same (https://github.com/apache/jackrabbit-filevault/blob/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/api/FilterSet.java#L259).
> This is not sufficient because there may be multiple distinct filter sets which do not
have any entries but rather only the implicit whitelist entry but distinct roots. All those
FilterSets are considered equal.
> One example is 
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <workspaceFilter version="1.0">
> 	<filter root="/content/test1" />
> 	<filter root="/content/test2" />
> </workspaceFilter>
> {code}
> Also the hashCode is implemented very ineffeciently (alway returning 0) which will lead
to degraded performance e.g. when using Maps.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message