[ 
https://issues.apache.org/jira/browse/AXIS2C-628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Samisa Abeysinghe resolved AXIS2C-628.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.0
         Assignee: Samisa Abeysinghe

Fixed in 
modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl

> c-server stubs: memset missing
> ------------------------------
>
>                 Key: AXIS2C-628
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-628
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: code generation
>         Environment: Linux V. 10.0, Apache Axis2 SNAPSHOT build May 16th, 2007
>            Reporter: Florian Steinborn
>            Assignee: Samisa Abeysinghe
>             Fix For: 1.1.0
>
>
> I raised this JIRA first under the Axis2 topic (as I thought generation takes 
> place there) but it was rejected and I was asked to re-JIRA it here.
> #######################################
> I guess I found a problem in generated sources. I try to get in touch with 
> Axis and play around with all the things... I have a service that returns an 
> array of structures that contain all possible datatypes - also float and 
> double. 
>   
> I used this class for generating the wsdl: 
>   
>   
> public class Dat{ 
>     public long l; 
>     public short s; 
>     public int i; 
>     public String str; 
>     public float fl; 
>     public double dl; 
> } 
>   
> The generated wsdl shows 
>   
> <xs:element name="Dat" type="ns:Dat" /> 
> <xs:complexType name="Dat"> 
> <xs:sequence> 
> <xs:element name="dl" type="xs:double" /> 
> <xs:element name="fl" type="xs:float" /> 
> <xs:element name="i" type="xs:int" /> 
> <xs:element name="str" nillable="true" type="xs:string" /> 
> <xs:element name="l" type="xs:long" /> 
> <xs:element name="s" type="xs:short" /> 
> </xs:sequence> 
> </xs:complexType> 
>   
> When you generate C-Server stubs the constructor function 
> shows: 
>   
> AXIS2_EXTERN axis2_Dat_t* AXIS2_CALL 
> axis2_Dat_create( 
>     const axutil_env_t *env ) 
> { 
>     axis2_Dat_t *Dat = NULL; 
>   
>     AXIS2_ENV_CHECK(env, NULL); 
>   
>     Dat = (axis2_Dat_t *) AXIS2_MALLOC(env-> 
>         allocator, sizeof(axis2_Dat_t)); 
>   
>     /* *********** missing *********** 
>      * memset( Dat, 0, sizeof(axis2_Dat_t)); 
>      * ******************************** 
>      */ 
>   
>     if(NULL == Dat) 
>     { 
>         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); 
>         return NULL; 
>     } 
>     return Dat; 
> } 
>   
> For more safety it would be desirable if the generation would add the 
> memset() call. Alternatively it could be possible to use an allocation method 
> that leaves the allocated memory initialized.... (calloc() ?)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to