remove redundant/diverging hardcoded defaults in parseInt/parseLong wrapping ConfigKey reads
@DaanHoogland ci sta già lavorando.
Dal 18/8/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 3.1k
- Fork
- 1.4k
- Merge medio
- 6g 20h
- PR unite (30g)
- 27
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/cloudstack
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
apache/cloudstack#14222 ·
-
create-kubernetes-binaries-iso.sh builds the ISO without setting a volume ID on EL8 based os's Apertabug component:kubernetes
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
apache/cloudstack#14180 ·
-
bug component:projects component:UI
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
apache/cloudstack#14070 · 5 commenti ·
-
component:backup
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/cloudstack#14013 ·
-
KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 Apertabug component:ceph
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/cloudstack#13989 · 3 commenti ·
Tutte le issue di apache/cloudstack
Issue simili
-
bug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
emitter:client:csharp feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Apertabug frontend maui-pilot
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100