JSON map and URL parameter builders fail for types with a version parameter
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 72/100
Línea de trabajo
Start in core/src/main/java/com/backblaze/b2/json/B2JsonObjectHandler.java. Compare the array allocation at line 457 in the normal deserialize path, which uses constructorParamCount and fills the version parameter around lines 492-494, with the two allocations at lines 504 and 536 in deserializeFromFieldNameToValueMap and deserializeFromUrlParameterMap. Done when a test class annotated with versionParam can be built through both methods without an IllegalArgumentException, and the version value is set there too.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
For a type that declares a versionParam, the normal deserialize path sizes its constructor argument array with constructorParamCount (fields plus the version parameter). deserializeFromFieldNameToValueMap and deserializeFromUrlParameterMap size it with fields.length, so the array is one element short and constructor.newInstance throws an unchecked IllegalArgumentException (wrong number of arguments) that is not turned into a B2JsonException.
Where
core/src/main/java/com/backblaze/b2/json/B2JsonObjectHandler.java:504 and :536 (compare :457, and :235-236 where constructorParamCount is set); the version parameter is filled in at :492-494 only on the normal path.
Why it matters
Impact: Availability (building the object fails), loud. Severity: High, because it only affects types that use versionParam and are built from a map or URL parameters (unusual), and no type in the SDK's main code uses versionParam.
How to check
Found by reading the code, not reproduced. Read the three array allocations. A test could define a @B2Json.type(versionParam = "v") class and call deserializeFromFieldNameToValueMap or deserializeFromUrlParameterMap on it. Using constructorParamCount and setting the version parameter in those two methods would fix it.
Version
Seen at v6.5.0. Present on the default branch: present.
- Lenguaje dominante
- Java
- Estrellas
- 103
- Forks
- 23
- Merge medio
- 5 d 8 h
- PR fusionados (30 d)
- 3
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 Backblaze/b2-sdk-java
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Backblaze/b2-sdk-java#248 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Backblaze/b2-sdk-java#247 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Backblaze/b2-sdk-java#246 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Backblaze/b2-sdk-java#245 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Backblaze/b2-sdk-java#242 ·
Los mantenedores suelen responder en 3 días
Todos los issues de Backblaze/b2-sdk-java
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
IETF-Hackathon/pqc-certificates#351 ·
Los mantenedores suelen responder en 2 días
-
bug(core): skip_nodes.json is missing SELECT and PRE, causing Python and Java to insert separators into dropdown options and preformatted textPosiblemente ocupada @Bhumit267 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
ExceptionThrowShouldUseContext: NullPointerException on a catch block inside an annotation typePosiblemente ocupada @Carbon14-48 la tomó hoy. Abiertoapproved
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
checkstyle/checkstyle#22784 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día