Skip to content

Commit 30ebc3b

Browse files
committed
Remove superfluous AnnotationAttributes#putIfAbsent implementation
Since Java 8, putIfAbsent() is a standard method in java.util.Map. We therefore no longer need the custom implementation that overrides the standard implementation in HashMap.
1 parent a092dc0 commit 30ebc3b

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

spring-core/src/main/java/org/springframework/core/annotation/AnnotationAttributes.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -369,26 +369,6 @@ private void assertAttributeType(String attributeName, Object attributeValue, Cl
369369
}
370370
}
371371

372-
/**
373-
* Store the supplied {@code value} in this map under the specified
374-
* {@code key}, unless a value is already stored under the key.
375-
* @param key the key under which to store the value
376-
* @param value the value to store
377-
* @return the current value stored in this map, or {@code null} if no
378-
* value was previously stored in this map
379-
* @see #get
380-
* @see #put
381-
* @since 4.2
382-
*/
383-
@Override
384-
public Object putIfAbsent(String key, Object value) {
385-
Object obj = get(key);
386-
if (obj == null) {
387-
obj = put(key, value);
388-
}
389-
return obj;
390-
}
391-
392372
@Override
393373
public String toString() {
394374
Iterator<Map.Entry<String, Object>> entries = entrySet().iterator();

0 commit comments

Comments
 (0)