Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion Output Tree has a bug with InputConverters #4

Open
bergerkiller opened this issue Jun 17, 2017 · 1 comment
Open

Conversion Output Tree has a bug with InputConverters #4

bergerkiller opened this issue Jun 17, 2017 · 1 comment

Comments

@bergerkiller
Copy link
Member

The output conversion tree is used to chain up converters in optimal routes from all possible input types towards a given output type. The problem is that Input Converters mess this up a little, because they use Object as input type. As a result, I see cases where it lazy-converts and Object to a String and then feeds that into the input converter.

Input converters shouldn't at all be stored in the conversion tree. They should instead be queried for every new input type to populate new converters (getConverter()).

@bergerkiller
Copy link
Member Author

Input converters need to provide information about what input types are supported. Without this there is no way to link up input converters together with normal converters to create a valid chain. This also ends the problem of having more than one input converter creating the same type; right now this fails due to the Output List.

Suggested is storing a List of supported input types which can be queried. The default 'input' field of the converter should default to Object at all times. Add a function called 'getInputs()' to query the real generic input types, and a protected 'addInput' member to register new types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant