public int loadLandmarksIntoVector(){ System.out.println("Loading landmarks from store into vector"); Object o; System.out.println("1"); int count = -1; System.out.println("2"); boolean gettingElements = true; System.out.println("3"); try { LandmarkList.removeAllElements(); } catch (NullPointerException npe ) { System.out.println("No elements to remove from LandmarkList"); } System.out.println("4"); try { System.out.println("About to get some landmarks"); Enumeration enlms = lms.getLandmarks(); System.out.println("Got enlms"); while (enlms.hasMoreElements()){ // while ( gettingElements == true ) { try { o = enlms.nextElement(); LandmarkList.addElement((Landmark) o); count++; System.out.println(count); } catch ( NullPointerException npe ){ //gettingElements = false; System.out.println("I'm outta here"); } } System.out.println(count + " landmarks loaded."); } catch ( NullPointerException npe ) { } catch (IOException ex) { ex.printStackTrace(); } return count; }