Buggy code:
@ Service public class ProductionRecordService { private static final String L_ORDER_OPERATION_COMPONENTS = "orderOperationComponents" ; private static final String L_STATE = "state" ; private static final String L_TYPE_OF_PRODUCTION_RCORDING = "typeOfProductionRecording" ; @ Autowired private DataDefinitionService dataDefinitionService ; @ Autowired private NumberGeneratorService numberGeneratorService ; @ Autowired private ProductQuantitiesService productQuantitiesService ; @ Autowired private NumberService numberService ; @ Autowired OrderRealizationTimeService orderRealizationTimeService ; public void generateData ( final DataDefinition productionRecordDD , final Entity productionRecord ) { } public boolean checkTypeOfProductionRecording ( final DataDefinition productionRecordDD , final Entity productionRecord ) { } public boolean isValidTypeOfProductionRecording ( final Entity productionRecord , final String typeOfProductionRecording , final DataDefinition productionRecordDD ) { } public boolean willOrderAcceptOneMore ( final DataDefinition productionRecordDD , final Entity productionRecord ) { } boolean willOrderAcceptOneMoreValidator ( final List < Entity > productionCountings , final Entity productionRecord , final DataDefinition dd ) { } public boolean checkIfOrderIsStarted ( final DataDefinition dd , final Entity entity ) { } public void copyProductsFromOrderOperation ( final DataDefinition productionRecordDD , final Entity productionRecord ) { } private void copyOperationProductComponents ( final List < Entity > orderOperations , final Entity productionRecord , final String modelName ) { } public boolean checkIfOperationIsSet ( final DataDefinition productionRecordDD , final Entity productionRecord ) { } public void countPlannedTimeAndBalance ( final DataDefinition productionRecordDD , final Entity productionRecord ) { } public final void changeStateToDefault ( final DataDefinition productionRecordDD , final Entity productionRecord ) { } public final void fillShiftAndDivisionField ( final ViewDefinitionState view , final ComponentState component , final String [ ] args ) { } public final void fillShiftAndDivisionField ( final ViewDefinitionState view ) { } public final void fillDivisionField ( final ViewDefinitionState view , final ComponentState component , final String [ ] args ) { } public final void fillDivisionField ( final ViewDefinitionState view ) { } private void countPlannedTime ( final Entity productionRecord , final EntityTreeNode operationComponents , final Entity orderOperComp ) { } <START_BUG> private void countTimeOperation ( final Entity orderOperationComponent , Map < String , BigDecimal > plannedTimeValues , final Integer durationOfOperation ) { <END_BUG> BigDecimal durationOfOperationComponent = new BigDecimal ( durationOfOperation ) ; BigDecimal plannedTime = plannedTimeValues . get ( PLANNED_TIME ) . add ( durationOfOperationComponent ) ; plannedTimeValues . put ( PLANNED_TIME , plannedTime ) ; BigDecimal plannedMachineTime = plannedTimeValues . get ( PLANNED_MACHINE_TIME ) . add ( durationOfOperationComponent . multiply ( ProductionRecordService . getBigDecimal ( orderOperationComponent . getField ( "machineUtilization" ) ) , numberService . getMathContext ( ) ) , numberService . getMathContext ( ) ) ; plannedTimeValues . put ( PLANNED_MACHINE_TIME , plannedMachineTime ) ; BigDecimal plannedLaborTime = plannedTimeValues . get ( PLANNED_LABOR_TIME ) . add ( durationOfOperationComponent . multiply ( ProductionRecordService . getBigDecimal ( orderOperationComponent . getField ( "laborUtilization" ) ) , numberService . getMathContext ( ) ) , numberService . getMathContext ( ) ) ; plannedTimeValues . put ( PLANNED_LABOR_TIME , plannedLaborTime ) ; } private void countTimeBalance ( final Entity productionRecord ) { } private static boolean checkIfOperationListIsEmpty ( final List < Entity > orderOperations ) { } private FieldComponent getFieldComponent ( final ViewDefinitionState view , final String name ) { } public static BigDecimal getBigDecimal ( final Object value ) { } public static Integer getInteger ( final Object value ) { } public static Boolean getBooleanValue ( final Object fieldValue ) { } }

Fix:
private void countTimeOperation ( final Entity orderOperationComponent , final Map < String , BigDecimal > plannedTimeValues , final Integer durationOfOperation ) {