You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by "Imesh Gunaratne (JIRA)" <ji...@apache.org> on 2014/10/12 05:28:33 UTC

[jira] [Resolved] (STRATOS-873) [Sonar Findings] [Critical] Array is Stored Directly

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

Imesh Gunaratne resolved STRATOS-873.
-------------------------------------
    Resolution: Fixed

> [Sonar Findings] [Critical] Array is Stored Directly 
> -----------------------------------------------------
>
>                 Key: STRATOS-873
>                 URL: https://issues.apache.org/jira/browse/STRATOS-873
>             Project: Stratos
>          Issue Type: Improvement
>    Affects Versions: 4.1.0 M1
>            Reporter: Imesh Gunaratne
>            Assignee: Imesh Gunaratne
>             Fix For: 4.1.0 M2
>
>
> This is to fix critical Sonar finding "Array is stored directly"
> http://stackoverflow.com/questions/11580948/sonar-violation-security-array-is-stored-directly
> It's complaining that the array you're storing is the same array that is held by the caller. That is, if the caller subsequently modifies this array, the array stored in the object (and hence the object itself) will change.
> The solution is to make a copy within the object when it gets passed. This is called defensive copying. A subsequent modification of the collection won't affect the array stored within the object.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)