yuqi1129 commented on code in PR #7830:
URL: https://github.com/apache/gravitino/pull/7830#discussion_r2241396864
##########
server/src/main/java/org/apache/gravitino/server/web/rest/MetadataObjectTagOperations.java:
##########
@@ -163,7 +163,7 @@ public Response listTagsForMetadataObject(
MetadataObjects.parse(
fullName,
MetadataObject.Type.valueOf(type.toUpperCase(Locale.ROOT)));
- List<TagDTO> tags = Lists.newArrayList();
+ Set<TagDTO> tags = Sets.newHashSet();
Review Comment:
The problem is that `equals` method in TagDTO is
```java
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof TagDTO)) {
return false;
}
TagDTO tagDTO = (TagDTO) o;
return Objects.equal(name, tagDTO.name)
&& Objects.equal(comment, tagDTO.comment)
&& Objects.equal(properties, tagDTO.properties)
&& Objects.equal(audit, tagDTO.audit);
}
```
So there can be two different `TagDTO` with the same `name`, that is why I
say `The size of the result may not be consistent with different value verbose
here.`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]