frjaeger220 / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Improve MoreTypes.getRawType() handling of array types #437

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently MoreTypes.getRawType() returns Object[].class for array types.
This makes it hard to use reflection with TypeLiterals, unless you add
special case code for array types.

Original issue reported on code.google.com by mccu...@gmail.com on 12 Oct 2009 at 8:13

GoogleCodeExporter commented 9 years ago
Suggested patch to return correct raw array types. Uses Array.newInstance() to 
create
a zero-length array of the raw component type and then returns the array's 
type. This
is simpler than going through all the reflection calls and checks ourselves.

Original comment by mccu...@gmail.com on 12 Oct 2009 at 8:20

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed with r1117. If you'd like to contribute a testcase also, that woud be 
quite 
welcome.

Original comment by limpbizkit on 12 Oct 2009 at 10:59