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

Suppress index-out-of-bounds warning from LGTM about loop unrolling #8380

Merged
merged 4 commits into from Sep 6, 2019

Conversation

@asdf2014
Copy link
Member

commented Aug 23, 2019

Description

Suppress index-out-of-bounds warning from LGTM about loop unrolling


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths.
  • added integration tests.
  • been tested in a test Druid cluster.

@asdf2014 asdf2014 added the Area - Dev label Aug 23, 2019

metricValues.put(aggFactoryNames[i + 5], metricVals[i + 5]);
metricValues.put(aggFactoryNames[i + 6], metricVals[i + 6]);
metricValues.put(aggFactoryNames[i + 7], metricVals[i + 7]);
metricValues.put(aggFactoryNames[i + 1], metricVals[i + 1]); // lgtm[java/index-out-of-bounds]

This comment has been minimized.

Copy link
@gianm

gianm Aug 23, 2019

Contributor

IMO would be nice to have a meta-comment here about why these are needed. Something like:

// LGTM.com flags this, but it's safe because we know "metricVals.length - extra" is a multiple of LOOP_UNROLL_COUNT.

This comment has been minimized.

Copy link
@asdf2014

asdf2014 Aug 23, 2019

Author Member

Yep, it's better. Thanks a lot.

@asdf2014

This comment has been minimized.

Copy link
Member Author

commented Sep 4, 2019

@gianm PTAL.

@himanshug himanshug merged commit 9fa3407 into apache:master Sep 6, 2019

3 of 5 checks passed

LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: Python No code changes detected
Details
Inspections: pull requests (Druid) TeamCity build finished
Details
LGTM analysis: Java No new or fixed alerts
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@asdf2014 asdf2014 deleted the asdf2014:suppress_index_out_of_bounds branch Sep 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.