-
Notifications
You must be signed in to change notification settings - Fork 149
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
Value or default bug #635
Value or default bug #635
Conversation
@@ -175,7 +175,7 @@ public String toJson() { | |||
JsonUtils.addField(sb, DELIVER_SUBJECT, deliverSubject); | |||
JsonUtils.addField(sb, DELIVER_GROUP, deliverGroup); | |||
JsonUtils.addField(sb, DELIVER_POLICY, GetOrDefault(deliverPolicy).toString()); | |||
JsonUtils.addField(sb, OPT_START_SEQ, startSeq); | |||
JsonUtils.addUnsigned(sb, OPT_START_SEQ, startSeq); |
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.
add as unsigned writes if the value is greater than 0 versus addField writes it if it's greater or equal to 0
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.
Naming of addUnsigned
method seems confusing. Is not 0 (zero) an unsigned integer? Why would I expect a side-effect that 0 (zero) is ignored?
@@ -998,7 +998,7 @@ public enum CcChangeHelper { | |||
} | |||
|
|||
public long valueOrDefault(Long val) { | |||
return val == null ? START_SEQ.Default : val; | |||
return val == null ? Default : val; |
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.
the other code was just wrong. This was introduced in a previous 2.14.1 PR so has not been released yet
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.
LGTM
addressing server defaults and unsigned ints better