Skip to content

False bool values are not written into message #766

Closed as not planned
Closed as not planned
@ao-swarm

Description

@ao-swarm

Issue:
The value of the bool field in the generic BoolValue message is only set when the provided value is true. Attempting to set a false value skips writing to the message object.

Expected:
I should be able to explicitly send a false boolean value in a message.

Version 0.9.4

--

bool { value = true }  // creates message with value 'true'

bool { value = false }  // creates message with no value
// from BoolValue.java
// not entirely sure if it's relevant, but logic here matches what I'm seeing

@java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (value_ != false) {
      output.writeBool(1, value_);
    }
    getUnknownFields().writeTo(output);
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions