We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
Discovered this today inside: DefaultCreator.java
DefaultCreator.java
public <T> T createInstance(final Class<T> clazz) { try { return getNoArgsConstructor(clazz).newInstance(); } catch (Exception e) { if (Collection.class.isAssignableFrom(clazz)) { return (T) createList(null); } else if (Map.class.isAssignableFrom(clazz)) { return (T) createMap(null); } else if (Set.class.isAssignableFrom(clazz)) { return (T) createSet(null); } throw new MappingException("No usable constructor for " + clazz.getName(), e); } }
Problem is that an Set class is also a collection. To solve it just flip the if statments like so:
if (Set.class.isAssignableFrom(clazz)) { return (T) createSet(null); } else if (Map.class.isAssignableFrom(clazz)) { return (T) createMap(null); } else if (Collection.class.isAssignableFrom(clazz)) { return (T) createList(null); }
I would create a PR but i have some issues with my repo... :(
The text was updated successfully, but these errors were encountered:
307729f
No branches or pull requests
Hi,
Discovered this today inside:
DefaultCreator.java
Problem is that an Set class is also a collection. To solve it just flip the if statments like so:
I would create a PR but i have some issues with my repo... :(
The text was updated successfully, but these errors were encountered: