-1
我使用下面的代碼:檢查無限循環。我使用的是布爾變量
boolean continueProcessing = true;
boolean lastRecord = false;
while (continueProcessing) //can it be changed to while (continueProcessing == true), what's the advantage
{
if(refListItemItr.hasNext() || lastRecord)
{
continueProcessing = true;
lastRecord = false;
}
else
{
continueProcessing = false;
}
if(continueProcessing)
{
lSynonymListType = objFactory.createSynonymListType();
}
}
我懷疑有無限循環的情況。我應該如何確認它沒有發生。
請格式化你的代碼之間沒有區別。 – 2012-07-26 06:46:51
此代碼似乎並未實際執行任何操作......您想在此實現什麼功能?另外,refListItemItr的類型是什麼? – Braiba 2012-07-26 06:53:41
我沒有寫完整的代碼。這很大。只是想知道這個情景能否完全消除? – dev 2012-07-26 07:15:52