Buggy code:
@ Parameter ( names = "--imageHeight" , description = "The<seq2seq4repair_space>height<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>entire<seq2seq4repair_space>image<seq2seq4repair_space>(all<seq2seq4repair_space>layers),<seq2seq4repair_space>for<seq2seq4repair_space>consistent<seq2seq4repair_space>mesh<seq2seq4repair_space>computation" , required = true ) private int imageHeight ; @ Parameter ( names = "--targetDir" , description = "Directory<seq2seq4repair_space>to<seq2seq4repair_space>output<seq2seq4repair_space>the<seq2seq4repair_space>new<seq2seq4repair_space>tilespec<seq2seq4repair_space>files" , required = true ) public String targetDir ; @ Parameter ( names = "--maxLayersDistance" , description = "The<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>neighboring<seq2seq4repair_space>layers<seq2seq4repair_space>to<seq2seq4repair_space>match" , required = false ) private int maxLayersDistance ; @ Parameter ( names = "--modelIndex" , description = "Model<seq2seq4repair_space>Index:<seq2seq4repair_space>0=Translation,<seq2seq4repair_space>1=Rigid,<seq2seq4repair_space>2=Similarity,<seq2seq4repair_space>3=Affine,<seq2seq4repair_space>4=Homography" , required = false ) private int modelIndex = 1 ; @ Parameter ( names = "--layerScale" , description = "Layer<seq2seq4repair_space>scale" , required = false ) private float layerScale = 0.1F ; @ Parameter ( names = "--resolutionSpringMesh" , description = "resolutionSpringMesh" , required = false ) private int resolutionSpringMesh = 32 ; @ Parameter ( names = "--stiffnessSpringMesh" , description = "stiffnessSpringMesh" , required = false ) private float stiffnessSpringMesh = 0.1F ; @ Parameter ( names = "--dampSpringMesh" , description = "dampSpringMesh" , required = false ) private float dampSpringMesh = 0.9F ; @ Parameter ( names = "--maxStretchSpringMesh" , description = "maxStretchSpringMesh" , required = false ) private float maxStretchSpringMesh = 2000.0F ; @ Parameter ( names = "--maxEpsilon" , description = "maxEpsilon" , required = false ) private float maxEpsilon = 200.0F ; @ Parameter ( names = "--maxIterationsSpringMesh" , description = "maxIterationsSpringMesh" , required = false ) private int maxIterationsSpringMesh = 1000 ; @ Parameter ( names = "--maxPlateauwidthSpringMesh" , description = "maxPlateauwidthSpringMesh" , required = false ) private int maxPlateauwidthSpringMesh = 200 ; @ Parameter ( names = "--useLegacyOptimizer" , description = "Use<seq2seq4repair_space>legacy<seq2seq4repair_space>optimizer" , required = false ) private boolean useLegacyOptimizer = false ; @ Parameter ( names = "--threads" , description = "Number<seq2seq4repair_space>of<seq2seq4repair_space>threads<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>used" , required = false ) public int numThreads = Runtime . getRuntime ( ) . availableProcessors ( ) ; @ Parameter ( names = "--fromLayer" , description = "The<seq2seq4repair_space>layer<seq2seq4repair_space>to<seq2seq4repair_space>start<seq2seq4repair_space>the<seq2seq4repair_space>optimization<seq2seq4repair_space>from<seq2seq4repair_space>(default:<seq2seq4repair_space>first<seq2seq4repair_space>layer<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>tile<seq2seq4repair_space>specs<seq2seq4repair_space>data)" , required = false ) private int fromLayer = - 1 ; @ Parameter ( names = "--toLayer" , description = "The<seq2seq4repair_space>last<seq2seq4repair_space>layer<seq2seq4repair_space>to<seq2seq4repair_space>include<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>optimization<seq2seq4repair_space>(default:<seq2seq4repair_space>last<seq2seq4repair_space>layer<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>tile<seq2seq4repair_space>specs<seq2seq4repair_space>data)" , required = false ) private int toLayer = - 1 ; @ Parameter ( names = "--skipLayers" , description = "The<seq2seq4repair_space>layers<seq2seq4repair_space>ranges<seq2seq4repair_space>that<seq2seq4repair_space>will<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>processed<seq2seq4repair_space>(default:<seq2seq4repair_space>none)" , required = false ) private String skippedLayers = "" ; } private OptimizeLayersElastic ( ) { } private static Map < Integer , Map < Integer , CorrespondenceSpec > > parseCorrespondenceFiles ( final List < String > fileUrls , final HashMap < String , Integer > tsUrlToLayerIds ) { } private static int readLayerFromFile ( String tsUrl ) { } private static Map < Integer , Map < Integer , CorrespondenceSpec > > parseCorrespondenceFiles ( final List < String > fileUrls , final HashMap < String , Integer > tsUrlToLayerIds , final int threadsNum ) { } private static ArrayList < Tile < ? > > createLayersModels ( int layersNum , int desiredModelIndex ) { } private static boolean compareArrays ( float [ ] a , float [ ] b ) { } private static List < PointMatch > fixPointMatchVertices ( List < PointMatch > pms , ArrayList < Vertex > vertices ) { } private static void adjustTargetPointMatchVertices ( final List < PointMatch > pms , final SpringMesh mesh ) { } private static ArrayList < SpringMesh > fixSubAllPointMatchVertices ( final OptimizeLayersElastic . Params param , final Map < Integer , Map < Integer , CorrespondenceSpec > > layersCorrs , final int startLayer , final int endLayer ) { } private static ArrayList < SpringMesh > fixAllPointMatchVertices ( final OptimizeLayersElastic . Params param , final Map < Integer , Map < Integer , CorrespondenceSpec > > layersCorrs , final int startLayer , final int endLayer , final int threadsNum ) { System . out . println ( ( ( "Fixing<seq2seq4repair_space>the<seq2seq4repair_space>point<seq2seq4repair_space>matches<seq2seq4repair_space>vertices<seq2seq4repair_space>with<seq2seq4repair_space>" + threadsNum ) + "<seq2seq4repair_space>threads" ) ) ; if ( threadsNum == 1 ) return OptimizeLayersElastic . fixSubAllPointMatchVertices ( param , layersCorrs , startLayer , endLayer ) ; final ExecutorService exec = Executors . newFixedThreadPool ( threadsNum ) ; final ArrayList < Future < ArrayList < SpringMesh > > > tasks = new ArrayList < Future < ArrayList < SpringMesh > > > ( ) ; final Distributer distributer = new Distributer ( ( ( endLayer - startLayer ) + 1 ) , threadsNum ) ; for ( int i = 0 ; ( i < threadsNum ) && ( distributer . hasNext ( ) ) ; i ++ ) { distributer . next ( ) ; final int fromIndex = startLayer + ( distributer . getStart ( ) ) ; final int lastIndex = startLayer + ( distributer . getEnd ( ) ) ; tasks . add ( exec . submit ( new Callable < ArrayList < SpringMesh > > ( ) { @ Override public ArrayList < SpringMesh > call ( ) throws Exception { <START_BUG> return OptimizeLayersElastic . fixSubAllPointMatchVertices ( param , layersCorrs , fromIndex , lastIndex ) ; <END_BUG> } } ) ) ; } final ArrayList < SpringMesh > meshes = new ArrayList < SpringMesh > ( ( ( endLayer - startLayer ) + 1 ) ) ; for ( Future < ArrayList < SpringMesh > > task : tasks ) { try { final ArrayList < SpringMesh > curMeshes = task . get ( ) ; meshes . addAll ( curMeshes ) ; } catch ( InterruptedException e ) { exec . shutdownNow ( ) ; e . printStackTrace ( ) ; } catch ( ExecutionException e ) { exec . shutdownNow ( ) ; e . printStackTrace ( ) ; } } exec . shutdown ( ) ; return meshes ; } private static void matchLayers ( final ArrayList < SpringMesh > meshes , final ArrayList < Tile < ? > > tiles , final TileConfiguration initMeshes , final Map < Integer , Map < Integer , CorrespondenceSpec > > layersCorrs , final List < Integer > fixedLayers , final int startLayer , final int endLayer , final Set < Integer > skippedLayers , final int maxDistance ) { }

Fix:
return OptimizeLayersElastic . fixSubAllPointMatchVertices ( param , layersCorrs , fromIndex , ( lastIndex - 1 ) ) ;