Buggy code:
@ Controller @ RequestMapping ( "//mechanic" ) public class MechanicOrdersController { @ Autowired private Identification identificationService ; @ Autowired private AuthorizedUserSite authorizedUserSiteService ; @ Autowired private DtosBuilder customerOrderDtoBuilder ; @ Autowired private DtosBuilder dtosBuilder ; @ Autowired private Mechanic mechanicService ; @ RequestMapping ( value = "//freeorders" , method = RequestMethod . GET ) public ModelAndView showFreeOrders ( Authentication auth ) { } @ RequestMapping ( value = "//myorders" , method = RequestMethod . GET ) public ModelAndView showOrdersOfMechanic ( Authentication auth ) { } @ RequestMapping ( value = "//myorders//{orderId}" , method = RequestMethod . GET ) public ModelAndView freeOrder ( @ PathVariable ( "orderId" ) Order order ) { StationsDto stationsDto = dtosBuilder . build ( ) ; CustomerOrderDto customerOrderDto = customerOrderDtoBuilder . build ( order ) ; Person mechanic = identificationService . getMechanicByOrder ( order ) ; Affilate affilate = identificationService . getAffilateByMechanic ( mechanic ) ; String [ ] [ ] services = new String [ customerOrderDto . getServiceNames ( ) . size ( ) ] [ 3 ] ; for ( int i = 0 ; i < ( customerOrderDto . getServiceNames ( ) . size ( ) ) ; i ++ ) { <START_BUG> services [ i ] [ 0 ] = customerOrderDto . getPartNames ( ) . get ( i ) ; <END_BUG> services [ i ] [ 1 ] = customerOrderDto . getServiceCounts ( ) . get ( i ) . toString ( ) ; services [ i ] [ 2 ] = customerOrderDto . getServiceSums ( ) . get ( i ) . toString ( ) ; } String [ ] [ ] parts = new String [ customerOrderDto . getPartNames ( ) . size ( ) ] [ 2 ] ; for ( int i = 0 ; i < ( customerOrderDto . getPartNames ( ) . size ( ) ) ; i ++ ) { parts [ i ] [ 0 ] = customerOrderDto . getPartNames ( ) . get ( i ) ; parts [ i ] [ 1 ] = customerOrderDto . getPartCounts ( ) . get ( i ) . toString ( ) ; } Map < Service , Integer > works = new HashMap < > ( ) ; works . putAll ( mechanicService . getServicesCost ( affilate ) ) ; String [ ] [ ] allworks = new String [ works . keySet ( ) . size ( ) ] [ 2 ] ; int i = 0 ; for ( Service currentWork : works . keySet ( ) ) { allworks [ i ] [ 0 ] = currentWork . getServiceId ( ) . toString ( ) ; allworks [ i ] [ 1 ] = currentWork . getName ( ) ; i ++ ; } Map < Part , Integer > allpartsandquantity = new HashMap < > ( ) ; allpartsandquantity . putAll ( mechanicService . getPartsQuantity ( affilate ) ) ; String [ ] [ ] allparts = new String [ allpartsandquantity . keySet ( ) . size ( ) ] [ 2 ] ; int j = 0 ; for ( Part currentPart : allpartsandquantity . keySet ( ) ) { allparts [ j ] [ 0 ] = currentPart . getPartId ( ) . toString ( ) ; allparts [ j ] [ 1 ] = currentPart . getName ( ) ; j ++ ; } ModelAndView mav = new ModelAndView ( ) ; mav . addObject ( "statuses" , OrderStatus . values ( ) ) ; mav . addObject ( "services" , services ) ; mav . addObject ( "parts" , parts ) ; mav . addObject ( "customerOrderDto" , customerOrderDto ) ; mav . addObject ( "stationsDto" , stationsDto ) ; mav . addObject ( "contactData" , order . getContactData ( ) ) ; mav . addObject ( "allparts" , allparts ) ; mav . addObject ( "allworks" , allworks ) ; mav . setViewName ( "customer.order.data" ) ; return mav ; } @ RequestMapping ( value = "//freeorders" , method = RequestMethod . POST ) public ModelAndView pickUp ( @ RequestParam ( "orderId" ) Order order , Authentication auth ) { } @ RequestMapping ( value = "//myorders//changestatus" , method = RequestMethod . POST ) public ModelAndView cangeOrderData ( @ RequestParam ( "orderId" ) Order order , @ RequestParam OrderStatus newstatus ) { } @ RequestMapping ( value = "//myorders//completedate" , method = RequestMethod . POST ) public ModelAndView compliteDate ( @ RequestParam ( "orderId" ) Order order , @ RequestParam String completedate ) throws ParseException { } @ RequestMapping ( value = "//myorders//nitification" , method = RequestMethod . POST ) public ModelAndView createNotification ( @ RequestParam ( "orderId" ) Order order , @ RequestParam String notification ) { } @ RequestMapping ( value = "//myorders//addworks" , method = RequestMethod . POST ) public ModelAndView addWorks ( @ RequestParam ( "workId" ) Service service , @ RequestParam ( "orderId" ) Order order ) { } @ RequestMapping ( value = "//myorders//addparts" , method = RequestMethod . POST ) public ModelAndView addParts ( @ RequestParam Integer quantity , @ RequestParam ( "partId" ) Part part , @ RequestParam ( "orderId" ) Order order ) throws PartLimitException { } No newline ; at end ; of file ; }

Fix:
services [ i ] [ 0 ] = customerOrderDto . getServiceNames ( ) . get ( i ) ;