File tree Expand file tree Collapse file tree
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema
hugegraph-struct/src/main/java/org/apache/hugegraph/struct/schema Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,14 +130,13 @@ public Object defaultValue() {
130130 // value (e.g. Date) comes back as a String. Normalize it to the
131131 // runtime type expected by this property key's data type. Idempotent
132132 // for values already of the expected type.
133- Object normalized = this .validValueOrThrow (value );
134-
135- // For SET cardinality, ensure we return a Set container and collapse duplicates
136- if (this .cardinality == Cardinality .SET && normalized instanceof Collection ) {
137- return new LinkedHashSet <>((Collection <?>) normalized );
133+ Object raw = value ;
134+ if (this .cardinality == Cardinality .SET && value instanceof Collection &&
135+ !(value instanceof Set )) {
136+ raw = new LinkedHashSet <>((Collection <?>) value );
138137 }
139138
140- return normalized ;
139+ return this . validValueOrThrow ( raw ) ;
141140 }
142141
143142 public boolean hasSameContent (PropertyKey other ) {
Original file line number Diff line number Diff line change @@ -135,14 +135,13 @@ public Object defaultValue() {
135135 // value (e.g. Date) comes back as a String. Normalize it to the
136136 // runtime type expected by this property key's data type. Idempotent
137137 // for values already of the expected type.
138- Object normalized = this .validValueOrThrow (value );
139-
140- // For SET cardinality, ensure we return a Set container and collapse duplicates
141- if (this .cardinality == Cardinality .SET && normalized instanceof Collection ) {
142- return new LinkedHashSet <>((Collection <?>) normalized );
138+ Object raw = value ;
139+ if (this .cardinality == Cardinality .SET && value instanceof Collection &&
140+ !(value instanceof Set )) {
141+ raw = new LinkedHashSet <>((Collection <?>) value );
143142 }
144143
145- return normalized ;
144+ return this . validValueOrThrow ( raw ) ;
146145 }
147146
148147 public boolean hasSameContent (PropertyKey other ) {
You can’t perform that action at this time.
0 commit comments