eclipse-ee4j / eclipse-ee4j/parsson
Removing from an empty JsonObjectBuilder may produce a NPE
Open
- Dominant language
- Java
- Stars
- 17
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
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)
Contributor guide
Assessment
This issue has not been assessed yet.