auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping > getExternalVnicProfileMappings ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { final java.util.Set < org.ovirt.engine.ui.uicommonweb.models.vms.register.VnicProfileMappingEntity > vnicProfileMappingEnities = externalVnicProfilesPerTargetCluster.get ( cluster ) ; final java.util.Collection < org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping > result = new java.util.ArrayList ( vnicProfileMappingEnities.size ( ) ) ; for ( org.ovirt.engine.ui.uicommonweb.models.vms.register.VnicProfileMappingEntity vnicProfileMappingEntity : vnicProfileMappingEnities ) { result.add ( new org.ovirt.engine.ui.uicommonweb.models.vms.register.VnicProfileMappingEntity ( vnicProfileMappingEntity ) ) ; } return result ; }

Target:
private java.util.Set < org.ovirt.engine.ui.uicommonweb.models.vms.register.VnicProfileMappingEntity > getClusterVnicProfileMappingEntities ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { final java.util.Set < org.ovirt.engine.ui.uicommonweb.models.vms.register.VnicProfileMappingEntity > result = externalVnicProfilesPerTargetCluster.get ( cluster ) ; if ( result == null ) { return new java.util.HashSet < > ( ) ; } else { return result ; } }
Source:
public void testClusterSpiceProxy ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setVdsGroupSpiceProxy ( org.ovirt.engine.api.restapi.types.VmMapperTest.CLUSTER_SPICE_PROXY ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.VM ) ( null ) ) ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.CLUSTER_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }

Target:
public void testClusterSpiceProxy ( ) { org.ovirt.engine.api.restapi.types.VM entity = new org.ovirt.engine.api.restapi.types.VM ( ) ; entity.setVdsGroupSpiceProxy ( org.ovirt.engine.api.restapi.types.VmMapperTest.CLUSTER_SPICE_PROXY ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.CLUSTER_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }
Source:
public void testParseStraySemiColons ( ) { java.util.List < org.ovirt.engine.api.model.PowerManagement > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( ";;foo:one=1,two=2,three=3;;" , "one=bool,two=int,three=bool" ) ; assertNotNull ( ret ) ; assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; }

Target:
public void testParseStraySemiColons ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( ";;foo:one=1,two=2,three=3;;" , "one=bool,two=int,three=bool" ) ; assertNotNull ( ret ) ; assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; }
Source:
public void execute ( ) { selectionModel.setSelected ( values.get ( 0 ) , true ) ; }

Target:
public void setRowData ( int start , final java.util.List < ? extends T > values ) { super . setRowData ( start , values ) ; selectionModel.resolveChanges ( ) ; if ( ( isAttached ( ) ) && ( isVisible ( ) ) ) { autoSelectFirst ( ) ; } updateTableControls ( ) ; enforceScrollPosition ( ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > setUpLuns ( ) { org.ovirt.engine.core.common.businessentities.LUNs lun = new org.ovirt.engine.core.common.businessentities.LUNs ( ) ; lun.setLUN_id ( GUIDS [ 2 ] . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > luns = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; luns.add ( lun ) ; return luns ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > setUpLuns ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun.setLUN_id ( GUIDS [ 2 ] . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; luns.add ( lun ) ; return luns ; }
Source:
public static boolean CanUpdateField ( java.lang.Class < ? > objectType , java.lang.String fieldName , java.lang.Enum < ? > status , java.lang.Object fieldContainer ) { org.ovirt.engine.core.utils.ObjectIdentityChecker checker = null ; if ( ( checker = org.ovirt.engine.core.utils.ObjectIdentityChecker.mIdentities.get ( objectType ) ) != null ) { return checker.IsFieldUpdatable ( status , fieldName , fieldContainer ) ; } return true ; }

Target:
public static boolean CanUpdateField ( java.lang.Class < ? > objectType , java.lang.String fieldName , java.lang.Enum < ? > status , java.lang.Object fieldContainer ) { org.ovirt.engine.core.utils.ObjectIdentityChecker checker = org.ovirt.engine.core.utils.ObjectIdentityChecker.identities.get ( objectType ) ; if ( checker != null ) { return checker.IsFieldUpdatable ( status , fieldName , fieldContainer ) ; } return true ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 20480 ; }

Target:
public static boolean canVmsBePaused ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > items ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : items ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSuspendSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ) { return false ; } } return true ; }
Source:
protected org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getVlanDevice ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , org.ovirt.engine.core.common.businessentities.network.Network network ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface n : nics ) { if ( ( org.apache.commons.lang.StringUtils.equals ( n.getName ( ) , org.ovirt.engine.core.utils.NetworkUtils.getVlanDeviceName ( baseNic , network ) ) ) || ( org.apache.commons.lang.StringUtils.equals ( n.getNetworkName ( ) , network.getName ( ) ) ) ) { return n ; } } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getVlanDevice ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , org.ovirt.engine.core.common.businessentities.network.Network network ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface n : nics ) { if ( ( ( baseNic.getName ( ) . equals ( n.getBaseInterface ( ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( n.getVlanId ( ) , network.getVlanId ( ) ) ) ) || ( org.apache.commons.lang.StringUtils.equals ( n.getNetworkName ( ) , network.getName ( ) ) ) ) { return n ; } } return null ; }
Source:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDiskHotpluggableInterfaces ( getEntity ( ) . getOs ( ) , clusterCompatibilityVersion ) . isEmpty ( ) ) ) ) ) ; } }

Target:
protected void updateDataCenterVersion ( ) { org.ovirt.engine.ui.frontend.AsyncQuery query = 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.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; model.setDataCenterVersion ( storagePool.getCompatibilityVersion ( ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterById ( query , getEntity ( ) . getStoragePoolId ( ) ) ; }
Source:
protected void copyVmDevices ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , srcDiskIdToTargetDiskIdMapping , _vmInterfaces , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isConsoleEnabled ( ) ) ; }

Target:
protected void copyVmDevices ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( vmDevicesSourceId , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , getSrcDeviceIdToTargetDeviceIdMapping ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isConsoleEnabled ( ) , isVirtioScsiEnabled ( ) , isBalloonEnabled ( ) , false ) ; if ( ( instanceTypeId ) != null ) { copyDiskDevicesFromTemplate ( ) ; } }
Source:
public void setTestResultImage ( java.lang.String errorMessage ) { testResultImage.setResource ( ( errorMessage.isEmpty ( ) ? resources.logNormalImage ( ) : resources.logErrorImage ( ) ) ) ; testResultImage.setStylePrimaryName ( style.testResultImageStyle ( ) ) ; testResultImage.setTitle ( errorMessage ) ; }

Target:
public void setTestResultImage ( java.lang.String errorMessage ) { testResultImage.setResource ( ( errorMessage.isEmpty ( ) ? resources.logNormalImage ( ) : resources.logErrorImage ( ) ) ) ; testResultImage.setStylePrimaryName ( style.testResultImage ( ) ) ; testResultMessage.setText ( ( errorMessage.isEmpty ( ) ? constants.testSuccessMessage ( ) : errorMessage ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.ExternalVmImport vmImport ) { if ( vmImport.getCluster ( ) . isSetId ( ) ) { return asGuid ( vmImport.getCluster ( ) . getId ( ) ) ; } else { java.lang.String clusterName = vmImport.getCluster ( ) . getName ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , VdcQueryType.GetClusterByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( clusterName ) , clusterName , true ) ; return cluster.getId ( ) ; } }

Target:
private org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.ExternalVmImport vmImport ) { if ( vmImport.getCluster ( ) . isSetId ( ) ) { return asGuid ( vmImport.getCluster ( ) . getId ( ) ) ; } else { java.lang.String clusterName = vmImport.getCluster ( ) . getName ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , QueryType.GetClusterByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( clusterName ) , clusterName , true ) ; return cluster.getId ( ) ; } }
Source:
private void attachDetachDisk ( org.ovirt.engine.core.common.businessentities.storage.Disk disk , org.ovirt.engine.core.common.action.VdcActionType actionType ) { runInternalAction ( actionType , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) , disk.getId ( ) , disk.getPlugged ( ) , disk.getReadOnly ( ) ) ) ; }

