-
Notifications
You must be signed in to change notification settings - Fork 576
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
NMS-15768: Fixed scan-interval handling #6275
Conversation
christianpape
commented
Jun 27, 2023
- JIRA: https://opennms.atlassian.net/browse/NMS-15768
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.
other than that, looks fine
@@ -57,10 +57,13 @@ public String marshal(final Duration v) { | |||
/** {@inheritDoc} */ | |||
@Override | |||
public Duration unmarshal(final String v) { | |||
if ("0".equals(v)) { | |||
if ("0".equals(v.trim())) { |
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.
Could v
ever be null? This would introduce an NPE if so...
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.
null-check added
@@ -39,10 +39,14 @@ public class StringIntervalPropertyEditor extends PropertyEditorSupport implemen | |||
/** {@inheritDoc} */ | |||
@Override | |||
public void setAsText(final String text) throws IllegalArgumentException { | |||
if ("0".equals(text)) { | |||
if ("0".equals(text.trim())) { |
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.
same here with text
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.
null-check added