私は確信が持てず、以下のような奇妙なnullpointerの問題に直面しています。誰かが以下のコードでこれについて私を助けてくれませんか
if ((COUNTRY_CODE.equalsIgnoreCase(Country.TEST.name())) && (strCellId.matches("[0-9]*")))
ログファイルにnullpointerを投げています(行番号に従って)。私が見ることができる唯一の問題のコードはstrCellId.matches("[0-9]*")
if strCellId
is null です
ただし、StringUtils.isNotEmpty(strCellId)
if 条件に入る前に既に呼び出されています。状態をご覧ください
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;
}