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

ASF GitHub Bot commented on HADOOP-20017:
-----------------------------------------

joseluisll commented on PR #8818:
URL: https://github.com/apache/hadoop/pull/8818#issuecomment-6480684594

   Thanks @ayushtkn. I solved some spotbugs by exception per module, but others 
I changed what callers see, not only what SpotBugs reports:
   
   - `CopyListingFileStatus#setAclEntries`, `#setXAttrs`, 
`DistCpContext#setSourcePaths` and the `DistCpOptions.Builder` constructor now 
copy the collection they are given, so later changes by the caller are no 
longer seen.
   - `DistCpContext#getSourcePaths` now returns an unmodifiable view.
   - `DistCpOptionSwitch#getOption` now returns a clone instead of the shared 
`Option`.
   
   The tests cover those changes, and each one fails against trunk. If you 
want, I cut down the tests.




> Fix the trunk SpotBugs warnings in hadoop-distcp
> ------------------------------------------------
>
>                 Key: HADOOP-20017
>                 URL: https://issues.apache.org/jira/browse/HADOOP-20017
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Jose Luis López
>            Assignee: Jose Luis López
>            Priority: Minor
>              Labels: pull-request-available
>
> The nightly trunk build (qbt) reports 19 spotbugs warning(s) in 
> {{hadoop-tools/hadoop-distcp}}:
> * {{org.apache.hadoop.tools.CopyListingFileStatus}}: EI_EXPOSE_REP in 
> CopyListingFileStatus.getPermission() line 217 (malicious_code)
> * {{org.apache.hadoop.tools.CopyListingFileStatus}}: EI_EXPOSE_REP2 in 
> CopyListingFileStatus.<init>() line 152 (malicious_code)
> * {{org.apache.hadoop.tools.CopyListingFileStatus}}: EI_EXPOSE_REP2 in 
> CopyListingFileStatus.setAclEntries() line 240 (malicious_code)
> * {{org.apache.hadoop.tools.CopyListingFileStatus}}: EI_EXPOSE_REP2 in 
> CopyListingFileStatus.setXAttrs() line 258 (malicious_code)
> * {{org.apache.hadoop.tools.DiffInfo}}: CT_CONSTRUCTOR_THROW in 
> DiffInfo.<init>() line 60 (experimental)
> * {{org.apache.hadoop.tools.DistCp}}: CT_CONSTRUCTOR_THROW in DistCp.<init>() 
> line 117 (experimental)
> * {{org.apache.hadoop.tools.DistCpContext}}: EI_EXPOSE_REP in 
> DistCpContext.getSourcePaths() line 63 (malicious_code)
> * {{org.apache.hadoop.tools.DistCpContext}}: EI_EXPOSE_REP2 in 
> DistCpContext.<init>() line 50 (malicious_code)
> * {{org.apache.hadoop.tools.DistCpContext}}: EI_EXPOSE_REP2 in 
> DistCpContext.setSourcePaths() line 55 (malicious_code)
> * {{org.apache.hadoop.tools.DistCpOptionSwitch}}: EI_EXPOSE_REP in 
> DistCpOptionSwitch.getOption() line 281 (malicious_code)
> * {{org.apache.hadoop.tools.DistCpOptions$Builder}}: EI_EXPOSE_REP2 in 
> DistCpOptions$Builder.<init>() line 540 (malicious_code)
> * {{org.apache.hadoop.tools.SimpleCopyListing}}: SS_SHOULD_BE_STATIC in 
> SimpleCopyListing.maxRetries line 80 (performance)
> * {{org.apache.hadoop.tools.mapred.CopyCommitter}}: EI_EXPOSE_REP2 in 
> CopyCommitter.<init>() line 95 (malicious_code)
> * {{org.apache.hadoop.tools.mapred.lib.DynamicInputChunk}}: 
> CT_CONSTRUCTOR_THROW in DynamicInputChunk.<init>() line 56 (experimental)
> * {{org.apache.hadoop.tools.mapred.lib.DynamicInputChunkContext}}: 
> CT_CONSTRUCTOR_THROW in DynamicInputChunkContext.<init>() line 47 
> (experimental)
> * {{org.apache.hadoop.tools.mapred.lib.DynamicRecordReader}}: EI_EXPOSE_REP2 
> in DynamicRecordReader.initialize() line 74 (malicious_code)
> * {{org.apache.hadoop.tools.util.ThrottledInputStream}}: CT_CONSTRUCTOR_THROW 
> in ThrottledInputStream.<init>() line 48 (experimental)
> * {{org.apache.hadoop.tools.util.WorkReport}}: EI_EXPOSE_REP in 
> WorkReport.getException() line 76 (malicious_code)
> * {{org.apache.hadoop.tools.util.WorkReport}}: EI_EXPOSE_REP2 in 
> WorkReport.<init>() line 51 (malicious_code)
> They turn the spotbugs vote of these module runs -1: hadoop-tools, 
> hadoop-tools/hadoop-distcp, root.
> Seen in:
> * JDK 17: 6 of the last 6 builds, latest 
> [#189|https://ci-hadoop.apache.org/job/hadoop-qbt-trunk-java17-linux-x86_64/189/]
>  (2026-10-11, trunk 16aa23404b)
> * JDK 21: 7 of the last 7 builds, latest 
> [#118|https://ci-hadoop.apache.org/job/hadoop-qbt-trunk-java21-linux-x86_64/118/]
>  (2026-10-11, trunk 16aa23404b)
> It turns the precommit of these open pull requests red:
> * [PR #8811|https://github.com/apache/hadoop/pull/8811] - clears the spotbugs 
> -1 on hadoop-tools/hadoop-distcp
> * [PR #8749|https://github.com/apache/hadoop/pull/8749] - 19 of the 77 
> warnings of the spotbugs -1 on root
> * [PR #8725|https://github.com/apache/hadoop/pull/8725] - 19 of the 77 
> warnings of the spotbugs -1 on root
> * [PR #8704|https://github.com/apache/hadoop/pull/8704] - 19 of the 77 
> warnings of the spotbugs -1 on root
> * [PR #8703|https://github.com/apache/hadoop/pull/8703] - 19 of the 77 
> warnings of the spotbugs -1 on root
> * [PR #8699|https://github.com/apache/hadoop/pull/8699] - 19 of the 77 
> warnings of the spotbugs -1 on root
> No open pull request or JIRA issue that fixes it was found.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to