HADOOP-18487. Disable spotbugs warnings of currency issues
It's not a real issue, just risk of duplicate writing to the cache, where that is considered acceptable. Change-Id: I11ef64d2bd0a303e678e114fb38317194d1b50cd
This commit is contained in:
parent
fc4a4e9a9a
commit
def228225d
|
@ -451,7 +451,7 @@
|
|||
</Match>
|
||||
|
||||
<Match>
|
||||
<Class name="org.apache.hadoop.ipc.impl.ShadedProtobufHelper" />
|
||||
<Class name="org.apache.hadoop.ipc.internal.ShadedProtobufHelper" />
|
||||
<Bug pattern="AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION" />
|
||||
</Match>
|
||||
</FindBugsFilter>
|
||||
|
|
|
@ -83,12 +83,7 @@ public final class ShadedProtobufHelper {
|
|||
ByteString value = FIXED_BYTESTRING_CACHE.get(key);
|
||||
if (value == null) {
|
||||
value = ByteString.copyFromUtf8(key.toString());
|
||||
final Text key1 = new Text(key.copyBytes());
|
||||
synchronized (FIXED_BYTESTRING_CACHE) {
|
||||
if (FIXED_BYTESTRING_CACHE.get(key1) == null) {
|
||||
FIXED_BYTESTRING_CACHE.put(key1, value);
|
||||
}
|
||||
}
|
||||
FIXED_BYTESTRING_CACHE.put(new Text(key.copyBytes()), value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
@ -102,11 +97,7 @@ public final class ShadedProtobufHelper {
|
|||
ByteString value = FIXED_BYTESTRING_CACHE.get(key);
|
||||
if (value == null) {
|
||||
value = ByteString.copyFromUtf8(key);
|
||||
synchronized (FIXED_BYTESTRING_CACHE) {
|
||||
if (FIXED_BYTESTRING_CACHE.get(key) == null) {
|
||||
FIXED_BYTESTRING_CACHE.put(key, value);
|
||||
}
|
||||
}
|
||||
FIXED_BYTESTRING_CACHE.put(key, value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue