gpt4 book ai didi

hadoop - StringUtils.isNotEmpty(str)在hadoop集群数据验证中似乎无法正常工作

转载 作者:行者123 更新时间:2023-12-02 21:50:07 25 4
gpt4 key购买 nike

我不确定并面临如下奇怪的nullpointer问题。有人可以在下面的代码中帮助我吗

 if ((COUNTRY_CODE.equalsIgnoreCase(Country.TEST.name())) && (strCellId.matches("[0-9]*")))

在日志文件中抛出空指针(按行号)。如果 strCellId.matches("[0-9]*")为null,我只能看到的有害代码是 strCellId
但是,在输入if条件之前,已经调用了 StringUtils.isNotEmpty(strCellId)。请看情况
public static boolean validateCellId(String strCellId)
{
if (StringUtils.isNotEmpty(strCellId)) {
//here the nullpointer is coming
if ((COUNTRY_CODE.equalsIgnoreCase(Country.TEST.name())) && (strCellId.matches("[0-9]*"))) {
return true;
}
}

return false;
}

最佳答案

它是我的坏。
@zsxwing你是正确的。我的国家/地区尚未初始化,我应该检查一下,我只是充满信心地忽略了它。

关于hadoop - StringUtils.isNotEmpty(str)在hadoop集群数据验证中似乎无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21757392/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com