From d3aff83097ed578e3278f9759947366c5f0307ea Mon Sep 17 00:00:00 2001 From: David Renshaw Date: Wed, 21 May 2014 21:06:18 -0400 Subject: [PATCH] more uses of unionDiscrim.set --- compiler/src/main/cpp/capnpc-java.c++ | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 0b7adfd..f17f1f2 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -554,9 +554,9 @@ private: kj::strTree(spaces(indent), " public final boolean is", titleCase, "() {\n", spaces(indent), " return which() == ", scope, "Which.", upperCase,";\n", spaces(indent), " }\n"), - kj::strTree(spaces(indent), " public final boolean is", titleCase, "() {\n", - spaces(indent), " return which() == ", scope, "Which.", upperCase, ";\n", - spaces(indent), " }\n"), + kj::strTree(spaces(indent), "public final boolean is", titleCase, "() {\n", + spaces(indent), " return which() == ", scope, "Which.", upperCase, ";\n", + spaces(indent), "}\n"), kj::strTree( "inline boolean ", scope, "Reader::is", titleCase, "() const {\n" " return which() == ", scope, upperCase, ";\n" @@ -796,10 +796,13 @@ private: spaces(indent), " }\n", (typeBody.which() == schema::Type::VOID ? - kj::strTree(spaces(indent), " public final void set", titleCase, "() {}\n") : + kj::strTree(spaces(indent), " public final void set", titleCase, "() {\n", + unionDiscrim.set, + spaces(indent), " }\n") : (typeBody.which() == schema::Type::ENUM ? kj::strTree( spaces(indent), " public final void set", titleCase, "(", type, " value) {\n", + unionDiscrim.set, spaces(indent), " _builder.setShortField(", offset, ", (short)value.ordinal());\n", spaces(indent), " }\n") : kj::strTree(