You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sure! Here’s the issue description formatted in Markdown:
## Description
The `optString` method in the Jettison library is expected to return the provided default value when the key is either absent or explicitly set to `null`. However, it currently returns `"null"` (as a string) for keys that are explicitly set to `null`, instead of the specified default value.
### Steps to Reproduce1. Create a JSON object with a key explicitly set to `null`.
```json
{
"name": null
}
Call the optString method with the key and a default value.
To address the issue where optString does not return the expected default value when the key is absent or explicitly set to null, I propose the following modification:
When the key is not present in the JSON, o is null, and we want to return the defaultValue.
When the key is present but the value is explicitly set to null, o will be an instance of Null, and isExplicitNull() will return true, prompting the method to return the defaultValue.
Sure! Here’s the issue description formatted in Markdown:
optString
method with the key and a default value.Expected Behavior
The expected output should be:
Actual Behavior
The actual output is:
Additional Information
The text was updated successfully, but these errors were encountered: