### 问题描述 使用带 filter 参数的 `JSON.toJSONString` 方法,同时指定 Feature.ReferenceDetection Feature参数 转出的 json 自引用属性后面缺少冒号“:” ,格式错误 ### 环境信息 *请填写以下信息:* - OS信息: Win10 4Core 16 GB - JDK信息: Openjdk 1.8.0_312 - 版本信息:Fastjson2 2.0.51 ### 重现步骤 见代码 1. 使用带 filter 参数的 `JSON.toJSONString` 方法,同时指定 Feature.ReferenceDetection Feature参数 2. 输入 任意带循环引用 的数据 3. 出现 转出的 json 自引用属性后面缺少冒号“:” ,格式错误 ```java Map<String, Object> map = new HashMap<>(); map.put("k", "v"); map.put("selfRef", map); // 无 filter 参数的 toJSONString String json = com.alibaba.fastjson2.JSON.toJSONString(map, Feature.ReferenceDetection); System.out.println(json); // 输出:{"selfRef":{"$ref":".."},"k":"v"} ,结果正确 PropertyPreFilter propertyJsonFilter = (serializer, source, property) -> true; // 带 filter 参数的 toJSONString String badJson = com.alibaba.fastjson2.JSON.toJSONString(map, propertyJsonFilter, Feature.ReferenceDetection); System.out.println(badJson); // 输出:{"selfRef"{"$ref":"$"},"k":"v"} ,自引用属性后面少了冒号“:” ``` ### 期待的正确结果 输出自引用属性后不缺少冒号“:”的正确格式 json 字符串