You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Kayvan Arianpour (JIRA)" <ji...@apache.org> on 2012/09/18 08:55:07 UTC

[jira] [Created] (CXF-4507) bug in SchemaJavascriptBuilder while deserializing

Kayvan Arianpour created CXF-4507:
-------------------------------------

             Summary: bug in SchemaJavascriptBuilder while deserializing
                 Key: CXF-4507
                 URL: https://issues.apache.org/jira/browse/CXF-4507
             Project: CXF
          Issue Type: Bug
          Components: JavaScript Client
    Affects Versions: 2.6.2
         Environment: FireFox
            Reporter: Kayvan Arianpour
            Priority: Critical


SchemaJavascriptBuilder.java creates a JavaScript for a service, while deserializing an array it uses a variable named "arrayItem" with no value on definition.

The Problem : if an item in the array is set to null on server, the deserializer on client side set the item to the value set for the latest value set.

Here you can find the solution :

SchemaJavascriptBuilder.java line 556 :

            if (itemInfo.isArray()) {
                utils.appendLine("item = [];");
                utils.startDo();
                valueTarget = "arrayItem";
                utils.appendLine("var arrayItem;");//****************
            }

should be read as 

            if (itemInfo.isArray()) {
                utils.appendLine("item = [];");
                utils.startDo();
                valueTarget = "arrayItem";
                utils.appendLine("var arrayItem = null;");//****************
            }

sample produced code : 

function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
...
     do  {
      var arrayItem;//*******************************
      var value = null;
      if (!cxfjsutils.isElementNil(curElement)) {
       value = cxfjsutils.getNodeText(curElement);
       arrayItem = value;
      }
      item.push(arrayItem);
      curElement = cxfjsutils.getNextElementSibling(curElement);
     }
...
    return newobject;
}


the corrected version should be :

function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
...
     do  {
      var arrayItem = null;//*******************************
      var value = null;
      if (!cxfjsutils.isElementNil(curElement)) {
       value = cxfjsutils.getNodeText(curElement);
       arrayItem = value;
      }
      item.push(arrayItem);
      curElement = cxfjsutils.getNextElementSibling(curElement);
     }
...
    return newobject;
}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CXF-4507) bug in SchemaJavascriptBuilder while deserializing an Array

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp reassigned CXF-4507:
--------------------------------

    Assignee: Daniel Kulp
    
> bug in SchemaJavascriptBuilder while deserializing an Array
> -----------------------------------------------------------
>
>                 Key: CXF-4507
>                 URL: https://issues.apache.org/jira/browse/CXF-4507
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.6.2
>         Environment: FireFox
>            Reporter: Kayvan Arianpour
>            Assignee: Daniel Kulp
>            Priority: Critical
>              Labels: javascript
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> SchemaJavascriptBuilder.java creates a JavaScript for a service, while deserializing an array it uses a variable named "arrayItem" with no value on definition.
> The Problem : if an item in the array is set to null on server, the deserializer on client side set the item to the value set for the latest value set.
> Here you can find the solution :
> SchemaJavascriptBuilder.java line 556 : (org\apache\cxf\javascript\types)
>     utils.appendLine("var arrayItem;");//****************
> should be read as 
>     utils.appendLine("var arrayItem = null;");//****************
> sample produced code : 
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }
> the corrected version should be :
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem = null;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4507) bug in SchemaJavascriptBuilder while deserializing an Array

Posted by "Kayvan Arianpour (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kayvan Arianpour updated CXF-4507:
----------------------------------

    Summary: bug in SchemaJavascriptBuilder while deserializing an Array  (was: bug in SchemaJavascriptBuilder while deserializing)
    
> bug in SchemaJavascriptBuilder while deserializing an Array
> -----------------------------------------------------------
>
>                 Key: CXF-4507
>                 URL: https://issues.apache.org/jira/browse/CXF-4507
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.6.2
>         Environment: FireFox
>            Reporter: Kayvan Arianpour
>            Priority: Critical
>              Labels: javascript
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> SchemaJavascriptBuilder.java creates a JavaScript for a service, while deserializing an array it uses a variable named "arrayItem" with no value on definition.
> The Problem : if an item in the array is set to null on server, the deserializer on client side set the item to the value set for the latest value set.
> Here you can find the solution :
> SchemaJavascriptBuilder.java line 556 :
>             if (itemInfo.isArray()) {
>                 utils.appendLine("item = [];");
>                 utils.startDo();
>                 valueTarget = "arrayItem";
>                 utils.appendLine("var arrayItem;");//****************
>             }
> should be read as 
>             if (itemInfo.isArray()) {
>                 utils.appendLine("item = [];");
>                 utils.startDo();
>                 valueTarget = "arrayItem";
>                 utils.appendLine("var arrayItem = null;");//****************
>             }
> sample produced code : 
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }
> the corrected version should be :
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem = null;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CXF-4507) bug in SchemaJavascriptBuilder while deserializing an Array

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-4507.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.6.3
                   2.5.6
                   2.4.10
    
