Strange part in connectivity/source/drivers/jdbc/tools.cxx

Julien Nabet serval2412 at yahoo.fr
Thu May 29 03:14:57 PDT 2014


On 29/05/2014 11:41, Lionel Elie Mamane wrote:
> On Wed, May 28, 2014 at 03:43:24PM -0700, julien2412 wrote:
>
>> I noticed this part:
>>      113         // this is a special property to find the jdbc driver
>>      114         if  (   pBegin->Name.compareToAscii( "JavaDriverClass" )
>>      115             &&  pBegin->Name.compareToAscii( "JavaDriverClassPath" )
>>      116             &&  pBegin->Name.compareToAscii( "SystemProperties" )
>>      117             &&  pBegin->Name.compareToAscii( "CharSet" )
>> etc.
> This means:
>
>   if pBegin->Name is neither "JavaDriverClass", nor
>   "JavaDriverClassPath", nor "SystemProperties", nor "CharSet"
>
> That could be correct... or not.
>
> That is in function createStringPropertyArray, which is used only in
> JConnection.hxx to create the arguments that are passed to the JDBC
> driver "connect" method. So, is this a list of properties that
> *should* be passed or a list of properties that should *not*? That's
> the question.
>
But as it is, this "if" can never be true since pBegin->Name can't be at 
the same time = to "JavaDriverClass" and also equal to "CharSet" for example
So either it's :

     114		  !pBegin->Name.compareToAscii( "JavaDriverClass" )
     115             &&  !pBegin->Name.compareToAscii( "JavaDriverClassPath" )
     116             &&  !pBegin->Name.compareToAscii( "SystemProperties" )
     117             &&  !pBegin->Name.compareToAscii( "CharSet" )

or

     114		 pBegin->Name.compareToAscii( "JavaDriverClass" )
     115             ||  pBegin->Name.compareToAscii( "JavaDriverClassPath" )
     116             ||  pBegin->Name.compareToAscii( "SystemProperties" )
     117             ||  pBegin->Name.compareToAscii( "CharSet" )


Sorry if I'm missing something obvious :-(

Julien


More information about the LibreOffice mailing list