Target:
private void attachDetachDisk ( org.ovirt.engine.core.common.businessentities.storage.Disk disk , org.ovirt.engine.core.common.action.VdcActionType actionType ) { runInternalAction ( actionType , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( disk.getId ( ) , org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) , disk.getPlugged ( ) , disk.getReadOnly ( ) ) ) ; }
Source:
public void nameLengthIsTooLong ( ) { 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 ) ) ; }

Target:
public void nameLengthIsTooLong ( ) { 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.hamcrest.MatcherAssert.assertThat ( validator.nameLengthIsLegal ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ) ; }
Source:
private void buildFaultResult ( ) { org.ovirt.engine.core.common.errors.VdcFault fault = new org.ovirt.engine.core.common.errors.VdcFault ( ) ; fault.setError ( VdcBllErrors.ReachedMaxNumberOfHostsInDC ) ; fault.setMessage ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . TranslateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getReturnValue ( ) . setFault ( fault ) ; }

Target:
private void buildFaultResult ( ) { org.ovirt.engine.core.common.errors.VdcFault fault = new org.ovirt.engine.core.common.errors.VdcFault ( ) ; fault.setError ( EngineError.ReachedMaxNumberOfHostsInDC ) ; fault.setMessage ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . TranslateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getReturnValue ( ) . setFault ( fault ) ; }
Source:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolNetmaskDifferent ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocolNetmask ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , 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 ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolNetmaskEqual ( ) { initIpv4ConfigurationBootProtocolNetmask ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , true ) ; org.hamcrest.MatcherAssert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public org.ovirt.engine.api.model.Tag get ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Tags > tags = getBackendCollection ( org.ovirt.engine.core.common.businessentities.Tags.class , VdcQueryType.GetTagsByVmId , new org.ovirt.engine.core.common.queries.GetTagsByVmIdParameters ( vmId.toString ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : tags ) { if ( tag.getTagId ( ) . equals ( guid ) ) { return addLinks ( populate ( map ( tag , null ) , tag ) ) ; } } return notFound ( ) ; }

Target:
public org.ovirt.engine.api.model.Tag get ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Tags > tags = getBackendCollection ( org.ovirt.engine.core.common.businessentities.Tags.class , QueryType.GetTagsByVmId , new org.ovirt.engine.core.common.queries.GetTagsByVmIdParameters ( vmId.toString ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : tags ) { if ( tag.getTagId ( ) . equals ( guid ) ) { return addLinks ( populate ( map ( tag , null ) , tag ) ) ; } } return notFound ( ) ; }
Source:
private void addPermissionForTemplate ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.bll.PredefinedRoles role ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( userId ) ; perms.setObjectType ( VdcObjectType.VmTemplate ) ; perms.setObjectId ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getVmTemplateId ( ) ) ; perms.setrole_id ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
private void addPermissionForTemplate ( org.ovirt.engine.core.bll.UniquePermissionsSet permissionsToAdd , org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.bll.PredefinedRoles role ) { permissionsToAdd.addPermission ( userId , role.getId ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getVmTemplateId ( ) , VdcObjectType.VmTemplate ) ; }
Source:
public void testValidModifiedBondsFailsWhenBondIsUnnamed ( ) throws java.lang.Exception { doTestValidModifiedBonds ( new org.ovirt.engine.core.common.businessentities.network.Bond ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID ) ; }

Target:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ; org.ovirt.engine.core.bll.ValidationResult slavesValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , "slaveA" ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_NAME , "networkName" ) ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , slavesValidationResult , slavesValidationResult ) ; }
Source:
protected boolean isBlankTemplateSelected ( ) { return ( ( getSelectedItem ( ) ) != null ) && ( org.ovirt.engine.core.compat.Guid.OpEquality ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getSelectedItem ( ) ) ) . getId ( ) , NGuid.Empty ) ) ; }

