You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Patrick Frants (JIRA)" <xe...@xml.apache.org> on 2004/12/01 16:06:52 UTC

[jira] Created: (XERCESC-1304) XSValue::getActValStrings translates dt_boolean wrong

XSValue::getActValStrings translates dt_boolean wrong
-----------------------------------------------------

         Key: XERCESC-1304
         URL: http://nagoya.apache.org/jira/browse/XERCESC-1304
     Project: Xerces-C++
        Type: Bug
    Versions: 2.6.0    
 Environment: Windows XP Professional
    Reporter: Patrick Frants


In the lines (marked with BUG) where retVal->fData.fValue.f_bool is assigned a boolean value, the *wrong* value is assigned.

XMLUni::fgBooleanValueSpace[0] and XMLUni::fgBooleanValueSpace[2] contain the values for false.
XMLUni::fgBooleanValueSpace[1] and XMLUni::fgBooleanValueSpace[3] contain the values for true.

Does anybody actually use this code?

XSValue*  
XSValue::getActValStrings(const XMLCh*         const content    
                        ,       DataType             datatype
                        ,       Status&              status
                        ,       XMLVersion           version
                        ,       bool                 toValidate
                        ,       MemoryManager* const manager)
{
    try
    {
        switch (datatype)
        { 
        case XSValue::dt_boolean:
            {
                //do validation here more efficiently
                if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[0]) ||
                    XMLString::equals(content, XMLUni::fgBooleanValueSpace[2])  )
                {
                    XSValue* retVal = new (manager) XSValue(dt_boolean, manager);
BUG                    retVal->fData.fValue.f_bool = true;
                    return retVal;
                }
                else if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[1]) ||
                         XMLString::equals(content, XMLUni::fgBooleanValueSpace[3])  )
                {
                    XSValue* retVal = new (manager) XSValue(dt_boolean, manager);
BUG                    retVal->fData.fValue.f_bool = false;
                    return retVal;
                }
                else
                {
                    status = st_FOCA0002;
                    return 0;
                }
            }
            break;


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Closed: (XERCESC-1304) XSValue::getActValStrings translates dt_boolean wrong

Posted by "cargilld (JIRA)" <xe...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XERCESC-1304?page=history ]
     
cargilld closed XERCESC-1304:
-----------------------------


Closing as per last comment.

BTW, there have been numerous other changes to XSValue.cpp/hpp since 2.6.0.  If you are using XSValue you may want to review the code changes.

These changes are not all binary compatible so are only made to the HEAD branch as per the Xerces Release Policy.

> XSValue::getActValStrings translates dt_boolean wrong
> -----------------------------------------------------
>
>          Key: XERCESC-1304
>          URL: http://nagoya.apache.org/jira/browse/XERCESC-1304
>      Project: Xerces-C++
>         Type: Bug
>     Versions: 2.6.0
>  Environment: Windows XP Professional
>     Reporter: Patrick Frants

>
> In the lines (marked with BUG) where retVal->fData.fValue.f_bool is assigned a boolean value, the *wrong* value is assigned.
> XMLUni::fgBooleanValueSpace[0] and XMLUni::fgBooleanValueSpace[2] contain the values for false.
> XMLUni::fgBooleanValueSpace[1] and XMLUni::fgBooleanValueSpace[3] contain the values for true.
> Does anybody actually use this code?
> XSValue*  
> XSValue::getActValStrings(const XMLCh*         const content    
>                         ,       DataType             datatype
>                         ,       Status&              status
>                         ,       XMLVersion           version
>                         ,       bool                 toValidate
>                         ,       MemoryManager* const manager)
> {
>     try
>     {
>         switch (datatype)
>         { 
>         case XSValue::dt_boolean:
>             {
>                 //do validation here more efficiently
>                 if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[0]) ||
>                     XMLString::equals(content, XMLUni::fgBooleanValueSpace[2])  )
>                 {
>                     XSValue* retVal = new (manager) XSValue(dt_boolean, manager);
> BUG                    retVal->fData.fValue.f_bool = true;
>                     return retVal;
>                 }
>                 else if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[1]) ||
>                          XMLString::equals(content, XMLUni::fgBooleanValueSpace[3])  )
>                 {
>                     XSValue* retVal = new (manager) XSValue(dt_boolean, manager);
> BUG                    retVal->fData.fValue.f_bool = false;
>                     return retVal;
>                 }
>                 else
>                 {
>                     status = st_FOCA0002;
>                     return 0;
>                 }
>             }
>             break;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Resolved: (XERCESC-1304) XSValue::getActValStrings translates dt_boolean wrong

