Skip to content

Commit 9bbe4e5

Browse files
committed
Address latest PR feedback
- Wrap return value in Collections.unmodifiableMap() to prevent external mutation - Update license headers for new files to use the new format - Throw IllegalStateException instead of returning null in get() method Signed-off-by: Manuel Mangas Zurita <mzurita@amazon.com>
1 parent 90bae7e commit 9bbe4e5

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

data-prepper-core/src/main/java/org/opensearch/dataprepper/core/parser/config/MetricsConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ private EMFLoggingRegistryConfig createEMFLoggingRegistryConfig(final DataPreppe
192192
return new EMFLoggingRegistryConfig() {
193193
@Override
194194
public String get(String key) {
195-
return null;
195+
throw new IllegalStateException("This method should never be called under normal circumstances");
196196
}
197197

198198
@Override
199199
public Map<String, String> additionalProperties() {
200-
return dataPrepperConfiguration.getEmfAdditionalProperties();
200+
return Collections.unmodifiableMap(dataPrepperConfiguration.getEmfAdditionalProperties());
201201
}
202202
};
203203
}

data-prepper-core/src/main/java/org/opensearch/dataprepper/core/parser/model/EmfConfig.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
/*
22
* Copyright OpenSearch Contributors
33
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* The OpenSearch Contributors require contributions made to
6+
* this file be licensed under the Apache-2.0 license or a
7+
* compatible open source license.
8+
*
49
*/
510

611
package org.opensearch.dataprepper.core.parser.model;

data-prepper-core/src/test/java/org/opensearch/dataprepper/core/parser/model/EmfConfigTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
/*
22
* Copyright OpenSearch Contributors
33
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* The OpenSearch Contributors require contributions made to
6+
* this file be licensed under the Apache-2.0 license or a
7+
* compatible open source license.
8+
*
49
*/
510

611
package org.opensearch.dataprepper.core.parser.model;

0 commit comments

Comments
 (0)