Environment (Required on creation):
Tested with spring camunda starter 7.16.2-ee and spin 1.9.0.
Support ticket: SUPPORT-12786
Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):
camunda-spin throws NullPointerException with maps containing null values. Probably sets with null values would fail too.
Steps to reproduce (Required on creation):
Create a map with null values and try to serialize it with spin.
See this example: https://github.com/daniel-ewing/spring-boot-spin1/tree/map-with-null-value
Observed Behavior (Required on creation):
NullPointerException
Expected behavior (Required on creation):
Spin should serialize maps with null values successfully (and sets too).
Root Cause (Required on prioritization):
Spin tries to construct a type for the key and value. With null value the value.getClass line throws a NPE in the TypeHelper class:
org/camunda/spin/impl/json/jackson/format/TypeHelper.java:78
Solution Ideas (Optional):
- Introduce null check. Try to determine the value type by looking at other, non-null values, or store Object as type (since iterating a full map can be expensive)
- Make sure to to test it for Set with null value.
- What if a map only contains a single entry with null value? We can't determine the type... Store Object as type.
Hints (optional):
-
This is the controller panel for Smart Panels app
[CAM-14331] NullPointerException in camunda-spin when serializing map containing null value
Description |
Original:
h3. Environment (Required on creation):
Tested with spring camunda starter 7.16.2-ee and spin 1.9.0. Support ticket: SUPPORT-12786 h3. Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket): camunda-spin throws NullPointerException with maps containing null values. Probably sets with null values would fail too. h3. Steps to reproduce (Required on creation): Create a map with null values and try to serialize it with spin. See this example: [https://github.com/daniel-ewing/spring-boot-spin1/tree/map-with-null-value] h3. Observed Behavior (Required on creation): NullPointerException h3. Expected behavior (Required on creation): Spin should serialize maps with null values in it (and sets too). h3. Root Cause (Required on prioritization): Spin tries to construct a type for each key and value. With null value the {{value.getClass}} line throws a NPE in the {{{}TypeHelper class{}}}: {{org/camunda/spin/impl/json/jackson/format/TypeHelper.java:78}} h3. Solution Ideas (Optional): Introduce null check. Try to determine the key type by looking at other, non-null values. Make sure to to test it for Set with null value. h3. Hints (optional): |
New:
h3. Environment (Required on creation):
Tested with spring camunda starter 7.16.2-ee and spin 1.9.0. Support ticket: SUPPORT-12786 h3. Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket): camunda-spin throws NullPointerException with maps containing null values. Probably sets with null values would fail too. h3. Steps to reproduce (Required on creation): Create a map with null values and try to serialize it with spin. See this example: [https://github.com/daniel-ewing/spring-boot-spin1/tree/map-with-null-value] h3. Observed Behavior (Required on creation): NullPointerException h3. Expected behavior (Required on creation): Spin should serialize maps with null values successfully (and sets too). h3. Root Cause (Required on prioritization): Spin tries to construct a type for each key and value. With null value the {{value.getClass}} line throws a NPE in the {{{}TypeHelper class{}}}: {{org/camunda/spin/impl/json/jackson/format/TypeHelper.java:78}} h3. Solution Ideas (Optional): Introduce null check. Try to determine the key type by looking at other, non-null values. Make sure to to test it for Set with null value. h3. Hints (optional): |
Mentioned Roles |
Mentioned Groups |
Summary | Original: NullPointerException when serializing map containing null value | New: NullPointerException in camunda-spin when serializing map containing null value |
Labels | New: SUPPORT |
Description |
Original:
h3. Environment (Required on creation):
Tested with spring camunda starter 7.16.2-ee and spin 1.9.0. Support ticket: SUPPORT-12786 h3. Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket): camunda-spin throws NullPointerException with maps containing null values. Probably sets with null values would fail too. h3. Steps to reproduce (Required on creation): Create a map with null values and try to serialize it with spin. See this example: [https://github.com/daniel-ewing/spring-boot-spin1/tree/map-with-null-value] h3. Observed Behavior (Required on creation): NullPointerException h3. Expected behavior (Required on creation): Spin should serialize maps with null values successfully (and sets too). h3. Root Cause (Required on prioritization): Spin tries to construct a type for each key and value. With null value the {{value.getClass}} line throws a NPE in the {{{}TypeHelper class{}}}: {{org/camunda/spin/impl/json/jackson/format/TypeHelper.java:78}} h3. Solution Ideas (Optional): Introduce null check. Try to determine the key type by looking at other, non-null values. Make sure to to test it for Set with null value. h3. Hints (optional): |
New:
h3. Environment (Required on creation):
Tested with spring camunda starter 7.16.2-ee and spin 1.9.0. Support ticket: SUPPORT-12786 h3. Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket): camunda-spin throws NullPointerException with maps containing null values. Probably sets with null values would fail too. h3. Steps to reproduce (Required on creation): Create a map with null values and try to serialize it with spin. See this example: [https://github.com/daniel-ewing/spring-boot-spin1/tree/map-with-null-value] h3. Observed Behavior (Required on creation): NullPointerException h3. Expected behavior (Required on creation): Spin should serialize maps with null values successfully (and sets too). h3. Root Cause (Required on prioritization): Spin tries to construct a type for each key and value. With null value the {{value.getClass}} line throws a NPE in the {{{}TypeHelper class{}}}: {{org/camunda/spin/impl/json/jackson/format/TypeHelper.java:78}} h3. Solution Ideas (Optional): Introduce null check. Try to determine the key type by looking at other, non-null values. Make sure to to test it for Set with null value. What if a map only contains a single entry with null value? We can't determine the type... Store {{Object}} as type. h3. Hints (optional): |
Labels | Original: SUPPORT |
Mentioned Roles |
Mentioned Groups |
Link | New: This issue is related to SUPPORT-12786 [ SUPPORT-12786 ] |