[jira] [Commented] (JOHNZON-408) JsonValue.EMPTY_JSON_OBJECT is null

2024-08-21 Thread Niclas Hedhman (Jira)


[ 
https://issues.apache.org/jira/browse/JOHNZON-408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17875522#comment-17875522
 ] 

Niclas Hedhman commented on JOHNZON-408:


Never mind. In 1.1.4 of the javax.json-api, it has been changed to "new 
EmptyObject()". 

> JsonValue.EMPTY_JSON_OBJECT is null
> ---
>
> Key: JOHNZON-408
> URL: https://issues.apache.org/jira/browse/JOHNZON-408
> Project: Johnzon
>  Issue Type: Bug
>  Components: Core
>Reporter: Niclas Hedhman
>Assignee: Markus Jung
>Priority: Major
>
> JsonValue.EMPTY_JSON_OBJECT is set to null, because the initialization of 
> that instance is calling the JsonObjectBuilderImpl.build() which returns 
> itself if it is an empty `attributeMap`.
> See comment
> https://github.com/apache/johnzon/commit/50a64d59a81384fe400570e36fc93ce7e2347746#r145601781
> for the exact time when this was broken, and the ultra-simple test for it. 
> And the previous code worked, but someone thought to be "clever" and no tests 
> capturing it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (JOHNZON-408) JsonValue.EMPTY_JSON_OBJECT is null

2024-08-21 Thread Niclas Hedhman (Jira)


[ 
https://issues.apache.org/jira/browse/JOHNZON-408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17875520#comment-17875520
 ] 

Niclas Hedhman commented on JOHNZON-408:



I end up with depending on `javax:json:javax.json-api:1.1` and in its 
`javax.json.JsonValue`, there is;

```
public interface JsonValue {

/**
 * The empty JSON object.
 * 
 * @since 1.1
 */
static final JsonObject EMPTY_JSON_OBJECT = 
Json.createObjectBuilder().build();

```

> JsonValue.EMPTY_JSON_OBJECT is null
> ---
>
> Key: JOHNZON-408
> URL: https://issues.apache.org/jira/browse/JOHNZON-408
> Project: Johnzon
>  Issue Type: Bug
>  Components: Core
>Reporter: Niclas Hedhman
>Assignee: Markus Jung
>Priority: Major
>
> JsonValue.EMPTY_JSON_OBJECT is set to null, because the initialization of 
> that instance is calling the JsonObjectBuilderImpl.build() which returns 
> itself if it is an empty `attributeMap`.
> See comment
> https://github.com/apache/johnzon/commit/50a64d59a81384fe400570e36fc93ce7e2347746#r145601781
> for the exact time when this was broken, and the ultra-simple test for it. 
> And the previous code worked, but someone thought to be "clever" and no tests 
> capturing it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (JOHNZON-408) JsonValue.EMPTY_JSON_OBJECT is null

2024-08-21 Thread Markus Jung (Jira)


[ 
https://issues.apache.org/jira/browse/JOHNZON-408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17875485#comment-17875485
 ] 

Markus Jung commented on JOHNZON-408:
-

don't quite understand your issue, both the old [geronimo json 
api|https://github.com/apache/geronimo-specs/blob/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/JsonValue.java#L27]
 and [jakartaee json 
API|https://github.com/jakartaee/jsonp-api/blob/master/api/src/main/java/jakarta/json/JsonValue.java#L37]
 don't delegate JsonValue.EMPTY_JSON_OBJECT to the JSON-P implementation and 
instead handle it internally.

Your test is also working fine when ran directly in the johnzon code. Can you 
maybe describe the environment where you encountered this issue? Specifically, 
which JSON-P api jar are you using?

> JsonValue.EMPTY_JSON_OBJECT is null
> ---
>
> Key: JOHNZON-408
> URL: https://issues.apache.org/jira/browse/JOHNZON-408
> Project: Johnzon
>  Issue Type: Bug
>  Components: Core
>Reporter: Niclas Hedhman
>Priority: Major
>
> JsonValue.EMPTY_JSON_OBJECT is set to null, because the initialization of 
> that instance is calling the JsonObjectBuilderImpl.build() which returns 
> itself if it is an empty `attributeMap`.
> See comment
> https://github.com/apache/johnzon/commit/50a64d59a81384fe400570e36fc93ce7e2347746#r145601781
> for the exact time when this was broken, and the ultra-simple test for it. 
> And the previous code worked, but someone thought to be "clever" and no tests 
> capturing it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)