[ 
https://issues.apache.org/jira/browse/DERBY-6195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13638927#comment-13638927
 ] 

Knut Anders Hatlen commented on DERBY-6195:
-------------------------------------------

When copying multi-dimensional arrays (such as 
ParseException.expectedTokenSequences) with the clone() method, only the first 
dimension is cloned. The rows in the array are still shared between the 
original and the clone, so if a value in the cloned array is changed, it will 
be changed in the original array too. So I think we need some sort of deep 
clone method to properly encapsulate the multi-dimensional arrays.

The corresponding field in impl.sql.compile.ParseException was encapsulated by 
making the class package private, so that the field wasn't exposed to other 
modules. Unfortunately, impl.tools.ij.ParseException cannot be made package 
private just like that, since a dependency on it has leaked out to MultiTest. 
It might be possible to hide that exception for MultiTest, though. And I think 
MultiTest isn't used anymore, now that stress.multi has been converted to 
JUnit, so we may be able to get rid of it.
                
> Cleanup suspect coding practices in the org.apache.derby.impl.tools.ij 
> package.
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-6195
>                 URL: https://issues.apache.org/jira/browse/DERBY-6195
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 10.11.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>            Priority: Minor
>         Attachments: derby-6195-01-aa-encapsulateBetter.diff
>
>
> Similar to DERBY-6177.

--
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

Reply via email to