alibaba / alibaba/fastjson2

[BUG]dubbo序列化BUG,值错误

Open
#3,139 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
4.4k
Forks
613
Avg merge
1d 22h
Merged PRs (30d)
6

Description

### 问题描述
*简要描述您碰到的问题。*
dubbo-version3.3.0+,在java consumer调用kotlin provider时,出现kotlin端有实际值(有效值),但是java端出现值变成默认值的情况

### 环境信息
*请填写以下信息:*

- OS信息: 版本 Windows 11 专业版
版本号 23H2
安装日期 ‎2023/‎9/‎6
操作系统版本 22631.4317
体验 Windows Feature Experience Pack 1000.22700.1041.0
RAM:32.0 GB
- JDK信息: [e.g.:Openjdk 17.0.9]
- 版本信息:[e.g.:Fastjson2 2.0.52-2.0.53]

### 重现步骤
*如何操作可以重现该问题:*
kotlin端
```kotlin
data class Item(val value: String = "默认值")
data class Result(val low: Item = Item(), val mid: Item = Item(), val high: Item = Item() )
// interface定义
fun getResult(q: String) : Result
```
```java
Result result = getResult("xxxx");
log.info("{}", JSON.toJSONString(result))
// 输出 {"low": {"value": "low"}, "mid": {"value": "默认值"}, "high": {"value": "high"}}
// 比较固定的是,只有mid这个里面的值会是默认值
```
1. 使用 `xxx.xxx` 方法
2. 输入 `...` 数据
3. 出现 `...` 错误
```java
//可在此输入示例代码
```

### 期待的正确结果
*对您期望发生的结果进行清晰简洁的描述。*
{"low": {"value": "low"}, "mid": {"value": "mid"}, "high": {"value": "high"}}

### 相关日志输出
*请复制并粘贴任何相关的日志输出。*

#### 附加信息
*如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。*

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Java consumer/Kotlin provider case with the supplied Item and Result data classes, then trace the serialization and deserialization path involved in the RPC response. Confirm the behavior across the missing JDK, Fastjson2, and Dubbo versions. Done means the Java result preserves "mid": {"value": "mid"} instead of the Kotlin default value.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.