Serialization dislocation
- Dominant language
- Java
- Stars
- 24.2k
- Forks
- 4.5k
- Avg merge
- 6d 4h
- Merged PRs (30d)
- 12
Description
## Dependency
JDK 1.8
```xml
com.google.code.gson
gson
2.8.6
```
## Usage
```java
(new GsonBuilder()).disableHtmlEscaping().setDateFormat("yyyy-MM-dd HH:mm:ss").serializeSpecialFloatingPointValues().create().toJson(obj)
```
The obj is `List` DTO like:
```java
public class DTO implements Serializable {
private int offlineActivityId;
private Date addTime;
private Date updateTime;
private int branchId;
private String branchName;
private int branchCount;
private String shopName;
private byte status;
//Omit other codes
}
```
## Appearance
**Sometimes**(not always)the result of Serialization is like this:
```json
[
{
"offlineActivityId":0,
"branchId":111111,
"branchName":"店",
"branchCount":0,
"shopName":"糕",
"status":0
},
{
"offlineActivityId":0,
"branchId":222222,
"branchName":"店",
"branchCount":0,
"shopName":"200",
"status":0
},
"糕",
{
"offlineActivityId":0,
"branchId":33333,
"branchName":"店",
"branchCount":0,
"shopName":"100",
"status":0
},
"糕",
{
"offlineActivityId":0,
"branchId":444444,
"branchName":"店",
"branchCount":0,
"shopName":"糕",
"status":0
}
]
```
you can see in some unit the value of branchCount is assigned to shopName,and the value of shopName appeares in a strange position
Is it a bug?
Contributor guide
Assessment
This issue has not been assessed yet.