Skip to content

Commit 911eefe

Browse files
committed
make collections in config not modifiable
1 parent d9918ac commit 911eefe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jmx-scraper/src/main/java/io/opentelemetry/contrib/jmxscraper/config/JmxScraperConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ public static JmxScraperConfig fromConfig(ConfigProperties config) {
171171
}
172172
});
173173

174-
scraperConfig.jmxConfig = jmxConfig;
175-
scraperConfig.targetSystems = new HashSet<>(targetSystem);
174+
scraperConfig.jmxConfig = Collections.unmodifiableList(jmxConfig);
175+
scraperConfig.targetSystems = Collections.unmodifiableSet(new HashSet<>(targetSystem));
176176

177177
scraperConfig.username = config.getString("otel.jmx.username");
178178
scraperConfig.password = config.getString("otel.jmx.password");

0 commit comments

Comments
 (0)