Posted by "cargilld (JIRA)" <xe...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XERCESC-1304?page=history ]
     
cargilld resolved XERCESC-1304:
-------------------------------

    Resolution: Fixed

I checked in a fix for this problem.  Please verify.
Thanks.

David

> XSValue::getActValStrings translates dt_boolean wrong
> -----------------------------------------------------
>
>          Key: XERCESC-1304
>          URL: http://nagoya.apache.org/jira/browse/XERCESC-1304
>      Project: Xerces-C++
>         Type: Bug
>     Versions: 2.6.0
>  Environment: Windows XP Professional
>     Reporter: Patrick Frants

>
> In the lines (marked with BUG) where retVal->fData.fValue.f_bool is assigned a boolean value, the *wrong* value is assigned.
> XMLUni::fgBooleanValueSpace[0] and XMLUni::fgBooleanValueSpace[2] contain the values for false.
> XMLUni::fgBooleanValueSpace[1] and XMLUni::fgBooleanValueSpace[3] contain the values for true.
> Does anybody actually use this code?
> XSValue*  
> XSValue::getActValStrings(const XMLCh*         const content    
>                         ,       DataType             datatype
>                         ,       Status&              status
>                         ,       XMLVersion           version
>                         ,       bool                 toValidate
>                         ,       MemoryManager* const manager)
> {
>     try
>     {
>         switch (datatype)
>         { 
>         case XSValue::dt_boolean:
>             {
>                 //do validation here more efficiently
>                 if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[0]) ||
>                     XMLString::equals(content, XMLUni::fgBooleanValueSpace[2])  )
>                 {
>                     XSValue* retVal = new (manager) XSValue(dt_boolean, manager);
> BUG                    retVal->fData.fValue.f_bool = true;
>                     return retVal;
>                 }
>                 else if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[1]) ||
>                          XMLString::equals(content, XMLUni::fgBooleanValueSpace[3])  )
>                 {
>                     XSValue* retVal = new (manager) XSValue(dt_boolean, manager);
> BUG                    retVal->fData.fValue.f_bool = false;
>                     return retVal;
>                 }
>                 else
>                 {
>                     status = st_FOCA0002;
>                     return 0;
>                 }
>             }
>             break;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Commented: (XERCESC-1304) XSValue::getActValStrings translates dt_boolean wrong

Posted by "Patrick Frants (JIRA)" <xe...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XERCESC-1304?page=comments#action_56068 ]
     
Patrick Frants commented on XERCESC-1304:
-----------------------------------------

I would expect this to be fixed in the 2.6 branch also...

> XSValue::getActValStrings translates dt_boolean wrong
> -----------------------------------------------------
>
>          Key: XERCESC-1304
>          URL: http://nagoya.apache.org/jira/browse/XERCESC-1304
>      Project: Xerces-C++
>         Type: Bug
>     Versions: 2.6.0
>  Environment: Windows XP Professional
>     Reporter: Patrick Frants

