summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-07-25 17:47:36 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-07-25 17:47:36 +0200
commite548dd63ec00b52e8d0f280b7a823516b8f61470 (patch)
treed3960c6fb761b135a4a6ad6cb991c1fa6f4d67f5
parentImproved IceGrid discovery, it now works with icegrid registry slaves and nodes (diff)
downloadice-e548dd63ec00b52e8d0f280b7a823516b8f61470.tar.bz2
ice-e548dd63ec00b52e8d0f280b7a823516b8f61470.tar.xz
ice-e548dd63ec00b52e8d0f280b7a823516b8f61470.zip
Fixed ICE-5595: Catch C++ exceptions by const reference
-rw-r--r--cpp/src/Ice/BasicStream.cpp2
-rw-r--r--cpp/src/Ice/ThreadPool.cpp6
-rw-r--r--cpp/src/IceGrid/AdminSessionI.cpp2
-rw-r--r--cpp/src/IceGrid/Database.cpp14
-rw-r--r--cpp/src/IceGrid/LocatorI.cpp2
-rw-r--r--cpp/src/IceGrid/ServerCache.cpp16
-rw-r--r--cpp/test/Ice/facets/AllTests.cpp6
-rw-r--r--cpp/test/Ice/faultTolerance/AllTests.cpp2
-rw-r--r--cpp/test/Ice/location/TestI.cpp2
-rw-r--r--cpp/test/Ice/servantLocator/AllTests.cpp2
-rw-r--r--cpp/test/IceGrid/allocation/AllTests.cpp16
-rw-r--r--cpp/test/IceGrid/replicaGroup/AllTests.cpp2
-rw-r--r--cpp/test/IceGrid/replication/AllTests.cpp10
-rw-r--r--cpp/test/IceGrid/update/AllTests.cpp2
-rw-r--r--cpp/test/IceUtil/thread/AliveTest.cpp2
-rw-r--r--cs/src/Ice/Proxy.cs3
16 files changed, 45 insertions, 44 deletions
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp
index ddaa4f29656..157d5e0c8ae 100644
--- a/cpp/src/Ice/BasicStream.cpp
+++ b/cpp/src/Ice/BasicStream.cpp
@@ -1650,7 +1650,7 @@ IceInternal::BasicStream::writeEnum(Int v, Int maxValue)
}
void
-IceInternal::BasicStream::writeException(const Ice::UserException& e)
+IceInternal::BasicStream::writeException(const UserException& e)
{
initWriteEncaps();
_currentWriteEncaps->encoder->write(e);
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp
index 593191c3034..cecbd78d868 100644
--- a/cpp/src/Ice/ThreadPool.cpp
+++ b/cpp/src/Ice/ThreadPool.cpp
@@ -699,7 +699,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
{
current._handler->message(current);
}
- catch(ThreadPoolDestroyedException&)
+ catch(const ThreadPoolDestroyedException&)
{
return;
}
@@ -721,7 +721,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
{
_selector.select(handlers, _serverIdleTime);
}
- catch(SelectorTimeoutException&)
+ catch(const SelectorTimeoutException&)
{
Lock sync(*this);
if(!_destroyed && _inUse == 0)
@@ -954,7 +954,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
assert(current._handler);
current._handler->message(current);
}
- catch(ThreadPoolDestroyedException&)
+ catch(const ThreadPoolDestroyedException&)
{
return;
}
diff --git a/cpp/src/IceGrid/AdminSessionI.cpp b/cpp/src/IceGrid/AdminSessionI.cpp
index 3be228f8ae5..1e88307b8b6 100644
--- a/cpp/src/IceGrid/AdminSessionI.cpp
+++ b/cpp/src/IceGrid/AdminSessionI.cpp
@@ -470,7 +470,7 @@ AdminSessionI::destroyImpl(bool shutdown)
{
_database->unlock(this);
}
- catch(AccessDeniedException&)
+ catch(const AccessDeniedException&)
{
}
diff --git a/cpp/src/IceGrid/Database.cpp b/cpp/src/IceGrid/Database.cpp
index 0cbad1e89cb..b409f4b0cd3 100644
--- a/cpp/src/IceGrid/Database.cpp
+++ b/cpp/src/IceGrid/Database.cpp
@@ -1246,7 +1246,7 @@ Database::getAdapterInfo(const string& id)
Lock sync(*this); // Make sure this isn't call during an update.
return _adapterCache.get(id)->getAdapterInfo();
}
- catch(AdapterNotExistException&)
+ catch(const AdapterNotExistException&)
{
}
@@ -1302,7 +1302,7 @@ Database::getFilteredAdapterInfo(const string& id, const Ice::ConnectionPtr& con
}
return infos;
}
- catch(AdapterNotExistException&)
+ catch(const AdapterNotExistException&)
{
}
@@ -1346,7 +1346,7 @@ Database::getAdapterServer(const string& id) const
return adapter->getServerId();
}
}
- catch(AdapterNotExistException&)
+ catch(const AdapterNotExistException&)
{
}
return "";
@@ -1360,7 +1360,7 @@ Database::getAdapterApplication(const string& id) const
Lock sync(*this); // Make sure this isn't call during an update.
return _adapterCache.get(id)->getApplication();
}
- catch(AdapterNotExistException&)
+ catch(const AdapterNotExistException&)
{
}
return "";
@@ -1378,7 +1378,7 @@ Database::getAdapterNode(const string& id) const
return adapter->getNodeName();
}
}
- catch(AdapterNotExistException&)
+ catch(const AdapterNotExistException&)
{
}
return "";
@@ -1715,7 +1715,7 @@ Database::getObjectProxy(const Ice::Identity& id)
//
return _objectCache.get(id)->getProxy();
}
- catch(ObjectNotRegisteredException&)
+ catch(const ObjectNotRegisteredException&)
{
}
@@ -1810,7 +1810,7 @@ Database::getObjectInfo(const Ice::Identity& id)
ObjectEntryPtr object = _objectCache.get(id);
return object->getObjectInfo();
}
- catch(ObjectNotRegisteredException&)
+ catch(const ObjectNotRegisteredException&)
{
}
diff --git a/cpp/src/IceGrid/LocatorI.cpp b/cpp/src/IceGrid/LocatorI.cpp
index e7d34802386..0a0add3df0d 100644
--- a/cpp/src/IceGrid/LocatorI.cpp
+++ b/cpp/src/IceGrid/LocatorI.cpp
@@ -113,7 +113,7 @@ public:
{
ex.ice_throw();
}
- catch(Ice::AdapterNotFoundException&)
+ catch(const Ice::AdapterNotFoundException&)
{
//
// We couldn't find the adapter, we ignore and return the
diff --git a/cpp/src/IceGrid/ServerCache.cpp b/cpp/src/IceGrid/ServerCache.cpp
index 4db64ce189c..00a392a85cb 100644
--- a/cpp/src/IceGrid/ServerCache.cpp
+++ b/cpp/src/IceGrid/ServerCache.cpp
@@ -266,7 +266,7 @@ ServerEntry::waitForSyncNoThrow(int timeout)
{
waitImpl(timeout);
}
- catch(SynchronizationException&)
+ catch(const SynchronizationException&)
{
assert(timeout >= 0);
}
@@ -604,7 +604,7 @@ ServerEntry::syncImpl()
{
_cache.getNodeCache().get(destroy.node)->destroyServer(this, destroy, timeout);
}
- catch(NodeNotExistException&)
+ catch(const NodeNotExistException&)
{
exception(NodeUnreachableException(destroy.node, "node is not active"));
}
@@ -615,7 +615,7 @@ ServerEntry::syncImpl()
{
_cache.getNodeCache().get(load.node)->loadServer(this, load, session, timeout, noRestart);
}
- catch(NodeNotExistException&)
+ catch(const NodeNotExistException&)
{
exception(NodeUnreachableException(load.node, "node is not active"));
}
@@ -782,7 +782,7 @@ ServerEntry::loadCallback(const ServerPrx& proxy, const AdapterPrxDict& adpts, i
{
_cache.getNodeCache().get(destroy.node)->destroyServer(this, destroy, timeout);
}
- catch(NodeNotExistException&)
+ catch(const NodeNotExistException&)
{
exception(NodeUnreachableException(destroy.node, "node is not active"));
}
@@ -793,7 +793,7 @@ ServerEntry::loadCallback(const ServerPrx& proxy, const AdapterPrxDict& adpts, i
{
_cache.getNodeCache().get(load.node)->loadServer(this, load, session, timeout, noRestart);
}
- catch(NodeNotExistException&)
+ catch(const NodeNotExistException&)
{
exception(NodeUnreachableException(load.node, "node is not active"));
}
@@ -836,7 +836,7 @@ ServerEntry::destroyCallback()
{
_cache.getNodeCache().get(load.node)->loadServer(this, load, session, -1, noRestart);
}
- catch(NodeNotExistException&)
+ catch(const NodeNotExistException&)
{
exception(NodeUnreachableException(load.node, "node is not active"));
}
@@ -888,7 +888,7 @@ ServerEntry::exception(const Ice::Exception& ex)
{
_cache.getNodeCache().get(load.node)->loadServer(this, load, session, timeout, noRestart);
}
- catch(NodeNotExistException&)
+ catch(const NodeNotExistException&)
{
exception(NodeUnreachableException(load.node, "node is not active"));
}
@@ -942,7 +942,7 @@ ServerEntry::checkUpdate(const ServerInfo& info, bool noRestart)
{
node = _cache.getNodeCache().get(info.node);
}
- catch(NodeNotExistException&)
+ catch(const NodeNotExistException&)
{
throw NodeUnreachableException(info.node, "node is not active");
}
diff --git a/cpp/test/Ice/facets/AllTests.cpp b/cpp/test/Ice/facets/AllTests.cpp
index f8f1f85308c..d4549916651 100644
--- a/cpp/test/Ice/facets/AllTests.cpp
+++ b/cpp/test/Ice/facets/AllTests.cpp
@@ -54,7 +54,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
adapter->addFacet(obj, communicator->stringToIdentity("d"), "facetABCD");
test(false);
}
- catch(Ice::AlreadyRegisteredException&)
+ catch(const Ice::AlreadyRegisteredException&)
{
}
adapter->removeFacet(communicator->stringToIdentity("d"), "facetABCD");
@@ -63,7 +63,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
adapter->removeFacet(communicator->stringToIdentity("d"), "facetABCD");
test(false);
}
- catch(Ice::NotRegisteredException&)
+ catch(const Ice::NotRegisteredException&)
{
}
cout << "ok" << endl;
@@ -86,7 +86,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
adapter->removeAllFacets(communicator->stringToIdentity("id1"));
test(false);
}
- catch(Ice::NotRegisteredException&)
+ catch(const Ice::NotRegisteredException&)
{
}
fm = adapter->removeAllFacets(communicator->stringToIdentity("id2"));
diff --git a/cpp/test/Ice/faultTolerance/AllTests.cpp b/cpp/test/Ice/faultTolerance/AllTests.cpp
index caa8686d274..0e6c759cbd4 100644
--- a/cpp/test/Ice/faultTolerance/AllTests.cpp
+++ b/cpp/test/Ice/faultTolerance/AllTests.cpp
@@ -89,7 +89,7 @@ public:
catch(const Ice::ConnectFailedException&)
{
}
- catch(Ice::Exception& ex)
+ catch(const Ice::Exception& ex)
{
cout << ex << endl;
test(false);
diff --git a/cpp/test/Ice/location/TestI.cpp b/cpp/test/Ice/location/TestI.cpp
index e14d70902b4..36ac34bf2ff 100644
--- a/cpp/test/Ice/location/TestI.cpp
+++ b/cpp/test/Ice/location/TestI.cpp
@@ -121,7 +121,7 @@ TestI::migrateHello(const Ice::Current&)
{
_registry->addObject(_adapter2->add(_adapter1->remove(id), id));
}
- catch(Ice::NotRegisteredException&)
+ catch(const Ice::NotRegisteredException&)
{
_registry->addObject(_adapter1->add(_adapter2->remove(id), id));
}
diff --git a/cpp/test/Ice/servantLocator/AllTests.cpp b/cpp/test/Ice/servantLocator/AllTests.cpp
index 0854288359d..01e226843c1 100644
--- a/cpp/test/Ice/servantLocator/AllTests.cpp
+++ b/cpp/test/Ice/servantLocator/AllTests.cpp
@@ -347,7 +347,7 @@ allTests(const CommunicatorPtr& communicator)
obj->ice_ping();
test(false);
}
- catch(Ice::ObjectNotExistException&)
+ catch(const Ice::ObjectNotExistException&)
{
cout << "ok" << endl;
}
diff --git a/cpp/test/IceGrid/allocation/AllTests.cpp b/cpp/test/IceGrid/allocation/AllTests.cpp
index c6405614b2b..64dba18ebcf 100644
--- a/cpp/test/IceGrid/allocation/AllTests.cpp
+++ b/cpp/test/IceGrid/allocation/AllTests.cpp
@@ -714,7 +714,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
session1->allocateObjectByType("::TestServer1");
test(false);
}
- catch(AllocationException&)
+ catch(const AllocationException&)
{
}
try
@@ -722,7 +722,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
session1->allocateObjectByType("::TestServer2");
test(false);
}
- catch(AllocationException&)
+ catch(const AllocationException&)
{
}
test(session2->allocateObjectByType("::TestServer1"));
@@ -731,7 +731,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
session2->allocateObjectByType("::TestServer1");
test(false);
}
- catch(AllocationException&)
+ catch(const AllocationException&)
{
}
try
@@ -739,7 +739,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
session2->allocateObjectByType("::TestServer2");
test(false);
}
- catch(AllocationException&)
+ catch(const AllocationException&)
{
}
session2->releaseObject(allocatable3);
@@ -785,7 +785,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
session2->allocateObjectByType("::TestMultipleByServer");
test(false);
}
- catch(AllocationException&)
+ catch(const AllocationException&)
{
}
test(session1->allocateObjectByType("::TestMultipleByServer"));
@@ -797,7 +797,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
session1->allocateObjectByType("::TestMultipleByServer");
test(false);
}
- catch(AllocationException&)
+ catch(const AllocationException&)
{
}
test(session2->allocateObjectByType("::TestMultipleByServer"));
@@ -813,7 +813,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
session1->allocateObjectByType("::TestMultipleServer");
test(false);
}
- catch(AllocationTimeoutException&)
+ catch(const AllocationTimeoutException&)
{
}
try
@@ -821,7 +821,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
session2->allocateObjectByType("::TestMultipleServer");
test(false);
}
- catch(AllocationTimeoutException&)
+ catch(const AllocationTimeoutException&)
{
}
session1->releaseObject(obj1->ice_getIdentity());
diff --git a/cpp/test/IceGrid/replicaGroup/AllTests.cpp b/cpp/test/IceGrid/replicaGroup/AllTests.cpp
index 0807975791d..51162ac6839 100644
--- a/cpp/test/IceGrid/replicaGroup/AllTests.cpp
+++ b/cpp/test/IceGrid/replicaGroup/AllTests.cpp
@@ -93,7 +93,7 @@ removeServer(const AdminPrx& admin, const string& id)
{
admin->updateApplication(update);
}
- catch(DeploymentException& ex)
+ catch(const DeploymentException& ex)
{
cerr << ex.reason << endl;
test(false);
diff --git a/cpp/test/IceGrid/replication/AllTests.cpp b/cpp/test/IceGrid/replication/AllTests.cpp
index 4da303781bb..20f8e9722b8 100644
--- a/cpp/test/IceGrid/replication/AllTests.cpp
+++ b/cpp/test/IceGrid/replication/AllTests.cpp
@@ -131,7 +131,7 @@ waitForNodeState(const IceGrid::AdminPrx& admin, const std::string& node, bool u
cerr << "state: " << up << endl;
}
}
- catch(NodeNotExistException&)
+ catch(const NodeNotExistException&)
{
if(up)
{
@@ -158,7 +158,7 @@ instantiateServer(const AdminPrx& admin, const string& templ, const map<string,
{
admin->updateApplication(update);
}
- catch(DeploymentException& ex)
+ catch(const DeploymentException& ex)
{
cerr << ex.reason << endl;
test(false);
@@ -199,7 +199,7 @@ removeServer(const AdminPrx& admin, const string& id)
{
admin->updateApplication(update);
}
- catch(DeploymentException& ex)
+ catch(const DeploymentException& ex)
{
cerr << ex.reason << endl;
test(false);
@@ -469,7 +469,7 @@ allTests(const Ice::CommunicatorPtr& comm)
masterMapper->getUserAccount("unknown");
test(false);
}
- catch(UserAccountNotFoundException&)
+ catch(const UserAccountNotFoundException&)
{
}
try
@@ -477,7 +477,7 @@ allTests(const Ice::CommunicatorPtr& comm)
slave1Mapper->getUserAccount("unknown");
test(false);
}
- catch(UserAccountNotFoundException&)
+ catch(const UserAccountNotFoundException&)
{
}
diff --git a/cpp/test/IceGrid/update/AllTests.cpp b/cpp/test/IceGrid/update/AllTests.cpp
index cf1b16d273d..f41a8a1d902 100644
--- a/cpp/test/IceGrid/update/AllTests.cpp
+++ b/cpp/test/IceGrid/update/AllTests.cpp
@@ -1233,7 +1233,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
test(admin->getServerState("Server") == Active);
break;
}
- catch(DeploymentException&)
+ catch(const DeploymentException&)
{
IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(200));
}
diff --git a/cpp/test/IceUtil/thread/AliveTest.cpp b/cpp/test/IceUtil/thread/AliveTest.cpp
index 0f303e19e2b..dbe0050da96 100644
--- a/cpp/test/IceUtil/thread/AliveTest.cpp
+++ b/cpp/test/IceUtil/thread/AliveTest.cpp
@@ -62,7 +62,7 @@ public:
_childCreated.signal();
_parentReady.waitForSignal();
}
- catch(IceUtil::ThreadLockedException &)
+ catch(const IceUtil::ThreadLockedException&)
{
}
}
diff --git a/cs/src/Ice/Proxy.cs b/cs/src/Ice/Proxy.cs
index 1e662c73fa4..2b2687b6314 100644
--- a/cs/src/Ice/Proxy.cs
+++ b/cs/src/Ice/Proxy.cs
@@ -2328,7 +2328,8 @@ namespace Ice
}
}
- public int handleException__(Exception ex, IceInternal.RequestHandler handler, OperationMode mode, bool sent, ref int cnt)
+ public int handleException__(Exception ex, IceInternal.RequestHandler handler, OperationMode mode, bool sent,
+ ref int cnt)
{
setRequestHandler__(handler, null); // Clear the request handler