-
Notifications
You must be signed in to change notification settings - Fork 948
ARTEMIS-5863 invalid acceptor URI shouldn't break configuration.exportAsProperties with NPE #6199
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
Conversation
…tAsProperties with NPE
|
@gtully this one caught me as I thought my stuff was causing it. totally unrelated but here is the fix. |
|
I need to merge this as I'm writing another test on top of the same test. If anything is needed I will followup with another PR or commit. please let me know on that case. |
| nested.push(entry.getKey().toString()); | ||
| export(beanUtils, nested, bufferedWriter, entry.getValue()); | ||
| nested.pop(); | ||
| if (entry.getValue() != null) { |
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.
this is inconsistent. the check for null to not export a key with for a null value
and the use of String.ValueOf that will write key="null" for a null value.
we should be consistent and write key= for null values and not introduce "null" as we don't understand that as a config value.
This means we need to check for a null value and write an empty string ''
| // useKQueue here would generate a hashMap Value null, what would break the exportAsProperties. | ||
| configuration.addAcceptorConfiguration("test", "tcp://0.0.0.0:61616?useKQueue"); | ||
| File fileOutput = new File(getTestDirfile(), "broker.properties"); | ||
| assertDoesNotThrow(() -> configuration.exportAsProperties(fileOutput)); |
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.
for sure should not throw, but should not loose info... I think it should be:
...params.useKQueue=
gtully
left a comment
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.
I think we need more consistency here on how to deal with null values.
|
BTW: String.valueOf is not fixing anything here.. this is just the proper way to call .toString on the recent JDK versions. I'm not really sure we should do pararams.useKQueue= the return would be an empty string. if you keep expanding on this you would have a much bigger task... and I can't do it now. At this moment all I did was to fix and avoid the NPE as it was failing to export stuff. |
No description provided.