MLE-29267: Fix bad use of null-like value and insufficient logging#602
Merged
vshaniga merged 1 commit intoMay 5, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes several null-handling edge cases and improves diagnostic logging in mlcp/mapreduce code paths, aligning with the validated changes from PR #601 to prevent avoidable NPEs and make failures easier to diagnose.
Changes:
- Prevent NPEs by adding explicit null guards in document reading, split parsing, and archive writing paths.
- Ensure
OutputArchivealways initializes a zip output stream before writing entries. - Add error-level logging for security option construction failures before rethrowing configuration exceptions.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/marklogic/mapreduce/utilities/InternalUtilities.java | Adds error logging when SecurityOptions construction fails. |
| src/main/java/com/marklogic/mapreduce/MarkLogicInputFormat.java | Avoids NPE when ruleUris is absent by guarding add(). |
| src/main/java/com/marklogic/mapreduce/DatabaseDocument.java | Guards stream-to-byte[] buffering when the stream is null; falls back to empty content. |
| src/main/java/com/marklogic/contentpump/OutputArchive.java | Ensures newOutputStream() is called whenever outputStream is null before putNextEntry(). |
| src/main/java/com/marklogic/contentpump/DatabaseContentReader.java | Adds null checks for item and result to avoid NPEs during metadata/iteration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
NeoSaber
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes have already been validated on the develop branch in the PR: #601
Tests