Skip to content

Conversation

@xccui
Copy link
Member

@xccui xccui commented Dec 27, 2018

What is the purpose of the change

This PR aims to fix the bounds checking errors for validateFixedIndexedProperties() and validateArray() in DescriptorProperties.

Brief change log

Change the upper bounds of the loops from < maxIndex to <= maxIndex.

Verifying this change

  1. To verify validateArray(), made the last element an invalid one.
  2. To verify validateFixedIndexedProperties(), added a new test case validateFixedIndexedProperties().

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

@xccui
Copy link
Member Author

xccui commented Dec 27, 2018

Thanks again for your reminding me of the bug in validateFixedIndexedProperties(), @hequn8128. I wonder if you and @sunjincheng121 could help take a look.

Best, Xingcan

Copy link
Contributor

@hequn8128 hequn8128 left a comment

Choose a reason for hiding this comment

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

@xccui Thanks a lot for the fix. The fix looks good and only left some minor suggestion.

Best, Hequn

maxLength)
}

private def testFixedFieldsValidation(properties: DescriptorProperties): Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about rename testFixedFieldsValidation to testFixedIndexedPropertiesValidation?

}

@Test(expected = classOf[ValidationException])
def testInvalidFixedIndexedProperty(): Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Properties

@xccui
Copy link
Member Author

xccui commented Dec 31, 2018

Thanks for the review @hequn8128. The methods are renamed according to your comments.

Best, Xingcan

@hequn8128
Copy link
Contributor

@xccui Thanks a lot for the update. +1 to merge.

Best, Hequn

Copy link
Contributor

@twalthr twalthr left a comment

Choose a reason for hiding this comment

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

Thank you @xccui and @hequn8128. Merging...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants