MP-Config 1.2.1: getPropertyNames() implementation question

11 views
Skip to first unread message

Laird Nelson

unread,
Jun 7, 2018, 7:41:06 PM6/7/18
to Eclipse MicroProfile

The specification says only this little bit about mutable data (https://github.com/eclipse/microprofile-config/blob/master/spec/src/main/asciidoc/configsources.asciidoc#configsource-and-mutable-data):

A Config instance provides no caching [1] but iterates over all ConfigSources for each getValue(String) operation. A ConfigSource is allowed to cache the underlying values itself.

This ([1]) suggests to me, but does not specify, that Config.getPropertyNames() must not cache the results of its ConfigSource#getPropertyNames() invocations.

In other words, must my implementation of Config#getPropertyNames() look like this (pseudocode, typed without checking):

Set<String> allPropertyNames = new HashSet<>();
for (final ConfigSource myConfigSource : myConfigSources) {
  allPropertyNames.addAll(myConfigSource.getPropertyNames());
}
return allPropertyNames;


Is this entire area undefined?

Thanks,
Best,
Laird

Laird Nelson

unread,
Jun 8, 2018, 2:23:30 PM6/8/18
to Eclipse MicroProfile
Reply all
Reply to author
Forward
0 new messages