Target:
protected boolean isBlankTemplateSelected ( ) { if ( isBlankTemplate ( getSelectedItem ( ) ) ) { return true ; } if ( ( getSelectedItems ( ) ) == null ) { return false ; } for ( java.lang.Object selectedItem : getSelectedItems ( ) ) { if ( isBlankTemplate ( selectedItem ) ) { return true ; } } return false ; }
Source:
public void canDoActionThinProvisioningSpaceCheckSucceeds ( ) throws java.lang.Exception { final int availableSize = 6 ; final int usedSize = 4 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionSpaceValidationSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmPoolDao ( ) ; existingVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.EXISTING_VM_POOL_ID ) ; deletableVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.DELETABLE_VM_POOL_ID ) ; newVmPool = new org.ovirt.engine.core.common.businessentities.VmPool ( ) ; newVmPool.setvm_pool_name ( "New VM Pool" ) ; newVmPool.setvm_pool_description ( "This is a new VM pool." ) ; newVmPool.setvds_group_id ( org.ovirt.engine.core.dao.VmPoolDAOTest.VDS_GROUP_ID ) ; existingVmPoolMap = dao.getVmPoolMapByVmGuid ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4355" ) ) ; newVmPoolMap = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( org.ovirt.engine.core.dao.VmPoolDAOTest.FREE_VM_ID , existingVmPool.getvm_pool_id ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmPoolDao ( ) ; existingVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.EXISTING_VM_POOL_ID ) ; deletableVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.DELETABLE_VM_POOL_ID ) ; newVmPool = new org.ovirt.engine.core.common.businessentities.VmPool ( ) ; newVmPool.setVmPoolName ( "New VM Pool" ) ; newVmPool.setVmPoolDescription ( "This is a new VM pool." ) ; newVmPool.setVdsGroupId ( org.ovirt.engine.core.dao.VmPoolDAOTest.VDS_GROUP_ID ) ; existingVmPoolMap = dao.getVmPoolMapByVmGuid ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4355" ) ) ; newVmPoolMap = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( org.ovirt.engine.core.dao.VmPoolDAOTest.FREE_VM_ID , existingVmPool.getVmPoolId ( ) ) ; }
Source:
public void checkAndRemoveVolumeSnapshotLimitsAlert ( final org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { if ( ! ( org.ovirt.engine.core.dao.gluster.GlusterDBUtils.getInstance ( ) . isVolumeSnapshotSoftLimitReached ( volume.getId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.removeVolumeAlert ( volume.getId ( ) , AuditLogType.GLUSTER_VOLUME_SNAPSHOT_SOFT_LIMIT_REACHED ) ; } if ( ! ( org.ovirt.engine.core.dao.gluster.GlusterDBUtils.getInstance ( ) . isVolumeSnapshotHardLimitReached ( volume.getId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.removeVolumeAlert ( volume.getId ( ) , AuditLogType.GLUSTER_VOLUME_SNAPSHOT_HARD_LIMIT_REACHED ) ; } }

Target:
public void checkAndRemoveVolumeSnapshotLimitsAlert ( final org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { if ( ! ( glusterDBUtils.isVolumeSnapshotSoftLimitReached ( volume.getId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.removeVolumeAlert ( volume.getId ( ) , AuditLogType.GLUSTER_VOLUME_SNAPSHOT_SOFT_LIMIT_REACHED ) ; } if ( ! ( glusterDBUtils.isVolumeSnapshotHardLimitReached ( volume.getId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.removeVolumeAlert ( volume.getId ( ) , AuditLogType.GLUSTER_VOLUME_SNAPSHOT_HARD_LIMIT_REACHED ) ; } }
Source:
protected void analyze ( ) { proceedDownVms ( ) ; proceedWatchdogEvents ( ) ; proceedBalloonCheck ( ) ; proceedGuaranteedMemoryCheck ( ) ; updateRepository ( ) ; prepareGuestAgentNetworkDevicesForUpdate ( ) ; updateLunDisks ( ) ; updateVmJobs ( ) ; analyzeExternalVms ( ) ; analyzeHostedEngineVm ( ) ; if ( ( vmDynamicToSave ) != null ) { vmsMonitoring.addVmDynamicToList ( vmDynamicToSave ) ; } }

Target:
public org.ovirt.engine.core.common.businessentities.VmDynamic getVmDynamicToSave ( ) { return vmDynamicToSave ; }
Source:
public void readKeysData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.configurationsync_3_2.ConfigurationSync.row43Struct.commonByteArrayLock ) { try { int length = 0 ; this . tag_join_id = readString ( dis ) ; this . tag_name = readString ( dis ) ; this . tag_description = readString ( dis ) ; this . tag_path = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public void readKeysData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.configurationsync_3_2.ConfigurationSync.row43Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_ConfigurationSync ) { try { int length = 0 ; this . tag_join_id = readString ( dis ) ; this . tag_name = readString ( dis ) ; this . tag_description = readString ( dis ) ; this . tag_path = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }
Source:
public static void addOrUpdateTaskInDB ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask asyncTask ) { try { if ( ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) , asyncTask.getEntityType ( ) , asyncTask.getAssociatedEntities ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.log.error ( java.lang.String.format ( "Adding/Updating task %1$s to DataBase threw an exception." , asyncTask.getVdsmTaskId ( ) ) , e ) ; } }

Target:
public static void addOrUpdateTaskInDB ( org.ovirt.engine.core.bll.SPMAsyncTask asyncTask ) { try { if ( ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) , asyncTask.getEntityType ( ) , asyncTask.getAssociatedEntities ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.log.error ( java.lang.String.format ( "Adding/Updating task %1$s to DataBase threw an exception." , asyncTask.getVdsmTaskId ( ) ) , e ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > findPermissionCheckSubjects ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( clusterId , org.ovirt.engine.core.common.VdcObjectType.Cluster , actionType.getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > findPermissionCheckSubjects ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.action.ActionType actionType ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( clusterId , org.ovirt.engine.core.common.VdcObjectType.Cluster , actionType.getActionGroup ( ) ) ) ; return permissionList ; }
Source:
private void setupVdsNetworkInterfaceDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > expectedVdsNetworkInterface = java.util.Collections.singletonList ( vdsNetworkInterface ) ; org.ovirt.engine.core.dao.InterfaceDAO vdsNetworkInterfaceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.InterfaceDAO.class ) ; org.mockito.Mockito.when ( vdsNetworkInterfaceDaoMock.getVdsInterfacesByNetworkId ( networkId ) ) . thenReturn ( expectedVdsNetworkInterface ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getInterfaceDao ( ) ) . thenReturn ( vdsNetworkInterfaceDaoMock ) ; }

Target:
private void setupVdsNetworkInterfaceDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > expectedVdsNetworkInterface = java.util.Collections.singletonList ( vdsNetworkInterface ) ; org.ovirt.engine.core.dao.InterfaceDao vdsNetworkInterfaceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.InterfaceDao.class ) ; org.mockito.Mockito.when ( vdsNetworkInterfaceDaoMock.getVdsInterfacesByNetworkId ( networkId ) ) . thenReturn ( expectedVdsNetworkInterface ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getInterfaceDao ( ) ) . thenReturn ( vdsNetworkInterfaceDaoMock ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { UpdateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateHostIsReadyToRun ( final org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { sb.append ( " VDS " ) . append ( vds.getvds_name ( ) ) . append ( " " ) . append ( vds.getId ( ) ) . append ( " " ) ; for ( org.ovirt.engine.core.bll.VdsSelector.HostValidator validator : this . hostValidators ) { org.ovirt.engine.core.dal.VdcBllMessages result = validator.validate ( vds , sb ) ; if ( result != null ) { return new org.ovirt.engine.core.bll.ValidationResult ( result ) ; } } return ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateHostIsReadyToRun ( final org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { sb.append ( " VDS " ) . append ( vds.getName ( ) ) . append ( " " ) . append ( vds.getId ( ) ) . append ( " " ) ; for ( org.ovirt.engine.core.bll.VdsSelector.HostValidator validator : this . hostValidators ) { org.ovirt.engine.core.dal.VdcBllMessages result = validator.validate ( vds , sb , isMigrate ) ; if ( result != null ) { return new org.ovirt.engine.core.bll.ValidationResult ( result ) ; } } return ValidationResult.VALID ; }
Source:
private static java.lang.String getMessageToLog ( java.lang.String loggerString , org.ovirt.engine.core.common.businessentities.AuditLog auditLog ) { java.lang.String logMessage ; if ( loggerString.isEmpty ( ) ) { logMessage = auditLog.toStringForLogging ( ) ; } else { logMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.transform ( loggerString , auditLog.getmessage ( ) ) ; } return logMessage ; }

Target:
protected static java.lang.String getMessageOrNull ( org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String key = logType.name ( ) ; try { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resourceBundle.getString ( key ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( "Key '{}' is not translated in '{}'" , key , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getResourceBundleName ( ) ) ; return null ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangable ( true ) ; setEnableSearchHost ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts ( ) ; externalDiscoveredHostsListModel.setItems ( hosts ) ; externalDiscoveredHostsListModel.setIsChangable ( true ) ; }
Source:
private static boolean vmAssignedToUser ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . getAllForVm ( vmId ) . size ( ) ) > 0 ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_ADD_VM_WITH_USERS_ATTACHED_TO_POOL.toString ( ) ) ; return true ; } return false ; }

Target:
private static boolean vmAssignedToUser ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . getAllForVm ( vmId ) . size ( ) ) > 0 ) { messages.add ( EngineMessage.VM_POOL_CANNOT_ADD_VM_WITH_USERS_ATTACHED_TO_POOL.toString ( ) ) ; return true ; } return false ; }
Source:
public void setEnabled ( boolean enabled ) { for ( E item : org.ovirt.engine.ui.common.widget.editor.EnumRadioEditor.EnumRadioCellTable.getVisibleItems ( ) ) { setEnabled ( item , enabled ) ; } }

Target:
public void setEnabled ( boolean enabled ) { for ( E item : org.ovirt.engine.ui.common.widget.editor.EnumRadioEditor.EnumRadioCellTable.getVisibleItems ( ) ) { setEnabled ( item , enabled ) ; } if ( enabled ) { nameColumn.getCell ( ) . setStyleClass ( OvirtCss.LABEL_ENABLED ) ; } else { nameColumn.getCell ( ) . setStyleClass ( OvirtCss.LABEL_DISABLED ) ; } }
Source:
private void persistTopology ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( interfaceDao , host.getInterfaces ( ) , dbNics , userConfiguredData ) ; networkInterfacesPersister.persistTopology ( ) ; createHostNetworkAttachmentsPersister ( host , clusterNetworks , userConfiguredData ) . persistNetworkAttachments ( ) ; }

Target:
private void persistTopology ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( interfaceDao , host.getInterfaces ( ) , dbNics , userConfiguredData.getUserOverriddenNicValuesByNicName ( ) ) ; networkInterfacesPersister.persistTopology ( ) ; createHostNetworkAttachmentsPersister ( host , clusterNetworks , userConfiguredData ) . persistNetworkAttachments ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareSharedStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( status , name , SHARED_SD_ID ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Arrays.asList ( sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return sharedDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareSharedStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( status , name , SHARED_SD_ID ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return sharedDomain ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > setUpFiles ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > isos = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.RepoFileMetaData file = new org.ovirt.engine.core.common.businessentities.RepoFileMetaData ( ) ; file.setRepoImageId ( NAMES [ i ] ) ; isos.add ( file ) ; } return isos ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > setUpFiles ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > isos = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.RepoImage file = new org.ovirt.engine.core.common.businessentities.RepoImage ( ) ; file.setRepoImageId ( NAMES [ i ] ) ; isos.add ( file ) ; } return isos ; }
Source:
private void init ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid hostId : hostDynamicDao.getIdsOfHostsWithStatus ( VDSStatus.Up ) ) { parameters.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( hostId ) ) ; } backend.runInternalMultipleActions ( VdcActionType.RefreshHostDevices , parameters ) ; hostDeviceDao.cleanDownVms ( ) ; }

Target:
private void init ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid hostId : hostDynamicDao.getIdsOfHostsWithStatus ( VDSStatus.Up ) ) { parameters.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( hostId ) ) ; } backend.runInternalMultipleActions ( ActionType.RefreshHostDevices , parameters ) ; hostDeviceDao.cleanDownVms ( ) ; }
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.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 getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > createNetworksMap ( java.lang.String networkName , boolean vmNetwork , int mtu , java.lang.Integer vlanId ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setVmNetwork ( vmNetwork ) ; network.setMtu ( mtu ) ; network.setvlan_id ( vlanId ) ; return java.util.Collections.singletonMap ( networkName , network ) ; }

Target:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > createNetworksMap ( java.lang.String networkName , boolean vmNetwork , int mtu , java.lang.Integer vlanId ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setVmNetwork ( vmNetwork ) ; network.setMtu ( mtu ) ; network.setVlanId ( vlanId ) ; return java.util.Collections.singletonMap ( networkName , network ) ; }
Source:
public static org.ovirt.engine.core.bll.provider.storage.OpenStackVolumeProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = getDbFacade ( ) . getStorageDomainDao ( ) . get ( storageDomainId , userID , isFiltered ) ; if ( storageDomain != null ) { org.ovirt.engine.core.common.businessentities.Provider provider = getDbFacade ( ) . getProviderDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomain.getStorage ( ) ) ) ; return org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( provider ) ; } return null ; }

