Skip to content

Map< , Object>死循环 #13

Description

@mshow7321

Contact Details

hanfei7321@163.com

Version

4.0.0

Plugin

smart-doc-maven-plugin

Build tool version

maven 3

Jdk version

1.8

Describe the bug (Bug描述,社区已开启国际化推广,请用千问、星火等免费大模型工具辅助翻译成英文,减少社区开发者的工作)

参数定义为Map<Enum, Object>的时候,会导致死循环
java.lang.StackOverflowError
at java.util.regex.Pattern.error (Pattern.java:1969)
at java.util.regex.Pattern. (Pattern.java:1354)
at java.util.regex.Pattern.compile (Pattern.java:1028)
at java.lang.String.replaceAll (String.java:2223)
at io.github.smartdoc.utils.DocUtil.replaceNewLineToHtmlBr (DocUtil.java:853)

临时修复方案是在TornaUtil.buildParams方法里把
if (apiParam.getChildren() != null ) {
httpParam.setChildren(buildParams(apiParam.getChildren()));
}
改为
if (apiParam.getChildren() != null && !"any object".equals(apiParam.getField())) {
httpParam.setChildren(buildParams(apiParam.getChildren()));
}

Expected Behavior (您期望的结果,社区已开启国际化推广,请用千问、星火等免费大模型工具辅助翻译成英文,减少社区开发者的工作)

正常上报

Image

Current Behavior (当前结果,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

StackOverflowError

Steps to Reproduce (Bug产生步骤,请尽量提供用例代码。社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

Image Image 如图结构定义,100%触发bug

Possible Solution (Bug解决建议,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

No response

Context (Bug影响描述,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

No response

Validations

  • Check if you're on the latest smart-doc version. (请检查是否为最新版本)
  • Read the docs. (请先阅读官方文档)
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. (检查是否存在报告相同错误的问题,以避免产生重复)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions