Hi Stephan,
> 4 Incorporate Daniel's fix and change the rules so that extracting a
> null reference of interface type T1 to a reference of interface type T2
> always succeeds, independent of T1 and T2. That is, the list would become
>
> b1: true x1: null
> b2: true x2: null
> b2a: true x2a: null
> b2b: true x2b: null
>
> I favor the fourth solution
Not sure. Look at
void setFacetValue( sal_Int32 nFacet, const Any& value )
{
if ( nFacet == ID_FACET_OF_TYPE_T )
{
T facetValue;
if ( !( value >>= facetValue ) )
throw IllegalArgumentException();
...
}
}
Here, it may be valid to pass a NULL reference, as long as it's of type
T (or a derived type). If no somebody passes a NULL-reference of type
T2, your proposal would imply that this value is accepted. However,
speaking strictly this is not allowed, as the given facet is of type T.
You could argue that effectively, it does not matter, because the facet
value is NULL afterwards, anyway. However, this would hide the error
made by the caller (passing an improperly typed value, no matter whether
NULL or not NULL).
Thus, I think 3. would be the best solution, not 4.
Ciao
Frank
--
- Frank Sch�nheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems, Inc. http://www.sun.com -
- OpenOffice.org Database Access http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]