Skip to content

Commit b16dd08

Browse files
committed
Revert "Set headerVersion"
This reverts commit 7f46032. Signed-off-by: Nigel Jones <[email protected]>
1 parent 31bac9c commit b16dd08

File tree

22 files changed

+136
-422
lines changed

22 files changed

+136
-422
lines changed

open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/MetadataElementHandler.java

-5
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
698698
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ArrayPropertyValue
699699
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ArrayPropertyValue();
700700

701-
omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
702701
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.ARRAY);
703702
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
704703
omrsPropertyValue.setTypeName(typeDef.getName());
@@ -753,7 +752,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
753752
omrsPropertyValue =
754753
new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue();
755754

756-
omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
757755
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.ENUM);
758756
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
759757
omrsPropertyValue.setTypeName(typeDef.getName());
@@ -787,7 +785,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
787785
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.MapPropertyValue
788786
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.MapPropertyValue();
789787

790-
omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
791788
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.MAP);
792789
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
793790
omrsPropertyValue.setTypeName(typeDef.getName());
@@ -831,7 +828,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
831828
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.PrimitivePropertyValue
832829
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.PrimitivePropertyValue();
833830

834-
omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
835831
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.PRIMITIVE);
836832
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
837833
omrsPropertyValue.setTypeName(typeDef.getName());
@@ -918,7 +914,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
918914
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue
919915
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue();
920916

921-
omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
922917
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.STRUCT);
923918
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
924919
omrsPropertyValue.setTypeName(typeDef.getName());

open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-archive-connectors/open-metadata-archive-directory-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/archiveconnector/directory/DirectoryBasedOpenMetadataArchiveStoreConnector.java

-2
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,6 @@ public ClassificationEntityExtension getClassification(String entityGUID,
815815

816816
dummyClassification.setName(classificationName);
817817
dummyEntity.setGUID(entityGUID);
818-
dummyExtension.setHeaderVersion(ClassificationEntityExtension.CURRENT_CLASSIFICATION_EXT_HEADER_VERSION);
819818
dummyExtension.setClassification(dummyClassification);
820819
dummyExtension.setEntityToClassify(dummyEntity);
821820

@@ -851,7 +850,6 @@ public ClassificationEntityExtension queryClassification(String entityGUID,
851850

852851
dummyClassification.setName(classificationName);
853852
dummyEntity.setGUID(entityGUID);
854-
dummyExtension.setHeaderVersion(ClassificationEntityExtension.CURRENT_CLASSIFICATION_EXT_HEADER_VERSION);
855853
dummyExtension.setClassification(dummyClassification);
856854
dummyExtension.setEntityToClassify(dummyEntity);
857855

open-metadata-implementation/common-services/gaf-metadata-management/gaf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/gaf/handlers/MetadataElementHandler.java

-5
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
711711
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ArrayPropertyValue
712712
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ArrayPropertyValue();
713713

714-
omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
715714
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.ARRAY);
716715
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
717716
omrsPropertyValue.setTypeName(typeDef.getName());
@@ -766,7 +765,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
766765
omrsPropertyValue =
767766
new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue();
768767

769-
omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
770768
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.ENUM);
771769
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
772770
omrsPropertyValue.setTypeName(typeDef.getName());
@@ -800,7 +798,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
800798
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.MapPropertyValue
801799
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.MapPropertyValue();
802800

803-
omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
804801
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.MAP);
805802
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
806803
omrsPropertyValue.setTypeName(typeDef.getName());
@@ -844,7 +841,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
844841
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.PrimitivePropertyValue
845842
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.PrimitivePropertyValue();
846843

847-
omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
848844
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.PRIMITIVE);
849845
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
850846
omrsPropertyValue.setTypeName(typeDef.getName());
@@ -931,7 +927,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
931927
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue
932928
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue();
933929

934-
omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
935930
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.STRUCT);
936931
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
937932
omrsPropertyValue.setTypeName(typeDef.getName());

open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/RepositoryElementHeader.java

-36
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import com.fasterxml.jackson.annotation.JsonInclude;
88
import com.fasterxml.jackson.annotation.JsonSubTypes;
99
import com.fasterxml.jackson.annotation.JsonTypeInfo;
10-
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ArrayPropertyValue;
1110
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ClassificationEntityExtension;
1211
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceAuditHeader;
1312
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceElementHeader;
@@ -17,7 +16,6 @@
1716
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefElementHeader;
1817

1918
import java.io.Serializable;
20-
import java.util.Objects;
2119

2220
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
2321
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;
@@ -96,38 +94,4 @@ public void setHeaderVersion(long headerVersion)
9694
}
9795

9896

99-
/**
100-
* Validate that an object is equal depending on their stored values.
101-
*
102-
* @param objectToCompare object
103-
* @return boolean result
104-
*/
105-
@Override
106-
public boolean equals(Object objectToCompare)
107-
{
108-
if (this == objectToCompare)
109-
{
110-
return true;
111-
}
112-
if (! (objectToCompare instanceof RepositoryElementHeader))
113-
{
114-
return false;
115-
}
116-
117-
RepositoryElementHeader that = (RepositoryElementHeader) objectToCompare;
118-
119-
return headerVersion == that.headerVersion;
120-
}
121-
122-
123-
/**
124-
* Return a hash code based on the property values
125-
*
126-
* @return int hash code
127-
*/
128-
@Override
129-
public int hashCode()
130-
{
131-
return (int) (headerVersion ^ (headerVersion >>> 32));
132-
}
13397
}

