@@ -255,7 +255,12 @@ public Map<String, String> getMergedMap(String key, String... aliases) {
255255 String value = sources [i ].get (key , aliases );
256256 Map <String , String > parsedMap = ConfigConverter .parseMap (value , key );
257257 if (!parsedMap .isEmpty ()) {
258- origin = sources [i ].origin ();
258+ if (origin != ConfigOrigin .DEFAULT ) {
259+ // if we already have a non-default origin, the value is calculated from multiple sources
260+ origin = ConfigOrigin .CALCULATED ;
261+ } else {
262+ origin = sources [i ].origin ();
263+ }
259264 }
260265 merged .putAll (parsedMap );
261266 }
@@ -277,7 +282,12 @@ public Map<String, String> getMergedTagsMap(String key, String... aliases) {
277282 Map <String , String > parsedMap =
278283 ConfigConverter .parseTraceTagsMap (value , ':' , Arrays .asList (',' , ' ' ));
279284 if (!parsedMap .isEmpty ()) {
280- origin = sources [i ].origin ();
285+ if (origin != ConfigOrigin .DEFAULT ) {
286+ // if we already have a non-default origin, the value is calculated from multiple sources
287+ origin = ConfigOrigin .CALCULATED ;
288+ } else {
289+ origin = sources [i ].origin ();
290+ }
281291 }
282292 merged .putAll (parsedMap );
283293 }
@@ -298,7 +308,12 @@ public Map<String, String> getOrderedMap(String key) {
298308 String value = sources [i ].get (key );
299309 Map <String , String > parsedMap = ConfigConverter .parseOrderedMap (value , key );
300310 if (!parsedMap .isEmpty ()) {
301- origin = sources [i ].origin ();
311+ if (origin != ConfigOrigin .DEFAULT ) {
312+ // if we already have a non-default origin, the value is calculated from multiple sources
313+ origin = ConfigOrigin .CALCULATED ;
314+ } else {
315+ origin = sources [i ].origin ();
316+ }
302317 }
303318 merged .putAll (parsedMap );
304319 }
@@ -322,7 +337,13 @@ public Map<String, String> getMergedMapWithOptionalMappings(
322337 Map <String , String > parsedMap =
323338 ConfigConverter .parseMapWithOptionalMappings (value , key , defaultPrefix , lowercaseKeys );
324339 if (!parsedMap .isEmpty ()) {
325- origin = sources [i ].origin ();
340+ if (origin != ConfigOrigin .DEFAULT ) {
341+ // if we already have a non-default origin, the value is calculated from multiple
342+ // sources
343+ origin = ConfigOrigin .CALCULATED ;
344+ } else {
345+ origin = sources [i ].origin ();
346+ }
326347 }
327348 merged .putAll (parsedMap );
328349 }
0 commit comments