This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fixed for public_field & getter diff type
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/test/java/com/alibaba/json/bvt/bug/Bug_for_DiffType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.alibaba.json.bvt.bug; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
|
||
import junit.framework.TestCase; | ||
|
||
public class Bug_for_DiffType extends TestCase { | ||
public void test_for_diff_type() throws Exception { | ||
Model model = new Model(); | ||
model.setValue(1001); | ||
|
||
JSON.toJSONString(model); | ||
} | ||
|
||
public static class Model { | ||
public String value; | ||
|
||
public long getValue() { | ||
return Long.parseLong(value); | ||
} | ||
|
||
public void setValue(long value) { | ||
this.value = Long.toString(value); | ||
} | ||
} | ||
} |