On 08/04/2012 09:16 PM, Michael Meeks wrote:
No ExtensionManager: exception 'component context fails to
supply singleton com.sun.star.deployment.ExtensionManager of
type ...
Is it intended that that would throw an exception rather than returning
NULL ? that was apparently not clear to either to Caolan, or me reading
it :-)
The new-style service constructors/singleton getters never return null
but throw DeplyomentException. (Old createInstance stuff is vague on
whether to return null or throw an exception, both happening in
practice. Maybe the code in question used to work with a null-returning
createInstance line, and then has been changed to use the new style getter.)
Of course - Android has no real need for the extension manager, we'll
bundle a static image - so this sort of thing is expected; so just a
question: is a nil return, or an exception ideal ? and/or is some
QUERY_THROW type annotation wanted ? :-)
The general contract is that the services/singletons specified in UNOIDL
are available from the global service manager. That implies that
throwing a DeploymentException ("something fundamental is broken with
this installation") is better than returning null. One could rethink
that for platform feature fragmentation (rethink it into both
directions: on the one hand, throwing an exception is not ideal; on the
other hand, ignoring the exception for non-Android is not ideal,
either), but I'm not sure it is worth it.
In any case, I'd augment the patch to catch just DeploymentException,
turn the fprintf into a SAL_WARN, and add a comment that the exception
is only expected to happen on Android.
Stephan
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.