auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }
Source:
private static void logField ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromOvf , java.lang.String fieldName , java.lang.String fieldValue ) { java.lang.String vmName = vmStaticFromOvf.getVmName ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.AddCustomValue ( "FieldName" , fieldName ) ; logable.AddCustomValue ( "VmName" , vmName ) ; logable.AddCustomValue ( "FieldValue" , fieldValue ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_IMPORT_INFO ) ; }

Target:
private static void logField ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromOvf , java.lang.String fieldName , java.lang.String fieldValue ) { java.lang.String vmName = vmStaticFromOvf.getVmName ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "FieldName" , fieldName ) ; logable.addCustomValue ( "VmName" , vmName ) ; logable.addCustomValue ( "FieldValue" , fieldValue ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_IMPORT_INFO ) ; }
Source:
protected void addItemText ( java.lang.Object item ) { java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > > entry = ( ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > > ) ( item ) ) ; org.ovirt.engine.ui.common.widget.EntityModelCheckBoxWidget cb = new org.ovirt.engine.ui.common.widget.EntityModelCheckBoxWidget ( org.ovirt.engine.ui.common.widget.Align.RIGHT , ( "- " + ( entry.getValue ( ) . getMessage ( ) ) ) , entry.getValue ( ) . getTitle ( ) ) ; cb.edit ( entry.getValue ( ) ) ; itemPanel.add ( cb ) ; }

Target:
protected void addItemText ( java.lang.Object item ) { java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > > entry = ( ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > > ) ( item ) ) ; org.ovirt.engine.ui.common.widget.EntityModelCheckBoxWidget cb = new org.ovirt.engine.ui.common.widget.EntityModelCheckBoxWidget ( org.ovirt.engine.ui.common.widget.Align.RIGHT , ( "- " + ( entry.getValue ( ) . getMessage ( ) ) ) , entry.getValue ( ) . getTitle ( ) ) ; cb.edit ( entry.getValue ( ) ) ; itemColumn.add ( cb ) ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolEqual ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( true ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4BootProtocolDifferent ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
public void setUp ( ) { super . setUp ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . checkNumberOfMonitors ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; initCommandMethods ( ) ; initDestSDs ( ) ; generateStorageToDisksMap ( ) ; cmd.init ( ) ; }

Target:
public void setUp ( ) { super . setUp ( ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . initTemplateDisks ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . checkNumberOfMonitors ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; initCommandMethods ( ) ; initDestSDs ( ) ; generateStorageToDisksMap ( ) ; cmd.init ( ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . getVmId ( ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getBroker ( ) . migrateCancel ( vmId.toString ( ) ) ; proceedProxyReturnValue ( ) ; if ( ! ( org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . isRerunAfterCancel ( ) ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . removeAsyncRunningVm ( vmId ) ; } }

Target:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . getVmId ( ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getBroker ( ) . migrateCancel ( vmId.toString ( ) ) ; proceedProxyReturnValue ( ) ; if ( ! ( org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . isRerunAfterCancel ( ) ) ) { resourceManager.removeAsyncRunningVm ( vmId ) ; } }
Source:
private void validateInterfacesExist ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : params.getInterfaces ( ) ) { java.lang.String nameWithoutVlanId = org.ovirt.engine.core.utils.NetworkUtils.StripVlan ( iface.getName ( ) ) ; if ( ( ! ( getExistingIfaces ( ) . containsKey ( nameWithoutVlanId ) ) ) && ( ! ( bonds.containsKey ( nameWithoutVlanId ) ) ) ) { addViolation ( VdcBllMessages.NETWORK_INTERFACES_DONT_EXIST , nameWithoutVlanId ) ; } } }

Target:
private void validateInterfacesExist ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : params.getInterfaces ( ) ) { java.lang.String nameWithoutVlanId = org.ovirt.engine.core.utils.NetworkUtils.stripVlan ( iface.getName ( ) ) ; if ( ( ! ( getExistingIfaces ( ) . containsKey ( nameWithoutVlanId ) ) ) && ( ! ( bonds.containsKey ( nameWithoutVlanId ) ) ) ) { addViolation ( VdcBllMessages.NETWORK_INTERFACES_DONT_EXIST , nameWithoutVlanId ) ; } } }
Source:
public void testAddLunDiskMissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddLunDiskMissingId" , "id" ) ; } }

Target:
public void testAddLunDiskMissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddLunDiskMissingId" , "id" ) ; } }
Source:
public void hostNameNotUsed ( ) { org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.anyString ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nameLengthIsTooLong ( ) { mockConfigRule.mockConfigValue ( ConfigValues.MaxVdsNameLength , org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( ( ( org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) * 2 ) ) ) ; org.junit.Assert.assertThat ( validator.nameLengthIsLegal ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ) ; }
Source:
public static org.ovirt.engine.core.bll.ValidationResult canRunActionOnNonManagedVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.bll.ValidationResult validationResult = ValidationResult.VALID ; if ( ! ( org.ovirt.engine.core.bll.VmHandler.isManagedVm ( vm ) ) ) { if ( ! ( org.ovirt.engine.core.bll.VmHandler.COMMANDS_ALLOWED_ON_NON_MANAGED_VMS.contains ( actionType ) ) ) { validationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_RUN_ACTION_ON_NON_MANAGED_VM ) ; } } return validationResult ; }

