Fix a bug in SearchFilter.equals() in which substring filter components are
only compared by their assertion values and the attribute type isn't taken into
account (so the filters "(cn=*bowen*)" and "(sn=*bowen*)" would be considered
equal when they shouldn't be).
OpenDS Issue Number: 1245
| | |
| | | return (attributeType.equals(f.attributeType) && |
| | | assertionValue.equals(f.assertionValue)); |
| | | case SUBSTRING: |
| | | if (! attributeType.equals(f.attributeType)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (subInitialElement == null) |
| | | { |
| | | if (f.subInitialElement != null) |
| | |
| | | case EQUALITY: |
| | | return (attributeType.hashCode() + assertionValue.hashCode()); |
| | | case SUBSTRING: |
| | | hashCode = 0; |
| | | hashCode = attributeType.hashCode(); |
| | | |
| | | if (subInitialElement != null) |
| | | { |
| | |
| | | {"(|(sn=Smith)(sn<=Aus))", "(|(sn=Smith)(sn>=Aus))", false, false}, |
| | | |
| | | |
| | | // Test cases for issue #1245 |
| | | {"(cn=*bowen*)", "(cn=*bowen*)", true, true}, |
| | | {"(cn=*bowen*)", "(sn=*bowen*)", false, false} |
| | | }; |
| | | |
| | | |