[
https://issues.apache.org/jira/browse/DERBY-6184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Knut Anders Hatlen updated DERBY-6184:
--------------------------------------
Attachment: derby-6184-01-a.diff
The patch derby-6184-01-a.diff silences the warnings.
All the regression tests ran cleanly.
Description of the changes:
- simplify existing cloning of arrays by using clone() instead of
calling new and arraycopy
- reduce visibility of array-returning methods in GlobalXactId to make
it clearer for code analysis tools that they are not called from
outside of the package in which the class lives
- remove said methods from the GlobalTransactionId to allow them to be
non-public
- make the public, array-returning methods in XAXactId return copies
of the internal arrays to protect the internal state, as instances
of this class may be returned all the way out to the user
> Clean up warnings in XA transaction id classes
> ----------------------------------------------
>
> Key: DERBY-6184
> URL: https://issues.apache.org/jira/browse/DERBY-6184
> Project: Derby
> Issue Type: Bug
> Components: Store
> Affects Versions: 10.11.0.0
> Reporter: Knut Anders Hatlen
> Assignee: Knut Anders Hatlen
> Priority: Minor
> Attachments: derby-6184-01-a.diff
>
>
> I see some FindBugs warnings in impl.store.raw.xact.GlobalXactId and
> iapi.store.access.xa.XAXactId about internal arrays being exposed through
> public methods. We should silence the warnings by making the methods
> non-public or by exposing copies of the arrays instead.
--
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