summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cs/Gen.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2005-07-25 17:52:39 +0000
committerMark Spruiell <mes@zeroc.com>2005-07-25 17:52:39 +0000
commitfb7076aea22b47d15fc3f2ec5a5b097b25fabaec (patch)
treeef2e0f188f743010ecf27019cc7336095d6830fc /cpp/src/slice2cs/Gen.cpp
parentremoving extra print statement (diff)
downloadice-fb7076aea22b47d15fc3f2ec5a5b097b25fabaec.tar.bz2
ice-fb7076aea22b47d15fc3f2ec5a5b097b25fabaec.tar.xz
ice-fb7076aea22b47d15fc3f2ec5a5b097b25fabaec.zip
fix for bug 421
Diffstat (limited to 'cpp/src/slice2cs/Gen.cpp')
-rwxr-xr-xcpp/src/slice2cs/Gen.cpp63
1 files changed, 26 insertions, 37 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index 1d740161bb6..a43a89b1286 100755
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -3759,40 +3759,32 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << nl << "__og.abort(__ex);";
_out << eb;
}
- if(!outParams.empty() || ret || !throws.empty())
- {
- _out << nl << "IceInternal.BasicStream __is = __og.istr();";
- }
- _out << nl << "if(!__og.invoke())";
+ _out << nl << "bool __ok = __og.invoke();";
+ _out << nl << "try";
_out << sb;
- if(!throws.empty())
- {
- //
- // The try/catch block is necessary because throwException()
- // can raise UserException.
- //
- _out << nl << "try";
- _out << sb;
- _out << nl << "__is.throwException();";
- _out << eb;
- for(ExceptionList::const_iterator t = throws.begin(); t != throws.end(); ++t)
- {
- _out << nl << "catch(" << fixId((*t)->scoped()) << ')';
- _out << sb;
- _out << nl << "throw;";
- _out << eb;
- }
- _out << nl << "catch(Ice.UserException)";
- _out << sb;
- _out << eb;
- }
- _out << nl << "throw new Ice.UnknownUserException();";
+ _out << nl << "IceInternal.BasicStream __is = __og.istr();";
+ _out << nl << "if(!__ok)";
+ _out << sb;
+ //
+ // The try/catch block is necessary because throwException()
+ // can raise UserException.
+ //
+ _out << nl << "try";
+ _out << sb;
+ _out << nl << "__is.throwException();";
_out << eb;
- if(!outParams.empty() || ret)
+ for(ExceptionList::const_iterator t = throws.begin(); t != throws.end(); ++t)
{
- _out << nl << "try";
+ _out << nl << "catch(" << fixId((*t)->scoped()) << ')';
_out << sb;
+ _out << nl << "throw;";
+ _out << eb;
}
+ _out << nl << "catch(Ice.UserException)";
+ _out << sb;
+ _out << nl << "throw new Ice.UnknownUserException();";
+ _out << eb;
+ _out << eb;
for(q = outParams.begin(); q != outParams.end(); ++q)
{
writeMarshalUnmarshalCode(_out, q->first, fixId(q->second), false, false, true, "");
@@ -3854,14 +3846,11 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p)
}
_out << nl << "return __ret;";
}
- if(!outParams.empty() || ret)
- {
- _out << eb;
- _out << nl << "catch(Ice.LocalException __ex)";
- _out << sb;
- _out << nl << "throw new IceInternal.NonRepeatable(__ex);";
- _out << eb;
- }
+ _out << eb;
+ _out << nl << "catch(Ice.LocalException __ex)";
+ _out << sb;
+ _out << nl << "throw new IceInternal.NonRepeatable(__ex);";
+ _out << eb;
_out << eb;
_out << nl << "finally";
_out << sb;