Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse debugger "jumps" skipping important code

I have a weird problem debugging an android application. To be accurate, I copy here the exact code I'm running on:

    // 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)
}

When I run on this code, after stepping over the line (A) m_cachedPuzzles.removePuzzles(newPuzzles); The debugger "jumps" to the last line (B) reqList = getRequestList(left);

A simple check shows it really skipped all code between these code lines. For example the Log.d(...) was never called nor written.

Can anyone give me a clue why does it happen???

Thanks!

like image 420
user1028741 Avatar asked Jan 30 '12 00:01

user1028741


1 Answers

Try to do a right click > refresh on the project as it appears on the Project Explorer after you compile the code and before you start debugging.

like image 199
dimitrisli Avatar answered Sep 20 '22 00:09

dimitrisli