Commit 9169c08
fix(sentinel): address SpotBugs violations in SentinelConfig
Fixed three SpotBugs issues:
1. EI2 (Expose Internal Representation - Builder):
- Added @Singular annotation to sentinelHosts field
- Lombok now creates defensive copies in builder methods
2. EI (Expose Internal Representation - Getter):
- Replaced @Getter with custom getSentinelHosts() method
- Returns Collections.unmodifiableList() to prevent external modification
3. CT (Constructor Throws Exception):
- Made HostPort class final to prevent finalizer attacks
- Constructor validation now safe from subclass finalizer exploits
All 350 tests pass, SpotBugs verification successful.
Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent fe1776f commit 9169c08
1 file changed
+19
-9
lines changedLines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
40 | 50 | | |
41 | 51 | | |
42 | 52 | | |
| |||
216 | 226 | | |
217 | 227 | | |
218 | 228 | | |
219 | | - | |
| 229 | + | |
220 | 230 | | |
221 | 231 | | |
222 | 232 | | |
| |||
0 commit comments