Removing from an empty JsonObjectBuilder may produce a NPE
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in JsonObjectBuilderImpl.java at the remove method and reproduce the issue with the Json.createObjectBuilder() example from the report. Trace how valueMap is initialized for an empty builder, then verify that removing from an empty builder completes without a NullPointerException.
Written by the indexing model from the issue text.
Description
It seems that builder does not initialize the valueMap field in all cases.
public class Test {
public static void main(String[] args) {
JsonObjectBuilder builder = Json.createObjectBuilder();
builder.remove("name");
}
}
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.util.Map.remove(Object)" because "this.valueMap" is null
at org.eclipse.parsson.JsonObjectBuilderImpl.remove(JsonObjectBuilderImpl.java:171)
- Dominant language
- Java
- Stars
- 17
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eclipse-ee4j/parsson
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
eclipse-ee4j/parsson#173 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
eclipse-ee4j/parsson#146 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
eclipse-ee4j/parsson#123 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
eclipse-ee4j/parsson#120 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
eclipse-ee4j/parsson#119 ·
All issues in eclipse-ee4j/parsson
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100