> bug in SchemaJavascriptBuilder while deserializing an Array
> -----------------------------------------------------------
>
>                 Key: CXF-4507
>                 URL: https://issues.apache.org/jira/browse/CXF-4507
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.6.2
>         Environment: FireFox
>            Reporter: Kayvan Arianpour
>            Assignee: Daniel Kulp
>            Priority: Critical
>              Labels: javascript
>             Fix For: 2.4.10, 2.5.6, 2.6.3
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> SchemaJavascriptBuilder.java creates a JavaScript for a service, while deserializing an array it uses a variable named "arrayItem" with no value on definition.
> The Problem : if an item in the array is set to null on server, the deserializer on client side set the item to the value set for the latest value set.
> Here you can find the solution :
> SchemaJavascriptBuilder.java line 556 : (org\apache\cxf\javascript\types)
>     utils.appendLine("var arrayItem;");//****************
> should be read as 
>     utils.appendLine("var arrayItem = null;");//****************
> sample produced code : 
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }
> the corrected version should be :
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem = null;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4507) bug in SchemaJavascriptBuilder while deserializing

Posted by "Kayvan Arianpour (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kayvan Arianpour updated CXF-4507:
----------------------------------

    Labels: javascript  (was: security)
    
> bug in SchemaJavascriptBuilder while deserializing
> --------------------------------------------------
>
>                 Key: CXF-4507
>                 URL: https://issues.apache.org/jira/browse/CXF-4507
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.6.2
>         Environment: FireFox
>            Reporter: Kayvan Arianpour
>            Priority: Critical
>              Labels: javascript
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> SchemaJavascriptBuilder.java creates a JavaScript for a service, while deserializing an array it uses a variable named "arrayItem" with no value on definition.
> The Problem : if an item in the array is set to null on server, the deserializer on client side set the item to the value set for the latest value set.
> Here you can find the solution :
> SchemaJavascriptBuilder.java line 556 :
>             if (itemInfo.isArray()) {
>                 utils.appendLine("item = [];");
>                 utils.startDo();
>                 valueTarget = "arrayItem";
>                 utils.appendLine("var arrayItem;");//****************
>             }
> should be read as 
>             if (itemInfo.isArray()) {
>                 utils.appendLine("item = [];");
>                 utils.startDo();
>                 valueTarget = "arrayItem";
>                 utils.appendLine("var arrayItem = null;");//****************
>             }
> sample produced code : 
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }
> the corrected version should be :
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem = null;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4507) bug in SchemaJavascriptBuilder while deserializing an Array

Posted by "Kayvan Arianpour (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kayvan Arianpour updated CXF-4507:
----------------------------------

    Description: 
SchemaJavascriptBuilder.java creates a JavaScript for a service, while deserializing an array it uses a variable named "arrayItem" with no value on definition.

The Problem : if an item in the array is set to null on server, the deserializer on client side set the item to the value set for the latest value set.

Here you can find the solution :

SchemaJavascriptBuilder.java line 556 :

    utils.appendLine("var arrayItem;");//****************

should be read as 

    utils.appendLine("var arrayItem = null;");//****************

sample produced code : 

function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
...
     do  {
      var arrayItem;//*******************************
      var value = null;
      if (!cxfjsutils.isElementNil(curElement)) {
       value = cxfjsutils.getNodeText(curElement);
       arrayItem = value;
      }
      item.push(arrayItem);
      curElement = cxfjsutils.getNextElementSibling(curElement);
     }
...
    return newobject;
}


the corrected version should be :

function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
...
     do  {
      var arrayItem = null;//*******************************
      var value = null;
      if (!cxfjsutils.isElementNil(curElement)) {
       value = cxfjsutils.getNodeText(curElement);
       arrayItem = value;
      }
      item.push(arrayItem);
      curElement = cxfjsutils.getNextElementSibling(curElement);
     }
...
    return newobject;
}


  was:
SchemaJavascriptBuilder.java creates a JavaScript for a service, while deserializing an array it uses a variable named "arrayItem" with no value on definition.

The Problem : if an item in the array is set to null on server, the deserializer on client side set the item to the value set for the latest value set.

Here you can find the solution :

SchemaJavascriptBuilder.java line 556 :

            if (itemInfo.isArray()) {
                utils.appendLine("item = [];");
                utils.startDo();
                valueTarget = "arrayItem";
                utils.appendLine("var arrayItem;");//****************
            }

should be read as 

            if (itemInfo.isArray()) {
                utils.appendLine("item = [];");
                utils.startDo();
                valueTarget = "arrayItem";
                utils.appendLine("var arrayItem = null;");//****************
            }

sample produced code : 

function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
...
     do  {
      var arrayItem;//*******************************
      var value = null;
      if (!cxfjsutils.isElementNil(curElement)) {
       value = cxfjsutils.getNodeText(curElement);
       arrayItem = value;
      }
      item.push(arrayItem);
      curElement = cxfjsutils.getNextElementSibling(curElement);
     }
...
    return newobject;
}


the corrected version should be :

function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
...
     do  {
      var arrayItem = null;//*******************************
      var value = null;
      if (!cxfjsutils.isElementNil(curElement)) {
       value = cxfjsutils.getNodeText(curElement);
       arrayItem = value;
      }
      item.push(arrayItem);
      curElement = cxfjsutils.getNextElementSibling(curElement);
     }
...
    return newobject;
}


    
> bug in SchemaJavascriptBuilder while deserializing an Array
> -----------------------------------------------------------
>
>                 Key: CXF-4507
>                 URL: https://issues.apache.org/jira/browse/CXF-4507
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.6.2
>         Environment: FireFox
>            Reporter: Kayvan Arianpour
>            Priority: Critical
>              Labels: javascript
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> SchemaJavascriptBuilder.java creates a JavaScript for a service, while deserializing an array it uses a variable named "arrayItem" with no value on definition.
> The Problem : if an item in the array is set to null on server, the deserializer on client side set the item to the value set for the latest value set.
> Here you can find the solution :
> SchemaJavascriptBuilder.java line 556 :
>     utils.appendLine("var arrayItem;");//****************
> should be read as 
>     utils.appendLine("var arrayItem = null;");//****************
> sample produced code : 
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }
> the corrected version should be :
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem = null;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4507) bug in SchemaJavascriptBuilder while deserializing an Array

Posted by "Kayvan Arianpour (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kayvan Arianpour updated CXF-4507:
----------------------------------

    Description: 
SchemaJavascriptBuilder.java creates a JavaScript for a service, while deserializing an array it uses a variable named "arrayItem" with no value on definition.

The Problem : if an item in the array is set to null on server, the deserializer on client side set the item to the value set for the latest value set.

Here you can find the solution :

SchemaJavascriptBuilder.java line 556 : (org\apache\cxf\javascript\types)

    utils.appendLine("var arrayItem;");//****************

should be read as 

    utils.appendLine("var arrayItem = null;");//****************

sample produced code : 

function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
...
     do  {
      var arrayItem;//*******************************
      var value = null;
      if (!cxfjsutils.isElementNil(curElement)) {
       value = cxfjsutils.getNodeText(curElement);
       arrayItem = value;
      }
      item.push(arrayItem);
      curElement = cxfjsutils.getNextElementSibling(curElement);
     }
...
    return newobject;
}


the corrected version should be :

function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
...
     do  {
      var arrayItem = null;//*******************************
      var value = null;
      if (!cxfjsutils.isElementNil(curElement)) {
       value = cxfjsutils.getNodeText(curElement);
       arrayItem = value;
      }
      item.push(arrayItem);
      curElement = cxfjsutils.getNextElementSibling(curElement);
     }
...
    return newobject;
}


  was:
SchemaJavascriptBuilder.java creates a JavaScript for a service, while deserializing an array it uses a variable named "arrayItem" with no value on definition.

The Problem : if an item in the array is set to null on server, the deserializer on client side set the item to the value set for the latest value set.

Here you can find the solution :

SchemaJavascriptBuilder.java line 556 :

    utils.appendLine("var arrayItem;");//****************

should be read as 

    utils.appendLine("var arrayItem = null;");//****************

sample produced code : 

function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
...
     do  {
      var arrayItem;//*******************************
      var value = null;
      if (!cxfjsutils.isElementNil(curElement)) {
       value = cxfjsutils.getNodeText(curElement);
       arrayItem = value;
      }
      item.push(arrayItem);
      curElement = cxfjsutils.getNextElementSibling(curElement);
     }
...
    return newobject;
}


the corrected version should be :

function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
...
     do  {
      var arrayItem = null;//*******************************
      var value = null;
      if (!cxfjsutils.isElementNil(curElement)) {
       value = cxfjsutils.getNodeText(curElement);
       arrayItem = value;
      }
      item.push(arrayItem);
      curElement = cxfjsutils.getNextElementSibling(curElement);
     }
...
    return newobject;
}


    
> bug in SchemaJavascriptBuilder while deserializing an Array
> -----------------------------------------------------------
>
>                 Key: CXF-4507
>                 URL: https://issues.apache.org/jira/browse/CXF-4507
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.6.2
>         Environment: FireFox
>            Reporter: Kayvan Arianpour
>            Priority: Critical
>              Labels: javascript
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> SchemaJavascriptBuilder.java creates a JavaScript for a service, while deserializing an array it uses a variable named "arrayItem" with no value on definition.
> The Problem : if an item in the array is set to null on server, the deserializer on client side set the item to the value set for the latest value set.
> Here you can find the solution :
> SchemaJavascriptBuilder.java line 556 : (org\apache\cxf\javascript\types)
>     utils.appendLine("var arrayItem;");//****************
> should be read as 
>     utils.appendLine("var arrayItem = null;");//****************
> sample produced code : 
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }
> the corrected version should be :
> function services_sal_ngs__rspPayCheque_deserialize (cxfjsutils, element) {
> ...
>      do  {
>       var arrayItem = null;//*******************************
>       var value = null;
>       if (!cxfjsutils.isElementNil(curElement)) {
>        value = cxfjsutils.getNodeText(curElement);
>        arrayItem = value;
>       }
>       item.push(arrayItem);
>       curElement = cxfjsutils.getNextElementSibling(curElement);
>      }
> ...
>     return newobject;
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira