Tencent/TencentKona-8

StringIndexOutOfBoundsException with empty input in sun.tools.jar.Manifest.isManifestName("")

suoyi123wang opened this issue · 2 comments

单元测试用例如下:
image
源码:
image
在调用charAt(0)之前应该先判断长度,或者直接用name.startsWith("-") 代替也可避免这种异常发生

建议在调用接口前做判断。
如果觉得在isManifestName中加上判断更必要的话,建议向上游社区提PR。

没有进一步的需求,关闭该issue