>
> In the lines (marked with BUG) where retVal->fData.fValue.f_bool is assigned a boolean value, the *wrong* value is assigned.
> XMLUni::fgBooleanValueSpace[0] and XMLUni::fgBooleanValueSpace[2] contain the values for false.
> XMLUni::fgBooleanValueSpace[1] and XMLUni::fgBooleanValueSpace[3] contain the values for true.
> Does anybody actually use this code?
> XSValue*  
> XSValue::getActValStrings(const XMLCh*         const content    
>                         ,       DataType             datatype
>                         ,       Status&              status
>                         ,       XMLVersion           version
>                         ,       bool                 toValidate
>                         ,       MemoryManager* const manager)
> {
>     try
>     {
>         switch (datatype)
>         { 
>         case XSValue::dt_boolean:
>             {
>                 //do validation here more efficiently
>                 if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[0]) ||
>                     XMLString::equals(content, XMLUni::fgBooleanValueSpace[2])  )
>                 {
>                     XSValue* retVal = new (manager) XSValue(dt_boolean, manager);
> BUG                    retVal->fData.fValue.f_bool = true;
>                     return retVal;
>                 }
>                 else if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[1]) ||
>                          XMLString::equals(content, XMLUni::fgBooleanValueSpace[3])  )
>                 {
>                     XSValue* retVal = new (manager) XSValue(dt_boolean, manager);
> BUG                    retVal->fData.fValue.f_bool = false;
>                     return retVal;
>                 }
>                 else
>                 {
>                     status = st_FOCA0002;
>                     return 0;
>                 }
>             }
>             break;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Commented: (XERCESC-1304) XSValue::getActValStrings translates dt_boolean wrong

Posted by "Patrick Frants (JIRA)" <xe...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XERCESC-1304?page=comments#action_56069 ]
     
Patrick Frants commented on XERCESC-1304:
-----------------------------------------

Already changed our copy of the 2.6 source code. 

I will not check out the head revision from CVS. The fix is trivial and
looks ok to me.

Is this issue now closed? As far as I am concerned it can be closed.

> XSValue::getActValStrings translates dt_boolean wrong
> -----------------------------------------------------
>
>          Key: XERCESC-1304
>          URL: http://nagoya.apache.org/jira/browse/XERCESC-1304
>      Project: Xerces-C++
>         Type: Bug
>     Versions: 2.6.0
>  Environment: Windows XP Professional
>     Reporter: Patrick Frants

>
> In the lines (marked with BUG) where retVal->fData.fValue.f_bool is assigned a boolean value, the *wrong* value is assigned.
> XMLUni::fgBooleanValueSpace[0] and XMLUni::fgBooleanValueSpace[2] contain the values for false.
> XMLUni::fgBooleanValueSpace[1] and XMLUni::fgBooleanValueSpace[3] contain the values for true.
> Does anybody actually use this code?
> XSValue*  
> XSValue::getActValStrings(const XMLCh*         const content    
>                         ,       DataType             datatype
>                         ,       Status&              status
>                         ,       XMLVersion           version
>                         ,       bool                 toValidate
>                         ,       MemoryManager* const manager)
> {
>     try
>     {
>         switch (datatype)
>         { 
>         case XSValue::dt_boolean:
>             {
>                 //do validation here more efficiently
>                 if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[0]) ||
>                     XMLString::equals(content, XMLUni::fgBooleanValueSpace[2])  )
>                 {
>                     XSValue* retVal = new (manager) XSValue(dt_boolean, manager);
> BUG                    retVal->fData.fValue.f_bool = true;
>                     return retVal;
>                 }
>                 else if (XMLString::equals(content, XMLUni::fgBooleanValueSpace[1]) ||
>                          XMLString::equals(content, XMLUni::fgBooleanValueSpace[3])  )
>                 {
>                     XSValue* retVal = new (manager) XSValue(dt_boolean, manager);
> BUG                    retVal->fData.fValue.f_bool = false;
>                     return retVal;
>                 }
>                 else
>                 {
>                     status = st_FOCA0002;
>                     return 0;
>                 }
>             }
>             break;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org