Program: 58834
Project: 58834
Buggy source:
public void chargeByMachineMinutes(ActionRequest request,ActionResponse response) throws AxelorException {
  List<Map<String,Object>> dataList=new ArrayList<Map<String,Object>>();
  DateTimeFormatter parser=ISODateTimeFormat.dateTime();
  LocalDateTime fromDateTime=LocalDateTime.parse(request.getContext().get("String_Node_Str").toString(),parser);
  LocalDateTime toDateTime=LocalDateTime.parse(request.getContext().get("String_Node_Str").toString(),parser);
  LocalDateTime itDateTime=new LocalDateTime(fromDateTime);
  if (Days.daysBetween(new LocalDate(fromDateTime.getYear(),fromDateTime.getMonthOfYear(),fromDateTime.getDayOfMonth()),new LocalDate(toDateTime.getYear(),toDateTime.getMonthOfYear(),toDateTime.getDayOfMonth())).getDays() > 5) {
    throw new AxelorException(String.format(I18n.get(IExceptionMessage.CHARGE_MACHINE_DAYS)),IException.CONFIGURATION_ERROR);
  }
  List<OperationOrder> operationOrderListTemp=operationOrderRepo.all().filter("String_Node_Str",fromDateTime,toDateTime).fetch();
  Set<String> machineNameList=new HashSet<String>();
  for (  OperationOrder operationOrder : operationOrderListTemp) {
    if (operationOrder.getWorkCenter() != null && operationOrder.getWorkCenter().getMachine() != null) {
      if (!machineNameList.contains(operationOrder.getWorkCenter().getMachine().getName())) {
        machineNameList.add(operationOrder.getWorkCenter().getMachine().getName());
      }
    }
  }
  while (!itDateTime.isAfter(toDateTime)) {
    List<OperationOrder> operationOrderList=operationOrderRepo.all().filter("String_Node_Str",itDateTime).fetch();
    Map<String,BigDecimal> map=new HashMap<String,BigDecimal>();
    for (    OperationOrder operationOrder : operationOrderList) {
      if (operationOrder.getWorkCenter() != null && operationOrder.getWorkCenter().getMachine() != null) {
        String machine=operationOrder.getWorkCenter().getMachine().getName();
        if (map.containsKey(machine)) {
          map.put(machine,map.get(machine).add(BigDecimal.ONE));
        }
 else {
          map.put(machine,BigDecimal.ONE);
        }
      }
    }
    Set<String> keyList=map.keySet();
    for (    String key : machineNameList) {
      if (keyList.contains(key)) {
        Map<String,Object> dataMap=new HashMap<String,Object>();
        dataMap.put("String_Node_Str",(Object)itDateTime.toString());
        dataMap.put("String_Node_Str",(Object)map.get(key).multiply(new BigDecimal(100)));
        dataMap.put("String_Node_Str",(Object)key);
        dataList.add(dataMap);
      }
 else {
        Map<String,Object> dataMap=new HashMap<String,Object>();
        dataMap.put("String_Node_Str",(Object)itDateTime.toString());
        dataMap.put("String_Node_Str",(Object)BigDecimal.ZERO);
        dataMap.put("String_Node_Str",(Object)key);
        dataList.add(dataMap);
      }
    }
    itDateTime=itDateTime.plusMinutes(1);
  }
  response.setData(dataList);
}

Fixed version (ground truth):
public void chargeByMachineMinutes(ActionRequest request,ActionResponse response) throws AxelorException {
  List<Map<String,Object>> dataList=new ArrayList<Map<String,Object>>();
  DateTimeFormatter parser=ISODateTimeFormat.dateTime();
  LocalDateTime fromDateTime=LocalDateTime.parse(request.getContext().get("String_Node_Str").toString(),parser);
  LocalDateTime toDateTime=LocalDateTime.parse(request.getContext().get("String_Node_Str").toString(),parser);
  LocalDateTime itDateTime=new LocalDateTime(fromDateTime);
  if (Days.daysBetween(new LocalDate(fromDateTime.getYear(),fromDateTime.getMonthOfYear(),fromDateTime.getDayOfMonth()),new LocalDate(toDateTime.getYear(),toDateTime.getMonthOfYear(),toDateTime.getDayOfMonth())).getDays() > 5) {
    throw new AxelorException(String.format(I18n.get(IExceptionMessage.CHARGE_MACHINE_DAYS)),IException.CONFIGURATION_ERROR);
  }
  List<OperationOrder> operationOrderListTemp=operationOrderRepo.all().filter("String_Node_Str",fromDateTime,toDateTime).fetch();
  Set<String> machineNameList=new HashSet<String>();
  for (  OperationOrder operationOrder : operationOrderListTemp) {
    if (operationOrder.getWorkCenter() != null && operationOrder.getWorkCenter().getMachine() != null) {
      if (!machineNameList.contains(operationOrder.getWorkCenter().getMachine().getName())) {
        machineNameList.add(operationOrder.getWorkCenter().getMachine().getName());
      }
    }
  }
  while (!itDateTime.isAfter(toDateTime)) {
    List<OperationOrder> operationOrderList=operationOrderRepo.all().filter("String_Node_Str",itDateTime).fetch();
    Map<String,BigDecimal> map=new HashMap<String,BigDecimal>();
    for (    OperationOrder operationOrder : operationOrderList) {
      if (operationOrder.getWorkCenter() != null && operationOrder.getWorkCenter().getMachine() != null) {
        String machine=operationOrder.getWorkCenter().getMachine().getName();
        if (map.containsKey(machine)) {
          map.put(machine,map.get(machine).add(BigDecimal.ONE));
        }
 else {
          map.put(machine,BigDecimal.ONE);
        }
      }
    }
    Set<String> keyList=map.keySet();
    for (    String key : machineNameList) {
      if (keyList.contains(key)) {
        Map<String,Object> dataMap=new HashMap<String,Object>();
        if (Hours.hoursBetween(fromDateTime,toDateTime).getHours() > 24) {
          dataMap.put("String_Node_Str",(Object)itDateTime.toString("String_Node_Str"));
        }
 else {
          dataMap.put("String_Node_Str",(Object)itDateTime.toString("String_Node_Str"));
        }
        dataMap.put("String_Node_Str",(Object)map.get(key).multiply(new BigDecimal(100)));
        dataMap.put("String_Node_Str",(Object)key);
        dataList.add(dataMap);
      }
 else {
        Map<String,Object> dataMap=new HashMap<String,Object>();
        if (Hours.hoursBetween(fromDateTime,toDateTime).getHours() > 24) {
          dataMap.put("String_Node_Str",(Object)itDateTime.toString("String_Node_Str"));
        }
 else {
          dataMap.put("String_Node_Str",(Object)itDateTime.toString("String_Node_Str"));
        }
        dataMap.put("String_Node_Str",(Object)BigDecimal.ZERO);
        dataMap.put("String_Node_Str",(Object)key);
        dataList.add(dataMap);
      }
    }
    itDateTime=itDateTime.plusMinutes(1);
  }
  response.setData(dataList);
}