Skip to content

How must converters be indexed? #740

@ljnelson

Description

@ljnelson

Suppose I call Config.getOptionalValue("foo", CharSequence.class).

Suppose there is not a Converter indexed under CharSequence.class directly.

Suppose there is a Converter registered under String.class (there must be, if I read the specification properly, because String has a valueOf() method).

Must the Converter<String> be used in this case by a Config implementation? If so, could you provide the specification reference, please?

Or: Must it not be used? If not, could you provide the specification reference, please? Will an IllegalArgumentException be thrown (I presume that is the exception that is thrown if conversion cannot happen for any reason)?

May it be used? (If this area is undefined, then what, honestly asking, is the purpose of this particular method?)

(The javadoc for getOptionalValue() also does not require that converters be used at all, i.e. it would be legal for a Config implementation to do whatever it wants in this method to perform conversion. But that's a separate issue that was never fully resolved.)

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