auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetAllForStorageDomainWithVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForStorageDomain ( FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_RHEL5_POOL_57 , result.get ( 0 ) . getId ( ) ) ; }

Target:
public void testGetAllForStorageDomainWithVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForStorageDomain ( FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , result.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.VM_RHEL5_POOL_57 , result.get ( 0 ) . getId ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( disk ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } buildSharedLockMap ( ) ; return ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ) && ( validateAllVmsForDiskAreDown ( ) ) ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) ? canRemoveDiskBasedOnImageStorageCheck ( ) : true ; }

Target:
private boolean canRemoveDiskBasedOnStorageTypeCheck ( ) { if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return canRemoveDiskBasedOnImageStorageCheck ( ) ; } return true ; }
Source:
public static void getMaximalVmMemSize64OS ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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 ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : - 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getDataCenterList ( 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 ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
private boolean isVmInterfacesConfigured ( ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface nic : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getInterfaces ( ) ) { if ( ( nic.getNetworkName ( ) ) == null ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmNicValidator.networkLinkingSupported ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; return false ; } else { return true ; } } } return true ; }

Target:
private boolean isVmInterfacesConfigured ( ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface nic : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getInterfaces ( ) ) { if ( ( nic.getNetworkName ( ) ) == null ) { if ( ! ( org.ovirt.engine.core.bll.validator.FeatureSupported.networkLinking ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; return false ; } else { return true ; } } } return true ; }
Source:
public void ovfUpdateTimer ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools = storagePoolDao.getAllByStatus ( StoragePoolStatus.Up ) ; updateOvfData ( storagePools ) ; }

