diff options
author | Jose <jose@zeroc.com> | 2016-01-19 16:27:53 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-01-19 16:27:53 +0100 |
commit | 6faa017414ad0321fd28da58ab5d3c851ec7f1f2 (patch) | |
tree | e9e9146105ffc5c23edd72b38d02442ba1fe2bbd /cpp/src | |
parent | Fix IEE-162 - multiple bluetooth test failures (diff) | |
download | ice-6faa017414ad0321fd28da58ab5d3c851ec7f1f2.tar.bz2 ice-6faa017414ad0321fd28da58ab5d3c851ec7f1f2.tar.xz ice-6faa017414ad0321fd28da58ab5d3c851ec7f1f2.zip |
Deprecate ice_name and add ice_id
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/AsyncResult.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/BasicStream.cpp | 1 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionFactory.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/IPEndpointI.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/Incoming.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/Outgoing.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/OutgoingAsync.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/Proxy.cpp | 20 | ||||
-rw-r--r-- | cpp/src/IceUtil/Exception.cpp | 164 | ||||
-rw-r--r-- | cpp/src/Slice/PythonUtil.cpp | 5 | ||||
-rw-r--r-- | cpp/src/Slice/RubyUtil.cpp | 2 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 19 | ||||
-rw-r--r-- | cpp/src/slice2cs/Gen.cpp | 9 | ||||
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 14 | ||||
-rw-r--r-- | cpp/src/slice2objc/Gen.cpp | 11 | ||||
-rw-r--r-- | cpp/src/slice2php/Main.cpp | 9 |
17 files changed, 183 insertions, 105 deletions
diff --git a/cpp/src/Ice/AsyncResult.cpp b/cpp/src/Ice/AsyncResult.cpp index dcc4a553180..bd8cdc80ccf 100644 --- a/cpp/src/Ice/AsyncResult.cpp +++ b/cpp/src/Ice/AsyncResult.cpp @@ -301,7 +301,7 @@ AsyncResult::finished(const Ice::Exception& ex) _state |= Done; ICE_RESET_EXCEPTION(_exception, ex.ice_clone()); _cancellationHandler = 0; - _observer.failed(ex.ice_name()); + _observer.failed(ex.ice_id()); if(!_callback) { _observer.detach(); diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index ed6f5402460..7599b6b8223 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -1976,7 +1976,6 @@ IceInternal::BasicStream::EncapsDecoder::newInstance(const string& typeId) } #endif } - return v; } diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index bbebcbd19b0..64f33ecb7e5 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -905,7 +905,7 @@ IceInternal::OutgoingConnectionFactory::ConnectCallback::connectionStartFailed(c if(_observer) { - _observer->failed(ex.ice_name()); + _observer->failed(ex.ice_id()); _observer->detach(); } diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index cb7fcfc5d3f..c0c1f55df22 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -2596,7 +2596,7 @@ Ice::ConnectionI::setState(State state) dynamic_cast<const ObjectAdapterDeactivatedException*>(&ex) || (dynamic_cast<const ConnectionLostException*>(&ex) && _state >= StateClosing))) { - _observer->failed(ex.ice_name()); + _observer->failed(ex.ice_id()); } } } @@ -2610,7 +2610,7 @@ Ice::ConnectionI::setState(State state) dynamic_cast<const ObjectAdapterDeactivatedException*>(_exception.get()) || (dynamic_cast<const ConnectionLostException*>(_exception.get()) && _state >= StateClosing))) { - _observer->failed(_exception->ice_name()); + _observer->failed(_exception->ice_id()); } } #endif diff --git a/cpp/src/Ice/IPEndpointI.cpp b/cpp/src/Ice/IPEndpointI.cpp index bb9bc8e170c..82da554a960 100644 --- a/cpp/src/Ice/IPEndpointI.cpp +++ b/cpp/src/Ice/IPEndpointI.cpp @@ -668,7 +668,7 @@ IceInternal::EndpointHostResolver::run() } if(r.observer) { - r.observer->failed(ex.ice_name()); + r.observer->failed(ex.ice_id()); r.observer->detach(); } r.callback->exception(ex); @@ -680,7 +680,7 @@ IceInternal::EndpointHostResolver::run() Ice::CommunicatorDestroyedException ex(__FILE__, __LINE__); if(p->observer) { - p->observer->failed(ex.ice_name()); + p->observer->failed(ex.ice_id()); p->observer->detach(); } p->callback->exception(ex); diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index 55071b685c1..18b0e23301f 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -300,7 +300,7 @@ IceInternal::IncomingBase::__handleException(const std::exception& exc, bool amd if(_observer) { - _observer.failed(rfe->ice_name()); + _observer.failed(rfe->ice_id()); } if(_response) @@ -356,7 +356,7 @@ IceInternal::IncomingBase::__handleException(const std::exception& exc, bool amd if(_observer) { - _observer.failed(ex->ice_name()); + _observer.failed(ex->ice_id()); } if(_response) diff --git a/cpp/src/Ice/Outgoing.cpp b/cpp/src/Ice/Outgoing.cpp index 2a12baf84d9..ca04e352075 100644 --- a/cpp/src/Ice/Outgoing.cpp +++ b/cpp/src/Ice/Outgoing.cpp @@ -82,7 +82,7 @@ ProxyOutgoingBase::completed(const Ice::Exception& ex) return; } - _childObserver.failed(ex.ice_name()); + _childObserver.failed(ex.ice_id()); _childObserver.detach(); _state = StateFailed; @@ -270,7 +270,7 @@ ProxyOutgoingBase::invokeImpl() } catch(const Ice::Exception& ex) { - _observer.failed(ex.ice_name()); + _observer.failed(ex.ice_id()); throw; } } @@ -680,7 +680,7 @@ void ConnectionFlushBatch::completed(const Ice::Exception& ex) { Monitor<Mutex>::Lock sync(_monitor); - _childObserver.failed(ex.ice_name()); + _childObserver.failed(ex.ice_id()); _childObserver.detach(); ICE_RESET_EXCEPTION(_exception, ex.ice_clone()); _monitor.notify(); diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index 74bdd2c9bd0..5c60223e335 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -87,7 +87,7 @@ OutgoingAsyncBase::finished(const Exception& ex) { if(_childObserver) { - _childObserver.failed(ex.ice_name()); + _childObserver.failed(ex.ice_id()); _childObserver.detach(); } return AsyncResult::finished(ex); @@ -104,7 +104,7 @@ ProxyOutgoingAsyncBase::completed(const Exception& exc) { if(_childObserver) { - _childObserver.failed(exc.ice_name()); + _childObserver.failed(exc.ice_id()); _childObserver.detach(); } @@ -297,7 +297,7 @@ ProxyOutgoingAsyncBase::invokeImpl(bool userThread) { if(_childObserver) { - _childObserver.failed(ex.ice_name()); + _childObserver.failed(ex.ice_id()); _childObserver.detach(); } int interval = handleException(ex); @@ -945,7 +945,7 @@ CommunicatorFlushBatchAsync::flushConnection(const ConnectionIPtr& con) virtual bool completed(const Exception& ex) { - _childObserver.failed(ex.ice_name()); + _childObserver.failed(ex.ice_id()); _childObserver.detach(); _outAsync->check(false); return false; @@ -1071,7 +1071,7 @@ OnewayClosureCallback::completed(const AsyncResultPtr& __result) const } catch(const UserException& __ex) { - throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + throw UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); } } __result->__readEmptyParams(); @@ -1195,7 +1195,7 @@ TwowayClosureCallback::completed(const AsyncResultPtr& __result) const { __userException(__ex); } - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); } } else diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index 61ca0b5ce24..9b7602394d6 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -848,7 +848,7 @@ IceProxy::Ice::Object::ice_isA(const string& typeId, const Context& context) } catch(const ::Ice::UserException& __ex) { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); } } bool __ret; @@ -894,7 +894,7 @@ IceProxy::Ice::Object::end_ice_isA(const AsyncResultPtr& __result) } catch(const UserException& __ex) { - throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + throw UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); } } bool __ret; @@ -920,7 +920,7 @@ IceProxy::Ice::Object::ice_ping(const Context& context) } catch(const ::Ice::UserException& __ex) { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); } } __og.readEmptyParams(); @@ -966,7 +966,7 @@ IceProxy::Ice::Object::ice_ids(const Context& context) } catch(const ::Ice::UserException& __ex) { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); } } vector<string> __ret; @@ -990,7 +990,7 @@ IceProxy::Ice::Object::ice_id(const Context& context) } catch(const ::Ice::UserException& __ex) { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); } } string __ret; @@ -1033,7 +1033,7 @@ IceProxy::Ice::Object::end_ice_ids(const AsyncResultPtr& __result) } catch(const UserException& __ex) { - throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + throw UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); } } vector<string> __ret; @@ -1076,7 +1076,7 @@ IceProxy::Ice::Object::end_ice_id(const AsyncResultPtr& __result) } catch(const UserException& __ex) { - throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + throw UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); } } string __ret; @@ -1247,7 +1247,7 @@ IceProxy::Ice::Object::__invoke(Outgoing& __og) const } catch(const ::Ice::UserException& __ex) { - ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name()); + ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_id()); throw __uue; } } @@ -1270,7 +1270,7 @@ IceProxy::Ice::Object::__end(const ::Ice::AsyncResultPtr& __result, const std::s } catch(const UserException& __ex) { - throw UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + throw UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); } } __result->__readEmptyParams(); @@ -1935,7 +1935,7 @@ ICE_OBJECT_PRX::ice_getConnection() } catch(const Exception& exc) { - observer.failed(exc.ice_name()); + observer.failed(exc.ice_id()); throw; } } diff --git a/cpp/src/IceUtil/Exception.cpp b/cpp/src/IceUtil/Exception.cpp index 869e160b9de..eab14ddffa1 100644 --- a/cpp/src/IceUtil/Exception.cpp +++ b/cpp/src/IceUtil/Exception.cpp @@ -42,8 +42,7 @@ # define DBGHELP_TRANSLATE_TCHAR # include <IceUtil/StringConverter.h> # if _MSC_VER >= 1900 -# // VS 2015 RC issues this warning for code in DbgHelp.h -# pragma warning(disable:4091) +# pragma warning(disable:4091) // VS 2015 RC issues this warning for code in DbgHelp.h # endif # endif # include <DbgHelp.h> @@ -407,18 +406,10 @@ IceUtil::Exception::Exception(const char* file, int line) : { } -IceUtil::Exception::~Exception() throw() +IceUtil::Exception::~Exception() ICE_NOEXCEPT { } -const char* IceUtil::Exception::_name = "IceUtil::Exception"; - -string -IceUtil::Exception::ice_name() const -{ - return _name; -} - void IceUtil::Exception::ice_print(ostream& out) const { @@ -426,11 +417,11 @@ IceUtil::Exception::ice_print(ostream& out) const { out << _file << ':' << _line << ": "; } - out << ice_name(); + out << ice_id(); } const char* -IceUtil::Exception::what() const throw() +IceUtil::Exception::what() const ICE_NOEXCEPT { try { @@ -451,6 +442,12 @@ IceUtil::Exception::what() const throw() return ""; } +string +IceUtil::Exception::ice_id() const +{ + return "::IceUtil::Exception"; +} + #ifdef ICE_CPP11_MAPPING exception_ptr IceUtil::Exception::ice_clone() const @@ -467,6 +464,13 @@ IceUtil::Exception::ice_clone() const return nullptr; // Make compilers happy } #else + +string +IceUtil::Exception::ice_name() const +{ + return "IceUtil::Exception"; +} + IceUtil::Exception* IceUtil::Exception::ice_clone() const { @@ -514,19 +518,23 @@ IceUtil::NullHandleException::NullHandleException(const char* file, int line) : } } -IceUtil::NullHandleException::~NullHandleException() throw() +IceUtil::NullHandleException::~NullHandleException() ICE_NOEXCEPT { } -const char* IceUtil::NullHandleException::_name = "IceUtil::NullHandleException"; +string +IceUtil::NullHandleException::ice_id() const +{ + return "::IceUtil::NullHandleException"; +} +#ifndef ICE_CPP11_MAPPING string IceUtil::NullHandleException::ice_name() const { - return _name; + return "IceUtil::NullHandleException"; } -#ifndef ICE_CPP11_MAPPING IceUtil::NullHandleException* IceUtil::NullHandleException::ice_clone() const { @@ -551,16 +559,8 @@ IceUtil::IllegalArgumentException::IllegalArgumentException(const char* file, in { } -IceUtil::IllegalArgumentException::~IllegalArgumentException() throw() -{ -} - -const char* IceUtil::IllegalArgumentException::_name = "IceUtil::IllegalArgumentException"; - -string -IceUtil::IllegalArgumentException::ice_name() const +IceUtil::IllegalArgumentException::~IllegalArgumentException() ICE_NOEXCEPT { - return _name; } void @@ -570,7 +570,19 @@ IceUtil::IllegalArgumentException::ice_print(ostream& out) const out << ": " << _reason; } +string +IceUtil::IllegalArgumentException::ice_id() const +{ + return "::IceUtil::IllegalArgumentException"; +} + #ifndef ICE_CPP11_MAPPING +string +IceUtil::IllegalArgumentException::ice_name() const +{ + return "IceUtil::IllegalArgumentException"; +} + IceUtil::IllegalArgumentException* IceUtil::IllegalArgumentException::ice_clone() const { @@ -593,9 +605,6 @@ IceUtil::IllegalArgumentException::reason() const // // IllegalConversionException // - -const char* IceUtil::IllegalConversionException::_name = "IceUtil::IllegalConversionException"; - IceUtil::IllegalConversionException::IllegalConversionException(const char* file, int line): Exception(file, line) {} @@ -606,15 +615,9 @@ IceUtil::IllegalConversionException::IllegalConversionException(const char* file _reason(reason) {} -IceUtil::IllegalConversionException::~IllegalConversionException() throw() +IceUtil::IllegalConversionException::~IllegalConversionException() ICE_NOEXCEPT {} -string -IceUtil::IllegalConversionException::ice_name() const -{ - return _name; -} - void IceUtil::IllegalConversionException::ice_print(ostream& out) const { @@ -623,7 +626,19 @@ IceUtil::IllegalConversionException::ice_print(ostream& out) const } +string +IceUtil::IllegalConversionException::ice_id() const +{ + return "::IceUtil::IllegalConversionException"; +} + #ifndef ICE_CPP11_MAPPING +string +IceUtil::IllegalConversionException::ice_name() const +{ + return "IceUtil::IllegalConversionException"; +} + IceUtil::IllegalConversionException* IceUtil::IllegalConversionException::ice_clone() const { @@ -651,14 +666,6 @@ IceUtil::SyscallException::SyscallException(const char* file, int line, int err { } -const char* IceUtil::SyscallException::_name = "IceUtil::SyscallException"; - -string -IceUtil::SyscallException::ice_name() const -{ - return _name; -} - void IceUtil::SyscallException::ice_print(ostream& os) const { @@ -669,7 +676,20 @@ IceUtil::SyscallException::ice_print(ostream& os) const } } +string +IceUtil::SyscallException::ice_id() const +{ + return "::IceUtil::SyscallException"; +} + #ifndef ICE_CPP11_MAPPING + +string +IceUtil::SyscallException::ice_name() const +{ + return "IceUtil::SyscallException"; +} + IceUtil::SyscallException* IceUtil::SyscallException::ice_clone() const { @@ -697,18 +717,10 @@ IceUtil::FileLockException::FileLockException(const char* file, int line, int er { } -IceUtil::FileLockException::~FileLockException() throw() +IceUtil::FileLockException::~FileLockException() ICE_NOEXCEPT { } -const char* IceUtil::FileLockException::_name = "IceUtil::FileLockException"; - -string -IceUtil::FileLockException::ice_name() const -{ - return _name; -} - void IceUtil::FileLockException::ice_print(ostream& os) const { @@ -720,7 +732,19 @@ IceUtil::FileLockException::ice_print(ostream& os) const } } +string +IceUtil::FileLockException::ice_id() const +{ + return "::IceUtil::FileLockException"; +} + #ifndef ICE_CPP11_MAPPING +string +IceUtil::FileLockException::ice_name() const +{ + return "IceUtil::FileLockException"; +} + IceUtil::FileLockException* IceUtil::FileLockException::ice_clone() const { @@ -749,19 +773,23 @@ IceUtil::OptionalNotSetException::OptionalNotSetException(const char* file, int } } -IceUtil::OptionalNotSetException::~OptionalNotSetException() throw() +IceUtil::OptionalNotSetException::~OptionalNotSetException() ICE_NOEXCEPT { } -const char* IceUtil::OptionalNotSetException::_name = "IceUtil::OptionalNotSetException"; +string +IceUtil::OptionalNotSetException::ice_id() const +{ + return "::IceUtil::OptionalNotSetException"; +} +#ifndef ICE_CPP11_MAPPING string IceUtil::OptionalNotSetException::ice_name() const { - return _name; + return "IceUtil::OptionalNotSetException"; } -#ifndef ICE_CPP11_MAPPING IceUtil::OptionalNotSetException* IceUtil::OptionalNotSetException::ice_clone() const { @@ -782,18 +810,10 @@ IceUtil::IconvInitializationException::IconvInitializationException(const char* { } -IceUtil::IconvInitializationException::~IconvInitializationException() throw() +IceUtil::IconvInitializationException::~IconvInitializationException() ICE_NOEXCEPT { } -const char* IceUtil::IconvInitializationException::_name = "IceUtil::IconvInitializationException"; - -string -IceUtil::IconvInitializationException::ice_name() const -{ - return _name; -} - void IceUtil::IconvInitializationException::ice_print(ostream& out) const { @@ -801,7 +821,19 @@ IceUtil::IconvInitializationException::ice_print(ostream& out) const out << ": " << _reason; } +string +IceUtil::IconvInitializationException::ice_id() const +{ + return "::IceUtil::IconvInitializationException"; +} + #ifndef ICE_CPP11_MAPPING +string +IceUtil::IconvInitializationException::ice_name() const +{ + return "IceUtil::IconvInitializationException"; +} + IceUtil::IconvInitializationException* IceUtil::IconvInitializationException::ice_clone() const { diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp index 14d5428e20e..f5aa79cd100 100644 --- a/cpp/src/Slice/PythonUtil.cpp +++ b/cpp/src/Slice/PythonUtil.cpp @@ -1089,6 +1089,11 @@ Slice::Python::CodeVisitor::visitExceptionStart(const ExceptionPtr& p) // _ice_name // _out << sp << nl << "_ice_name = '" << scoped.substr(2) << "'"; + + // + // _ice_id + // + _out << sp << nl << "_ice_id = '" << scoped << "'"; _out.dec(); diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp index 393aa565593..5ff96c56245 100644 --- a/cpp/src/Slice/RubyUtil.cpp +++ b/cpp/src/Slice/RubyUtil.cpp @@ -880,7 +880,7 @@ Slice::Ruby::CodeVisitor::visitExceptionStart(const ExceptionPtr& p) // _out << sp << nl << "def to_s"; _out.inc(); - _out << nl << "'" << scoped.substr(2) << "'"; + _out << nl << "'" << scoped << "'"; _out.dec(); _out << nl << "end"; diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index e53d0ed13fa..789be476a40 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -993,11 +993,18 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) C << sb; C << eb; + H << nl << "ICE_DEPRECATED_API(\"ice_name() is deprecated, use ice_id() instead.\")"; H << nl << "virtual ::std::string ice_name() const;"; C << sp << nl << "::std::string" << nl << scoped.substr(2) << "::ice_name() const"; C << sb; C << nl << "return \"" << p->scoped().substr(2) << "\";"; C << eb; + + H << nl << "virtual ::std::string ice_id() const;"; + C << sp << nl << "::std::string" << nl << scoped.substr(2) << "::ice_id() const"; + C << sb; + C << nl << "return \"" << p->scoped() << "\";"; + C << eb; StringList metaData = p->getMetaData(); if(find(metaData.begin(), metaData.end(), "cpp:ice_print") != metaData.end()) @@ -1994,7 +2001,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) // COMPILERFIX: Don't throw UnknownUserException directly. This is causing access // violation errors with Visual C++ 64bits optimized builds. See bug #2962. // - C << nl << "::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name());"; + C << nl << "::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_id());"; C << nl << "throw __uue;"; C << eb; C << eb; @@ -2095,7 +2102,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) } C << nl << "catch(const ::Ice::UserException& __ex)"; C << sb; - C << nl << "throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());"; + C << nl << "throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_id());"; C << eb; C << eb; if(ret || !outParams.empty()) @@ -2158,7 +2165,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) } C << nl << "catch(const ::Ice::UserException& __ex)"; C << sb; - C << nl << "throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());"; + C << nl << "throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_id());"; C << eb; C << eb; @@ -5425,10 +5432,10 @@ Slice::Gen::Cpp11TypesVisitor::visitExceptionStart(const ExceptionPtr& p) C << sp << nl << "}"; } - H << nl << "virtual ::std::string ice_name() const;"; - C << sp << nl << "::std::string" << nl << scoped.substr(2) << "::ice_name() const"; + H << nl << "virtual ::std::string ice_id() const;"; + C << sp << nl << "::std::string" << nl << scoped.substr(2) << "::ice_id() const"; C << sb; - C << nl << "return \"" << p->scoped().substr(2) << "\";"; + C << nl << "return \"" << p->scoped() << "\";"; C << eb; StringList metaData = p->getMetaData(); diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 2b6e736795f..7c00c5afff0 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -3710,10 +3710,17 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp; emitGeneratedCodeAttribute(); + _out << nl << "[_System.Obsolete(\"ice_name() is deprecated, use ice_id() instead.\")]"; _out << nl << "public override string ice_name()"; _out << sb; _out << nl << "return \"" << p->scoped().substr(2) << "\";"; _out << eb; + + emitGeneratedCodeAttribute(); + _out << nl << "public override string ice_id()"; + _out << sb; + _out << nl << "return \"" << p->scoped() << "\";"; + _out << eb; _out << sp << nl << "#region Object members"; @@ -5514,7 +5521,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) } _out << nl << "catch(Ice.UserException ex__)"; _out << sb; - _out << nl << "throw new Ice.UnknownUserException(ex__.ice_name(), ex__);"; + _out << nl << "throw new Ice.UnknownUserException(ex__.ice_id(), ex__);"; _out << eb; _out << eb; diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 354b0ce37f1..e9da95c087c 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -3653,11 +3653,21 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) } } - out << sp << nl << "public String" << nl << "ice_name()"; + out << sp; + out << nl << "/**"; + out << nl << " * @deprecated ice_name() is deprecated, use ice_id() instead."; + out << nl << " **/"; + out << nl << "@Deprecated"; + out << nl << "public String" << nl << "ice_name()"; out << sb; out << nl << "return \"" << scoped.substr(2) << "\";"; out << eb; + out << sp << nl << "public String" << nl << "ice_id()"; + out << sb; + out << nl << "return \"" << scoped << "\";"; + out << eb; + return true; } @@ -4943,7 +4953,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) } out << nl << "catch(Ice.UserException __ex)"; out << sb; - out << nl << "throw new Ice.UnknownUserException(__ex.ice_name(), __ex);"; + out << nl << "throw new Ice.UnknownUserException(__ex.ice_id(), __ex);"; out << eb; out << eb; diff --git a/cpp/src/slice2objc/Gen.cpp b/cpp/src/slice2objc/Gen.cpp index f31146e05ab..6455d87a4ce 100644 --- a/cpp/src/slice2objc/Gen.cpp +++ b/cpp/src/slice2objc/Gen.cpp @@ -1291,6 +1291,15 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _M << nl << "return @\"" << p->scoped().substr(2) << "\";"; _M << eb; + // + // ice_id + // + _H << nl << "-(NSString *) ice_id;"; + _M << sp << nl << "-(NSString *) ice_id"; + _M << sb; + _M << nl << "return @\"" << p->scoped() << "\";"; + _M << eb; + ContainerType ct = p->isLocal() ? LocalException : Other; writeInit(p, dataMembers, baseDataMembers, allDataMembers, requiresMemberInit(dataMembers), BaseTypeException, ct); writeFactory(p, allDataMembers, BaseTypeException, ct); @@ -3089,7 +3098,7 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p) _M << sb; _M << nl << "[is_ endEncapsulation];"; _M << nl << "@throw [ICEUnknownUserException unknownUserException:__FILE__ line:__LINE__ " - << "unknown:[ex_ ice_name]];"; + << "unknown:[ex_ ice_id]];"; _M << eb; _M << eb; diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp index 88a37ef619a..2e42bc8fb73 100644 --- a/cpp/src/slice2php/Main.cpp +++ b/cpp/src/slice2php/Main.cpp @@ -688,8 +688,17 @@ CodeVisitor::visitExceptionStart(const ExceptionPtr& p) // _out << sp << nl << "public function ice_name()"; _out << sb; + _out << nl << "trigger_error('ice_name() is deprecated use ice_id() instead.', E_DEPRECATED);"; _out << nl << "return '" << scoped.substr(2) << "';"; _out << eb; + + // + // ice_name + // + _out << sp << nl << "public function ice_id()"; + _out << sb; + _out << nl << "return '" << scoped << "';"; + _out << eb; // // __toString |