spring-cloud-openfeign icon indicating copy to clipboard operation
spring-cloud-openfeign copied to clipboard

Handle byte[] arrays correctly.(Fixes gh-741)

Open pandaapo opened this issue 3 years ago • 7 comments
trafficstars

Fixes #741

Make AbstractFormWriter#isTypeOrCollection() handle byte[] arrays correctly instead of casting byte[] to object[] directly.

pandaapo avatar Oct 05 '22 23:10 pandaapo

@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.

pivotal-cla avatar Oct 05 '22 23:10 pivotal-cla

@pandaapo Thank you for signing the Contributor License Agreement!

pivotal-cla avatar Oct 05 '22 23:10 pivotal-cla

Is copying the array the only way around this?

spencergibb avatar Oct 06 '22 00:10 spencergibb

Codecov Report

Merging #765 (ef43e0b) into main (d7fd71d) will increase coverage by 0.18%. The diff coverage is 0.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

Impacted file tree graph

@@             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

codecov[bot] avatar Oct 06 '22 00:10 codecov[bot]

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

pandaapo avatar Oct 06 '22 00:10 pandaapo

@OlgaMaciaszek Could you review this PR?

pandaapo avatar Oct 11 '22 04:10 pandaapo

Thanks, @pandaapo . Will review today.

OlgaMaciaszek avatar Oct 11 '22 09:10 OlgaMaciaszek

Thanks @pandaapo . The fix looks mostly good, but have added comments - please address them. Please add your full name with @author tag 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 against 3.1.x branch instead of main so that they get included in the upcoming 2021.x releases as well?

OK. I will also create a PR to 3.1.x branch.

pandaapo avatar Oct 18 '22 12:10 pandaapo

Closing in favour of https://github.com/spring-cloud/spring-cloud-openfeign/pull/774.

OlgaMaciaszek avatar Oct 18 '22 16:10 OlgaMaciaszek