{"task": {"agent_timeout": 3000, "task": "testgen__alibaba__fastjson2-2559", "verifier_timeout": 3000, "instruction": "The following text contains a user issue (in <issue/> brackets) posted at a repository. Further, you are provided with file contents of several files in the repository that contain relevant code (in <code> brackets). It may be necessary to use code from third party dependencies or files not contained in the attached documents however. Your task is to identify the issue and implement a test case that verifies a proposed solution to this issue. More details at the end of this text.\n<issue>\n      ### \u8bf7\u63cf\u8ff0\u60a8\u7684\u9700\u6c42\u6216\u8005\u6539\u8fdb\u5efa\u8bae\n\u80cc\u666f\u5982\u4e0b\uff1a\n1\u3001\u6211\u4eec\u4f1a\u628a`java`\u5bf9\u8c61\u901a\u8fc7`fastjson`\u8f6c\u4e3a`String`\u7136\u540e\u901a\u8fc7**MQ** \u53d1\u9001\u51fa\u6765\uff0c\u5728\u63a5\u6536\u7aef\u4f1a\u518d\u901a\u8fc7`fastjson`\u628a`String`\u8f6c\u5316`JSONObject`\n```\n    public void handleChannel(String data) throws PropertyMapperException {\n        JSONObject jsonData = JSON.parseObject(data);\n        ViewMO inputMO = jsonData.toJavaObject(ViewMO.class);\n        ImportBatchDetailDO task = new ImportBatchDetailDO();\n        task.setData(jsonData);\n        task.setSyncImportTaskId(inputMO.getId());\n        importBatchDetailRepo.save(task);\n    }\n```\n2\u3001\u7531\u4e8efastjson\u7f3a\u7701\u53cd\u5e8f\u5217\u5316\u5e26\u5c0f\u6570\u70b9\u7684\u6570\u503c\u7c7b\u578b\u4e3aBigDecimal\uff0c\u6240\u4ee5\u4e0a\u9762`jsonData`\u8fd9\u4e2a`JSONObject`\u91cc\u9762\u7684\u5c0f\u6570\u90fd\u4f1a\u88ab\u8f6c\u4e3a`BigDecimal`, \u800c\u7531\u4e8e\u6211\u4eec\u7684\u6570\u636e\u5e93\u7528\u7684\u662f`mongodb`\uff0c\u6240\u4ee5\u5b58\u50a8\u8fdb`mongodb`\u65f6\u8fd9\u4e2a`BigDecimal`\u53c8\u4f1a\u81ea\u52a8\u88ab\u8f6c\u4e3a`org.bson.types.Decimal128`\n3\u3001\u4f46\u662f\u5f53\u6211\u4eec\u4ece`MongoDB`\u8bfb\u56de\u8fd9\u4e2a`JSONObject`\u5bf9\u8c61\u65f6\uff0c\u7531\u4e8e`java`\u6620\u5c04\u8fd9\u4e2a`JSONObject`\u7684\u5c0f\u6570\u7684\u7c7b\u578b\u662f`Double`\uff0c\u8fd9\u65f6\u7531\u4e8e`fastjson`\u4ee3\u7801\u91cc\u7684`ObjectReaderProvider.typeConverts`\u5e76\u6ca1\u6709\u628a`org.bson.types.Decimal128`\u8f6c\u4e3a`Double`\u7684**Converts**, \u8fd9\u65f6\u5c31\u4f1a\u62a5**can not cast to java.lang.Double, from class org.bson.types.Decimal128**\u9519\u8bef\uff0c\u4ee5\u4e0b\u662f\u5177\u4f53\u7684\u4ee3\u7801\uff1a\n```\n@SpringBootTest\npublic class BigDecimalTest {\n\n    @Autowired\n    private ImportBatchDetailRepo importBatchDetailRepo;\n    @Test\n    public void testBigDecimal() {\n        ImportBatchDetailDO importBatchDetailDO = importBatchDetailRepo.findById(\"64dc97577e47e340a7165e0b\");\n        JSONObject data = importBatchDetailDO.getData();\n        ImportRefinedMO javaObject = data.toJavaObject(ImportRefinedMO.class);\n\n    }\n}\n\n@Getter\n@Setter\npublic class ImportBatchDetailDO {\n\n    private String syncImportTaskId;\n    private JSONObject data;\n\n}\n\n@Getter\n@Setter\npublic class ImportRefinedMO {\n\n    private Double holidayHour;\n}\n```\n\n### \u8bf7\u63cf\u8ff0\u4f60\u5efa\u8bae\u7684\u5b9e\u73b0\u65b9\u6848\n\u53ea\u8981\u4f18\u5316`TypeUtils.cast`\u8fd9\u4e2a\u65b9\u6cd5\uff0c\u589e\u52a0\u652f\u6301\u4ece`org.bson.types.Decimal128`\u8f6c\u4e3a`Double`\u5c31\u53ef\u4ee5\u4e86\uff0c\u4ee5\u4e0b\u662f\u5177\u4f53\u7684\u4ee3\u7801\u53ef\u80fd\u5b9e\u73b0\u5e76\u4e0d\u662f\u6700\u4f18\u7f8e\u7684\u65b9\u5f0f\uff0c\u4f46\u662f\u4ee5\u4e0b\u8fd9\u4e2a\u5b9e\u73b0\u7ecf\u8fc7\u6211\u7684\u6d4b\u8bd5\u662f\u53ef\u4ee5\u89e3\u51b3\u6211\u4e0a\u9762\u8fd9\u4e2a\u95ee\u9898\uff0c\u5728`TypeUtils`\u7c7b\u7684**1525**\u884c\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801:\n```\n        String objClassName = obj.getClass().getName();\n        if (obj instanceof Number && objClassName.equals(\"org.bson.types.Decimal128\") && targetClass == Double.class) {\n            ObjectWriter objectWriter = JSONFactory\n                    .getDefaultObjectWriterProvider()\n                    .getObjectWriter(obj.getClass());\n            if (objectWriter instanceof ObjectWriterPrimitiveImpl) {\n                Function function = ((ObjectWriterPrimitiveImpl<?>) objectWriter).getFunction();\n                if (function != null) {\n                    Object apply = function.apply(obj);\n                    Function DecimalTypeConvert = provider.getTypeConvert(apply.getClass(), targetClass);\n                    if (DecimalTypeConvert != null) {\n                        return (T) DecimalTypeConvert.apply(obj);\n                    }\n                }\n            }\n        }\n```\n\n</issue>\nPlease generate test cases that check whether an implemented solution resolves the issue of the user (at the top, within <issue/> brackets).\nYou may apply changes to several files.\nApply as much reasoning as you please and see necessary.\nMake sure to implement only test cases and don't try to fix the issue itself.\nYou are not allowed to read git history.\n", "memory": "8192m", "runnable": false, "difficulty": "hard", "language": "", "cpus": "", "instruction_truncated": false, "category": "test-generation", "compose": false, "has_solution": true, "oracle": null, "docker_image": "", "taskset": "devopsgym", "tags": ["test-generation", "devops-bench"]}, "runs": []}