Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix fastjson serialization with generic return type #3771

Merged
merged 2 commits into from
Apr 1, 2019
Merged

fix fastjson serialization with generic return type #3771

merged 2 commits into from
Apr 1, 2019

Conversation

cyejing
Copy link
Contributor

@cyejing cyejing commented Mar 29, 2019

What is the purpose of the change

修复fastjson序列的问题,有三层泛型以上时序列化报错 如:A<B>

Brief changelog

修复fastjson序列的问题,有三层泛型以上时序列化报错 如:A<B>

Verifying this change

三层泛型以上 会序列化成JSONArray 或者 JSONObject导致获取对象时发生强转异常
: Class1 cannot be cast to Class2

some issues #3767

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@codecov-io
Copy link

Codecov Report

Merging #3771 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3771      +/-   ##
============================================
- Coverage     63.59%   63.55%   -0.05%     
  Complexity       71       71              
============================================
  Files           704      704              
  Lines         31063    31063              
  Branches       5037     5037              
============================================
- Hits          19756    19743      -13     
- Misses         9033     9044      +11     
- Partials       2274     2276       +2
Impacted Files Coverage Δ Complexity Δ
...common/serialize/fastjson/FastJsonObjectInput.java 100% <100%> (+8%) 0 <0> (ø) ⬇️
...ache/dubbo/remoting/p2p/support/AbstractGroup.java 45.45% <0%> (-11.37%) 0% <0%> (ø)
...e/dubbo/remoting/transport/netty/NettyChannel.java 57.64% <0%> (-4.71%) 0% <0%> (ø)
.../apache/dubbo/remoting/transport/AbstractPeer.java 63.04% <0%> (-4.35%) 0% <0%> (ø)
...dubbo/remoting/exchange/support/DefaultFuture.java 73.46% <0%> (-2.05%) 0% <0%> (ø)
...pache/dubbo/registry/support/AbstractRegistry.java 79.52% <0%> (-1.19%) 0% <0%> (ø)
...bo/rpc/cluster/support/FailbackClusterInvoker.java 70.49% <0%> (+3.27%) 0% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fca31c4...aadfdda. Read the comment docs.

@kexianjun kexianjun added the status/don’t-merge No plan to merge label Mar 29, 2019
@kexianjun
Copy link
Member

do not merge, let me check again

@kexianjun kexianjun changed the title fix fastjson serialize type fix fastjson serialization with generic return type Apr 1, 2019
Copy link
Member

@kexianjun kexianjun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this work fine for method with generic return type, but when a method has generic parameters, this problem still exists, merge this first and I'll open an issue for the generic parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants