Fix semantic of DefaultAttribute impl on setIfAbsent

This commit is contained in:
Norman Maurer 2013-01-31 11:49:52 +01:00
parent 2d9cc9f63b
commit 2ad1451ce8

View File

@ -51,11 +51,13 @@ public class DefaultAttributeMap implements AttributeMap {
@Override
public T setIfAbsent(T value) {
if (compareAndSet(null, value)) {
return null;
} else {
return get();
while (!compareAndSet(null, value)) {
T old = get();
if (old != null) {
return old;
}
}
return null;
}
@Override