Konrad Windszus created JCRVLT-81:
-------------------------------------
Summary: 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">
<!-- allow configurations to be detected in deeper levels -->
<filter root="/content/test1" />
<filter root="/content/test1" />
</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)