Skip to content
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

KAA-1650: Don't set the body present flag in extension options if body size is equal to zero #1370

Merged
merged 1 commit into from
Dec 9, 2016
Merged

Conversation

RostakaGmfun
Copy link
Contributor

Port of #1369

garniy
garniy previously approved these changes Dec 8, 2016
@@ -424,7 +424,8 @@ private void encode(GrowingByteBuffer buf, LogServerSync logSync) {
private void encode(GrowingByteBuffer buf, ConfigurationServerSync configurationSync) {
int option = 0;
boolean confSchemaPresent = configurationSync.getConfSchemaBody() != null;
boolean confBodyPresent = configurationSync.getConfDeltaBody() != null;
boolean confBodyPresent = configurationSync.getConfDeltaBody() != null
&& configurationSync.getConfDeltaBody().array().length != 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call hasArray() method before invoking array()

@@ -423,8 +423,12 @@ private void encode(GrowingByteBuffer buf, LogServerSync logSync) {

private void encode(GrowingByteBuffer buf, ConfigurationServerSync configurationSync) {
int option = 0;
boolean confSchemaPresent = configurationSync.getConfSchemaBody() != null;
boolean confBodyPresent = configurationSync.getConfDeltaBody() != null;
boolean confSchemaPresent = configurationSync.getConfSchemaBody() != null
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract configurationSync.getConfSchemaBody() to local variable

boolean confSchemaPresent = configurationSync.getConfSchemaBody() != null
&& configurationSync.getConfSchemaBody().hasArray()
&& configurationSync.getConfSchemaBody().array().length != 0;
boolean confBodyPresent = configurationSync.getConfDeltaBody() != null
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract configurationSync.getConfDeltaBody() to local variable

&& configurationSync.getConfSchemaBody().hasArray()
&& configurationSync.getConfSchemaBody().array().length != 0;
boolean confBodyPresent = configurationSync.getConfDeltaBody() != null
&& configurationSync.getConfSchemaBody().hasArray()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the typo

@garniy garniy dismissed their stale review December 8, 2016 19:11

Potential exception

@rasendubi rasendubi merged commit 2efffc9 into kaaproject:release-0.10 Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants