Return NORMAL for a null property map in TopicMessageType.parseFromMessageProperty#10553
Open
vasiliy-mikhailov wants to merge 1 commit into
Open
Conversation
parseFromMessageProperty threw a NullPointerException for a null message property map. Guard against null and return TopicMessageType.NORMAL.
RockteMQ-AI
approved these changes
Jun 27, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Adds a null guard to TopicMessageType.parseFromMessageProperty() to return NORMAL when the property map is null, preventing NullPointerException.
Findings
- [Info]
TopicMessageType.java:50-52— Correct defensive fix. The null check is placed at the right position (before anymessageProperty.get()call). - [Info]
TopicMessageTypeTest.java:140-144— Test covers the null case explicitly.
Verdict
Simple, correct defensive fix. LGTM.
Automated review by github-manager-bot
RockteMQ-AI
reviewed
Jun 27, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Adds a null check at the top of TopicMessageType.parseFromMessageProperty() to return NORMAL when the property map is null, preventing a potential NullPointerException.
Findings
- [Info]
TopicMessageType.java:50-52— Clean defensive null guard. ReturningNORMALas the default is consistent with the existing fallback behavior when no special properties are found. - [Info]
TopicMessageTypeTest.java:141-144— Simple and direct test for the null case.
Suggestions
- Consider whether callers that pass
nullrepresent a bug in the caller. If so, it might be worth logging a warning atDEBUGorWARNlevel to help diagnose the root cause, rather than silently treating null as empty. This is optional — the null guard itself is a good defensive measure regardless.
Verdict
Clean, minimal fix. LGTM.
Automated review by github-manager-bot
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.
TopicMessageType.parseFromMessagePropertydereferences the message-property map without a null check, throwing aNullPointerExceptionwhen the map is null. Guard against null and returnTopicMessageType.NORMAL.Added a test for the null case.
Verifying this change
The added
TopicMessageTypeTest#testParseFromMessageProperty_Nullfails on the currentdevelopand passes with this change:Before the fix (on
develop):After the fix:
AI assistance disclosure
This contribution was produced with the help of an AI pipeline. The pipeline processed a large amount of source code to surface suspected bugs, reproduced a subset of them with failing unit tests and generated candidate fixes, and prepared pull requests from the ones that held up. Each PR was then reviewed and verified by a human before being opened: the fix and test were checked by hand and the test was confirmed to fail before the change and pass after.