Target:
public void ovfUpdate ( ) { lock.lock ( ) ; try { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools = storagePoolDao.getAllByStatus ( StoragePoolStatus.Up ) ; updateOvfData ( storagePools ) ; } catch ( java.lang.Throwable t ) { org.ovirt.engine.core.bll.storage.ovfstore.OvfDataUpdater.log.error ( "Exception updating ovf data: {}" , org.apache.commons.lang.exception.ExceptionUtils.getRootCauseMessage ( t ) ) ; org.ovirt.engine.core.bll.storage.ovfstore.OvfDataUpdater.log.debug ( "Exception" , t ) ; } finally { lock.unlock ( ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { getView ( ) . setErrorMessage ( loginModel.getMessage ( ) ) ; org.ovirt.engine.ui.common.presenter.AbstractLoginPopupPresenterWidget.logger.warning ( ( ( "Login failed for user [" + ( loginModel.getUserName ( ) . getEntity ( ) ) ) + "]" ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { lockInteractionManager.hideLoadingIndicator ( ) ; getView ( ) . setErrorMessage ( loginModel.getMessage ( ) ) ; org.ovirt.engine.ui.common.presenter.AbstractLoginPopupPresenterWidget.logger.warning ( ( ( "Login failed for user [" + ( loginModel.getUserName ( ) . getEntity ( ) ) ) + "]" ) ) ; }
Source:
private void setGlobalHaMaintenance ( boolean enabled ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getSelectedItem ( ) ) ) ; if ( vm == null ) { return ; } if ( ! ( vm.isHostedEngine ( ) ) ) { return ; } org.ovirt.engine.core.common.action.SetHaMaintenanceParameters params = new org.ovirt.engine.core.common.action.SetHaMaintenanceParameters ( vm.getRunOnVds ( ) , org.ovirt.engine.core.common.businessentities.HaMaintenanceMode.GLOBAL , enabled ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.SetHaMaintenance , params ) ; }

Target:
private void setObjectName ( java.lang.Object object , java.lang.String input , boolean isSuffix ) { java.lang.String nameForTheClonedVm = ( isSuffix ) ? ( getObjectName ( object ) ) + input : input ; setObjectName ( object , nameForTheClonedVm ) ; assignedVmNames.add ( nameForTheClonedVm ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult consistentDataCenter ( ) { return ( ( qos ) != null ) && ( ( ( getOldQos ( ) ) == null ) || ( ! ( qos.getStoragePoolId ( ) . equals ( getOldQos ( ) . getStoragePoolId ( ) ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_QOS_STORAGE_POOL_NOT_CONSISTENT ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult consistentDataCenter ( ) { return ( ( qos ) != null ) && ( ( ( getOldQos ( ) ) == null ) || ( ! ( qos.getStoragePoolId ( ) . equals ( getOldQos ( ) . getStoragePoolId ( ) ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_QOS_STORAGE_POOL_NOT_CONSISTENT ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWithAddtionalFeature ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > addtionalFeaturesSupported = new java.util.HashSet < > ( ) ; org.ovirt.engine.core.common.businessentities.AdditionalFeature feature = new org.ovirt.engine.core.common.businessentities.AdditionalFeature ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_FEATURE_ID , "TEST_FEATURE" , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , "Test Feature" , org.ovirt.engine.core.common.mode.ApplicationMode.AllModes ) ; addtionalFeaturesSupported.add ( new org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature ( group.getId ( ) , true , feature ) ) ; group.setAddtionalFeaturesSupported ( addtionalFeaturesSupported ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.Cluster createClusterWithAddtionalFeature ( ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.ovirt.engine.core.bll.UpdateClusterCommandTest.createDefaultCluster ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > addtionalFeaturesSupported = new java.util.HashSet < > ( ) ; org.ovirt.engine.core.common.businessentities.AdditionalFeature feature = new org.ovirt.engine.core.common.businessentities.AdditionalFeature ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DEFAULT_FEATURE_ID , "TEST_FEATURE" , org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 , "Test Feature" , org.ovirt.engine.core.common.mode.ApplicationMode.AllModes ) ; addtionalFeaturesSupported.add ( new org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature ( group.getId ( ) , true , feature ) ) ; group.setAddtionalFeaturesSupported ( addtionalFeaturesSupported ) ; return group ; }
Source:
public org.ovirt.engine.core.common.businessentities.ServerCpu getServerCpuByName ( java.lang.String cpuName ) { org.ovirt.engine.core.common.businessentities.ServerCpu result = null ; if ( cpuName != null ) { result = _intelCpuByNameDictionary.get ( cpuName ) ; if ( result == null ) { result = _amdCpuByNameDictionary.get ( cpuName ) ; } } return result ; }

Target:
public org.ovirt.engine.core.common.businessentities.ServerCpu getServerCpuByName ( java.lang.String cpuName ) { org.ovirt.engine.core.common.businessentities.ServerCpu result = null ; if ( cpuName != null ) { result = _intelCpuByNameDictionary.get ( cpuName ) ; if ( result == null ) { result = _amdCpuByNameDictionary.get ( cpuName ) ; } if ( result == null ) { result = _ibmCpuByNameDictionary.get ( cpuName ) ; } } return result ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getBaseTemplate ( ) . setItems ( java.util.Collections.singletonList ( template ) ) ; model.getBaseTemplate ( ) . setSelectedItem ( template ) ; model.getBaseTemplate ( ) . setIsChangable ( false ) ; }

Target:
protected void setReadOnlyTemplateWithVersion ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion templateCouple ) { getModel ( ) . getTemplateWithVersion ( ) . setItems ( java.util.Collections.singleton ( templateCouple ) ) ; getModel ( ) . getTemplateWithVersion ( ) . setSelectedItem ( templateCouple ) ; getModel ( ) . getTemplateWithVersion ( ) . setIsChangeable ( false ) ; }
Source:
private static java.lang.Object instantiate ( java.lang.Class < ? > clz ) { java.lang.Object model = null ; try { model = clz.newInstance ( ) ; } catch ( java.lang.Exception e ) { } return model ; }

Target:
private static java.lang.Object instantiate ( java.lang.Class < ? > clz ) { java.lang.Object model = null ; try { model = clz.newInstance ( ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.api.restapi.types.MappingTestHelper.logger.error ( ( "Failed to instantiate class " + ( clz.getSimpleName ( ) ) ) , e ) ; } return model ; }
Source:
protected boolean canDoAction ( ) { java.lang.String sshPublicKey = org.ovirt.engine.core.bll.UserProfilesOperationCommandBase.getParameters ( ) . getUserProfile ( ) . getSshPublicKey ( ) ; if ( ( sshPublicKey == null ) || ( sshPublicKey.isEmpty ( ) ) ) { return true ; } if ( ! ( org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.isPublicKeyValid ( sshPublicKey ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_INVALID_PUBLIC_SSH_KEY ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { java.lang.String sshPublicKey = org.ovirt.engine.core.bll.UserProfilesOperationCommandBase.getParameters ( ) . getUserProfile ( ) . getSshPublicKey ( ) ; if ( ( sshPublicKey == null ) || ( sshPublicKey.isEmpty ( ) ) ) { return true ; } if ( ! ( org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.isPublicKeyValid ( sshPublicKey ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_INVALID_PUBLIC_SSH_KEY ) ; } return true ; }
Source:
protected org.ovirt.engine.core.compat.Guid getTemplateId ( org.ovirt.engine.api.model.VM vm ) { return vm.getTemplate ( ) . isSetId ( ) ? asGuid ( vm.getTemplate ( ) . getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , SearchType.VmTemplate , ( "Template: name=" + ( vm.getTemplate ( ) . getName ( ) ) ) ) . getId ( ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmTemplate getTemplateByName ( org.ovirt.engine.api.model.VM vm ) { return isFiltered ( ) ? lookupTemplateByName ( vm.getTemplate ( ) . getName ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , SearchType.VmTemplate , ( "Template: name=" + ( vm.getTemplate ( ) . getName ( ) ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface createVdsInterface ( java.lang.String name , java.lang.Boolean bonded , java.lang.String bondName , java.lang.Integer vlanId , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface ( ) ; iface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; iface.setName ( name ) ; iface.setBonded ( bonded ) ; iface.setBondName ( bondName ) ; iface.setVlanId ( vlanId ) ; iface.setNetworkName ( networkName ) ; return iface ; }

Target:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface createNic ( java.lang.String nicName , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , nicName , false , null , null , networkName ) ; }
Source:
public void commandFailsSlaveNotOvirtMonitored ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.SetupGlusterGeoRepMountBrokerInternalCommand ( new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , new java.util.HashSet ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) , null , null ) , null ) ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getSlaveVolume ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void commandFailsSlaveNotOvirtMonitored ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.SetupGlusterGeoRepMountBrokerInternalCommand ( new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , new java.util.HashSet ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) , null , null ) , null ) ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getSlaveVolume ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( command.validate ( ) ) ; }
Source:
protected void handleSpecificCommandActions ( ) { if ( ( mVmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.StopVdsCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) ) ; restartVmsOper.restartVms ( mVmList ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }

Target:
protected void handleSpecificCommandActions ( ) { if ( ( mVmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.StopVdsCommand.getContext ( ) , org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) ) ; restartVmsOper.restartVms ( mVmList ) ; runVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice findVmDeviceByName ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmDevice > vmManagedDeviceMap , java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmManagedDeviceMap.values ( ) ) { if ( vmDevice.getDevice ( ) . equals ( name ) ) { return vmDevice ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice findVmDeviceByType ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmDevice > vmManagedDeviceMap , java.lang.String typeName ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmManagedDeviceMap.values ( ) ) { if ( vmDevice.getDevice ( ) . equals ( typeName ) ) { return vmDevice ; } } return null ; }
Source:
private java.lang.String getDirectoryGroupSearchPattern ( java.lang.String groupname , java.lang.String domain ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.common.businessentities.aaa.DbGroup.class , false ) ; final java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( org.ovirt.engine.api.restapi.resource.aaa.BackendGroupsResource.DIRECTORY_GROUP_SEARCH_TEMPLATE , domain ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "allnames=" + groupname : constraint ) ) ; return sb.toString ( ) ; }

Target:
private java.lang.String getDirectoryGroupSearchPattern ( java.lang.String groupname , java.lang.String domain ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.common.businessentities.aaa.DbGroup.class , false ) ; final java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( ResourceConstants.AAA_GROUPS_SEARCH_TEMPLATE , domain , "" ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "allnames=" + groupname : constraint ) ) ; return sb.toString ( ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainsByStoragePoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > allDomains , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain s : allDomains ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = s.getstatus ( ) ; if ( ( ( s.getstorage_domain_type ( ) ) == type ) && ( ( ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) == status ) || ( ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Unknown ) == status ) ) ) { domains.add ( s ) ; } } return domains ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainsByStoragePoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > allDomains , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain s : allDomains ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = s.getStatus ( ) ; if ( ( ( s.getStorageDomainType ( ) ) == type ) && ( ( ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) == status ) || ( ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Unknown ) == status ) ) ) { domains.add ( s ) ; } } return domains ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc createVG ( java.lang.String sdUUID , java.lang.String [ ] deviceList ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.createVG ( sdUUID , deviceList ) ; org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( 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 add_image_ticket ( java.lang.String ticketId , java.lang.String [ ] ops , long timeout , long size , java.lang.String url ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.add_image_ticket ( ticketId , ops , timeout , size , url ) ; 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 ) ; } }
Source:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "imageSizeInBytes" , getImageSizeInBytes ( ) ) . append ( "volumeFormat" , getVolumeFormat ( ) ) . append ( "srcImageGroupId" , getSrcImageGroupId ( ) ) . append ( "srcImageId" , getSrcImageId ( ) ) . append ( "newImageGroupId" , getNewImageGroupId ( ) ) . append ( "newImageId" , getNewImageID ( ) ) . append ( "description" , getDescription ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "imageSizeInBytes" , getImageSizeInBytes ( ) ) . append ( "volumeFormat" , getVolumeFormat ( ) ) . append ( "srcImageGroupId" , getSrcImageGroupId ( ) ) . append ( "srcImageId" , getSrcImageId ( ) ) . append ( "newImageGroupId" , getNewImageGroupId ( ) ) . append ( "newImageId" , getNewImageID ( ) ) . append ( "description" , getDescription ( ) ) . append ( "initialSize" , getInitialSize ( ) ) ; }
Source:
protected void performLogout ( ) { getLoginModel ( ) . resetAfterLogout ( ) ; user.onUserLogout ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . clearCache ( ) ; org.ovirt.engine.ui.common.uicommon.model.CleanupModelEvent.fire ( eventBus ) ; }

Target:
public void onLogout ( ) { org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; query.setHandleFailure ( true ) ; query.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { Window.Location.reload ( ) ; } } ; frontend.logoffAsync ( frontend.getLoggedInUser ( ) , query ) ; }
Source:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = getBackend ( ) . runInternalAction ( getImagesActionType ( ) , buildModeOrCopyImageGroupParameters ( containerID , disk ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) ; getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( getImagesActionType ( ) , buildModeOrCopyImageGroupParameters ( containerID , disk ) ) ; getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return null ; }
Source:
public static void GetDataCentersWithPermittedActionOnClusters ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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_pool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDataCentersWithPermittedActionOnClusters , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public static void GetVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }
Source:
private org.ovirt.engine.api.model.Network getNetworkByName ( java.lang.String networkName , java.lang.String clusterId ) { for ( org.ovirt.engine.api.model.Network network : getNetworks ( clusterId ) ) { if ( network.getName ( ) . equals ( networkName ) ) { return network ; } } return null ; }

Target:
private org.ovirt.engine.api.model.Network getNetworkByName ( java.lang.String networkName , java.util.List < org.ovirt.engine.api.model.Network > networks ) { for ( org.ovirt.engine.api.model.Network network : networks ) { if ( network.getName ( ) . equals ( networkName ) ) { return network ; } } return null ; }
Source:
public boolean matches ( final java.lang.Object o ) { if ( o == null ) { return false ; } org.ovirt.engine.core.common.queries.SearchParameters param = ( ( org.ovirt.engine.core.common.queries.SearchParameters ) ( o ) ) ; return param.getSearchTypeValue ( ) . equals ( SearchType.VDS ) ; }

Target:
private void vdsGroupHasVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; vdsList.add ( new org.ovirt.engine.core.common.businessentities.VDS ( ) ) ; org.mockito.Mockito.when ( vdsDAO.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }
Source:
public static void getGlusterRemoveBricksStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters parameters = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters ( clusterId , volumeId , bricks ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRemoveBricksStatus , parameters , aQuery ) ; }

Target:
public static void getRpmVersionViaPublic ( 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 ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public boolean validate ( boolean isOVirt ) { getOVirtISO ( ) . setIsValid ( true ) ; getRootPassword ( ) . setIsValid ( true ) ; if ( isOVirt ) { getOVirtISO ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } else { getRootPassword ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } return ( getRootPassword ( ) . getIsValid ( ) ) && ( getOVirtISO ( ) . getIsValid ( ) ) ; }

Target:
public void setAuthenticationMethod ( org.ovirt.engine.core.common.action.VdsOperationActionParameters.AuthenticationMethod value ) { hostAuthenticationMethod = value ; }
Source:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void canDoActionTemplateImageIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initTemplateDiskImage ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED.toString ( ) ) ) ; }
Source:
public static void GetoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void GetVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.String prefix = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel ) ( target ) ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( prefix ) ) ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel pathModel = model.getStorage ( ) . getPath ( ) ; pathModel.setEntity ( prefix ) ; pathModel.setIsChangable ( false ) ; } configureLocalStorage3 ( model ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.StopProgress ( ) ; CancelConfirm ( ) ; }
Source:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
private void addSchedulingPolicies ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.SchedulingPolicyType [ ] values ) { version.setSchedulingPolicies ( new org.ovirt.engine.api.model.SchedulingPolicies ( ) ) ; for ( org.ovirt.engine.api.model.SchedulingPolicyType policy : values ) { version.getSchedulingPolicies ( ) . getPolicy ( ) . add ( policy.value ( ) ) ; } }

Target:
private void addVmPoolTypes ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.VmPoolType [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_6 ) ) { org.ovirt.engine.api.model.VmPoolTypes types = new org.ovirt.engine.api.model.VmPoolTypes ( ) ; for ( org.ovirt.engine.api.model.VmPoolType state : values ) { types.getVmPoolTypes ( ) . add ( state.value ( ) ) ; } version.setVmPoolTypes ( types ) ; } }
Source:
public void reportCompleted ( ) { final boolean isRunAndPaused = ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; if ( isRunAndPaused ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , true ) ; } else { super . reportCompleted ( ) ; } }

