Buggy code:
public class BannerStudentDataUpdate extends BaseImport { private static String rootName = "studentUpdates" ; private static String studentElementName = "student" ; private static String enrollmentElementName = "enrollment" ; private HashMap < Session , HashSet < Long > > studentIdsSucessfullyProcessed = new HashMap < Session , HashSet < Long > > ( ) ; private HashSet < String > studentIdsNotProcessed = new HashSet < String > ( ) ; private HashSet < String > studentIdsSucessfullyProcessedWithProblems = new HashSet < String > ( ) ; private HashSet < Long > classIdsTouched = new HashSet < Long > ( ) ; private HashSet < Long > courseIdsTouched = new HashSet < Long > ( ) ; private boolean trimLeadingZerosFromExternalId ; private HashMap < String , Vector < Long > > bannerSessionIdMap = new HashMap < String , Vector < Long > > ( ) ; public BannerStudentDataUpdate ( ) { } @ Override public void loadXml ( Element rootElement ) throws Exception { } private void processStudentElement ( Element studentElement ) { } private void addSessionRecordToList ( HashMap < Session , HashSet < Long > > processedList , Session session , Long uniqueId ) { } private void mergeSessionRecordLists ( HashMap < Session , HashSet < Long > > globalList , HashMap < Session , HashSet < Long > > studentList ) { } private HashMap < Session , HashSet < Long > > updateStudent ( HashSet < Student > studentRecords , HashMap < Session , HashMap < CourseOffering , Vector < Class_ > > > classEnrollments , String externalId , String firstName , String middleName , String lastName , String academicArea , String classification , String major , String email ) { } private HashMap < Session , HashMap < CourseOffering , Vector < Class_ > > > processEnrollmentElements ( Element studentElement , String bannerSession , String externalId ) throws Exception { HashMap < Session , HashMap < CourseOffering , Vector < Class_ > > > enrollments = new HashMap < Session , HashMap < CourseOffering , Vector < Class_ > > > ( ) ; for ( Iterator < ? > eIt = studentElement . elementIterator ( BannerStudentDataUpdate . enrollmentElementName ) ; eIt . hasNext ( ) ; ) { Element enrollmentElement = ( ( Element ) ( eIt . next ( ) ) ) ; Integer crn = getRequiredIntegerAttribute ( enrollmentElement , "crn" , BannerStudentDataUpdate . enrollmentElementName ) ; CourseOffering co = BannerSection . findCourseOfferingForCrnAndTermCode ( crn , bannerSession ) ; if ( co == null ) { studentIdsSucessfullyProcessedWithProblems . add ( externalId ) ; error ( ( ( ( "Course<seq2seq4repair_space>Offering<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>CRN<seq2seq4repair_space>=<seq2seq4repair_space>" + ( crn . toString ( ) ) ) + ",<seq2seq4repair_space>banner<seq2seq4repair_space>session<seq2seq4repair_space>=<seq2seq4repair_space>" ) + bannerSession ) ) ; continue ; } boolean foundClasses = false ; for ( Iterator < ? > it = BannerSection . findAllClassesForCrnAndTermCode ( crn , bannerSession ) . iterator ( ) ; it . hasNext ( ) ; ) { Class_ c = ( ( Class_ ) ( it . next ( ) ) ) ; foundClasses = true ; <START_BUG> HashMap < CourseOffering , Vector < Class_ > > sessionCourseToClasses = enrollments . get ( c . getSessionId ( ) ) ; <END_BUG> if ( sessionCourseToClasses == null ) { sessionCourseToClasses = new HashMap < CourseOffering , Vector < Class_ > > ( ) ; enrollments . put ( c . getSession ( ) , sessionCourseToClasses ) ; } Vector < Class_ > classes = sessionCourseToClasses . get ( co ) ; if ( classes == null ) { classes = new Vector < Class_ > ( ) ; sessionCourseToClasses . put ( co , classes ) ; } classes . add ( c ) ; } if ( ! foundClasses ) { studentIdsSucessfullyProcessedWithProblems . add ( externalId ) ; error ( ( ( ( "Classes<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>CRN<seq2seq4repair_space>=<seq2seq4repair_space>" + ( crn . toString ( ) ) ) + ",<seq2seq4repair_space>banner<seq2seq4repair_space>session<seq2seq4repair_space>=<seq2seq4repair_space>" ) + bannerSession ) ) ; } } return enrollments ; } private Vector < Long > getSessionIdsForBannerSession ( String bannerSessionId ) { } public static void receiveResponseDocument ( QueueIn queueIn ) throws LoggableException { } private void updateEnrollmentForClassIds ( ) { } private void updateCourseOfferingEnrollmentCounts ( ) { } }

Fix:
HashMap < CourseOffering , Vector < Class_ > > sessionCourseToClasses = enrollments . get ( c . getSession ( ) ) ;