EmptyHeaders get with default value returns null
Motivation: EmptyHeaders#get with a default value argument returns null. It should never return null, and instead it should return the default value. Modifications: - EmptyHeaders#get with a default value should return that default value Result: More correct implementation of the Headers API.
This commit is contained in:
parent
352e36a179
commit
6e5fd9311f
@ -30,7 +30,7 @@ public class EmptyHeaders<K, V, T extends Headers<K, V, T>> implements Headers<K
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public V get(K name, V defaultValue) {
|
public V get(K name, V defaultValue) {
|
||||||
return null;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -40,7 +40,7 @@ public class EmptyHeaders<K, V, T extends Headers<K, V, T>> implements Headers<K
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public V getAndRemove(K name, V defaultValue) {
|
public V getAndRemove(K name, V defaultValue) {
|
||||||
return null;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user