Source:
<code>public void addVNFCInstance(String id, String idVnf, VNFComponent component, String projectId) throws NotFoundException, BadFormatException, WrongStatusException { log.info("Adding new VNFCInstance to VNFR with id: " + idVnf); NetworkServiceRecord networkServiceRecord = getNetworkServiceRecordInActiveState(id); if (!networkServiceRecord.getProjectId().equals(projectId)) { throw new UnauthorizedUserException( "NSR not under the project chosen, are you trying to hack us? Just kidding, it's a bug :)"); } VirtualNetworkFunctionRecord virtualNetworkFunctionRecord = getVirtualNetworkFunctionRecord(idVnf, networkServiceRecord); if (!virtualNetworkFunctionRecord.getProjectId().equals(projectId)) { throw new UnauthorizedUserException( "VNFR not under the project chosen, are you trying to hack us? Just kidding, it's a bug :)"); } List<VirtualDeploymentUnit> vdusFound = new LinkedList<>(); VirtualDeploymentUnit virtualDeploymentUnit = null; for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) { if (vdu.getProjectId() != null && vdu.getProjectId().equals(projectId)) vdusFound.add(vdu); } if (vdusFound.size() == 0) throw new NotFoundException("No VirtualDeploymentUnit found"); for (VirtualDeploymentUnit vdu : vdusFound) { <START> if (vdu.getScale_in_out() == vdu.getVnfc_instance().size()) continue; <END> virtualDeploymentUnit = vdu; break; } if (virtualDeploymentUnit == null) throw new WrongStatusException( "All VirtualDeploymentUnits have reached their maximum number of VNFCInstances"); log.debug("A new VNFCInstance will be added to the VDU with id " + virtualDeploymentUnit.getId()); networkServiceRecord.setStatus(Status.SCALING); networkServiceRecord = nsrRepository.save(networkServiceRecord); scaleOUT( networkServiceRecord, virtualNetworkFunctionRecord, virtualDeploymentUnit, component, ""); }</code><technical_language>if vdu.getVnfc_instance().size() is vdu.getScale_in_out()? scalable in this case, it</technical_language>

Target:
public void addVNFCInstance(String id, String idVnf, VNFComponent component, String projectId) throws NotFoundException, BadFormatException, WrongStatusException { log.info("Adding new VNFCInstance to VNFR with id: " + idVnf); NetworkServiceRecord networkServiceRecord = getNetworkServiceRecordInActiveState(id); if (!networkServiceRecord.getProjectId().equals(projectId)) { throw new UnauthorizedUserException( "NSR not under the project chosen, are you trying to hack us? Just kidding, it's a bug :)"); } VirtualNetworkFunctionRecord virtualNetworkFunctionRecord = getVirtualNetworkFunctionRecord(idVnf, networkServiceRecord); if (!virtualNetworkFunctionRecord.getProjectId().equals(projectId)) { throw new UnauthorizedUserException( "VNFR not under the project chosen, are you trying to hack us? Just kidding, it's a bug :)"); } List<VirtualDeploymentUnit> vdusFound = new LinkedList<>(); VirtualDeploymentUnit virtualDeploymentUnit = null; for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) { if (vdu.getProjectId() != null && vdu.getProjectId().equals(projectId)) vdusFound.add(vdu); } if (vdusFound.size() == 0) throw new NotFoundException("No VirtualDeploymentUnit found"); for (VirtualDeploymentUnit vdu : vdusFound) { if (vdu.getScale_in_out() == vdu.getVnfc_instance().size()) continue; virtualDeploymentUnit = vdu; break; } if (virtualDeploymentUnit == null) throw new NotFoundException( "All VirtualDeploymentUnits have reached their maximum number of VNFCInstances"); log.debug( "A new VNFCInstance will be added to the VDU with id " + virtualDeploymentUnit.getId()); networkServiceRecord.setStatus(Status.SCALING); networkServiceRecord = nsrRepository.save(networkServiceRecord); scaleOUT( networkServiceRecord, virtualNetworkFunctionRecord, virtualDeploymentUnit, component, ""); }