-
Notifications
You must be signed in to change notification settings - Fork 105
GH-399: Check for null writers in DenseUnionWriter#setPosition #938
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
base: main
Are you sure you want to change the base?
GH-399: Check for null writers in DenseUnionWriter#setPosition #938
Conversation
Added null checks for setPosition and test cases to validate the issue
This comment has been minimized.
This comment has been minimized.
|
I do not have permissions to set labels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| public class TestDenseUnionWriterNPE { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: JUnit 5 doesn't require declaring everything public
| } | ||
|
|
||
| @Test | ||
| public void testListOfDenseUnionWriterNPE() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link back to the issue
| public void testListOfDenseUnionWriterNPE() { | |
| public void testListOfDenseUnionWriterNPE() { | |
| // Regression test for ... |
GH-399 Fix setPosition fails with NullPointerException
Fixed a
NullPointerExceptioninDenseUnionWriter#setPosition.The issue was that
setPositiontried to update all writers in its internal array, even if they hadn't been initialized yet. I added a null check so it only updates writers that actually exist.Also added a regression test (
TestDenseUnionWriterNPE) to verify the fix and updated.gitignore.Closes #399.