File formats don't use parent configuration

Description

None of the current file format implementations (e.g. PropertiesConfigurationFileFormat) use the parent configuration passed to them when loading, breaking the fallback chain. For example:

should be

This needs fixed for all the file formats.

Environment

None

Activity

Show:
Garret Wilson
October 24, 2018, 2:01 PM

We probably need to add a unit test to each file format where we pass it a parent configuration. (Whether you add it to the existing test or or create a new one is up to you.) It's easy to create a parent configuration; here's the Java 9+ version:

For this (currently) Java 8 code you can look up an easy way to create a map, but that's the idea.

Magno Nascimento
October 25, 2018, 1:49 PM
Edited

I think you didn't express yourself correctly on this ticket.

We should yet have both of these options:

But the problem is that findParameterImpl(key) or load(configuration, parentConfiguration) is not actually looking at the parent configuration, if provided, and the property is not present on the actual configuration.

This is what this ticket is about, right?

Garret Wilson
October 25, 2018, 1:52 PM

parentConfiguration is nullable and can simply be passed along. The problem is that it is not being passed along.

I think you didn't express yourself correctly on this ticket.

Isn't "X should be Y" pretty clear?

Magno Nascimento
October 25, 2018, 1:55 PM
Edited

Ooh, I see the problem, you're talking about the internal implementation, by your example I thought that the user is the one that should be doing that.

Garret Wilson
October 25, 2018, 2:00 PM

I gave an example class: PropertiesConfigurationFileFormat

Assignee

Magno Nascimento

Reporter

Garret Wilson

Labels

None

Fix versions

Affects versions

Priority

Critical
Configure