Buggy code:
public class PortfolioCapture { public static void main ( String [ ] args ) { } public void capturePages ( String filePath ) { Document document = new Document ( ) ; ExecutorService executorService = Executors . newFixedThreadPool ( 8 ) ; try { document . setFile ( filePath ) ; if ( ( ( document . getCatalog ( ) . getNames ( ) ) != null ) && ( ( document . getCatalog ( ) . getNames ( ) . getEmbeddedFilesNameTree ( ) ) != null ) ) { NameTree embeddedFilesNameTree = document . getCatalog ( ) . getNames ( ) . getEmbeddedFilesNameTree ( ) ; if ( ( embeddedFilesNameTree . getRoot ( ) ) != null ) { Library library = document . getCatalog ( ) . getLibrary ( ) ; <START_BUG> List filePairs = embeddedFilesNameTree . getRoot ( ) . getNamesAndValues ( ) ; <END_BUG> List < Callable < Void > > callables = new ArrayList < Callable < Void > > ( ( ( filePairs . size ( ) ) // 2 ) ) ; for ( int i = 0 , max = filePairs . size ( ) ; i < max ; i += 2 ) { String fileName = Utils . convertStringObject ( library , ( ( StringObject ) ( filePairs . get ( i ) ) ) ) ; HashMap tmp = ( ( HashMap ) ( library . getObject ( ( ( Reference ) ( filePairs . get ( ( i + 1 ) ) ) ) ) ) ) ; FileSpecification fileSpec = new FileSpecification ( library , tmp ) ; tmp = fileSpec . getEmbeddedFileDictionary ( ) ; Reference fileRef = ( ( Reference ) ( tmp . get ( F_KEY ) ) ) ; Stream fileStream = ( ( Stream ) ( library . getObject ( fileRef ) ) ) ; InputStream fileInputStream = fileStream . getDecodedByteArrayInputStream ( ) ; System . out . println ( ( "Loading<seq2seq4repair_space>embedded<seq2seq4repair_space>file:<seq2seq4repair_space>" + fileName ) ) ; Document embeddedDocument = new Document ( ) ; embeddedDocument . setInputStream ( fileInputStream , fileName ) ; callables . add ( new PortfolioCapture . CaptureDocument ( embeddedDocument , i , fileName ) ) ; } executorService . invokeAll ( callables ) ; executorService . submit ( new PortfolioCapture . DocumentCloser ( document ) ) . get ( ) ; } } } catch ( PDFException ex ) { System . out . println ( ( "Error<seq2seq4repair_space>parsing<seq2seq4repair_space>PDF<seq2seq4repair_space>document<seq2seq4repair_space>" + ex ) ) ; } catch ( PDFSecurityException ex ) { System . out . println ( ( "Error<seq2seq4repair_space>encryption<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>" + ex ) ) ; } catch ( FileNotFoundException ex ) { System . out . println ( ( "Error<seq2seq4repair_space>file<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>" + ex ) ) ; } catch ( IOException ex ) { System . out . println ( ( "Error<seq2seq4repair_space>handling<seq2seq4repair_space>PDF<seq2seq4repair_space>document<seq2seq4repair_space>" + ex ) ) ; } catch ( InterruptedException e ) { System . out . println ( ( "Error<seq2seq4repair_space>parsing<seq2seq4repair_space>PDF<seq2seq4repair_space>document<seq2seq4repair_space>" + e ) ) ; } catch ( ExecutionException e ) { System . out . println ( ( "Error<seq2seq4repair_space>parsing<seq2seq4repair_space>PDF<seq2seq4repair_space>document<seq2seq4repair_space>" + e ) ) ; } executorService . shutdown ( ) ; } public class CaptureDocument implements Callable < Void > { private Document document ; private String fileName ; private int fileIndex ; private float scale = 1.0F ; private float rotation = 0.0F ; private CaptureDocument ( Document document , int fileIndex , String fileName ) { } public Void call ( ) { } } public class DocumentCloser implements Callable < Void > { private Document document ; private DocumentCloser ( Document document ) { } public Void call ( ) { } } }

Fix:
List filePairs = embeddedFilesNameTree . getNamesAndValues ( ) ;