-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Use ParameterizedTypeReference in REST method calls #1467
Use ParameterizedTypeReference in REST method calls #1467
Conversation
Generic response class is natively supported in Spring for Android 2.0. This commit utilize that support, if it is available in the reponse class is generic. It falls back to the old implementation otherwise.
49c284d to
2507b1e
Compare
|
Unfortunately this does not work for multiple reasons:
However i am leaving this branch if anybody wants to continue. |
|
might this #1489 help for the second point? |
|
Yeah, i also thought about that. But i am stranded about the first. :( |
|
could you elaborate on the issue? what cases do you mean? maybe we can find a solution together :) |
|
Thanks for helping out! I really appreciate that. In this class, there are lots of cases when arrays and generics are used together. There are two problems with my solution:
You can check out this branch and see for yourself. You have to upgrade the Spring Android version in the POM to <repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories> |
|
I'll try to take a look on it this weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt the expectedType be declaredType? if not you should remove the unused variable declaredType.
|
Good job! Let's open a PR. However, we cannot merge that yet, since the |
|
shall i open the PR from my branch? |
|
Yes, please, so until that other people can comment. |
Generic response class is natively supported in Spring for Android 2.0. This change utilizes that support, if it is available and the reponse class is generic. It falls back to the old implementation otherwise.
Unfortunetaly there is no way to add this to the compile or functional tests.
Related to #1440.