iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

Add null guards for TsFileExecutor constructor

Open pingpingy1 opened this issue 1 year ago • 0 comments

Description

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.
  • [x] 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

pingpingy1 avatar Jan 31 '24 14:01 pingpingy1