Target:
public void reportCompleted ( ) { if ( isRunAndPaused ( ) ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , true ) ; } else { super . reportCompleted ( ) ; } }
Source:
private void mockStoragePoolDao ( ) { org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setId ( spId ) ; sp.setstatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDAO.get ( spId ) ) . thenReturn ( sp ) ; org.mockito.Mockito.doReturn ( storagePoolDAO ) . when ( spyCommand ) . getStoragePoolDAO ( ) ; }

Target:
private void mockStoragePoolDao ( ) { org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setId ( spId ) ; sp.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDAO.get ( spId ) ) . thenReturn ( sp ) ; org.mockito.Mockito.doReturn ( storagePoolDAO ) . when ( spyCommand ) . getStoragePoolDAO ( ) ; }
Source:
public void testRemoveNetworkFromIscsiBond ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > networks = dao.getNetworkIdsByIscsiBondId ( iscsiBondId ) ; networkId = networks.get ( 0 ) ; dao.removeNetworkFromIscsiBond ( iscsiBondId , networkId ) ; networks = dao.getNetworkIdsByIscsiBondId ( iscsiBondId ) ; junit.framework.Assert.assertTrue ( networks.isEmpty ( ) ) ; }

Target:
public void testRemoveNetworkFromIscsiBond ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > networks = dao.getNetworkIdsByIscsiBondId ( iscsiBondId ) ; networkId = networks.get ( 0 ) ; dao.removeNetworkFromIscsiBond ( iscsiBondId , networkId ) ; networks = dao.getNetworkIdsByIscsiBondId ( iscsiBondId ) ; org.junit.Assert.assertTrue ( networks.isEmpty ( ) ) ; }
Source:
protected void endSuccessfully ( ) { removeRedundantVolumesForOrphanedDisks ( ) ; if ( ! ( org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.getParameters ( ) . isParentHasTasks ( ) ) ) { org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getParentCommand ( ) , org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getParentParameters ( ) , org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }

Target:
protected void endSuccessfully ( ) { removeRedundantVolumesForOrphanedDisks ( ) ; if ( ! ( org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.getParameters ( ) . isParentHasTasks ( ) ) ) { unlockSnapshot ( org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getSnapshot ( ) . getId ( ) ) ; super . endSuccessfully ( ) ; } org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.setSucceeded ( true ) ; }
Source:
protected void setGetTemplateQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; template.setvds_group_id ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , template ) ; } }

