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 length of array is never negative #4510

Merged
merged 1 commit into from
Jul 11, 2019

Conversation

tswstarplanet
Copy link
Contributor

What is the purpose of the change

XXXXX

Brief changelog

XXXXX

Verifying this change

XXXXX

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 sample in dubbo samples project.
  • 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 #4510 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4510      +/-   ##
============================================
- Coverage     62.94%   62.91%   -0.03%     
- Complexity      449      450       +1     
============================================
  Files           770      770              
  Lines         33006    33006              
  Branches       5216     5216              
============================================
- Hits          20774    20766       -8     
- Misses         9835     9845      +10     
+ Partials       2397     2395       -2
Impacted Files Coverage Δ Complexity Δ
...o/common/extension/support/ActivateComparator.java 66.66% <100%> (ø) 0 <0> (ø) ⬇️
...ache/dubbo/remoting/p2p/support/AbstractGroup.java 45.45% <0%> (-11.37%) 0% <0%> (ø)
.../dubbo/remoting/transport/netty4/NettyChannel.java 61.17% <0%> (-4.71%) 0% <0%> (ø)
...he/dubbo/remoting/transport/netty/NettyServer.java 69.64% <0%> (-3.58%) 8% <0%> (-1%)
...pache/dubbo/registry/support/AbstractRegistry.java 78.54% <0%> (-3.07%) 0% <0%> (ø)
.../exchange/support/header/HeaderExchangeServer.java 65.09% <0%> (-1.89%) 0% <0%> (ø)
.../java/org/apache/dubbo/config/ReferenceConfig.java 59.48% <0%> (-0.37%) 0% <0%> (ø)
...ache/dubbo/registry/multiple/MultipleRegistry.java 63.38% <0%> (+0.7%) 21% <0%> (+1%) ⬆️
...che/dubbo/remoting/transport/mina/MinaChannel.java 55.26% <0%> (+1.31%) 18% <0%> (+1%) ⬆️
...he/dubbo/registry/multicast/MulticastRegistry.java 69.23% <0%> (+1.35%) 0% <0%> (ø) ⬇️
... and 3 more

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 519df67...df58910. Read the comment docs.

@htynkn
Copy link
Member

htynkn commented Jul 10, 2019

According to doc (https://docs.oracle.com/javase/specs/jls/se8/html/jls-10.html#jls-10.7), length may be positive or zero.

Also when try to create a negative length array, it will throw NegativeArraySizeException

@htynkn htynkn merged commit 5eec017 into apache:master Jul 11, 2019
rolandhe pushed a commit to rolandhe/dubbo that referenced this pull request Sep 9, 2019
rolandhe pushed a commit to rolandhe/dubbo that referenced this pull request Sep 9, 2019
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.

3 participants