Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037151Openbravo ERPA. Platformpublic2017-10-24 10:442022-02-01 08:08
alostale 
Triage Platform Base 
normalminorhave not tried
acknowledgedopen 
5
 
 
Core
No
0037151: upgrade/replace JSON library
Jettison library is used to handle JSON <-> String transformations in Java.

Current version is 1.3 (2011), with some patches to solve some critical issues.

This is a very old version that should be upgraded.

-
This library is consumed not only by Openbravo platform but also any code manipulating JSON in Java.

Reviewing changes since then to latest version, it turns out there are some that might cause changes in behavior [1].

One of this changes fixes the following issue, given a JSON like:

{a:null}

the following code:

josonObject.getString("a")

returns:

 "null" (java.lang.String)

In newer versions, it returns a null pointer.

Currently, there is code like:

1. if (josonObject.getString("a").equals("null")) {...}
2. if ("null".equals(josonObject.getString("a"))) {...}

In first case new behavior would throw NPE, whereas in 2nd case it would silently misbehave.

Therefore, this change must be carefully handled.

Ideally, there should be an Openbravo Platform layer between functional code and JSON library, so that these API changes would be managed by it or even it would be possible to replace this library by any other one (note jettison project currently is not very active).

---
[1] https://docs.google.com/spreadsheets/d/1ldZ2IL3s5f-BSHlqVSGxG1ecTSJK20jIxaQudgZIlX8/edit#gid=0 [^]

No tags attached.
related to defect 0037135 closed alostale OOM parsing corrupted JSON 
related to design defect 0051132 scheduled gdagnesses Update jettison library to the latest version 
blocks defect 0052255 closed kousalya_r Request to provide valid version for jettison-1.3-patched.jar 
Issue History
2017-10-24 10:44alostaleNew Issue
2017-10-24 10:44alostaleAssigned To => platform
2017-10-24 10:44alostaleModules => Core
2017-10-24 10:44alostaleTriggers an Emergency Pack => No
2017-10-24 10:44alostaleTypedefect => design defect
2017-10-24 10:44alostaleStatusnew => acknowledged
2017-10-24 10:45alostaleRelationship addedrelated to 0037135
2017-10-24 10:53alostaleSummaryupgrade JSON library => upgrade/replace JSON library
2022-02-01 08:08alostaleAssigned Toplatform => Triage Platform Base
2022-12-13 13:54shuehnerRelationship addedrelated to 0051132
2023-04-26 13:38kousalya_rRelationship addedblocks 0052255

There are no notes attached to this issue.