Skip to content

Commit 1168690

Browse files
committed
ATLAS-4763: Update copy constructor of AtlasClassification
- Fix the shallow copy issue.
1 parent 3cf0436 commit 1168690

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ public AtlasClassification(Map map) {
8181
}
8282

8383
public AtlasClassification(AtlasClassification other) {
84+
super(other);
85+
8486
if (other != null) {
85-
setTypeName(other.getTypeName());
86-
setAttributes(other.getAttributes());
8787
setEntityGuid(other.getEntityGuid());
8888
setEntityStatus(other.getEntityStatus());
8989
setPropagate(other.isPropagate());

Diff for: intg/src/main/java/org/apache/atlas/model/instance/AtlasStruct.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ public AtlasStruct(Map map) {
102102
public AtlasStruct(AtlasStruct other) {
103103
if (other != null) {
104104
setTypeName(other.getTypeName());
105-
setAttributes(new HashMap<>(other.getAttributes()));
105+
if (other.getAttributes() != null) {
106+
setAttributes(new HashMap<>(other.getAttributes()));
107+
}
106108
}
107109
}
108110

0 commit comments

Comments
 (0)