-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
contribution welcomekind/bugCategory issues or prs related to bug.Category issues or prs related to bug.
Milestone
Description
Background
Follow-up to #14469 (SpotBugs check enforcement). This addresses the DM_BOXED_PRIMITIVE_FOR_PARSING pattern — using Long.valueOf(s) where Long.parseLong(s) should be used, causing unnecessary boxing/unboxing.
Affected locations (4 occurrences)
| File | Line | Current code |
|---|---|---|
client/.../CacheData.java |
L70 | Long.valueOf(notifyTimeouts) |
plugin/control/.../RateCounter.java |
L87 | Long.valueOf(Long.valueOf(substring) / 60 * 60 + "000") |
plugin/control/.../RateCounter.java |
L99 | Long.valueOf(substring + "000") |
plugin/control/.../RateCounter.java |
L111 | Long.valueOf(Long.valueOf(substring) / (60 * 60) * (60 * 60) + "000") |
Fix
Replace all Long.valueOf() with Long.parseLong(). Pure API substitution, semantically equivalent.
After fixing, the DM_BOXED_PRIMITIVE_FOR_PARSING exclusion in style/spotbugs-exclude.xml should be removed so that future occurrences are caught by CI.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
contribution welcomekind/bugCategory issues or prs related to bug.Category issues or prs related to bug.