Skip to content

Commit

Permalink
S2U-28-32 Tags fixes (#11752)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusmmp authored and Miguel Pellicer committed Nov 17, 2023
1 parent 62e7ba9 commit 65fc84b
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,9 @@ public void updateTagAssociations(String collectionId, String itemId, List<Strin
if (StringUtils.isEmpty(tagId) || oldAssociationIds.contains(tagId)) {
continue;
}
byte[] bytes = tagId.getBytes();
byte[] copy = new byte[TAG_MAX_LABEL];
// new tag, we create it
if (bytes.length > TAG_MAX_LABEL) {
System.arraycopy(bytes, 0, copy, 0, TAG_MAX_LABEL);
tagId = new String(copy);
// we cut the tag
if (tagId.length() > TAG_MAX_LABEL) {
tagId = tagId.substring(0, TAG_MAX_LABEL);
}
// new association, check tag exists
Tag t = tags.getForId(tagId).orElse(null);
Expand Down

0 comments on commit 65fc84b

Please sign in to comment.