iotdb
iotdb copied to clipboard
Add null guards for TsFileExecutor constructor
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 NullPointerException
s 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.