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:
Scott Mitchell 2018-03-01 20:30:37 -08:00 committed by Norman Maurer
parent 352e36a179
commit 6e5fd9311f

View File

@ -30,7 +30,7 @@ public class EmptyHeaders<K, V, T extends Headers<K, V, T>> implements Headers<K
@Override
public V get(K name, V defaultValue) {
return null;
return defaultValue;
}
@Override
@ -40,7 +40,7 @@ public class EmptyHeaders<K, V, T extends Headers<K, V, T>> implements Headers<K
@Override
public V getAndRemove(K name, V defaultValue) {
return null;
return defaultValue;
}
@Override