Buggy code:
public class FileListenerThread implements Runnable { private volatile boolean isDone = false ; private final FileListener fileListener ; private final PartnerConnection partnerConnection ; FileListenerThread ( FileListener fileListener , PartnerConnection partnerConnection ) throws ConnectionException , IOException { } public void run ( ) { System . out . println ( ( ( "Starting<seq2seq4repair_space>FileListener<seq2seq4repair_space>for<seq2seq4repair_space>Dataset<seq2seq4repair_space>{" + ( fileListener . getDataset ( ) ) ) + "}<seq2seq4repair_space>" ) ) ; try { while ( ! ( isDone ) ) { try { long cutOff = ( System . currentTimeMillis ( ) ) - ( fileListener . getFileAge ( ) ) ; IOFileFilter ageFilter = FileFilterUtils . ageFileFilter ( cutOff ) ; IOFileFilter nameFilter = FileFilterUtils . nameFileFilter ( fileListener . getInputFilePattern ( ) , IOCase . INSENSITIVE ) ; IOFileFilter andFilter = FileFilterUtils . and ( nameFilter , ageFilter ) ; File [ ] files = FileListenerThread . getFiles ( fileListener . fileDir , andFilter ) ; if ( files == null ) { try { Thread . sleep ( fileListener . getPollingInterval ( ) ) ; } catch ( Throwable t ) { t . printStackTrace ( ) ; } if ( isDone ) break ; else continue ; } for ( File file : files ) { PrintStream logger = null ; Session session = null ; try { String orgId = null ; orgId = partnerConnection . getUserInfo ( ) . getOrganizationId ( ) ; <START_BUG> session = Session . getCurrentSession ( orgId , fileListener . getDataset ( ) ) ; <END_BUG> session . start ( ) ; File logFile = session . getSessionLog ( ) ; logger = new PrintStream ( new FileOutputStream ( logFile ) , true , "UTF-8" ) ; boolean status = DatasetLoader . uploadDataset ( file . toString ( ) , fileListener . getUploadFormat ( ) , fileListener . cea , fileListener . charset , fileListener . getDataset ( ) , fileListener . getApp ( ) , fileListener . getDatasetLabel ( ) , fileListener . getOperation ( ) , fileListener . isUseBulkAPI ( ) , partnerConnection , logger ) ; if ( status ) session . end ( ) ; else session . fail ( "Check<seq2seq4repair_space>sessionLog<seq2seq4repair_space>for<seq2seq4repair_space>details" ) ; FileListenerThread . moveInputFile ( file , status , session ) ; } catch ( Throwable t ) { if ( logger != null ) t . printStackTrace ( logger ) ; else t . printStackTrace ( ) ; if ( session != null ) session . fail ( "Check<seq2seq4repair_space>sessionLog<seq2seq4repair_space>for<seq2seq4repair_space>details" ) ; } finally { if ( logger != null ) logger . close ( ) ; logger = null ; } } } catch ( Throwable t ) { t . printStackTrace ( ) ; } } } catch ( Throwable t ) { System . out . println ( ( ( ( Thread . currentThread ( ) . getName ( ) ) + "<seq2seq4repair_space>" ) + ( t . getMessage ( ) ) ) ) ; } System . out . println ( ( ( "Starting<seq2seq4repair_space>FileListener<seq2seq4repair_space>for<seq2seq4repair_space>Dataset<seq2seq4repair_space>{" + ( fileListener . getDataset ( ) ) ) + "}<seq2seq4repair_space>" ) ) ; isDone = true ; } public boolean isDone ( ) { } public static File [ ] getFiles ( File directory , IOFileFilter fileFilter ) { } public static void moveInputFile ( File inputFile , boolean isSuccess , Session session ) { } No newline ; at end ; of file ; }

Fix:
session = Session . getCurrentSession ( orgId , fileListener . getDataset ( ) , true ) ;