Git Product home page Git Product logo

Comments (4)

A248 avatar A248 commented on August 21, 2024

Can you elaborate on and clarify the matter? Also, can you state whether this is a bug or a feature request?

from dazzleconf.

BlueTree242 avatar BlueTree242 commented on August 21, 2024

its a bug, when you make map of string and nested section, and soon add new value to nested section, the config is reset

from dazzleconf.

A248 avatar A248 commented on August 21, 2024

This is a bug, but it is a design bug rather than a functional bug. The fix is more difficult than it seems.

When you load the configuration with fallback-to-default behavior, what really happens is default values are created using ConfigurationFactory#loadDefaults. These defaults are then provided to the #load method as auxiliary values (auxiliary values are fallback values). When a configuration option is processed, we have access only to the auxiliary value of the entire configuration option.

Therefore, in the current design, we have only access to the Map<String, YourConfSection> default value but not the YourConfSection default value. Solving this would require a design rework. Possible options:

  • Use a node system of ConfigEntry and ConfigValue<T> objects, which can provide additional metadata. This will happen at some point, but it would be a breaking change, and so must either wait until 2.0 or be established with backwards compatibility in mind.
  • Creating another #load method on ConfigurationFactory which provides more dynamic handling of auxiliary values, such that they could be requested on-demand from different sources.
  • Various "hacks" are possible, including adding a toggle to ConfigurationOptions to provide special behavior for your situation.

from dazzleconf.

BlueTree242 avatar BlueTree242 commented on August 21, 2024

Oh! Looks really complicated, whatever it is i am waiting (let me know when there is a beta)

from dazzleconf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.