Akanksha-kedia opened a new pull request, #17110:
URL: https://github.com/apache/pinot/pull/17110
### File Modified: `FixedByteSingleValueMultiColumnReaderWriter.java`
__Location__:
`pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/readerwriter/impl/FixedByteSingleValueMultiColumnReaderWriter.java`
__Improvement__: Enhanced the `close()` method with defensive null checks to
prevent NullPointerException during resource cleanup.
__Before__:
```java
@Override
public void close() throws IOException {
for (FixedByteSingleValueMultiColWriter writer : _writers) {
writer.close();
}
for (FixedByteSingleValueMultiColReader reader : _readers) {
reader.close();
}
}
```
__After__:
```java
@Override
public void close() throws IOException {
if (_writers != null) {
for (FixedByteSingleValueMultiColWriter writer : _writers) {
if (writer != null) {
writer.close();
}
}
}
if (_readers != null) {
for (FixedByteSingleValueMultiColReader reader : _readers) {
if (reader != null) {
reader.close();
}
}
}
}
```
## Impact
✅ __Prevents NullPointerException__ during resource cleanup\
✅ __Improves robustness__ of the close() method\
✅ __Follows defensive programming best practices__\
✅ __No functional changes__ to normal operation\
✅ __Low risk__ - purely defensive improvement
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]