Skip to content

KYLIN-3597, fix the critical bug reported by sonar: Make sure this ex…#326

Merged
shaofengshi merged 1 commit intoapache:masterfrom
Aaaaaaron:KYLIN-3597
Nov 12, 2018
Merged

KYLIN-3597, fix the critical bug reported by sonar: Make sure this ex…#326
shaofengshi merged 1 commit intoapache:masterfrom
Aaaaaaron:KYLIN-3597

Conversation

@Aaaaaaron
Copy link
Member

…pression can't be zero before doing this division.

@asfgit
Copy link

asfgit commented Nov 3, 2018

Can one of the admins verify this patch?

@Aaaaaaron
Copy link
Member Author

Aaaaaaron commented Nov 3, 2018

Hi @mingmwang, there's a critical bug reported by sonar, and I offer a fix, can you take a look and confirm the change? Thanks.

@coveralls
Copy link

coveralls commented Nov 3, 2018

Pull Request Test Coverage Report for Build 3836

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.003%) to 23.613%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cache/src/main/java/net/spy/memcached/RefinedKetamaNodeLocator.java 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/MemDiskStore.java 5 77.81%
Totals Coverage Status
Change from base Build 3832: -0.003%
Covered Lines: 16809
Relevant Lines: 71186

💛 - Coveralls

@codecov-io
Copy link

codecov-io commented Nov 3, 2018

Codecov Report

Merging #326 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #326      +/-   ##
============================================
- Coverage     21.55%   21.54%   -0.02%     
+ Complexity     4579     4577       -2     
============================================
  Files          1112     1112              
  Lines         71186    71186              
  Branches      10284    10285       +1     
============================================
- Hits          15343    15334       -9     
- Misses        54373    54379       +6     
- Partials       1470     1473       +3
Impacted Files Coverage Δ Complexity Δ
...va/net/spy/memcached/RefinedKetamaNodeLocator.java 24.17% <0%> (ø) 8 <0> (ø) ⬇️
...org/apache/kylin/rest/util/QueryRequestLimits.java 35.71% <0%> (-4.77%) 5% <0%> (-1%)
...rg/apache/kylin/cube/inmemcubing/MemDiskStore.java 69.3% <0%> (-1.83%) 7% <0%> (ø)
...a/org/apache/kylin/dict/Number2BytesConverter.java 81.74% <0%> (-0.8%) 17% <0%> (-1%)

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 caf109e...80027df. Read the comment docs.

…pression can't be zero before doing this division.
@Aaaaaaron
Copy link
Member Author

When "totalWeight" is 0, means there are no nodes, so "thisWeight" is 0 too.

Copy link
Contributor

@shaofengshi shaofengshi left a comment

Choose a reason for hiding this comment

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

LGTM

@shaofengshi shaofengshi merged commit f0b26c4 into apache:master Nov 12, 2018
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