Closed GoogleCodeExporter closed 9 years ago
There's something weird about what the JDK does with arrays across JDK
versions. I forget the details. Ben will know.
Original comment by cpov...@google.com
on 25 Nov 2013 at 8:20
I found a related JDK issue,
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041784
It looks like a fix was applied for 7 that makes an explicit check for this
scenario. It looks like the same fix could be applied to Guava.
Original comment by chris.th...@bronto.com
on 25 Nov 2013 at 9:01
So I see now that this isn't a problem for Guava running on top of JDK 7, but
it would be nice for Guava to work around this issue for older JDKs.
Original comment by chris.th...@bronto.com
on 25 Nov 2013 at 9:58
This was intentional.
Currently TypeToken stays consistent with whatever JDK it runs in.
In Java 7, getGenericReturnType() for the follow method includes int[].class:
List<int[]> foo();
In Java 6, the same getGenericReturnType() includes GenericArrayType.
The rationale is:
* If it's broken, it's already broken. By staying consistent with JDK, we aren't making things more surprising.
* Migrating from Java 6 to Java 7 does have slight behavior difference. But presumably other reflection code already has to deal with this behavior difference.
Original comment by be...@google.com
on 26 Nov 2013 at 1:53
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:10
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:17
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
chris.th...@bronto.com
on 25 Nov 2013 at 8:17