Target:
public static org.ovirt.engine.core.bll.provider.storage.OpenStackVolumeProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered , org.ovirt.engine.core.bll.provider.ProviderProxyFactory providerProxyFactory ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = getDbFacade ( ) . getStorageDomainDao ( ) . get ( storageDomainId , userID , isFiltered ) ; if ( storageDomain != null ) { org.ovirt.engine.core.common.businessentities.Provider provider = getDbFacade ( ) . getProviderDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomain.getStorage ( ) ) ) ; return providerProxyFactory.create ( provider ) ; } return null ; }
Source:
protected void onAction ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel network = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) ; if ( network.isManaged ( ) ) { item.edit ( ) ; } else { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperationFactory.OperationMap operationMap = item.getSetupModel ( ) . commandsFor ( item ) ; final org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand detach = operationMap.get ( NetworkOperation.REMOVE_UNMANAGED_NETWORK ) . get ( 0 ) ; item.getSetupModel ( ) . onOperation ( NetworkOperation.REMOVE_UNMANAGED_NETWORK , detach ) ; } }

Target:
protected void onAction ( ) { if ( item.isManaged ( ) ) { item.edit ( ) ; } else { java.util.Map < org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation , java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand > > operationMap = item.getSetupModel ( ) . commandsFor ( item ) ; final org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand detach = operationMap.get ( NetworkOperation.REMOVE_UNMANAGED_NETWORK ) . get ( 0 ) ; item.getSetupModel ( ) . onOperation ( NetworkOperation.REMOVE_UNMANAGED_NETWORK , detach ) ; } }
Source:
public void testWithEnoughSparesMemory ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "1" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 2048 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.Assert.assertEquals ( 5 , result.size ( ) ) ; }

