diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-11-26 14:53:59 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-11-26 14:53:59 -0500 |
commit | 781b07f5f0c07633510b645c0ba8aa7b43f80a59 (patch) | |
tree | 3d6cc9e07abd6fd696e018a08268b6b59a7ad8e7 /cpp/src | |
parent | fix slice2cs definition (diff) | |
download | ice-781b07f5f0c07633510b645c0ba8aa7b43f80a59.tar.bz2 ice-781b07f5f0c07633510b645c0ba8aa7b43f80a59.tar.xz ice-781b07f5f0c07633510b645c0ba8aa7b43f80a59.zip |
Fixed SystemException to no longer derive from LocalException
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Exception.cpp | 2 | ||||
-rwxr-xr-x | cpp/src/slice2cpp/Gen.cpp | 4 | ||||
-rwxr-xr-x | cpp/src/slice2cs/Gen.cpp | 31 | ||||
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 30 |
4 files changed, 27 insertions, 40 deletions
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp index c147357e62c..c930fca7b7e 100644 --- a/cpp/src/Ice/Exception.cpp +++ b/cpp/src/Ice/Exception.cpp @@ -53,7 +53,7 @@ Ice::LocalException::~LocalException() throw() } Ice::SystemException::SystemException(const char* file, int line) : - LocalException(file, line) + Exception(file, line) { } diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 65fd5a08e58..dbc34fc94f7 100755 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -3026,6 +3026,10 @@ Slice::Gen::DelegateDVisitor::visitOperation(const OperationPtr& p) C << nl << "throw;"; C << eb; } + C << nl << "catch(const ::Ice::SystemException&)"; + C << sb; + C << nl << "throw;"; + C << eb; C << nl << "catch(const ::IceInternal::LocalExceptionWrapper&)"; C << sb; C << nl << "throw;"; diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index dc23423563c..1192172a13e 100755 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -4150,6 +4150,9 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sb; _out << nl << "direct__ = new IceInternal.Direct(current__, run__);"; + _out << nl << "try"; + _out << sb; + _out << nl << "Ice.DispatchStatus status__ = direct__.servant().collocDispatch__(direct__);"; if(!throws.empty()) { @@ -4161,6 +4164,12 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "_System.Diagnostics.Debug.Assert(status__ == Ice.DispatchStatus.DispatchOK);"; _out << eb; + _out << nl << "finally"; + _out << sb; + _out << nl << "direct__.destroy();"; + _out << eb; + _out << eb; + for(ExceptionList::const_iterator i = throws.begin(); i != throws.end(); ++i) { _out << nl << "catch(" << fixId((*i)->scoped()) << ')'; @@ -4168,31 +4177,15 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "throw;"; _out << eb; } - _out << nl << "catch(System.Exception ex__)"; - _out << sb; - _out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(ex__);"; - _out << eb; - _out << nl << "finally"; - _out << sb; - _out << nl << "if(direct__ != null)"; - _out << sb; - _out << nl << "try"; + _out << nl << "catch(Ice.SystemException)"; _out << sb; - _out << nl << "direct__.destroy();"; + _out << nl << "throw;"; _out << eb; - for(ExceptionList::const_iterator j = throws.begin(); j != throws.end(); ++j) - { - _out << nl << "catch(" << fixId((*j)->scoped()) << " ex__)"; - _out << sb; - _out << nl << "throw ex__;"; - _out << eb; - } _out << nl << "catch(System.Exception ex__)"; _out << sb; _out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(ex__);"; _out << eb; - _out << eb; - _out << eb; + // // // Set out parameters diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index dd285b1db1c..37fe9a2d6d8 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -4392,6 +4392,8 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) out << eb; out << ";"; + out << nl << "try"; + out << sb; out << sp << nl << "Ice.DispatchStatus __status = __direct.servant().__collocDispatch(__direct);"; out << nl << "if(__status == Ice.DispatchStatus.DispatchUserException)"; out << sb; @@ -4404,6 +4406,12 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) } out << eb; + out << nl << "finally"; + out << sb; + out << nl << "__direct.destroy();"; + out << eb; + + out << eb; for(ExceptionList::const_iterator t = throws.begin(); t != throws.end(); ++t) { string exS = getAbsolute(*t, package); @@ -4413,33 +4421,15 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) out << eb; } - out << nl << "catch(java.lang.Throwable __ex)"; + out << nl << "catch(Ice.SystemException __ex)"; out << sb; - out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(__ex);"; + out << nl << "throw __ex;"; out << eb; - out << nl << "finally"; - out << sb; - out << nl << "if(__direct != null)"; - out << sb; - out << nl << "try"; - out << sb; - out << nl << "__direct.destroy();"; - out << eb; - for(ExceptionList::const_iterator k = throws.begin(); k != throws.end(); ++k) - { - string exS = getAbsolute(*k, package); - out << nl << "catch(" << exS << " __ex)"; - out << sb; - out << nl << "throw __ex;"; - out << eb; - } out << nl << "catch(java.lang.Throwable __ex)"; out << sb; out << nl << "IceInternal.LocalExceptionWrapper.throwWrapper(__ex);"; out << eb; - out << eb; - out << eb; } if(ret && !cl->hasMetaData("amd") && !op->hasMetaData("amd")) { |