OPENDJ-1645 CR-5805 Use name instead of oid to for hash code of schema elements
oid is modified during bootstrap of server, whereas name is always the same
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | this.description = description; |
| | | this.isObsolete = isObsolete; |
| | | |
| | | hashCode = oid.hashCode(); |
| | | |
| | | // Make sure we have a primary name if possible. |
| | | if (primaryName == null) { |
| | | if (names != null && !names.isEmpty()) { |
| | |
| | | } |
| | | this.lowerName = toLowerCase(primaryName); |
| | | |
| | | // OPENDJ-1645: oid changes during server bootstrap, so prefer using name if available |
| | | hashCode = getNameOrOID().hashCode(); |
| | | |
| | | // Construct the normalized attribute name mapping. |
| | | if (names != null) { |
| | | this.names = new LinkedHashMap<String, String>(names.size()); |
| | |
| | | |
| | | if (o instanceof CommonSchemaElements) { |
| | | CommonSchemaElements other = (CommonSchemaElements) o; |
| | | return oid.equals(other.oid); |
| | | return getNameOrOID().equals(other.getNameOrOID()); |
| | | } |
| | | |
| | | return false; |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | public final Object[][] createEqualsTestData() { |
| | | return new Object[][] { |
| | | { "testType", "1.2.3", "testType", "1.2.3", true }, |
| | | { "testType", "1.2.3", "xxx", "1.2.3", true }, |
| | | { "testType", "1.2.3", "testType", "1.2.4", false }, |
| | | { "testType", "1.2.3", "xxx", "1.2.3", false }, |
| | | { "testType", "1.2.3", "testType", "1.2.4", true }, |
| | | { "testType", "1.2.3", "xxx", "1.2.4", false } }; |
| | | } |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.types; |
| | | |