open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/ArrayPropertyValue.java

+9-22
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import org.odpi.openmetadata.repositoryservices.ffdc.OMRSErrorCode;
99
import org.odpi.openmetadata.repositoryservices.ffdc.exception.OMRSRuntimeException;
1010

11+
import java.util.Objects;
12+
1113
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
1214
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;
1315

@@ -30,8 +32,7 @@ public class ArrayPropertyValue extends InstancePropertyValue
3032
/**
3133
* Default constructor sets the array to empty.
3234
*/
33-
public ArrayPropertyValue()
34-
{
35+
public ArrayPropertyValue() {
3536
super(InstancePropertyCategory.ARRAY);
3637
}
3738

@@ -167,8 +168,7 @@ public void setArrayValues(InstanceProperties arrayValues) {
167168
* @return JSON style description of variables.
168169
*/
169170
@Override
170-
public String toString()
171-
{
171+
public String toString() {
172172
return "ArrayPropertyValue{" +
173173
"arrayCount=" + arrayCount +
174174
", arrayValues=" + arrayValues +
@@ -192,22 +192,13 @@ public boolean equals(Object objectToCompare)
192192
{
193193
return true;
194194
}
195-
if (! (objectToCompare instanceof ArrayPropertyValue))
196-
{
197-
return false;
198-
}
199-
if (! super.equals(objectToCompare))
195+
if (objectToCompare == null || getClass() != objectToCompare.getClass())
200196
{
201197
return false;
202198
}
203-
204199
ArrayPropertyValue that = (ArrayPropertyValue) objectToCompare;
205-
206-
if (arrayCount != that.arrayCount)
207-
{
208-
return false;
209-
}
210-
return arrayValues != null ? arrayValues.equals(that.arrayValues) : that.arrayValues == null;
200+
return arrayCount == that.arrayCount &&
201+
Objects.equals(arrayValues, that.arrayValues);
211202
}
212203

213204

@@ -217,11 +208,7 @@ public boolean equals(Object objectToCompare)
217208
* @return int hash code
218209
*/
219210
@Override
220-
public int hashCode()
221-
{
222-
int result = super.hashCode();
223-
result = 31 * result + arrayCount;
224-
result = 31 * result + (arrayValues != null ? arrayValues.hashCode() : 0);
225-
return result;
211+
public int hashCode() {
212+
return Objects.hash(arrayCount, arrayValues);
226213
}
227214
}

open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/ClassificationEntityExtension.java

+6-18
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
package org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances;
44

55

6+
import java.util.Objects;
7+
68
/**
79
* ClassificationEntityExtension is used to represent a single classification for an entity.
810
* It includes the details of the classification and an entity proxy to define which entity
@@ -16,8 +18,6 @@ public class ClassificationEntityExtension extends InstanceElementHeader
1618
private Classification classification = null;
1719
private EntityProxy entityToClassify = null;
1820

19-
public static final long CURRENT_CLASSIFICATION_EXT_HEADER_VERSION = 1;
20-
2121

2222
/**
2323
* Default constructor
@@ -117,22 +117,13 @@ public boolean equals(Object objectToCompare)
117117
{
118118
return true;
119119
}
120-
if (! (objectToCompare instanceof ClassificationEntityExtension))
121-
{
122-
return false;
123-
}
124-
if (! super.equals(objectToCompare))
120+
if (objectToCompare == null || getClass() != objectToCompare.getClass())
125121
{
126122
return false;
127123
}
128-
129124
ClassificationEntityExtension that = (ClassificationEntityExtension) objectToCompare;
130-
131-
if (classification != null ? ! classification.equals(that.classification) : that.classification != null)
132-
{
133-
return false;
134-
}
135-
return entityToClassify != null ? entityToClassify.equals(that.entityToClassify) : that.entityToClassify == null;
125+
return Objects.equals(getClassification(), that.getClassification()) &&
126+
Objects.equals(getEntityToClassify(), that.getEntityToClassify());
136127
}
137128

138129

@@ -144,9 +135,6 @@ public boolean equals(Object objectToCompare)
144135
@Override
145136
public int hashCode()
146137
{
147-
int result = super.hashCode();
148-
result = 31 * result + (classification != null ? classification.hashCode() : 0);
149-
result = 31 * result + (entityToClassify != null ? entityToClassify.hashCode() : 0);
150-
return result;
138+
return Objects.hash(getClassification(), getEntityToClassify());
151139
}
152140
}

open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/metadatacollectionstore/properties/instances/EnumPropertyValue.java

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ public boolean equals(Object objectToCompare)
189189
@Override
190190
public int hashCode()
191191
{
192+
192193
return Objects.hash(super.hashCode(), getOrdinal(), getSymbolicName(), getDescription());
193194
}
194195
}

0 commit comments

Comments
 (0)