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 #1369

Merged
merged 1 commit into from
Dec 9, 2016

Conversation

RostakaGmfun
Copy link
Contributor

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()

@RostakaGmfun
Copy link
Contributor Author

/cc @vtkhir

@@ -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().array().length != 0;
boolean confBodyPresent = configurationSync.getConfDeltaBody() != null
&& configurationSync.getConfSchemaBody().hasArray()
&& 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.

Fix the typo

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

potential Exeption

@rasendubi
Copy link
Contributor

Jenkins failure is caused by KAA-1640 and is not related to the PR.

@rasendubi rasendubi merged commit 7ab238e into kaaproject:master 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