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

Add null guards for TsFileExecutor constructor #50

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

pingpingy1
Copy link

Description

(Copied from Apache IoTDB PR#12013.)

This PR intends to provide null guards in the TsFileExecutor's constructors.
The inputs to the constructor of TsFileExecutor are immediately saved to the executor's private properties, which cannot neither be changed elsewhere nor are they guarded against null in other methods of the class.
Even though null inputs to the constructor make little sense, allowing them to be null makes debugging any subsequent NullPointerExceptions convoluted.
This PR uses the Object.requireNonNull method for a fail-fast guard against null inputs.


This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • 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, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

The inputs to the constructor of `TsFileExecutor` is immediately saved
to the executor's private properties, which cannot neither be changed
elsewhere nor are they guarded against `null` in other methods of the
class.
This commit adds guards such for a fail-fast guard against `null`
inputs.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hi, this is your first pull request in the Apache TsFile project. Thanks for your contribution! TsFile will be better because of you.

The inputs to the constructor of `TsFileExecutor` is immediately saved
to the executor's private properties, which cannot neither be changed
elsewhere nor are they guarded against `null` in other methods of the
class.
This commit adds guards such for a fail-fast guard against `null`
inputs.
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.

1 participant