Skip to content

Fix SpotBugs EI_EXPOSE_REP warnings #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
Merged

Fix SpotBugs EI_EXPOSE_REP warnings #92

merged 1 commit into from
Jun 17, 2025

Conversation

ic0ns
Copy link
Contributor

@ic0ns ic0ns commented Jun 17, 2025

Summary

  • Add defensive copying in ExecutorConfig getters and setters for probes and excludedProbes lists
  • Add defensive copying in ScanJob constructor and getters for probe and after lists
  • Prevents external modification of internal mutable state

Test plan

  • Code compiles successfully
  • All existing tests pass
  • SpotBugs warnings reduced from 8 to 2 EI_EXPOSE_REP violations
  • Code formatting applied successfully

The remaining EI_EXPOSE_REP warnings are in Scanner and ThreadedScanJobExecutor classes where configuration objects are shared by design.

- Add defensive copying in ExecutorConfig getters and setters for probes and excludedProbes lists
- Add defensive copying in ScanJob constructor and getters for probe and after lists
- Prevents external modification of internal mutable state
- Fixes 6 of 8 SpotBugs EI_EXPOSE_REP warnings
@ic0ns ic0ns merged commit ae4d1c8 into main Jun 17, 2025
12 checks passed
@ic0ns ic0ns deleted the fix/expose-rep-warnings branch June 17, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant