[Bug]: An initiative list with no current entry logs an error on every change
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
Direzione di ricerca
Inizia nella classe InitiativeList, dove insertToken, remove, move e sort chiamano ciascuna getTokenInitiative(getCurrent()), e in getTokenInitiative stesso, che registra come errore qualsiasi indice fuori intervallo. Per riprodurre, crea una lista con delle voci e senza voce corrente, poi copia una map e controlla il log. È completato quando una lista senza voce corrente non produce alcun log di errore e le altre operazioni continuano a comportarsi allo stesso modo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the Bug
InitiativeList logs an error whenever an entry is inserted, removed, moved or the list is sorted while no entry has the initiative:
ERROR ... getTokenInitiative: index = -1, size = 0
Each of those methods saves the current entry first with getTokenInitiative(getCurrent()). With no current entry, getCurrent() is -1, and getTokenInitiative logs any out-of-range index as an error. But no current entry is the normal state of a new or emptied list, and of any list before someone starts a round.
It happens a lot more than adding tokens by hand would suggest, because copying a map rebuilds its initiative list one insertToken at a time. A campaign copy is made for every autosave, and when a server starts, so a map with initiative entries and no current one logs one error per entry each time. My dedicated server logged it 933 times before I worked around it.
Nothing else goes wrong: the methods treat the null as "no current entry" correctly. It's only the log.
To Reproduce
- Add a few tokens to the initiative list of a map, without starting a round.
- Let the campaign autosave, or start a server with it.
- The log has one
getTokenInitiative: index = -1error per entry.
Expected Behaviour
No error. "No entry has the initiative" isn't an error.
MapTool Info
develop (445f76a1d)
Desktop
Ubuntu 24.04 LTS
- Lingua principale
- Java
- Stelle
- 927
- Fork
- 286
- Merge medio
- 3g 17h
- PR unite (30g)
- 94
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi 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 RPTools/maptool
-
[Maintenance]: Migrate gradle dependency submission to modern alternativeForse già presa @VelpulaGangavardhan l’ha presa 18 giorni fa. Apertacode-maintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
RPTools/maptool#6156 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
code-maintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
RPTools/maptool#5722 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di RPTools/maptool
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
FasterXML/jackson-databind#6443 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
finos/fluxnova-bpm-platform#387 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 84/100
cpp-best-practices/project_validator#251 ·
I maintainer di solito rispondono entro 1 giorno