int size = u.branches ().size () + 1;
Enumeration e = u.branches ().elements ();
int i = 0;
while (e.hasMoreElements ())
{
UnionBranch branch = (UnionBranch)e.nextElement ();
Util.fillInfo (branch.typedef);
// <f46082.51> Remove -stateful feature; javaStatefulName() obsolete.
//stream.println (" private " + Util.javaStatefulName (branch.typedef) + " ___" + branch.typedef.name () + ";");
stream.println (" private " + Util.javaName (branch.typedef) + " ___" + branch.typedef.name () + ";");
++i;
}
stream.println (" private " + Util.javaName (utype) + " __discriminator;");
stream.println (" private boolean __uninitialized = true;");
// Write ctor
stream.println ();
stream.println (" public " + u.name () + " ()");
stream.println (" {");
stream.println (" }");
// Write discriminator
stream.println ();
stream.println (" public " + Util.javaName (utype) + " " + safeName (u, "discriminator") + " ()");
stream.println (" {");
stream.println (" if (__uninitialized)");
stream.println (" throw new org.omg.CORBA.BAD_OPERATION ();");
stream.println (" return __discriminator;");
stream.println (" }");
// Write for each branch:
// - setter
// - getter
// - private verifyXXX
e = u.branches ().elements ();
i = 0;
while (e.hasMoreElements ())
{
UnionBranch branch = (UnionBranch)e.nextElement ();
writeBranchMethods (stream, u, branch, i++);
}
if (u.defaultBranch () == null && !coversAll (u))
{
stream.println ();