Validate command input and handle bad values cleanly
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 50/100
Línea de trabajo
Start by reading the command handlers for /shop add, update, delete, sell, and create, plus identifyStore and the tab completer; the issue does not name their files. Run the existing tests that reproduce the first three rows and the sell case, then add coverage for the remaining rows. Done means invalid input leaves state unchanged, duplicate matches use STORE_MULTI_MATCH in commands and completion, and all listed cases are covered.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
Several commands accept input they can't handle, or fail with an unhelpful error.
| Input | Result |
|---|---|
/shop add stone NaN NaN -1 1 (also Infinity, and the same through update) |
Accepted. /shop buy on that item then always fails with "Invalid numerical value" |
/shop add stone -3 with shops.update.inf-stock |
Takes 3 from the store's stock, then reports "Invalid number of arguments" |
/shop update location Dup ... when two stores are named Dup |
MultipleStoresMatchedException isn't caught, so "An internal error occurred". The tab completer calls identifyStore unguarded too |
/shop delete abc~ when a store named abc exists |
split("~") leaves no second part, so input[1] throws |
Store names containing ~ |
Created normally, but can't be found by name afterward |
/shop sell notreal all |
Reports "Invalid quantity (0)" instead of an invalid material |
/shop create <name> <player> |
The limit is checked against the sender's stores, not the new owner's |
The first three rows and the sell row were reproduced in tests. The others come from reading the code.
Done when
- Prices must be finite numbers, and negative values are only accepted where they have a meaning.
- A failed command changes nothing.
- Duplicate-name errors show
STORE_MULTI_MATCHeverywhere, including tab completion. - Store names can't contain
~, or the parser handles them. - Tests cover each row.
- Lenguaje dominante
- Java
- Estrellas
- 1
- Forks
- 0
- Merge medio
- 2 h 35 min
- PR fusionados (30 d)
- 14
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de BrendonButler/Shops
-
dependencies enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
BrendonButler/Shops#79 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
BrendonButler/Shops#70 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
BrendonButler/Shops#69 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
BrendonButler/Shops#68 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
BrendonButler/Shops#67 ·
Los mantenedores suelen responder en 1 día
Todos los issues de BrendonButler/Shops
Issues similares
-
hermes-queue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
chrisalunlloyd2-sudo/mindpalace#373 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug priority: lowest
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
SkriptLang/Skript#8953 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
quality-assurance
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#228 ·
Los mantenedores suelen responder en 1 día
-
[java] TestClassWithoutTestCases: document that abstract classes and interfaces are not checkedAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
Los mantenedores suelen responder en 2 días