OPENDJ-1368 (CR-3232) Remove AttributeValue
Help and some code review from Matthew Swift
Removed AttributeValue interface replaced by ByteString class.
Removed AttributeValues class.
Changed the code in several places to cater for the fact that AttributeValue.equals() and hashCode() were using the normalized values.
AttributeValue.java, TestAttributeValue.java, AttributeValues.java: REMOVED
PasswordPolicyState.java:
Extracted method getPwComponents().
ExternalSASLMechanismHandler.java:
Extracted find().
LDAPFilter.java:
In toSearchFilter(), simplified code.
SearchFilter.java:
In decodeExtensibleMatchFilter(), simplified code.
Extracted methods typeAndOptionsAndAssertionEqual(), equalsSubstring(), equalsExtensible(), typeAndAssertionHashCode(), hashCode() and appendOptions().
AttributeBuilder.java:
Changed values from Set<ByteString> to Map<ByteString, ByteString> + did the same in inner classes.
A subsequent commit should look at introducing a SmallMap to mimick the SmallSet.
VirtualAttributeProvider.java + sub classes:
In getValues(), changed return type from Set<AttributeValue> to Attribute.
Removed hasAnyValue(), only used by tests + removed all subtypes implementations + removed all tests testing it.
AbstractAttribute.java + sub classes:
Changed hashCode() to build the hashCode with normalized values, equals is already covered by contains().
These methods are more than likely only used by unit tests when comparing actual/expected attributes, thus performance is not a concern here.
SearchFilter.java:
Added normalizedAssertionValue field + getNormalizedAssertionValue() + normalizeAssertionValue()
AttributeBuilderTest.java:
In testAttributeIterator(), normalized the attribute values with the equality matching rule for comparison.
SubentryManagerTestCase.java:
In testCollectiveAttributeSubentries(), removed normalization to make the test pass.
TestModifyDNOperation.java:
In testModifyDNchangeCaseAndAddValue() and testModifyDNchangeCaseOfExistingEntryValue(), used non normalized values to make the tests pass.
ModifyConflictTest.java:
In delAndAddSameOp() and addAndDelSameOp(), ensured the attribute values used in the tests are exactly the same.
*.java:
Used Utils.joinAsString().