spring-cloud-openfeign
spring-cloud-openfeign copied to clipboard
Handle byte[] arrays correctly.(Fixes gh-741)
Fixes #741
Make AbstractFormWriter#isTypeOrCollection() handle byte[] arrays correctly instead of casting byte[] to object[] directly.
@pandaapo Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
@pandaapo Thank you for signing the Contributor License Agreement!
Is copying the array the only way around this?
Codecov Report
Merging #765 (ef43e0b) into main (d7fd71d) will increase coverage by
0.18%. The diff coverage is0.00%.
:exclamation: Current head ef43e0b differs from pull request most recent head a2f37be. Consider uploading reports for the commit a2f37be to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## main #765 +/- ##
============================================
+ Coverage 79.03% 79.22% +0.18%
- Complexity 539 545 +6
============================================
Files 65 65
Lines 2013 2026 +13
Branches 275 277 +2
============================================
+ Hits 1591 1605 +14
Misses 263 263
+ Partials 159 158 -1
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...rk/cloud/openfeign/support/AbstractFormWriter.java | 60.86% <0.00%> (-9.14%) |
:arrow_down: |
| ...ncer/RetryableFeignBlockingLoadBalancerClient.java | 61.81% <0.00%> (-0.57%) |
:arrow_down: |
| ...gframework/cloud/openfeign/FeignClientBuilder.java | 84.37% <0.00%> (ø) |
|
| ...mework/cloud/openfeign/FeignAutoConfiguration.java | 90.14% <0.00%> (ø) |
|
| ...ork/cloud/openfeign/DefaultFeignLoggerFactory.java | 100.00% <0.00%> (ø) |
|
| ...eign/annotation/CookieValueParameterProcessor.java | 94.11% <0.00%> (ø) |
|
| ...mework/cloud/openfeign/FeignClientFactoryBean.java | 77.48% <0.00%> (+0.29%) |
:arrow_up: |
| ...amework/cloud/openfeign/support/SpringEncoder.java | 84.88% <0.00%> (+0.73%) |
:arrow_up: |
| ...enfeign/annotation/QueryMapParameterProcessor.java | 88.88% <0.00%> (+1.38%) |
:arrow_up: |
| ...amework/cloud/openfeign/FeignClientsRegistrar.java | 78.84% <0.00%> (+1.92%) |
:arrow_up: |
| ... and 1 more |
Is copying the array the only way around this?
I had optimized this code by getting one element instead of copying the whole array. Would you review it again? @spencergibb
@OlgaMaciaszek Could you review this PR?
Thanks, @pandaapo . Will review today.
Thanks @pandaapo . The fix looks mostly good, but have added comments - please address them. Please add your full name with
@authortag to the javadoc. Could you also add a test that will verify your changes (one that would fail before your change)? Additionally, could you submit these changes against3.1.xbranch instead ofmainso that they get included in the upcoming2021.xreleases as well?
OK. I will also create a PR to 3.1.x branch.
Closing in favour of https://github.com/spring-cloud/spring-cloud-openfeign/pull/774.