Skip to content

Commit

Permalink
Clarify ContextN.putAll(Map) intended internal use in javadoc (#3103)
Browse files Browse the repository at this point in the history
The Javadoc clarifies expectations for internal usage of package private
`ContextN.putAll(Map)` method that is inheritted from `Map` interface
in terms of `null` keys and values.
  • Loading branch information
chemicL authored Jul 5, 2022
1 parent 3cfd0a7 commit bc40e94
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion reactor-core/src/main/java/reactor/util/context/ContextN.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 VMware Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2015-2022 VMware Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -165,6 +165,20 @@ public void unsafePutAllInto(ContextN other) {
other.putAll((Map<Object, Object>) this);
}

/**
* This method is part of the {@link Map} API. As this is an internal
* implementation detail, no validation of the {@link Map} keys or values is
* performed. I.e. the caller must ensure they are not null, otherwise this
* {@link Context} will have disallowed mappings.
* Despite being public, this API is not exposed to end users and can be used
* internally for means of populating the inner contents of {@link ContextN}.
*
* @param m mappings to be stored in this map
*/
public void putAll(Map<?, ?> m) {
super.putAll(m);
}

@Override
public Context putAll(ContextView other) {
if (other.isEmpty()) return this;
Expand Down

0 comments on commit bc40e94

Please sign in to comment.