Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

数据中要合并的值全为空,报StringIndexOutOfBoundsException异常 #2

Open
lookupman opened this issue Jul 29, 2019 · 0 comments

Comments

@lookupman
Copy link

result.stream().forEach((obj) -> {
field.setAccessible(true);
Object o = null;

                    try {
                        o = field.get(obj);
                        if (o != null && !ids.contains(o)) {
                            ids.add(o.toString());
                            sb.append(o.toString()).append(",");
                        }

                    } catch (IllegalAccessException var6) {
                        log.error("数据属性加工失败:" + field, var6);
                        throw new RuntimeException("数据属性加工失败:" + field, var6);
                    }
                });
                args = sb.substring(0, sb.length() - 1);

如果sb为空,报如下异常StringIndexOutOfBoundsException: String index out of range: -1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant