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

idlj generates read/write union helper methods that throw... #118 #120

Merged
merged 1 commit into from
Feb 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ private int readBoolean (String disName, int index, String indent,
stream.println (indent + "if (" + disName + ')');

if (firstBranch == null)
stream.println (indent + " throw new org.omg.CORBA.BAD_OPERATION ();");
stream.println (indent + " value._default(" + disName + ");");
else {
stream.println (indent + '{');
index = readBranch (index, indent + " ", firstBranch.typedef.name (),
Expand All @@ -771,7 +771,7 @@ private int readBoolean (String disName, int index, String indent,
stream.println (indent + "else");

if (secondBranch == null)
stream.println (indent + " throw new org.omg.CORBA.BAD_OPERATION ();");
stream.println (indent + " value._default(" + disName + ");");
else {
stream.println (indent + '{');
index = readBranch (index, indent + " ", secondBranch.typedef.name (),
Expand Down Expand Up @@ -921,23 +921,25 @@ private int writeBoolean (String disName, int index, String indent, String name,
firstBranch = secondBranch;
secondBranch = tmp;
}
stream.println (indent + "if (" + disName + ')');
if (firstBranch == null)
stream.println (indent + " throw new org.omg.CORBA.BAD_OPERATION ();");
else
{
stream.println (indent + '{');
index = writeBranch (index, indent + " ", name, firstBranch.typedef, stream);
stream.println (indent + '}');
}
stream.println (indent + "else");
if (secondBranch == null)
stream.println (indent + " throw new org.omg.CORBA.BAD_OPERATION ();");
else
{
stream.println (indent + '{');
index = writeBranch (index, indent + " ", name, secondBranch.typedef, stream);
stream.println (indent + '}');
if (firstBranch != null && secondBranch != null) {
stream.println (indent + "if (" + disName + ')');
stream.println (indent + '{');
index = writeBranch (index, indent + " ", name, firstBranch.typedef, stream);
stream.println (indent + '}');
stream.println (indent + "else");
stream.println (indent + '{');
index = writeBranch (index, indent + " ", name, secondBranch.typedef, stream);
stream.println (indent + '}');
} else if (firstBranch != null) {
stream.println (indent + "if (" + disName + ')');
stream.println (indent + '{');
index = writeBranch (index, indent + " ", name, firstBranch.typedef, stream);
stream.println (indent + '}');
} else {
stream.println (indent + "if (!" + disName + ')');
stream.println (indent + '{');
index = writeBranch (index, indent + " ", name, secondBranch.typedef, stream);
stream.println (indent + '}');
}
}
return index;
Expand Down