You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Jason Lowe (JIRA)" <ji...@apache.org> on 2017/12/11 16:23:00 UTC

[jira] [Commented] (YARN-7576) Findbug warning for Resource exposing internal representation

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

Jason Lowe commented on YARN-7576:
----------------------------------

Sorry this fell off my radar and now the patch doesn't apply.  I'm +1 for the findbugs exclude change.  The import cleanup is what's conflicting, so if we drop that from the patch then I think we're good to go.


> Findbug warning for Resource exposing internal representation
> -------------------------------------------------------------
>
>                 Key: YARN-7576
>                 URL: https://issues.apache.org/jira/browse/YARN-7576
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: api
>    Affects Versions: 3.0.0
>            Reporter: Jason Lowe
>            Assignee: Wangda Tan
>         Attachments: YARN-7576.001.patch
>
>
> Precommit builds are complaining about a findbugs warning:
> {noformat}
> EI 	org.apache.hadoop.yarn.api.records.Resource.getResources() may expose internal representation by returning Resource.resources
> 	
> Bug type EI_EXPOSE_REP (click for details)
> In class org.apache.hadoop.yarn.api.records.Resource
> In method org.apache.hadoop.yarn.api.records.Resource.getResources()
> Field org.apache.hadoop.yarn.api.records.Resource.resources
> At Resource.java:[line 213]
> Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org