Target:
public static org.ovirt.engine.core.bll.ValidationResult canRunActionOnNonManagedVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.bll.ValidationResult validationResult = ValidationResult.VALID ; if ( ( ( vm.isHostedEngine ( ) ) && ( ! ( org.ovirt.engine.core.bll.VmHandler.COMMANDS_ALLOWED_ON_HOSTED_ENGINE.contains ( actionType ) ) ) ) || ( ( vm.isExternalVm ( ) ) && ( ! ( org.ovirt.engine.core.bll.VmHandler.COMMANDS_ALLOWED_ON_EXTERNAL_VMS.contains ( actionType ) ) ) ) ) { validationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_RUN_ACTION_ON_NON_MANAGED_VM ) ; } return validationResult ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel model ) { customizeAgentTab ( ( ( java.lang.Boolean ) ( model.getAgentTabAvailable ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( model.getInterfaceMappingsLabel ( ) . getEntity ( ) ) ) ) ; driver.edit ( model ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel model ) { setAgentTabVisibility ( model.getNeutronAgentModel ( ) . getIsAvailable ( ) ) ; driver.edit ( model ) ; neutronAgentWidget.edit ( model.getNeutronAgentModel ( ) ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Cluster model = org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.core.common.businessentities.Cluster model = org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
protected boolean canDoAction ( ) { if ( checkIsDomainLocked ( org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getStorageDomain ( ) . getStoragePoolIsoMapData ( ) ) ) { return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > poolDomains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getStoragePool ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap poolDomain : poolDomains ) { if ( checkIsDomainLocked ( poolDomain ) ) { return false ; } } return org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.initializeVds ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getNewMasterStorageDomainId ( ) { if ( ( newMasterStorageDomainId ) == null ) { newMasterStorageDomain = electNewMaster ( true , org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getParameters ( ) . isCanChooseInactiveDomainAsMaster ( ) , org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getParameters ( ) . isCanChooseCurrentMasterAsNewMaster ( ) ) ; newMasterStorageDomainId = ( ( newMasterStorageDomain ) != null ) ? newMasterStorageDomain.getId ( ) : org.ovirt.engine.core.compat.Guid.Empty ; } return newMasterStorageDomainId ; }
Source:
protected boolean canDoAction ( ) { boolean retValue = super . canDoAction ( ) ; if ( ( job ) != null ) { if ( ! ( job.isExternal ( ) ) ) { retValue = false ; addCanDoActionMessage ( EngineMessage.ACTION_TYPE_NOT_EXTERNAL ) ; } } if ( ! retValue ) { addCanDoActionMessage ( EngineMessage.VAR__ACTION__ADD ) ; addCanDoActionMessage ( EngineMessage.VAR__TYPE__EXTERNAL_JOB ) ; } return retValue ; }

Target:
protected boolean validate ( ) { boolean retValue = super . validate ( ) ; if ( ( job ) != null ) { if ( ! ( job.isExternal ( ) ) ) { retValue = false ; addValidationMessage ( EngineMessage.ACTION_TYPE_NOT_EXTERNAL ) ; } } if ( ! retValue ) { addValidationMessage ( EngineMessage.VAR__ACTION__ADD ) ; addValidationMessage ( EngineMessage.VAR__TYPE__EXTERNAL_JOB ) ; } return retValue ; }
Source:
private boolean isPersistentAuth ( java.lang.String ... values ) { java.util.Vector < java.lang.String > vector = new java.util.Vector < > ( ) ; java.util.Collections.addAll ( vector , values ) ; javax.servlet.http.HttpServletRequest request = org.mockito.Mockito.mock ( javax.servlet.http.HttpServletRequest.class ) ; org.mockito.Mockito.when ( request.getHeaders ( FiltersHelper.Constants.HEADER_PREFER ) ) . thenReturn ( vector.elements ( ) ) ; return org.ovirt.engine.core.aaa.filters.FiltersHelper.isPersistentAuth ( request ) ; }

Target:
private int getPrefer ( java.lang.String ... values ) { java.util.Vector < java.lang.String > vector = new java.util.Vector < > ( ) ; java.util.Collections.addAll ( vector , values ) ; javax.servlet.http.HttpServletRequest request = org.mockito.Mockito.mock ( javax.servlet.http.HttpServletRequest.class ) ; org.mockito.Mockito.when ( request.getHeaders ( FiltersHelper.Constants.HEADER_PREFER ) ) . thenReturn ( vector.elements ( ) ) ; return org.ovirt.engine.core.aaa.filters.FiltersHelper.getPrefer ( request ) ; }
Source:
public void testUpdateDoesntChangeExternalId ( ) { org.ovirt.engine.core.common.businessentities.DbGroup groupBefore = dao.get ( existingGroup.getId ( ) ) ; dao.update ( groupBefore ) ; org.ovirt.engine.core.common.businessentities.DbGroup groupAfter = dao.get ( existingGroup.getId ( ) ) ; org.junit.Assert.assertEquals ( groupBefore.getExternalId ( ) , groupAfter.getExternalId ( ) ) ; }

Target:
public void testUpdateDoesntChangeExternalId ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbGroup groupBefore = dao.get ( existingGroup.getId ( ) ) ; dao.update ( groupBefore ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup groupAfter = dao.get ( existingGroup.getId ( ) ) ; org.junit.Assert.assertEquals ( groupBefore.getExternalId ( ) , groupAfter.getExternalId ( ) ) ; }
Source:
private void updateDiskVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ; if ( disk.getDiskStorageType ( ) . isInternal ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; imageDao.updateImageVmSnapshotId ( diskImage.getImageId ( ) , snapshotId ) ; } else { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.StorageException , "update of snapshot id was initiated for unsupported disk type" ) ; } }

Target:
private void updateDiskVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid snapshotId = snapshotDao.getId ( org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ; if ( disk.getDiskStorageType ( ) . isInternal ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; imageDao.updateImageVmSnapshotId ( diskImage.getImageId ( ) , snapshotId ) ; } else { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.StorageException , "update of snapshot id was initiated for unsupported disk type" ) ; } }
Source:
protected void executeVmCommand ( ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.ConvertVm , buildConvertParameters ( ) ) ; if ( retValue.getSucceeded ( ) ) { getVdsManager ( ) . addV2VJobInfoForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) , JobStatus.WAIT_FOR_START ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" , e ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }

Target:
protected void executeVmCommand ( ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.ConvertVm , buildConvertParameters ( ) ) ; if ( retValue.getSucceeded ( ) ) { getVdsManager ( ) . addV2VJobInfoForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) , JobStatus.WAIT_FOR_START ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" , e ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }
Source:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters parameter = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepStatusDetailVDSCommand.getParameters ( ) ; result = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepStatusDetailVDSCommand.getBroker ( ) . glusterVolumeGeoRepStatusDetail ( parameter.getVolumeName ( ) , parameter.getSlaveHost ( ) , parameter.getSlaveVolume ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepStatusDetailVDSCommand.proceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepStatusDetailVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( result.getGeoRepDetails ( ) ) ; } }

Target:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters parameter = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.getParameters ( ) ; result = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.getBroker ( ) . glusterVolumeGeoRepSessionStatus ( parameter.getVolumeName ( ) , parameter.getSlaveHost ( ) , parameter.getSlaveVolume ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.proceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( result.getGeoRepDetails ( ) ) ; } }
Source:
public static void setIsAdminGUIFlag ( org.ovirt.engine.core.compat.Guid userId , boolean hasPermissions ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getDbUserDAO ( ) . get ( userId ) ; if ( ( user.getLastAdminCheckStatus ( ) ) != hasPermissions ) { user.setLastAdminCheckStatus ( hasPermissions ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getDbUserDAO ( ) . update ( user ) ; } }

Target:
public static void setIsAdminGUIFlag ( org.ovirt.engine.core.compat.Guid userId , boolean hasPermissions ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getDbUserDAO ( ) . get ( userId ) ; if ( ( user.isAdmin ( ) ) != hasPermissions ) { user.setAdmin ( hasPermissions ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getDbUserDAO ( ) . update ( user ) ; } }
Source:
public void testImportedHostedEngineLunDiskRemove ( ) { vm.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; vm.setStatus ( VMStatus.Up ) ; disk = new org.ovirt.engine.core.common.businessentities.storage.LunDisk ( ) ; setupDisk ( ) ; disk.setDiskAlias ( StorageConstants.HOSTED_ENGINE_LUN_DISK_ALIAS ) ; org.mockito.Mockito.doReturn ( disk ) . when ( cmd ) . getDisk ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; }

Target:
public void testImportedHostedEngineLunDiskRemove ( ) { vm.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; vm.setStatus ( VMStatus.Up ) ; disk = new org.ovirt.engine.core.common.businessentities.storage.LunDisk ( ) ; setupDisk ( ) ; disk.setDiskAlias ( StorageConstants.HOSTED_ENGINE_LUN_DISK_ALIAS ) ; org.mockito.Mockito.doReturn ( disk ) . when ( cmd ) . getDisk ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( getMessage ( ) ) == null ? 0 : getMessage ( ) . hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( getMessage ( ) ) == null ? 0 : getMessage ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getVariableReplacements ( ) ) == null ? 0 : getVariableReplacements ( ) . hashCode ( ) ) ; return result ; }
Source:
public void testCanDoActionNonExistingStorageDomain ( ) { org.mockito.Mockito.doReturn ( null ) . when ( storageDomainDaoMock ) . get ( storageDomain.getId ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( storageDomainDaoMock ) . getAllForStorageDomain ( storageDomain.getId ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( "canDoAction shouldn't be possible for a non-existent storage domain" , command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }

Target:
public void testValidateNonExistingStorageDomain ( ) { org.mockito.Mockito.doReturn ( null ) . when ( storageDomainDaoMock ) . get ( storageDomain.getId ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( storageDomainDaoMock ) . getAllForStorageDomain ( storageDomain.getId ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "validate shouldn't be possible for a non-existent storage domain" , command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }
Source:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.File > collection ) throws java.lang.Exception { assertNotNull ( collection ) ; assertEquals ( NAMES.length , collection.size ( ) ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { verifyModel ( collection.get ( i ) , i ) ; } }

Target:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.File > collection ) throws java.lang.Exception { org.junit.Assert.assertNotNull ( collection ) ; org.junit.Assert.assertEquals ( NAMES.length , collection.size ( ) ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { verifyModel ( collection.get ( i ) , i ) ; } }
Source:
private void validateGateway ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( iface.getGateway ( ) ) ) && ( ! ( managementNetworkUtil.isManagementNetwork ( iface.getNetworkName ( ) , vds.getVdsGroupId ( ) ) ) ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( vds.getVdsGroupCompatibilityVersion ( ) ) ) ) ) { addViolation ( VdcBllMessages.NETWORK_ATTACH_ILLEGAL_GATEWAY , iface.getNetworkName ( ) ) ; } }

Target:
private void validateGateway ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( iface.getGateway ( ) ) ) && ( ! ( managementNetworkUtil.isManagementNetwork ( iface.getNetworkName ( ) , vds.getVdsGroupId ( ) ) ) ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( vds.getVdsGroupCompatibilityVersion ( ) ) ) ) ) { addViolation ( EngineMessage.NETWORK_ATTACH_ILLEGAL_GATEWAY , iface.getNetworkName ( ) ) ; } }
Source:
private void initVmDiskImage ( boolean isShareable ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.VM ) ; diskImage.setShareable ( isShareable ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }

Target:
public void moveShareableDiskToGlusterDomain ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setShareable ( true ) ; initializeCommand ( diskImage , VmEntityType.VM ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( super . canDoAction ( ) ) && ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.checkStoragePool ( ) ) ) && ( CheckStoragePoolStatus ( StoragePoolStatus.Uninitialized ) ) ) && ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.initializeVds ( ) ) ) && ( checkStorageDomainsInPool ( ) ) ; return returnValue ; }

Target:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( super . canDoAction ( ) ) && ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.checkStoragePool ( ) ) ) && ( checkStoragePoolStatus ( StoragePoolStatus.Uninitialized ) ) ) && ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.initializeVds ( ) ) ) && ( checkStorageDomainsInPool ( ) ) ; return returnValue ; }
Source:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runInternalMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , org.ovirt.engine.core.bll.job.ExecutionContext executionContext ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalMultipleActions ( actionType , parameters , executionContext ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc startSpice ( java.lang.String vdsIp , int port , java.lang.String ticket ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.startSpice ( vdsIp , port , ticket ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc freeze ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.freeze ( vmId ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }

Target:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
private void initUnregisteredOVFData ( org.ovirt.engine.core.common.businessentities.OvfEntityData resultOvfEntityData ) { java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList = new java.util.ArrayList < > ( ) ; if ( resultOvfEntityData != null ) { ovfEntityDataList.add ( resultOvfEntityData ) ; } org.mockito.Mockito.when ( unregisteredOVFDataDao.getByEntityIdAndStorageDomain ( vmId , storageDomainId ) ) . thenReturn ( ovfEntityDataList ) ; }

Target:
private void initUnregisteredOVFData ( org.ovirt.engine.core.common.businessentities.OvfEntityData resultOvfEntityData ) { java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList = new java.util.ArrayList < > ( ) ; if ( resultOvfEntityData != null ) { ovfEntityDataList.add ( resultOvfEntityData ) ; } org.mockito.Mockito.when ( unregisteredOVFDataDao.getByEntityIdAndStorageDomain ( vmId , org.ovirt.engine.core.bll.exportimport.ImportVMFromConfigurationCommandTest.storageDomainId ) ) . thenReturn ( ovfEntityDataList ) ; }
Source:
protected org.ovirt.engine.core.bll.provider.ProviderProxyFactory getProviderProxyFactory ( ) { return org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) ; }

Target:
private void setDefaultTemplateName ( ) { if ( ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getImportAsTemplate ( ) ) && ( ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getTemplateName ( ) ) == null ) ) { org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setTemplateName ( ( "GlanceTemplate-" + ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) . substring ( 0 , 7 ) ) ) ) ; } }
Source:
public void setIsAutoSelect ( boolean value ) { if ( ( isAutoSelect ) != value ) { isAutoSelect = value ; getHosts ( ) . setIsChangable ( ( ! ( isAutoSelect ) ) ) ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "IsAutoSelect" ) ) ; setIsSameVdsMessageVisible ( ( ! value ) ) ; privateSelectHostAutomatically_IsSelected.setEntity ( value ) ; privateSelectDestinationHost_IsSelected.setEntity ( ( ! value ) ) ; privateHosts.setIsChangable ( ( ! value ) ) ; } }

