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

修复hessian在集合类反序列化时,包装类为null返回基本类型默认值的bug #11

Merged
merged 1 commit into from
Mar 16, 2020

Conversation

fingthinking
Copy link

@fingthinking fingthinking commented Mar 24, 2019

修复hessian在集合类反序列化时,包装类为null返回基本类型默认值的bug: apache/dubbo#3640
之前看到合入的某个bugfix: #8,会出现多线程问题,而且不是从本质上解决类型转换错误的问题。

@fingthinking fingthinking changed the title 修复hessian在集合类反序列化时,包装类为null返回基本类型默认值的bug: https://github.com/apache/i… 修复hessian在集合类反序列化时,包装类为null返回基本类型默认值的bug Mar 24, 2019
@codecov-io
Copy link

codecov-io commented Mar 24, 2019

Codecov Report

Merging #11 into master will increase coverage by 0.21%.
The diff coverage is 75%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #11      +/-   ##
============================================
+ Coverage     24.46%   24.68%   +0.21%     
- Complexity      460      471      +11     
============================================
  Files            89       89              
  Lines          6302     6299       -3     
  Branches       1048     1050       +2     
============================================
+ Hits           1542     1555      +13     
+ Misses         4545     4524      -21     
- Partials        215      220       +5
Impacted Files Coverage Δ Complexity Δ
...ba/com/caucho/hessian/io/AbstractHessianInput.java 7.69% <ø> (ø) 1 <0> (ø) ⬇️
...om/alibaba/com/caucho/hessian/io/HessianInput.java 19.34% <0%> (-0.04%) 46 <1> (+1)
...ibaba/com/caucho/hessian/io/BasicDeserializer.java 6.99% <100%> (+1.6%) 11 <8> (+3) ⬆️
.../com/caucho/hessian/io/CollectionDeserializer.java 67.39% <50%> (-5.69%) 12 <0> (-2)
...m/alibaba/com/caucho/hessian/io/Hessian2Input.java 19.93% <85.71%> (+0.23%) 67 <2> (+3) ⬆️
.../alibaba/com/caucho/hessian/io/Hessian2Output.java 25.12% <0%> (+0.69%) 35% <0%> (+2%) ⬆️
...alibaba/com/caucho/hessian/io/BasicSerializer.java 17.39% <0%> (+4.34%) 7% <0%> (+2%) ⬆️
...libaba/com/caucho/hessian/util/IdentityIntMap.java 39.28% <0%> (+7.14%) 9% <0%> (+2%) ⬆️

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 5a74492...1110eb4. Read the comment docs.

@CrazyHZM
Copy link
Member

my fault,
This PR looks good.

@chickenlj chickenlj merged commit 6e78128 into apache:master Mar 16, 2020
@Override
public boolean checkAndReadNull() {
try {
int tag = read();

Choose a reason for hiding this comment

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

这里的tag有可能返回-1,在_buffer[_offset++]中会出现ArrayIndexOutOfBoundsException的问题。可在下面offset--处做个保护

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.

5 participants