我有一个奇怪的问题调试
Android应用程序.
为了准确,我在这里复制我正在运行的确切代码:
为了准确,我在这里复制我正在运行的确切代码:
// Get the puzzles from cache List<PuzzleDetails> newPuzzles = m_cachedPuzzles.getPuzzles(count); if(newPuzzles.size() > 0){ // Remove from cache m_cachedPuzzles.removePuzzles(newPuzzles); // LINE (A) // Add the new puzzles from cache immediately m_ownedPuzzles.addPuzzles(newPuzzles); Log.d("requests","" + newPuzzles.size() + " moved from cache to user"); } int left = count - newPuzzles.size(); String deviceId = ResourcesPublisher.getInstance().getDeviceId(); // Don't let anyone else use these points for now ChallengePointsManagerImpl.getInstance().usePoints(left); Log.d("requests","aquirePuzzles(" + left + ")"); // Get a list of requests for 'left' number of puzzles RequestList reqList = getRequestList(left); // TODO this is a bug,now if(reqList.size() > 1){ reqList = getRequestList(left); // LINE (B) }
当我运行这段代码后,踩到线路(A)
m_cachedPuzzles.removePuzzles(newPuzzles);
调试器“跳转”到最后一行(B)
reqList = getRequestList(左);
一个简单的检查表明它确实跳过了这些代码行之间的所有代码.
例如,Log.d(…)从未被调用或写入.
谁能给我一个线索为什么会发生???
谢谢!