[BUG] JSONArray.toJavaList()不支持Boolean类型到boolean类型的转换,导致赋值错误
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 613
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Description
### 问题描述
JSONArray.toJavaList()不支持Boolean类型到boolean类型的转换,导致赋值错误
### 环境信息
*请填写以下信息:*
- OS信息: windows 11
- JDK信息: jdk 1.8
- 版本信息:fastjson2-2.0.23.jar
### 重现步骤
string中为true,解析后为false
```
public class IegnrstOpusJsonTest {
public static class JSONBooleanTest {
@JsonField("is_cooperate")
private boolean cooperate;
}
@Test
public void toJsonList() throws IOException {
List opusResults = null;
String string = "[{\"is_cooperate\":true}]";
opusResults = JSONArray.parseArray(string).toJavaList(JSONBooleanTest.class);
System.out.println(opusResults.toString());
}
}
```

### 期待的正确结果
应该解析为true
Contributor guide
Research direction
Start at JSONArray.toJavaList() and reproduce the supplied toJavaList test using JSONBooleanTest and its @JsonField mapping. Use the string containing true as the test input and verify that the resulting boolean field is true; that passing behavior is the done criterion.
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
- Clearly specified
- Newbie friendliness
- 42/100