Target:
public void setIsAutoSelect ( boolean value ) { if ( ( isAutoSelect ) != value ) { isAutoSelect = value ; getHosts ( ) . setIsChangable ( ( ! ( isAutoSelect ) ) ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsAutoSelect" ) ) ; setIsSameVdsMessageVisible ( ( ! value ) ) ; privateSelectHostAutomatically_IsSelected.setEntity ( value ) ; privateSelectDestinationHost_IsSelected.setEntity ( ( ! value ) ) ; privateHosts.setIsChangable ( ( ! value ) ) ; } }
Source:
public void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setBootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
public void getVdsSwallowsException ( ) { final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; b.setVds ( vds ) ; b.setVdsId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }

Target:
public void getVdsSwallowsException ( ) { final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; b.setVds ( vds ) ; b.setVdsId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.jupiter.api.Assertions.assertNull ( v ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateDiskProfile , org.ovirt.engine.core.common.action.DiskProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendDiskProfileResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateDiskProfile , org.ovirt.engine.core.common.action.DiskProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendDiskProfileResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void createSnapshotsForDisks ( org.ovirt.engine.core.compat.Guid vmSnapshotId ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateSnapshot , buildCreateSnapshotParameters ( image , vmSnapshotId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getExecutionContext ( ) ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalTaskIdList ( ) ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcReturnValue.getFault ( ) . getError ( ) , "CreateAllSnapshotsFromVmCommand::executeVmCommand: Failed to create snapshot!" ) ; } } }

Target:
private void createSnapshotsForDisks ( org.ovirt.engine.core.compat.Guid vmSnapshotId ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateSnapshot , buildCreateSnapshotParameters ( image , vmSnapshotId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalTaskIdList ( ) ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcReturnValue.getFault ( ) . getError ( ) , "Failed to create snapshot!" ) ; } } }
Source:
private void initMinimalVmMemSize ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMinimalVmMemSize ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MinMemSize ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; } } , getHash ( ) ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmRngDevice generateRngDevice ( ) { org.ovirt.engine.core.common.businessentities.VmRngDevice dev = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) ; dev.setBytes ( rngBytes.getEntity ( ) ) ; dev.setPeriod ( rngPeriod.getEntity ( ) ) ; dev.setSource ( ( java.lang.Boolean.TRUE.equals ( rngSourceRandom.getEntity ( ) ) ? VmRngDevice.Source.RANDOM : VmRngDevice.Source.HWRNG ) ) ; return dev ; }
Source:
public void testValidUpdateOfStatusRestrictedEditableFieldOnDownHost ( ) { int srcSshPort = 22 ; int destSshPort = 23 ; org.ovirt.engine.core.common.businessentities.VdsStatic src = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; src.setSshPort ( srcSshPort ) ; org.ovirt.engine.core.common.businessentities.VdsStatic dest = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; dest.setSshPort ( destSshPort ) ; boolean updateIsValid = org.ovirt.engine.core.bll.VdsHandler.isUpdateValid ( src , dest , VDSStatus.Down ) ; org.junit.Assert.assertTrue ( "Update should be valid for different SSH ports in Down status" , updateIsValid ) ; }

