[BUG]String转jsonObject后,出现部分元素缺失,2.0.38有此问题,2.0.39就修复了,但是在release-note没有提及此问题,这个是否影响到之前的所有版本
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 613
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Description
### 问题描述
*简要描述您碰到的问题。*
在字符串转JSONObject过程中,其中dataParam包含了64个元素,转为Json之后只有59个元素了, 缺少了5个元素,
json字符串如下:
```json
{"box_num":6,"dataParam":{"ocs1_4g_register_state":0,"m_EDCU1_state":0,"ocs1_wifi_channel":0,"m_HVAC3_state":1,"ocs1_4g_state":0,"ocs2_4g_signal_intensity":0,"m_PCMS1_state":0,"m_DCU3_state":0,"m_EMS1_state":0,"m_LCU3_state":0,"ocs2_wlan_signal_intensity":0,"ocs2_wlan_state":0,"m_EDCU5_state":0,"m_BCU2_state":0,"ocs2_MB300_state":1,"ocs1_MB300_state":0,"m_LCU1_state":0,"ocs2_tcms_life_state":0,"ocs2_disk_state":0,"ocs1_time_service_state":0,"m_EDCU2_state":0,"m_HVAC4_state":1,"ocs2_4g_register_state":0,"ocs2_time_service_state":0,"m_DCU2_state":0,"ocs1_disk_state":0,"m_BCU1_state":0,"m_HVAC1_state":1,"m_LCU4_state":0,"m_LCU2_state":0,"m_EDCU6_state":0,"ocs2_wifi_channel":0,"m_BMS2_state":0,"ocs2_WL350_state":1,"m_EMS2_state":0,"ocs2_lte_channel":0,"ocs1_wlan_state":0,"ocs1_WL350_state":0,"ocs2_location":1,"m_EDCU3_state":0,"ocs1_lte_channel":0,"ocs1_tcms_life_state":0,"m_TDS1_state":0,"ocs1_free_space":0,"ocs2_DR302_state":1,"m_HVAC5_state":1,"ocs1_PU300_state":0,"ocs2_PU300_state":1,"ocs2_4g_state":3,"m_LCU5_state":0,"ocs1_DR302_state":0,"ocs2_free_space":54655,"m_HVAC2_state":1,"ocs1_location":0,"ocs1_4g_signal_intensity":0,"m_PCMS2_state":0,"ocs1_wlan_signal_intensity":0,"m_BMS1_state":0,"m_LCU6_state":0,"m_DCU1_state":0,"m_EDCU4_state":0,"m_DCU4_state":0,"m_TDS2_state":0,"m_HVAC6_state":1},"message_type":5005,"ttype_id":10}
```
### 环境信息
*请填写以下信息:*
java1.8,fastsjon2.0.38
- OS信息: [e.g.:Windows11]
- JDK信息: [e.g.:Openjdk 1.8.0_312]
- 版本信息:[e.g.:Fastjson2 2.0.38]
### 重现步骤
*如何操作可以重现该问题:*
直接通过JSONObject.parseObject()方法,将以上字符串转json,然后查看dataParam的元素个数
```java
```
### 期待的正确结果
*对您期望发生的结果进行清晰简洁的描述。*
* 期待的正确结果,dataParam包含的元素为64个*
### 相关日志输出
*请复制并粘贴任何相关的日志输出。*
#### 附加信息
*如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。*
Contributor guide
Research direction
Start with JSONObject.parseObject() and reproduce the provided JSON on Java 1.8 with fastjson2 2.0.38, then compare the result with 2.0.39. Check which five dataParam elements are missing, determine whether earlier versions are affected, and verify whether the fix is represented in the release notes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100