Skip to content

Commit

Permalink
NIFI-14072 Restored support for partial updates of Labels (apache#9575)
Browse files Browse the repository at this point in the history
Signed-off-by: David Handermann <[email protected]>
  • Loading branch information
pvillard31 authored Dec 14, 2024
1 parent 9c79c87 commit 8d2db60
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

@Repository
Expand Down Expand Up @@ -99,7 +101,9 @@ public Label updateLabel(LabelDTO labelDTO) {
label.setPosition(new Position(labelDTO.getPosition().getX(), labelDTO.getPosition().getY()));
}
if (labelDTO.getStyle() != null) {
label.setStyle(labelDTO.getStyle());
final Map<String, String> updatedStyles = new HashMap<>(label.getStyle());
updatedStyles.putAll(labelDTO.getStyle());
label.setStyle(updatedStyles);
}
if (labelDTO.getLabel() != null) {
label.setValue(labelDTO.getLabel());
Expand Down

0 comments on commit 8d2db60

Please sign in to comment.