You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Regis Xu (JIRA)" <ji...@apache.org> on 2008/08/05 05:10:44 UTC

[jira] Commented: (HARMONY-5932) [classlib][sql] Can BaseRowSet.clone() be removed?

    [ https://issues.apache.org/jira/browse/HARMONY-5932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619769#action_12619769 ] 

Regis Xu commented on HARMONY-5932:
-----------------------------------

Hi Andrew,

overriding the clone() method is necessary to make BaseRowSet cloneable, since Object.clone() is "protected", we should override it to be "public", that can be used by any other classes.

And I think we could remove the local variable "result" by  using return super.clone(); directly if RI also did the "shallow" copy. I will check it.

> [classlib][sql] Can BaseRowSet.clone() be removed?
> --------------------------------------------------
>
>                 Key: HARMONY-5932
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5932
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: All SQL M6
>            Reporter: Andrew Cornwall
>            Priority: Minor
>
> The class BaseRowSet has an implementation of clone() which does the following:
>     public BaseRowSet clone() throws CloneNotSupportedException{
>         BaseRowSet result = (BaseRowSet) super.clone();        
>         return result;
>         
>     }
> Is there any reason this method can't be removed so BaseRowSet inherits Object.clone() instead? The spec explicitly says clone() is inherited from Object, so the cast to BaseRowSet seems unnecessary.

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