Target:
public void testValidUpdateOfStatusRestrictedEditableFieldOnDownHost ( ) { int srcSshPort = 22 ; int destSshPort = 23 ; org.ovirt.engine.core.common.businessentities.VdsStatic src = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; src.setSshPort ( srcSshPort ) ; org.ovirt.engine.core.common.businessentities.VdsStatic dest = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; dest.setSshPort ( destSshPort ) ; boolean updateIsValid = vdsHandler.isUpdateValid ( src , dest , VDSStatus.Down ) ; org.junit.Assert.assertTrue ( "Update should be valid for different SSH ports in Down status" , updateIsValid ) ; }
Source:
public org.ovirt.engine.sdk.decorators.VMDisk add ( org.ovirt.engine.sdk.decorators.Disk disk ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; return getProxy ( ) . add ( url , disk , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.VMDisk.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VMDisk add ( org.ovirt.engine.sdk.decorators.Disk disk ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , disk , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.VMDisk.class , headers ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" , "dataCenter.name|id" ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , entity ) ; if ( network.isSetProfileRequired ( ) ) { parameters.setVnicProfileRequired ( network.isProfileRequired ( ) ) ; } return performCreate ( VdcActionType.AddNetwork , parameters , new org.ovirt.engine.api.restapi.resource.BackendNetworksResource.AddedNetworkResolver ( ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getAddParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }
Source:
public static org.ovirt.engine.api.model.DiskAttachment map ( org.ovirt.engine.core.common.businessentities.storage.DiskVmElement entity , org.ovirt.engine.api.model.DiskAttachment template ) { org.ovirt.engine.api.model.DiskAttachment model = ( template != null ) ? template : new org.ovirt.engine.api.model.DiskAttachment ( ) ; model.setId ( entity.getDiskId ( ) . toString ( ) ) ; model.setBootable ( entity.isBoot ( ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.DiskMapper.mapInterface ( entity.getDiskInterface ( ) ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.DiskAttachment map ( org.ovirt.engine.core.common.businessentities.storage.DiskVmElement entity , org.ovirt.engine.api.model.DiskAttachment template ) { org.ovirt.engine.api.model.DiskAttachment model = ( template != null ) ? template : new org.ovirt.engine.api.model.DiskAttachment ( ) ; model.setId ( entity.getDiskId ( ) . toString ( ) ) ; model.setBootable ( entity.isBoot ( ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.DiskMapper.mapInterface ( entity.getDiskInterface ( ) ) ) ; model.setActive ( entity.isPlugged ( ) ) ; return model ; }