You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "joseluisll (via GitHub)" <gi...@apache.org> on 2026/10/12 22:11:16 UTC

[PR] HADOOP-20017. Fix the trunk SpotBugs warnings in hadoop-distcp. [hadoop]

joseluisll opened a new pull request, #8818:
URL: https://github.com/apache/hadoop/pull/8818

   ### Description of PR
   
   JIRA: [HADOOP-20017](https://issues.apache.org/jira/browse/HADOOP-20017)
   
   The nightly qbt builds (JDK 17 and JDK 21) report 19 SpotBugs warnings in `hadoop-tools/hadoop-distcp`, which make the spotbugs vote -1 for `hadoop-distcp`, `hadoop-tools` and root, and turn the precommit of other open PRs red. This PR fixes 10 of them in code and adds narrow exclusions for the other 9. Each exclusion matches class, method and bug pattern, and the `EI_EXPOSE_REP2` ones also match the field. The module had no SpotBugs exclude file before, so this adds `hadoop-tools/hadoop-distcp/dev-support/findbugs-exclude.xml` and points `spotbugs-maven-plugin` at it in the module pom. I did not add the module to `dev-support/findbugs-exclude-global.xml`, because that file turns these patterns off for the whole module.
   
   | # | Class | Warning | Resolution |
   |---|---|---|---|
   | 1 | `SimpleCopyListing` | SS_SHOULD_BE_STATIC `maxRetries` | **Code**: `private static final int MAX_RETRIES = 3` |
   | 2 | `DiffInfo` | CT_CONSTRUCTOR_THROW `<init>` | **Code**: package-private class made `final` |
   | 3 | `DynamicInputChunk` | CT_CONSTRUCTOR_THROW `<init>` | **Code**: package-private class made `final` |
   | 4 | `DynamicInputChunkContext` | CT_CONSTRUCTOR_THROW `<init>` | **Code**: package-private class made `final` |
   | 5 | `CopyListingFileStatus` | EI_EXPOSE_REP2 `setAclEntries` | **Code**: copies the list, keeping null as null |
   | 6 | `CopyListingFileStatus` | EI_EXPOSE_REP2 `setXAttrs` | **Code**: copies into a `LinkedHashMap`, keeping null as null and the iteration order |
   | 7 | `DistCpContext` | EI_EXPOSE_REP2 `setSourcePaths` | **Code**: copies the list, keeping null as null |
   | 8 | `DistCpContext` | EI_EXPOSE_REP `getSourcePaths` | **Code**: returns an unmodifiable view, or null |
   | 9 | `DistCpOptions$Builder` | EI_EXPOSE_REP2 `<init>` | **Code**: copies the source path list. `DistCpOptions` is documented as immutable, and `getSourcePaths()` already returns an unmodifiable copy |
   | 10 | `DistCpOptionSwitch` | EI_EXPOSE_REP `getOption` | **Code**: returns a clone of the enum's shared, JVM-wide CLI `Option`. The only caller is `OptionsParser`, which just adds it to `Options` |
   | 11 | `CopyListingFileStatus` | EI_EXPOSE_REP `getPermission` | **Excluded**: the `FsPermission` is shared on purpose. One instance is created per copied file, so copying would add an allocation per file and per access |
   | 12 | `CopyListingFileStatus` | EI_EXPOSE_REP2 `<init>` (field `permission`) | **Excluded**: same reason as #11 |
   | 13 | `DistCpContext` | EI_EXPOSE_REP2 `<init>` (field `options`) | **Excluded**: `DistCpOptions` is immutable once built |
   | 14 | `DistCp` | CT_CONSTRUCTOR_THROW `<init>` | **Excluded**: the class is `@InterfaceAudience.Public` and non-final, so making it final would break subclasses |
   | 15 | `ThrottledInputStream` | CT_CONSTRUCTOR_THROW `<init>` | **Excluded**: public, non-final class; the constructor only `assert`s that the bandwidth is positive |
   | 16 | `CopyCommitter` | EI_EXPOSE_REP2 `<init>` (field `taskAttemptContext`) | **Excluded**: the MapReduce framework passes this context in and the committer has to keep the same instance |
   | 17 | `DynamicRecordReader` | EI_EXPOSE_REP2 `initialize` (field `taskAttemptContext`) | **Excluded**: same reason as #16 |
   | 18 | `WorkReport` | EI_EXPOSE_REP2 `<init>` (field `exception`) | **Excluded**: the report carries the original exception back to the caller on purpose |
   | 19 | `WorkReport` | EI_EXPOSE_REP `getException` | **Excluded**: same reason as #18 |
   
   No public method signature changes. There are two small behaviour changes for callers that kept and later changed a collection they passed in. Changes made to the list after `new DistCpOptions.Builder(list, target)` are no longer seen, which matches the documented immutability of `DistCpOptions`. Changing the list returned by `DistCpContext.getSourcePaths()` now throws `UnsupportedOperationException`; when the paths came from `DistCpOptions` it already did. Nothing in the repository depends on either behaviour.
   
   **Expected Yetus result:** the spotbugs vote on the trunk (base) column will still be `-1` ("hadoop-distcp in trunk has 21 extant spotbugs warnings"), because Yetus scores the base branch before applying the patch. Those 21 are the warnings fixed here. The patch column reports `0 new + 0 unchanged - 21 fixed = 0 total`.
   
   ### How was this patch tested?
   
   - SpotBugs on `hadoop-distcp` (`mvn -pl hadoop-tools/hadoop-distcp spotbugs:spotbugs` / `spotbugs:check`):
     - before: **21** BugInstances. These are the 19 warnings above; `DynamicInputChunk` and `ThrottledInputStream` each have a second constructor that is reported separately.
     - after: **0** (`BugInstance size is 0`, `spotbugs:check` passes).
     - With an empty filter file, the build reports exactly the 10 BugInstances that the 9 entries in the exclude file are meant to cover, so the exclusions don't hide anything else.
   - Checkstyle (`checkstyle:checkstyle`): no new violations. The module total is unchanged, and the changed test files have no issues.
   - New unit tests cover the behaviour changes. They all fail against the pre-fix code and pass with it:
     - `TestCopyListingFileStatus#testAclEntriesAndXAttrsAreCopied`
     - `TestDistCpOptions#testBuilderCopiesSourcePaths`
     - `TestDistCpOptions#testContextSourcePaths`
     - `TestDistCpOptions#testOptionSwitchReturnsCopyOfOption`
   - The full `hadoop-distcp` unit test suite passes locally (Maven 3.9.15, JDK 21), with 0 failures and 0 errors. The 2 skips are the large-file tests in `TestHDFSContractDistCp`, which are skipped by default.
   - Yetus precommit (JDK 17 and 21) on this change gives `+1` for test4tests, compile, javac, checkstyle, javadoc, mvnsite, shadedclient, asflicense and the hadoop-distcp unit tests; the only `-1` is the base-branch spotbugs vote described above.
   
   ### For code changes:
   
   - [x] Does the title of this PR start with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: Have the integration tests been executed and the endpoint
         declared according to the connector-specific documentation? *Not applicable: no object store connector changes.*
   - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? *No new dependencies.*
   - [x] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files? *Not applicable.*
   
   ### AI Tooling
   
   If an AI tool was used:
   
   - [x] The PR includes the phrase "Contains content generated by Claude Code"
         where <tool> is the name of the AI tool used.
   - [X ] My use of AI contributions follows the ASF legal policy
         https://www.apache.org/legal/generative-tooling.html
   
   Contains content generated by Claude Code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HADOOP-20017. Fix the trunk SpotBugs warnings in hadoop-distcp. [hadoop]

Posted by "hadoop-yetus (via GitHub)" <gi...@apache.org>.
hadoop-yetus commented on PR #8818:
URL: https://github.com/apache/hadoop/pull/8818#issuecomment-6483985501

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 54s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  |
   | +0 :ok: |  xmllint  |   0m  0s |  |  xmllint was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  |  The patch appears to include 2 new or modified test files.  |
   |||| _ trunk Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  50m 25s |  |  trunk passed  |
   | +1 :green_heart: |  compile  |   0m 54s |  |  trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  compile  |   0m 54s |  |  trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  checkstyle  |   0m 52s |  |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   0m 56s |  |  trunk passed  |
   | +1 :green_heart: |  javadoc  |   0m 53s |  |  trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javadoc  |   0m 50s |  |  trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | -1 :x: |  spotbugs  |   1m 14s | [/branch-spotbugs-hadoop-tools_hadoop-distcp-warnings.html](https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/3/artifact/out/branch-spotbugs-hadoop-tools_hadoop-distcp-warnings.html) |  hadoop-tools/hadoop-distcp in trunk has 21 extant spotbugs warnings.  |
   | +1 :green_heart: |  shadedclient  |  35m 28s |  |  branch has no errors when building and testing our client artifacts.  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   0m 26s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 25s |  |  the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javac  |   0m 25s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 25s |  |  the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  javac  |   0m 25s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | +1 :green_heart: |  checkstyle  |   0m 20s |  |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   0m 27s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 22s |  |  the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javadoc  |   0m 22s |  |  the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  spotbugs  |   0m 56s |  |  hadoop-tools/hadoop-distcp generated 0 new + 0 unchanged - 21 fixed = 0 total (was 21)  |
   | +1 :green_heart: |  shadedclient  |  34m 25s |  |  patch has no errors when building and testing our client artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |  39m 18s |  |  hadoop-distcp in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 39s |  |  The patch does not generate ASF License warnings.  |
   |  |   | 174m 29s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/3/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/8818 |
   | Optional Tests | dupname asflicense codespell detsecrets xmllint compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle |
   | uname | Linux d68ba9d0070a 5.15.0-198-generic #208-Ubuntu SMP Fri Sep 4 10:22:38 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/bin/hadoop.sh |
   | git revision | trunk / e05097032f9837918240981b93976d0b16dcf711 |
   | Default Java | Ubuntu-17.0.20.1+1-1-24.04-Ubuntu |
   | Multi-JDK versions | /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu |
   |  Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/3/testReport/ |
   | Max. process+thread count | 570 (vs. ulimit of 10000) |
   | modules | C: hadoop-tools/hadoop-distcp U: hadoop-tools/hadoop-distcp |
   | Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/3/console |
   | versions | git=2.43.0 maven=3.9.15 spotbugs=4.9.7 |
   | Powered by | Apache Yetus 0.14.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HADOOP-20017. Fix the trunk SpotBugs warnings in hadoop-distcp. [hadoop]

Posted by "joseluisll (via GitHub)" <gi...@apache.org>.
joseluisll closed pull request #8818: HADOOP-20017. Fix the trunk SpotBugs warnings in hadoop-distcp.
URL: https://github.com/apache/hadoop/pull/8818


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HADOOP-20017. Fix the trunk SpotBugs warnings in hadoop-distcp. [hadoop]

Posted by "hadoop-yetus (via GitHub)" <gi...@apache.org>.
hadoop-yetus commented on PR #8818:
URL: https://github.com/apache/hadoop/pull/8818#issuecomment-6472336377

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 54s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  1s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  1s |  |  detect-secrets was not available.  |
   | +0 :ok: |  xmllint  |   0m  1s |  |  xmllint was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  |  The patch appears to include 2 new or modified test files.  |
   |||| _ trunk Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  51m 28s |  |  trunk passed  |
   | +1 :green_heart: |  compile  |   0m 53s |  |  trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  compile  |   0m 53s |  |  trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  checkstyle  |   0m 49s |  |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   0m 51s |  |  trunk passed  |
   | +1 :green_heart: |  javadoc  |   0m 52s |  |  trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javadoc  |   0m 51s |  |  trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | -1 :x: |  spotbugs  |   1m 14s | [/branch-spotbugs-hadoop-tools_hadoop-distcp-warnings.html](https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/2/artifact/out/branch-spotbugs-hadoop-tools_hadoop-distcp-warnings.html) |  hadoop-tools/hadoop-distcp in trunk has 21 extant spotbugs warnings.  |
   | +1 :green_heart: |  shadedclient  |  35m 51s |  |  branch has no errors when building and testing our client artifacts.  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   0m 26s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 24s |  |  the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javac  |   0m 24s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 24s |  |  the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  javac  |   0m 24s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | +1 :green_heart: |  checkstyle  |   0m 20s |  |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   0m 27s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 22s |  |  the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javadoc  |   0m 21s |  |  the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  spotbugs  |   0m 55s |  |  hadoop-tools/hadoop-distcp generated 0 new + 0 unchanged - 21 fixed = 0 total (was 21)  |
   | +1 :green_heart: |  shadedclient  |  33m 41s |  |  patch has no errors when building and testing our client artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |  38m 36s |  |  hadoop-distcp in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 37s |  |  The patch does not generate ASF License warnings.  |
   |  |   | 174m  4s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/2/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/8818 |
   | Optional Tests | dupname asflicense codespell detsecrets xmllint compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle |
   | uname | Linux be487c7717de 5.15.0-198-generic #208-Ubuntu SMP Fri Sep 4 10:22:38 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/bin/hadoop.sh |
   | git revision | trunk / f1bfd0606ef61d5038850af0c00f9e8ef965158d |
   | Default Java | Ubuntu-17.0.20.1+1-1-24.04-Ubuntu |
   | Multi-JDK versions | /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu |
   |  Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/2/testReport/ |
   | Max. process+thread count | 570 (vs. ulimit of 10000) |
   | modules | C: hadoop-tools/hadoop-distcp U: hadoop-tools/hadoop-distcp |
   | Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/2/console |
   | versions | git=2.43.0 maven=3.9.15 spotbugs=4.9.7 |
   | Powered by | Apache Yetus 0.14.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HADOOP-20017. Fix the trunk SpotBugs warnings in hadoop-distcp. [hadoop]

Posted by "joseluisll (via GitHub)" <gi...@apache.org>.
joseluisll commented on PR #8818:
URL: https://github.com/apache/hadoop/pull/8818#issuecomment-6153991717

   The -1 overall comes only from the **trunk (base) spotbugs** check. The patch doesn't introduce it.
   
   - **spotbugs -1 (trunk):** Yetus runs SpotBugs on trunk before applying the patch, and trunk has the 21 existing `hadoop-distcp` warnings that this PR fixes. With the patch applied the result is `0 new + 0 unchanged - 21 fixed = 0 total (was 21)`.
   - **patch -0 ("Used diff version of patch file"):** CI downloaded the PR's HTML page instead of the `.patch` file, so Yetus used the `.diff`. All 12 files applied cleanly, and Yetus leaves this vote out of the overall result.
   - Everything else on the patch is +1, including the `hadoop-distcp` unit tests (401 run, 0 failures, 0 errors).
   
   The trunk spotbugs -1 will stay until this change is merged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HADOOP-20017. Fix the trunk SpotBugs warnings in hadoop-distcp. [hadoop]

Posted by "joseluisll (via GitHub)" <gi...@apache.org>.
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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HADOOP-20017. Fix the trunk SpotBugs warnings in hadoop-distcp. [hadoop]

Posted by "joseluisll (via GitHub)" <gi...@apache.org>.
joseluisll commented on PR #8818:
URL: https://github.com/apache/hadoop/pull/8818#issuecomment-6154068367

   @slfan1989 @pan3793 could you please review this PR? Spotbugs introduce noise. I propose to exclude some when the behaviour is intended, the rest i fix. I also propose exclusions at the module level, so to keep the exception as small as possible.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HADOOP-20017. Fix the trunk SpotBugs warnings in hadoop-distcp. [hadoop]

Posted by "hadoop-yetus (via GitHub)" <gi...@apache.org>.
hadoop-yetus commented on PR #8818:
URL: https://github.com/apache/hadoop/pull/8818#issuecomment-6135865523

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 56s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  1s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  1s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  1s |  |  detect-secrets was not available.  |
   | +0 :ok: |  xmllint  |   0m  1s |  |  xmllint was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  |  The patch appears to include 2 new or modified test files.  |
   |||| _ trunk Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  53m 16s |  |  trunk passed  |
   | +1 :green_heart: |  compile  |   0m 56s |  |  trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  compile  |   0m 53s |  |  trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  checkstyle  |   0m 51s |  |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   0m 56s |  |  trunk passed  |
   | +1 :green_heart: |  javadoc  |   0m 52s |  |  trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javadoc  |   0m 50s |  |  trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | -1 :x: |  spotbugs  |   1m 16s | [/branch-spotbugs-hadoop-tools_hadoop-distcp-warnings.html](https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/1/artifact/out/branch-spotbugs-hadoop-tools_hadoop-distcp-warnings.html) |  hadoop-tools/hadoop-distcp in trunk has 21 extant spotbugs warnings.  |
   | +1 :green_heart: |  shadedclient  |  35m 46s |  |  branch has no errors when building and testing our client artifacts.  |
   | -0 :warning: |  patch  |  36m 21s |  |  Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   0m 28s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 24s |  |  the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javac  |   0m 24s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 25s |  |  the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  javac  |   0m 25s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | +1 :green_heart: |  checkstyle  |   0m 20s |  |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   0m 27s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 22s |  |  the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javadoc  |   0m 22s |  |  the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  spotbugs  |   0m 55s |  |  hadoop-tools/hadoop-distcp generated 0 new + 0 unchanged - 21 fixed = 0 total (was 21)  |
   | +1 :green_heart: |  shadedclient  |  34m 24s |  |  patch has no errors when building and testing our client artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |  37m 30s |  |  hadoop-distcp in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 44s |  |  The patch does not generate ASF License warnings.  |
   |  |   | 175m 52s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/1/artifact/out/Dockerfile |
   | Optional Tests | dupname asflicense codespell detsecrets xmllint compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle |
   | uname | Linux 36e62ffb15ec 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/bin/hadoop.sh |
   | git revision | trunk / 86e6c2038166f7716872104f5c37dafb08aba268 |
   | Default Java | Ubuntu-17.0.20.1+1-1-24.04-Ubuntu |
   | Multi-JDK versions | /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu |
   |  Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/1/testReport/ |
   | Max. process+thread count | 573 (vs. ulimit of 10000) |
   | modules | C: hadoop-tools/hadoop-distcp U: hadoop-tools/hadoop-distcp |
   | Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8818/1/console |
   | versions | git=2.43.0 maven=3.9.15 spotbugs=4.9.7 |
   | Powered by | Apache Yetus 0.14.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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