MicroProfile Config: not using value from higher ordinal source with profile?

Hi there!

While using Payara Server Full Profile inside a Docker container, I made my application use a MP Config Profile called “ct” by setting the environment variable.

Having a default value in my microprofile-config .properties for a certain value %ct.dataverse.solr.host=solr, I noticed this was not overwritten when setting an environment variable DATAVERSE_SOLR_HOST=foobar.

When setting a variable _CT_DATAVERSE_SOLR_HOST, the setting was changed as expected.

My question is now: is this a bug or is this compliant to spec?

Reading MPC 3.0 spec, it says about profiles:

Conforming implementations are required to search for a configuration source with the highest ordinal (priority) that provides either the property name or the “profile-specific” property name. If the configuration source provides the “profile-specific” name, the value of the “profile-specific” property will be returned. If it doesn’t contain the “profile-specific” name, the value of the plain property will be returned.

Reading the discussion when the spec for profiles was written, it seems people agreed to make a profiled value provided by a lower ordinal source overrideable by a non-profiled setting in a higher ordinal source.

Looking at the resolver code, it seems the ordinality of a source is not taken into account. (BTW: it seems the core business logoc of resolving order etc hasn’t been touched since Payara 4.1.192 and latest greatest Payara 6.2023.x) But I might be wrong there. Can someone enlighten me here, please?

This is not a bug report (yet?), but if it helps I sure can provide a reproducer. Plz let me know.

Thank you very much!