NIFI-13682 Fixed Flow Versioning when changing Label styles (#9526)

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Pierre Villard 2024-11-15 23:16:09 +01:00 committed by GitHub
parent b623ccc7fe
commit 3fd3957b83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 5 deletions

View File

@ -29,8 +29,8 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
public class StandardLabel implements Label {
public static final long DEFAULT_Z_INDEX = 0;
@ -112,10 +112,7 @@ public class StandardLabel implements Label {
if (style != null) {
boolean updated = false;
while (!updated) {
final Map<String, String> existingStyles = this.style.get();
final Map<String, String> updatedStyles = new HashMap<>(existingStyles);
updatedStyles.putAll(style);
updated = this.style.compareAndSet(existingStyles, Collections.unmodifiableMap(updatedStyles));
updated = this.style.compareAndSet(this.style.get(), Collections.unmodifiableMap(style));
}
}
}