remove redundant/diverging hardcoded defaults in parseInt/parseLong wrapping ConfigKey reads
維護者通常 1 天內回覆
@DaanHoogland 已經在處理了。
開始於 2026年8月18日。
評估
這個 Issue 還沒有評估資料。
描述
Many call sites read a ConfigKey via the raw DAO and wrap the result in NumbersUtil.parseInt(value, someLiteral) / NumbersUtil.parseLong(...) / Integer.parseInt(...), supplying a hardcoded fallback even though the ConfigKey already carries its own default via .defaultValue() (and .value() applies that default automatically when no DB row exists). Most of the time the literal happens to match the ConfigKey's declared default, so it's just redundant. But it doesn't always match — which is a latent bug, not just noise, since the two numbers silently diverge depending on which code path executes.
Found during the .value() migration pass (issue #10752):
DeploymentPlanningManagerImpl.java—HostReservationReleasePeriod:ConfigKeydefault is"300000", but the field's Java-level initializer is60L * 60L * 1000L(3,600,000), and the code only falls back to theConfigKeydefault when the persisted value is<= 0— not when the row is simply missing (null), in which case it silently keeps 3,600,000 instead of 300,000.StorageCacheManagerImpl.java—ExpungeWorkers:ConfigKeydefault is"1", but the read isNumbersUtil.parseInt(configDao.getValue(...), 10)— a hardcoded fallback of 10 vs. the registered default of 1.UcsManagerImpl.java—UCSSyncBladeInterval:ConfigKeydefault is"3600", but a leftovercatch (NumberFormatException e) { syncBladeInterval = 600; }uses 600. Low risk in practice since.value()no longer throws on parse, but the mismatched literal is still latent debt.
These three were left un-migrated to .value() specifically because of this discrepancy — picking either number without a decision would silently change fresh-install/edge-case behavior. Worth a repo-wide sweep for the same parseInt/parseLong-with-hardcoded-default pattern, since these three were only found incidentally while migrating unrelated call sites, not through an exhaustive search.
- 主要語言
- Java
- 星號
- 3.1k
- 分支
- 1.4k
- 平均合併
- 6 天 11 小時
- 30 天內合併 PR
- 13
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/cloudstack 的其他 Issue
-
listPublicIpAddresses NullPointerException on shared networks with a VR (4.22)可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉bug
難度 2/5 1-3 小時 新手友好度 80/100
apache/cloudstack#14248 ·
維護者通常 1 天內回覆
-
CKS: upgradeKubernetesCluster fails on control node when binaries ISO ships headlamp.yaml instead of dashboard.yaml可能已有人在做 @mw-0 於 10 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 68/100
apache/cloudstack#14244 · 1 則留言 ·
維護者通常 1 天內回覆
-
Resize volume API validation errors are not displayed in the UI可能已有人在做 @sathvikaragi 於 13 天前認領。 未關閉bug
難度 1/5 1 小時以內 新手友好度 90/100
apache/cloudstack#14222 ·
維護者通常 1 天內回覆
-
bug component:kubernetes
難度 1/5 1 小時以內 新手友好度 88/100
apache/cloudstack#14180 ·
維護者通常 1 天內回覆
-
bug component:projects component:UI
難度 1/5 1 小時以內 新手友好度 88/100
apache/cloudstack#14070 · 5 則留言 ·
維護者通常 1 天內回覆
查看 apache/cloudstack 的全部 Issue
相似的 Issue
-
CalendarEventAttendance/get returns eventAttendanceStatus while the doc says attendanceStatus可能已有人在做 @chibenwa 今天認領。 未關閉bug claude
難度 1/5 1 小時以內 新手友好度 90/100
linagora/tmail-backend#2697 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
apache/skywalking#14120 ·
維護者通常 1 天內回覆
-
[BUG] Case-insensitive search suggestions miss items when the JVM default locale is Turkish可能已有人在做 @thswlsqls 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
NameAllocator generates colliding identifiers with ignorable characters可能已有人在做 @PHJ2000 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