Kaydet (Commit) 8f11dce7 authored tarafından Oliver-Rainer Wittmann's avatar Oliver-Rainer Wittmann

#121625# - method <ExtensionManager::getExtensionsWithSameId(..)> - catch…

#121625# - method <ExtensionManager::getExtensionsWithSameId(..)> - catch certain exceptions to avoid crashes

- method <ExtensionManager::getAllExtensions(..)> - do not add bundled extensions twice to the map; the map can not hold a fourth entry.
üst b3c966ab
...@@ -313,26 +313,59 @@ void ExtensionManager::addExtensionsToMap( ...@@ -313,26 +313,59 @@ void ExtensionManager::addExtensionsToMap(
{ //will throw an exception if the extension does not exist { //will throw an exception if the extension does not exist
extensionList.push_back(getUserRepository()->getDeployedPackage( extensionList.push_back(getUserRepository()->getDeployedPackage(
identifier, fileName, Reference<ucb::XCommandEnvironment>())); identifier, fileName, Reference<ucb::XCommandEnvironment>()));
} catch(lang::IllegalArgumentException &) }
catch(lang::IllegalArgumentException &)
{
extensionList.push_back(Reference<deploy::XPackage>());
}
// catch deploy::DeploymentException and ucb::CommandFailedException to avoid unhandled exceptions causing crashes
catch( deploy::DeploymentException & )
{
extensionList.push_back(Reference<deploy::XPackage>());
}
catch( ucb::CommandFailedException & )
{ {
extensionList.push_back(Reference<deploy::XPackage>()); extensionList.push_back(Reference<deploy::XPackage>());
} }
try try
{ {
extensionList.push_back(getSharedRepository()->getDeployedPackage( extensionList.push_back(getSharedRepository()->getDeployedPackage(
identifier, fileName, Reference<ucb::XCommandEnvironment>())); identifier, fileName, Reference<ucb::XCommandEnvironment>()));
} catch (lang::IllegalArgumentException &) }
catch (lang::IllegalArgumentException &)
{
extensionList.push_back(Reference<deploy::XPackage>());
}
// catch deploy::DeploymentException and ucb::CommandFailedException to avoid unhandled exceptions causing crashes
catch( deploy::DeploymentException & )
{ {
extensionList.push_back(Reference<deploy::XPackage>()); extensionList.push_back(Reference<deploy::XPackage>());
} }
catch( ucb::CommandFailedException & )
{
extensionList.push_back(Reference<deploy::XPackage>());
}
try try
{ {
extensionList.push_back(getBundledRepository()->getDeployedPackage( extensionList.push_back(getBundledRepository()->getDeployedPackage(
identifier, fileName, Reference<ucb::XCommandEnvironment>())); identifier, fileName, Reference<ucb::XCommandEnvironment>()));
} catch (lang::IllegalArgumentException &) }
catch (lang::IllegalArgumentException &)
{ {
extensionList.push_back(Reference<deploy::XPackage>()); extensionList.push_back(Reference<deploy::XPackage>());
} }
// catch deploy::DeploymentException and ucb::CommandFailedException to avoid unhandled exceptions causing crashes
catch( deploy::DeploymentException & )
{
extensionList.push_back(Reference<deploy::XPackage>());
}
catch( ucb::CommandFailedException & )
{
extensionList.push_back(Reference<deploy::XPackage>());
}
OSL_ASSERT(extensionList.size() == 3); OSL_ASSERT(extensionList.size() == 3);
return extensionList; return extensionList;
} }
...@@ -1181,7 +1214,6 @@ uno::Sequence< uno::Sequence<Reference<deploy::XPackage> > > ...@@ -1181,7 +1214,6 @@ uno::Sequence< uno::Sequence<Reference<deploy::XPackage> > >
uno::Sequence<Reference<deploy::XPackage> > bundledExt = uno::Sequence<Reference<deploy::XPackage> > bundledExt =
getBundledRepository()->getDeployedPackages(xAbort, xCmdEnv); getBundledRepository()->getDeployedPackages(xAbort, xCmdEnv);
addExtensionsToMap(mapExt, bundledExt, OUSTR("bundled")); addExtensionsToMap(mapExt, bundledExt, OUSTR("bundled"));
addExtensionsToMap(mapExt, bundledExt, OUSTR("bundled_prereg"));
// Create the tmp repository to trigger its clean up (deletion // Create the tmp repository to trigger its clean up (deletion
// of old temporary data.) // of old temporary data.)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment