You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Senaka Fernando (JIRA)" <ji...@apache.org> on 2008/02/28 11:27:51 UTC
[jira] Created: (AXIS2C-1015) In axutil_uri, a reference is
returned, where a duplicated string should be.
In axutil_uri, a reference is returned, where a duplicated string should be.
----------------------------------------------------------------------------
Key: AXIS2C-1015
URL: https://issues.apache.org/jira/browse/AXIS2C-1015
Project: Axis2-C
Issue Type: Bug
Components: util
Affects Versions: 1.3.0
Reporter: Senaka Fernando
Assignee: Senaka Fernando
In axutil_uri, a reference is returned, where a duplicated string should be. This is because we return axis2_char_t * rather than const axis2_char_t *. However, a user is expected to be able modify what is returned, according to current api, and thus we must return a cloned copy of the actual string.
--
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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Commented: (AXIS2C-1015) In axutil_uri, a reference is
returned, where a duplicated string should be.
Posted by "Senaka Fernando (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2C-1015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12573406#action_12573406 ]
Senaka Fernando commented on AXIS2C-1015:
-----------------------------------------
Hi Bill,
Well it seems that we should rather append the const prefix to the return type, as you say. But, what if someone has already made it a point to modify the returned value? Well, I believe that these could rather be documented for the moment.
The right thing would be to use the const keyword, but, would that lead to a change in API? I'm not having a clear picture of what should be done.
I'm not so sure what could a modification to a reference, cause to the object in concern, but, in the case of the URI, we'll be stumped, if someone modifies a reference. Because all those validations, at the point of parsing are going to be useless.
Regards,
Senaka
> In axutil_uri, a reference is returned, where a duplicated string should be.
> ----------------------------------------------------------------------------
>
> Key: AXIS2C-1015
> URL: https://issues.apache.org/jira/browse/AXIS2C-1015
> Project: Axis2-C
> Issue Type: Bug
> Components: util
> Affects Versions: 1.3.0
> Reporter: Senaka Fernando
> Assignee: Senaka Fernando
>
> In axutil_uri, a reference is returned, where a duplicated string should be. This is because we return axis2_char_t * rather than const axis2_char_t *. However, a user is expected to be able modify what is returned, according to current api, and thus we must return a cloned copy of the actual string.
--
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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Resolved: (AXIS2C-1015) In axutil_uri, a reference is
returned, where a duplicated string should be.
Posted by "Senaka Fernando (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2C-1015?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Senaka Fernando resolved AXIS2C-1015.
-------------------------------------
Resolution: Fixed
Fix Version/s: Current (Nightly)
Fixed Issue
> In axutil_uri, a reference is returned, where a duplicated string should be.
> ----------------------------------------------------------------------------
>
> Key: AXIS2C-1015
> URL: https://issues.apache.org/jira/browse/AXIS2C-1015
> Project: Axis2-C
> Issue Type: Bug
> Components: util
> Affects Versions: 1.3.0
> Reporter: Senaka Fernando
> Assignee: Senaka Fernando
> Fix For: Current (Nightly)
>
>
> In axutil_uri, a reference is returned, where a duplicated string should be. This is because we return axis2_char_t * rather than const axis2_char_t *. However, a user is expected to be able modify what is returned, according to current api, and thus we must return a cloned copy of the actual string.
--
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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Commented: (AXIS2C-1015) In axutil_uri, a reference is
returned, where a duplicated string should be.
Posted by "Senaka Fernando (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2C-1015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574569#action_12574569 ]
Senaka Fernando commented on AXIS2C-1015:
-----------------------------------------
Hi Bill,
Used approach that you pointed out. Using const can cause build breaks. Leaving that for later. Hope that documentation suffices.
Regards,
Senaka
> In axutil_uri, a reference is returned, where a duplicated string should be.
> ----------------------------------------------------------------------------
>
> Key: AXIS2C-1015
> URL: https://issues.apache.org/jira/browse/AXIS2C-1015
> Project: Axis2-C
> Issue Type: Bug
> Components: util
> Affects Versions: 1.3.0
> Reporter: Senaka Fernando
> Assignee: Senaka Fernando
> Fix For: Current (Nightly)
>
>
> In axutil_uri, a reference is returned, where a duplicated string should be. This is because we return axis2_char_t * rather than const axis2_char_t *. However, a user is expected to be able modify what is returned, according to current api, and thus we must return a cloned copy of the actual string.
--
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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Commented: (AXIS2C-1015) In axutil_uri, a reference is
returned, where a duplicated string should be.
Posted by "Bill Mitchell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2C-1015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12573357#action_12573357 ]
Bill Mitchell commented on AXIS2C-1015:
---------------------------------------
Although I've not researched exactly how the axutil_uri_get_xxx accessors are used, it appears that generally throughout Axis2C the _get_ accessors return axis2_char_t * or similar references without a const declaration, and with no intention of allowing the caller to modify the indicated string. Consider, for example, axiom_namespace_get_prefix in axiom_namespace.h. Changing every such interface to return a duplicate will introduce a lot of overhead and will mean that the callers must take ownership and free the associated memory. It would be better to perform a general overhaul of the interfaces to add const to the declarations, although such a change, too, will naturally propagate throughout the callers' code as well.
> In axutil_uri, a reference is returned, where a duplicated string should be.
> ----------------------------------------------------------------------------
>
> Key: AXIS2C-1015
> URL: https://issues.apache.org/jira/browse/AXIS2C-1015
> Project: Axis2-C
> Issue Type: Bug
> Components: util
> Affects Versions: 1.3.0
> Reporter: Senaka Fernando
> Assignee: Senaka Fernando
>
> In axutil_uri, a reference is returned, where a duplicated string should be. This is because we return axis2_char_t * rather than const axis2_char_t *. However, a user is expected to be able modify what is returned, according to current api, and thus we must return a cloned copy of the actual string.
--
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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Issue Comment Edited: (AXIS2C-1015) In axutil_uri, a
reference is returned, where a duplicated string should be.
Posted by "Senaka Fernando (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2C-1015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12573406#action_12573406 ]
senakafdo edited comment on AXIS2C-1015 at 2/28/08 11:12 AM:
-------------------------------------------------------------------
Hi Bill,
Well it seems that we should rather append the const prefix to the return type, as you say. But, what if someone has already made it a point to modify the returned value? Well, I believe that these could rather be documented for the moment.
The right thing would be to use the const keyword, but, would that lead to a change in API? Might it lead to build breaks etc.? Therefore, I'm not having a clear picture of what should be done.
I'm not so sure what could a modification to a reference, cause to the object in concern, but, in the case of the URI, we'll be stumped, if someone modifies a reference. Because all those validations, at the point of parsing are going to be useless.
Regards,
Senaka
was (Author: senakafdo):
Hi Bill,
Well it seems that we should rather append the const prefix to the return type, as you say. But, what if someone has already made it a point to modify the returned value? Well, I believe that these could rather be documented for the moment.
The right thing would be to use the const keyword, but, would that lead to a change in API? I'm not having a clear picture of what should be done.
I'm not so sure what could a modification to a reference, cause to the object in concern, but, in the case of the URI, we'll be stumped, if someone modifies a reference. Because all those validations, at the point of parsing are going to be useless.
Regards,
Senaka
> In axutil_uri, a reference is returned, where a duplicated string should be.
> ----------------------------------------------------------------------------
>
> Key: AXIS2C-1015
> URL: https://issues.apache.org/jira/browse/AXIS2C-1015
> Project: Axis2-C
> Issue Type: Bug
> Components: util
> Affects Versions: 1.3.0
> Reporter: Senaka Fernando
> Assignee: Senaka Fernando
>
> In axutil_uri, a reference is returned, where a duplicated string should be. This is because we return axis2_char_t * rather than const axis2_char_t *. However, a user is expected to be able modify what is returned, according to current api, and thus we must return a cloned copy of the actual string.
--
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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org