tinyid icon indicating copy to clipboard operation
tinyid copied to clipboard

在调用 nextIdSimple 获取id时,batchSize = 0 时会出现越界

Open iheshichao opened this issue 4 years ago • 1 comments

curl http://127.0.0.1:9999/tinyid/id/nextIdSimple -d 'token=0f673adf80504e2eaa552f5d791b644c&bizType=test&batchSize=0'

java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.AbstractStringBuilder.deleteCharAt(AbstractStringBuilder.java:824) ~[?:1.8.0_241] at java.lang.StringBuilder.deleteCharAt(StringBuilder.java:253) ~[?:1.8.0_241] at com.xiaoju.uemc.tinyid.server.controller.IdContronller.nextIdSimple(IdContronller.java:85) [classes/:?]

iheshichao avatar Jun 29 '20 06:06 iheshichao

确实有这个问题,可以考虑在checkBatchSize方法中改进一下

351524388 avatar Jul 23 '20 09:07 351524388