Target:
protected void setGetTemplateQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; template.setVdsGroupId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , template ) ; } }
Source:
protected void setupForStorageTests ( ) { org.mockito.Mockito.doReturn ( multipleSdValidator ) . when ( command ) . getStorageDomainsValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anySetOf ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }

Target:
protected void setupForStorageTests ( ) { org.mockito.Mockito.doReturn ( multipleSdValidator ) . when ( command ) . getStorageDomainsValidator ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.anySetOf ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > watchdogs = getWatchdogs ( ) ; if ( watchdogs.isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.WATCHDOG_NOT_FOUND ) ; } if ( ! ( validate ( validateModelCompatibleWithOs ( ) ) ) ) { return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > watchdogs = getWatchdogs ( ) ; if ( watchdogs.isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.WATCHDOG_NOT_FOUND ) ; } if ( ( ! ( getParameters ( ) . isInstanceType ( ) ) ) && ( ! ( validate ( validateModelCompatibleWithOs ( ) ) ) ) ) { return false ; } return true ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getSparsifyCommand ( ) ) ) { return sparsifyConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
private void newMacPool ( ) { org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel model = new org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel ( this , org.ovirt.engine.core.common.action.VdcActionType.AddMacPool ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . newSharedMacPoolTitle ( ) ) ; model.setHashName ( "new_shared_mac_pool" ) ; model.setHelpTag ( HelpTag.new_shared_mac_pool ) ; setWindow ( model ) ; }

Target:
private void newMacPool ( ) { org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel model = new org.ovirt.engine.ui.uicommonweb.models.macpool.NewSharedMacPoolModel ( this ) ; model.setEntity ( new org.ovirt.engine.core.common.businessentities.MacPool ( ) ) ; setWindow ( model ) ; }
Source:
public static java.lang.String map ( org.ovirt.engine.core.common.businessentities.ArchitectureType model , java.lang.String template ) { if ( model != null ) { switch ( model ) { case undefined : return Architecture.UNDEFINED.value ( ) ; case x86_64 : return Architecture.X86_64.value ( ) ; default : return null ; } } return null ; }

Target:
public static java.lang.String map ( org.ovirt.engine.core.common.businessentities.ArchitectureType model , java.lang.String template ) { if ( model != null ) { switch ( model ) { case undefined : return Architecture.UNDEFINED.value ( ) ; case x86_64 : return Architecture.X86_64.value ( ) ; case ppc64 : return Architecture.PPC64.value ( ) ; default : return null ; } } return null ; }
Source:
public static boolean IsDataActiveStorageDomain ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { boolean isData = ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ; boolean isActive = org.ovirt.engine.ui.uicommonweb.Linq.IsActiveStorageDomain ( storageDomain ) ; return isData && isActive ; }

Target:
public static boolean IsDataActiveStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isData = ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ; boolean isActive = org.ovirt.engine.ui.uicommonweb.Linq.IsActiveStorageDomain ( storageDomain ) ; return isData && isActive ; }