Skip to content

Guice module breaks when binding configs of config that has empty list #1337

@ajcamilo

Description

@ajcamilo

Guice module breaks when binding configs of config that has empty list. (Jooby 2.0)

In JoobyModule class, line 69:

      if (value instanceof List) {
        List values = (List) value;
        Type listType = Types.listOf(values.iterator().next().getClass());
        Key key = Key.get(listType, Names.named(name));
        bind(key).toInstance(values);
        value = values.stream().map(Object::toString).collect(Collectors.joining(","));
      }

This will break if the config has:

some.property = []

I understand the problem that this is trying to resolve. But somehow this worked in jooby 1.x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions