joptsimple.internal.Reflection does not handle autoboxing #5

Closed
dyokomizo opened this Issue Aug 30, 2011 · 3 comments

Comments

Projects
None yet
2 participants
@dyokomizo

It would be nice if using parser.ofType(int.class) was equivalent to parser.ofType(Integer.class), but currently it fails because Reflection doesn't handle autoboxing.

Generics specification makes int.class and Integer.class equivalent for generic purposes (i.e. parser.ofType(int.class) is of type ArgumentAcceptingOptionSpec.

@pholser

This comment has been minimized.

Show comment
Hide comment
@pholser

pholser Aug 30, 2011

Collaborator

That sounds like a reasonable, simple change.

Collaborator

pholser commented Aug 30, 2011

That sounds like a reasonable, simple change.

pholser added a commit that referenced this issue Aug 30, 2011

gh-5 -- Allowing classes representing primitives into ofType().
Currently char.class still bombs out, since java.lang.Character has neither a valueOf(String) method nor a one-arg String ctor. Maybe this is OK? Using ofType(Character.class) would fail before this change anyways.
@pholser

This comment has been minimized.

Show comment
Hide comment
@pholser

pholser Aug 30, 2011

Collaborator

If you're OK with char/Character still not counting as "value types" for purposes of option arg conversion, I think the above commit settles it. Let me know what you think.

Collaborator

pholser commented Aug 30, 2011

If you're OK with char/Character still not counting as "value types" for purposes of option arg conversion, I think the above commit settles it. Let me know what you think.

@dyokomizo

This comment has been minimized.

Show comment
Hide comment
@dyokomizo

dyokomizo Aug 31, 2011

This seems to good enough. Thanks for the fix.

This seems to good enough. Thanks for the fix.

@dyokomizo dyokomizo closed this Aug 31, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment