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

ApiObjectFieldDoc fails on Maps that contain either a key or value that is a ParameterizedType #33

Closed
jimmorgan opened this issue Oct 30, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@jimmorgan
Copy link

When resolving a parameterized map in ApiObjectField, the key and value classes are pulled from the parameterizedType actualTypeArguments array and then cast to Class<?>. If the key or value is also a ParameterizedType, then this cast fails. To do this properly, the returned type should be recursively walked until all ParameterizedType returns are resolved. Either that or punt and use the raw type.

Specifically, I have a field declared as:
Map<String, Set> map;
I should expect getFieldObject to either return ["Map", "String", "Set", "map"] or ["Map", "String", "Set", "map"](or, at worse: ["Map", "String", null, "map"])

Handling of generics is probably present elsewhere in the code and might be best handled by a utility method that returns a Class for a given Type.

@fabiomaffioletti fabiomaffioletti added this to the 1.0.5 milestone Nov 18, 2014
@fabiomaffioletti fabiomaffioletti self-assigned this Nov 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants