Skip to content

ConfigImpl doesn't respect key order #35

@esuomi

Description

@esuomi

This is a very simple use case: A list of common steps (configuration for scheduling, processing order etc.) with inter-dependent order is configured using namespaced keys, like this:

tasks.prepare.args="collect,store"
tasks.process.args="count"
tasks.cleanup.args="deleteTemps"

Expected: When iterating the keys under tasks, the order is [prepare, process, cleanup].
Actual: Dependent on JDK's HashMap implementation.

The simplest fix for this would be to use LinkedHashMap instead. As a workaround I now need to add a number as additional key to each task and then sort afterwards the objects created based on the configuration using that number to get them into order I want to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions