Buggy code:
public class LibraryAwardUploadStep extends AbstractProcessingStep { public static final String SUBMIT_UPLOAD_BUTTON = "submit_upload" ; public static final String SUBMIT_SKIP_BUTTON = "submit_skip" ; public static final String SUBMIT_MORE_BUTTON = "submit_more" ; public static final String CANCEL_EDIT_BUTTON = "submit_edit_cancel" ; public static final int STATUS_INTEGRITY_ERROR = 1 ; public static final int STATUS_UPLOAD_ERROR = 2 ; public static final int STATUS_NO_FILES_ERROR = 5 ; public static final int STATUS_UNKNOWN_FORMAT = 10 ; public static final int STATUS_EDIT_BITSTREAM = 20 ; public static final int STATUS_EDIT_COMPLETE = 25 ; public static final int STATUS_MISSING_BITSTREAMS = 30 ; public static final int STATUS_NOT_PDF = 35 ; public static final List < String > requiredBitstreams = Arrays . asList ( "Application<seq2seq4repair_space>Form" , "Essay" , "Research<seq2seq4repair_space>Paper" , "Bibliography" , "Letter<seq2seq4repair_space>of<seq2seq4repair_space>Support" ) ; public static final List < String > hiddenBitstreams = Arrays . asList ( "Application<seq2seq4repair_space>Form" , "Letter<seq2seq4repair_space>of<seq2seq4repair_space>Support" ) ; private static Logger log = Logger . getLogger ( LibraryAwardUploadStep . class ) ; @ Override public int doProcessing ( Context context , HttpServletRequest request , HttpServletResponse response , SubmissionInfo subInfo ) throws IOException , SQLException , ServletException , AuthorizeException { } @ Override public int getNumberOfPages ( HttpServletRequest request , SubmissionInfo subInfo ) throws ServletException { } protected int processRemoveFile ( Context context , Item item , int bitstreamID ) throws IOException , SQLException , AuthorizeException { } protected int processUploadFile ( Context context , HttpServletRequest request , HttpServletResponse response , SubmissionInfo subInfo ) throws IOException , SQLException , ServletException , AuthorizeException { boolean formatKnown = true ; boolean fileOK = false ; BitstreamFormat bf = null ; Bitstream b = null ; LibraryAwardUploadStep . log . debug ( LogManager . getHeader ( context , "processUploadFile" , "begin" ) ) ; Enumeration attNames = request . getAttributeNames ( ) ; while ( attNames . hasMoreElements ( ) ) { String attr = ( ( String ) ( attNames . nextElement ( ) ) ) ; if ( attr . endsWith ( "-path" ) ) { String param = attr . replace ( "-path" , "" ) ; String filePath = ( ( String ) ( request . getAttribute ( ( param + "-path" ) ) ) ) ; InputStream fileInputStream = ( ( InputStream ) ( request . getAttribute ( ( param + "-inputstream" ) ) ) ) ; String fileDescription = ( ( String ) ( request . getAttribute ( ( param + "-description" ) ) ) ) ; if ( ( fileDescription == null ) || ( ( fileDescription . length ( ) ) == 0 ) ) { <START_BUG> request . getParameter ( "description" ) ; <END_BUG> } if ( ( filePath == null ) || ( fileInputStream == null ) ) { LibraryAwardUploadStep . log . info ( LogManager . getHeader ( context , "processUploadFile" , "upload<seq2seq4repair_space>error:<seq2seq4repair_space>0" ) ) ; return LibraryAwardUploadStep . STATUS_UPLOAD_ERROR ; } if ( subInfo != null ) { Item item = subInfo . getSubmissionItem ( ) . getItem ( ) ; String bundleName = "ORIGINAL" ; if ( ( fileDescription != null ) && ( LibraryAwardUploadStep . hiddenBitstreams . contains ( fileDescription ) ) ) { bundleName = "PRESERVATION" ; } Bundle [ ] bundles = item . getBundles ( bundleName ) ; if ( ( bundles . length ) < 1 ) { b = item . createSingleBitstream ( fileInputStream , bundleName ) ; } else { b = bundles [ 0 ] . createBitstream ( fileInputStream ) ; } String noPath = filePath ; while ( ( noPath . indexOf ( '//' ) ) > ( - 1 ) ) { noPath = noPath . substring ( ( ( noPath . indexOf ( '//' ) ) + 1 ) ) ; } while ( ( noPath . indexOf ( '\\' ) ) > ( - 1 ) ) { noPath = noPath . substring ( ( ( noPath . indexOf ( '\\' ) ) + 1 ) ) ; } b . setName ( noPath ) ; b . setSource ( filePath ) ; b . setDescription ( fileDescription ) ; bf = FormatIdentifier . guessFormat ( context , b ) ; b . setFormat ( bf ) ; b . update ( ) ; item . update ( ) ; if ( ( bf == null ) || ( ! ( bf . isInternal ( ) ) ) ) { fileOK = true ; } else { LibraryAwardUploadStep . log . warn ( "Attempt<seq2seq4repair_space>to<seq2seq4repair_space>upload<seq2seq4repair_space>file<seq2seq4repair_space>format<seq2seq4repair_space>marked<seq2seq4repair_space>as<seq2seq4repair_space>internal<seq2seq4repair_space>system<seq2seq4repair_space>use<seq2seq4repair_space>only" ) ; Bundle [ ] bnd = b . getBundles ( ) ; bnd [ 0 ] . removeBitstream ( b ) ; Bitstream [ ] bitstreams = bnd [ 0 ] . getBitstreams ( ) ; if ( ( bitstreams . length ) < 1 ) { item . removeBundle ( bnd [ 0 ] ) ; item . update ( ) ; } subInfo . setBitstream ( null ) ; } } else { LibraryAwardUploadStep . log . error ( LogManager . getHeader ( context , "processUploadFile" , "integrity<seq2seq4repair_space>error" ) ) ; return LibraryAwardUploadStep . STATUS_INTEGRITY_ERROR ; } if ( fileOK ) { context . commit ( ) ; subInfo . setBitstream ( b ) ; if ( bf == null ) { formatKnown = false ; } } else { LibraryAwardUploadStep . log . error ( LogManager . getHeader ( context , "processUploadFile" , "upload<seq2seq4repair_space>error:<seq2seq4repair_space>1" ) ) ; return LibraryAwardUploadStep . STATUS_UPLOAD_ERROR ; } } } if ( ! formatKnown ) { return LibraryAwardUploadStep . STATUS_UNKNOWN_FORMAT ; } else { return STATUS_COMPLETE ; } } protected int processSaveFileFormat ( Context context , HttpServletRequest request , HttpServletResponse response , SubmissionInfo subInfo ) throws IOException , SQLException , ServletException , AuthorizeException { } protected int processSaveFileDescription ( Context context , HttpServletRequest request , HttpServletResponse response , SubmissionInfo subInfo ) throws IOException , SQLException , ServletException , AuthorizeException { } public static List < String > getNeededBitstreams ( Context context , HttpServletRequest request , SubmissionInfo subInfo ) throws IOException , SQLException , ServletException , AuthorizeException { }

Fix:
fileDescription = request . getParameter ( "description" ) ;