Target:
public void testWithEnoughSparesMemory ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "1" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 2048 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 5 , result.size ( ) ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , org.apache.commons.lang.StringUtils.defaultString ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewName ( ) ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , org.apache.commons.lang.StringUtils.defaultString ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewName ( ) ) ) ; jobProperties.put ( "sourcevm" , org.apache.commons.lang.StringUtils.defaultString ( getSourceVmFromDb ( ) . getName ( ) ) ) ; } return jobProperties ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = getBackendInstance ( ) . RunVdsCommand ( VDSCommandType.GetGlusterVolumeOptionsInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( getClusterUtils ( ) . getUpServer ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeOptionsInfoQuery.getParameters ( ) . getClusterId ( ) ) . getId ( ) ) ) ; org.ovirt.engine.core.bll.gluster.GetGlusterVolumeOptionsInfoQuery.getQueryReturnValue ( ) . setReturnValue ( returnValue.getReturnValue ( ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.bll.gluster.GetGlusterVolumeOptionsInfoQuery.getBackendResourceManager ( ) . RunVdsCommand ( VDSCommandType.GetGlusterVolumeOptionsInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( getUpServerId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeOptionsInfoQuery.getParameters ( ) . getClusterId ( ) ) ) ) ; org.ovirt.engine.core.bll.gluster.GetGlusterVolumeOptionsInfoQuery.getQueryReturnValue ( ) . setReturnValue ( returnValue.getReturnValue ( ) ) ; }