Commit 0b86e55f authored by Andrew Flynn's avatar Andrew Flynn

Fix some indenting issues with set__() function

Previously it looked like this:

public final class OuterClass {
  [...]
  public static final class InnerClass extends
      com.google.protobuf.nano.MessageNano {
    [...]
    public void setId(java.lang.String value) {
      if (value == null) {
    throw new java.lang.NullPointerException();
  }
  id_ = value;
      bitfield0_ |= 0x00000001;
    [...]
  }
  [...]
}

Now it looks like this:

public final class OuterClass {
  [...]
  public static final class InnerClass extends
      com.google.protobuf.nano.MessageNano {
    [...]
    public void setId(java.lang.String value) {
      if (value == null) throw new java.lang.NullPointerException();
      id_ = value;
      bitfield0_ |= 0x00000001;
    [...]
  }
  [...]
}

Change-Id: I2a9289b528f785c846210d558206d677aa13e9be
parent e7336cdd
...@@ -281,14 +281,6 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, const Params param ...@@ -281,14 +281,6 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, const Params param
(*variables)["tag"] = SimpleItoa(WireFormat::MakeTag(descriptor)); (*variables)["tag"] = SimpleItoa(WireFormat::MakeTag(descriptor));
(*variables)["tag_size"] = SimpleItoa( (*variables)["tag_size"] = SimpleItoa(
WireFormat::TagSize(descriptor->number(), descriptor->type())); WireFormat::TagSize(descriptor->number(), descriptor->type()));
if (IsReferenceType(GetJavaType(descriptor))) {
(*variables)["null_check"] =
" if (value == null) {\n"
" throw new java.lang.NullPointerException();\n"
" }\n";
} else {
(*variables)["null_check"] = "";
}
int fixed_size = FixedSize(descriptor->type()); int fixed_size = FixedSize(descriptor->type());
if (fixed_size != -1) { if (fixed_size != -1) {
(*variables)["fixed_size"] = SimpleItoa(fixed_size); (*variables)["fixed_size"] = SimpleItoa(fixed_size);
...@@ -425,8 +417,12 @@ GenerateMembers(io::Printer* printer) const { ...@@ -425,8 +417,12 @@ GenerateMembers(io::Printer* printer) const {
"public $type$ get$capitalized_name$() {\n" "public $type$ get$capitalized_name$() {\n"
" return $name$_;\n" " return $name$_;\n"
"}\n" "}\n"
"public void set$capitalized_name$($type$ value) {\n" "public void set$capitalized_name$($type$ value) {\n");
"$null_check$" if (IsReferenceType(GetJavaType(descriptor_))) {
printer->Print(variables_,
" if (value == null) throw new java.lang.NullPointerException();\n");
}
printer->Print(variables_,
" $name$_ = value;\n" " $name$_ = value;\n"
" $set_has$;\n" " $set_has$;\n"
"}\n" "}\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment