java.lang.NullPointerException: null
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770) ~[spigot-1.12.2.jar:git-Spigot-c3093ef-7e94e65]
at com.google.common.base.Joiner.toString(Joiner.java:454) ~[spigot-1.12.2.jar:git-Spigot-c3093ef-7e94e65]
at com.google.common.base.Joiner.appendTo(Joiner.java:106) ~[spigot-1.12.2.jar:git-Spigot-c3093ef-7e94e65]
at com.google.common.base.Joiner.appendTo(Joiner.java:154) ~[spigot-1.12.2.jar:git-Spigot-c3093ef-7e94e65]
at com.google.common.base.Joiner.join(Joiner.java:197) ~[spigot-1.12.2.jar:git-Spigot-c3093ef-7e94e65]
at com.google.common.base.Joiner.join(Joiner.java:187) ~[spigot-1.12.2.jar:git-Spigot-c3093ef-7e94e65]
at com.google.common.base.Joiner.join(Joiner.java:205) ~[spigot-1.12.2.jar:git-Spigot-c3093ef-7e94e65]
编码:
public static String join(String[] args, int ignored, String separator) {
if (ignored > -1)
args = (String[]) ArrayUtils.remove(args, ignored);
String combined = Joiner.on(separator).join(args); // ERROR HERE
return combined.substring(0, combined.length());
}
我正在尝试使用分隔符完成加入字符串数组,并在需要时选择忽略参数。但是,我遇到了大约一周前不存在的这个错误。这段代码运行良好....现在不是。我尝试为“args”变量插入空检查,但无济于事。我从中提取的包裹有什么变化吗?