auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testUpdateUploadIcon ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUpUpdateExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { "VmLargeIcon" } , new java.lang.Object [ ] { org.ovirt.engine.core.common.businessentities.VmIcon.typeAndDataToDataUrl ( IconTestHelpler.MEDIA_TYPE , IconTestHelpler.DATA_URL ) } , true , true ) ) ; final org.ovirt.engine.api.model.Template model = getRestModel ( 0 ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; verifyModel ( resource.update ( model ) , 0 ) ; }

Target:
protected void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( getRestModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; }
Source:
public void testInventoryFile ( ) { java.nio.file.Path inventoryFile = java.nio.file.Paths.get ( "myfile" ) ; java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . inventoryFile ( inventoryFile ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.PRIVATE_KEY , ( "--inventory=" + inventoryFile ) , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }

Target:
public void testInventoryFile ( ) { java.nio.file.Path inventoryFile = java.nio.file.Paths.get ( "myfile" ) ; java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . inventoryFile ( inventoryFile ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_LOG_LEVEL , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.PRIVATE_KEY , ( "--inventory=" + inventoryFile ) , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }
Source:
private void initNetworkModels ( ) { java.util.Map < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networkModels = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Network network : allNetworks ) { netTodcParams.put ( network.getname ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.DcNetworkParams ( network ) ) ; networkModels.put ( network.getname ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ( network , this ) ) ; } setNetworks ( networkModels ) ; }

Target:
private void initDcNetworkParams ( ) { for ( org.ovirt.engine.core.common.businessentities.Network network : allNetworks ) { netTodcParams.put ( network.getname ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.DcNetworkParams ( network ) ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.network_cluster CloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network_cluster instance ) { org.ovirt.engine.core.common.businessentities.network_cluster obj = new org.ovirt.engine.core.common.businessentities.network_cluster ( ) ; obj.setstatus ( instance.getstatus ( ) ) ; obj.setis_display ( instance.getis_display ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; return obj ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster CloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; return obj ; }
Source:
protected org.ovirt.engine.api.model.Vm setVmOvfConfiguration ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runQuery ( VdcQueryType.GetVmOvfByVmId , new org.ovirt.engine.core.common.queries.GetVmOvfByVmIdParameters ( entity.getId ( ) , entity.getDbGeneration ( ) ) ) ; if ( ( queryReturnValue.getSucceeded ( ) ) && ( ( queryReturnValue.getReturnValue ( ) ) != null ) ) { java.lang.String configuration = queryReturnValue.getReturnValue ( ) ; return org.ovirt.engine.api.restapi.types.VmMapper.map ( configuration , ConfigurationType.OVF , model ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.Vm setVmOvfConfiguration ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runQuery ( QueryType.GetVmOvfByVmId , new org.ovirt.engine.core.common.queries.GetVmOvfByVmIdParameters ( entity.getId ( ) , entity.getDbGeneration ( ) ) ) ; if ( ( queryReturnValue.getSucceeded ( ) ) && ( ( queryReturnValue.getReturnValue ( ) ) != null ) ) { java.lang.String configuration = queryReturnValue.getReturnValue ( ) ; return org.ovirt.engine.api.restapi.types.VmMapper.map ( configuration , ConfigurationType.OVF , model ) ; } return model ; }
Source:
public static void GetDefaultSpmPriority ( 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.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public static void GetNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.GetAllNetworkQueryParamenters ( dataCenterId ) , aQuery ) ; }
Source:
private void assertDiskFromVolume ( com.woorea.openstack.cinder.model.Volume volume , org.ovirt.engine.core.common.businessentities.storage.CinderDisk disk ) { org.junit.Assert.assertEquals ( volume.getId ( ) , disk.getId ( ) . toString ( ) ) ; org.junit.Assert.assertEquals ( volume.getName ( ) , disk.getDiskAlias ( ) ) ; org.junit.Assert.assertEquals ( volume.getSize ( ) . intValue ( ) , disk.getSizeInGigabytes ( ) ) ; org.junit.Assert.assertEquals ( getQueryParameters ( ) . getId ( ) , disk.getStorageIds ( ) . get ( 0 ) ) ; }

Target:
private void assertDiskFromVolume ( com.woorea.openstack.cinder.model.Volume volume , org.ovirt.engine.core.common.businessentities.storage.CinderDisk disk ) { org.junit.jupiter.api.Assertions.assertEquals ( volume.getId ( ) , disk.getId ( ) . toString ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( volume.getName ( ) , disk.getDiskAlias ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( volume.getSize ( ) . intValue ( ) , disk.getSizeInGigabytes ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( getQueryParameters ( ) . getId ( ) , disk.getStorageIds ( ) . get ( 0 ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isDomainExistAndActive ( ) { if ( ( storageDomain ) == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ( storageDomain.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 , java.lang.String.format ( "$%1$s %2$s" , "status" , storageDomain.getStatus ( ) . name ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isDomainExist ( ) { if ( ( storageDomain ) == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static void GetTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters ( templateId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters ( templateId ) , aQuery ) ; }
Source:
public void rollback ( ) { log.error ( "Transaction rolled-back for command '{}'." , this . getClass ( ) . getName ( ) ) ; try { if ( isQuotaDependant ( ) ) { rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.error ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }

Target:
private void executeActionInTransactionScope ( ) { registerRollbackHandler ( new DefaultCommandTransactionCompletionListener ( ) ) ; if ( ! ( executeWithoutTransaction ( ) ) ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) == null ) { cancelTasks ( ) ; } org.ovirt.engine.core.utils.transaction.TransactionSupport.setRollbackOnly ( ) ; } }
Source:
public void newProfile ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedItem = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel ) ( org.ovirt.engine.ui.uicommonweb.models.CommonModel.getInstance ( ) . getSystemTree ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedDc = org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel.findAncestor ( SystemTreeItemType.DataCenter , treeSelectedItem ) ; final org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profileModel = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( this , ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( treeSelectedDc.getEntity ( ) ) ) . getcompatibility_version ( ) ) ; setWindow ( profileModel ) ; initNetworkList ( profileModel ) ; }

Target:
public void newProfile ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.core.common.businessentities.StoragePool treeSelectedDc = getSelectedDc ( ) ; final org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profileModel = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( this , treeSelectedDc.getcompatibility_version ( ) , treeSelectedDc.getId ( ) ) ; setWindow ( profileModel ) ; initNetworkList ( profileModel ) ; }
Source:
public static < T extends org.ovirt.engine.core.common.businessentities.VmBase > void updateVmDevices ( T entity , org.ovirt.engine.core.compat.Guid newId ) { if ( entity != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateCdInVmDevice ( entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateBootOrderInVmDevice ( entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateNumOfMonitorsInVmDevice ( null , entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateUSBSlots ( null , entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateMemoryBalloon ( null , entity , true ) ; } }

Target:
public static < T extends org.ovirt.engine.core.common.businessentities.VmBase > void updateVmDevices ( T entity , org.ovirt.engine.core.compat.Guid newId ) { if ( entity != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateCdInVmDevice ( entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateBootOrderInVmDeviceAndStoreToDB ( entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateNumOfMonitorsInVmDevice ( null , entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateUSBSlots ( null , entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateMemoryBalloon ( null , entity , true ) ; } }
Source:
public void testVMIsNotValid ( ) { org.mockito.Mockito.when ( vmValidator.vmNotSavingRestoring ( ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_SAVING_RESTORING ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotsForVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_IS_SAVING_RESTORING ) ; }

Target:
public void testVMIsNotValid ( ) { org.mockito.Mockito.when ( vmValidator.vmNotSavingRestoring ( ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_SAVING_RESTORING ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_IS_SAVING_RESTORING ) ; }
Source:
private void externalNetworkPortMirroringTest ( boolean externalNetwork , boolean portMirroring , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.ovirt.engine.core.common.businessentities.network.Network network = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.network.Network.class ) ; if ( externalNetwork ) { org.mockito.Mockito.when ( network.getProvidedBy ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.network.ProviderNetwork.class ) ) ; } org.mockito.Mockito.when ( nic.isPortMirroring ( ) ) . thenReturn ( portMirroring ) ; org.junit.Assert.assertThat ( validator.portMirroringNotSetIfExternalNetwork ( network ) , matcher ) ; }

Target:
private void externalNetworkPortMirroringTest ( boolean externalNetwork , boolean portMirroring , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.ovirt.engine.core.common.businessentities.network.Network network = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.network.Network.class ) ; org.mockito.Mockito.when ( network.isExternal ( ) ) . thenReturn ( externalNetwork ) ; org.mockito.Mockito.when ( nic.isPortMirroring ( ) ) . thenReturn ( portMirroring ) ; org.junit.Assert.assertThat ( validator.portMirroringNotSetIfExternalNetwork ( network ) , matcher ) ; }
Source:
protected void EndImportCommand ( ) { if ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) { setVm ( null ) ; } EndActionOnAllImageGroups ( ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) . getId ( ) ) ; UpdateVmImSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }

Target:
public org.ovirt.engine.core.compat.Guid getVmId ( ) { if ( getParameters ( ) . isImportAsNewEntity ( ) ) { return getParameters ( ) . getVm ( ) . getId ( ) ; } else { return super . getVmId ( ) ; } }
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.setVlanId ( vlanId ) ; return java.util.Collections.singletonMap ( networkName , network ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network createNetwork ( 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 network ; }
Source:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImageById ( org.ovirt.engine.core.compat.Guid id , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { return org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( diskImages , new org.ovirt.engine.ui.uicommonweb.Linq.IdPredicate < > ( id ) ) ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesSubtract ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesToSubtract ) { java.util.Set < org.ovirt.engine.core.compat.Guid > idsToSubtract = imagesToSubtract.stream ( ) . map ( DiskImage :: getImageId ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; return images.stream ( ) . filter ( new org.ovirt.engine.ui.uicommonweb.Linq.IdsPredicate < > ( idsToSubtract ) . negate ( ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getRpmVersion ( 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.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( obj != null ) && ( obj instanceof org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature ) ) { org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature feature = ( ( org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature ) ( obj ) ) ; if ( ( ( ( enabled ) == ( feature.isEnabled ( ) ) ) && ( java.util.Objects.equals ( getClusterId ( ) , feature.getClusterId ( ) ) ) ) && ( java.util.Objects.equals ( getFeature ( ) , feature.getFeature ( ) ) ) ) { return true ; } } return false ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature ) ) { return false ; } org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature other = ( ( org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature ) ( obj ) ) ; return ( ( ( enabled ) == ( other.enabled ) ) && ( java.util.Objects.equals ( clusterId , other.clusterId ) ) ) && ( java.util.Objects.equals ( feature , other.feature ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchServers ( org.ovirt.engine.core.common.businessentities.VDS upServer ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue result = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.GlusterServersList , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( upServer.getId ( ) ) ) ; return result.getSucceeded ( ) ? ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > ) ( result.getReturnValue ( ) ) ) : null ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchServers ( org.ovirt.engine.core.common.businessentities.VDS upServer ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue result = runVdsCommand ( VDSCommandType.GlusterServersList , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( upServer.getId ( ) ) ) ; return result.getSucceeded ( ) ? ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > ) ( result.getReturnValue ( ) ) ) : null ; }
Source:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > > aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public static void saveAsyncTaskInDB ( org.ovirt.engine.core.bll.SPMAsyncTask asyncTask ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . save ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) , asyncTask.getEntityType ( ) , asyncTask.getAssociatedEntities ( ) ) ; }

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.getTaskID ( ) ) , e ) ; } }
Source:
public void run ( ) { try { java.lang.String encrypted = org.ovirt.engine.core.utils.crypt.EncryptionUtils.encrypt ( plain , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.keyStoreURL , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.keyStorePass , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.certAlias ) ; java.lang.String plain2 = org.ovirt.engine.core.utils.crypt.EncryptionUtils.decrypt ( encrypted , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.keyStoreURL , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.keyStorePass , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.certAlias ) ; if ( ! ( plain.equals ( plain2 ) ) ) { failed.set ( true ) ; java.lang.System.out.println ( "BAD" ) ; java.lang.System.out.println ( ( "plain2: " + plain2 ) ) ; } } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void run ( ) { try { java.lang.String encrypted = org.ovirt.engine.core.utils.crypt.EncryptionUtils.encrypt ( plain , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.keyStoreURL , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.keyStorePass , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.certAlias ) ; java.lang.String actualDecrypted = org.ovirt.engine.core.utils.crypt.EncryptionUtils.decrypt ( encrypted , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.keyStoreURL , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.keyStorePass , org.ovirt.engine.core.utils.crypt.EncryptionUtilsTest.certAlias ) ; if ( ! ( plain.equals ( actualDecrypted ) ) ) { java.lang.String failure = java.lang.String.format ( "Failure in test %d, plain is %s%n" , threadCount , actualDecrypted ) ; failures.append ( failure ) ; failed.set ( true ) ; } } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
protected void executeVdsBrokerCommand ( ) { java.util.List < java.lang.String > vmIds = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getParameters ( ) . getVmIds ( ) ; java.lang.String [ ] vmIdsArray = vmIds.toArray ( new java.lang.String [ vmIds.size ( ) ] ) ; fullVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getBroker ( ) . list ( java.lang.Boolean.TRUE.toString ( ) , vmIdsArray ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > [ ] struct = fullVmListReturn.vmList ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.setReturnValue ( struct ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { java.util.List < java.lang.String > vmIds = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getParameters ( ) . getVmIds ( ) ; java.lang.String [ ] vmIdsArray = vmIds.toArray ( new java.lang.String [ vmIds.size ( ) ] ) ; fullVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getBroker ( ) . fullList ( vmIdsArray ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > [ ] struct = fullVmListReturn.vmList ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.setReturnValue ( struct ) ; }
Source:
private void readUsbItem ( org.ovirt.engine.core.compat.backendcompat.XmlNode node ) { _vm.getStaticData ( ) . setUsbPolicy ( org.ovirt.engine.core.common.businessentities.UsbPolicy.forStringValue ( node.SelectSingleNode ( "rasd:UsbPolicy" , _xmlNS ) . innerText ) ) ; }

Target:
protected void updateSingleNic ( org.ovirt.engine.core.compat.backendcompat.XmlNode node , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { super . updateSingleNic ( node , iface ) ; iface.setName ( node.SelectSingleNode ( OvfProperties.VMD_NAME , _xmlNS ) . innerText ) ; iface.setMacAddress ( ( ( node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) ) != null ? node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) . innerText : "" ) ) ; }
Source:
public void mixedClusterServicesNotSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , false ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ) ; }

Target:
public void nonMixedClusterServiceSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , false ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( false ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private boolean canVdsBeReached ( ) { org.ovirt.engine.core.common.businessentities.VDSStatus vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getstatus ( ) ; if ( ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) || ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Reboot ) ) ) { vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getprevious_status ( ) ; } return ( vdsStatus != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) && ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Problematic ) ) ; }

Target:
private boolean canVdsBeReached ( ) { org.ovirt.engine.core.common.businessentities.VDSStatus vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getstatus ( ) ; if ( ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) || ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Reboot ) ) ) { vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getprevious_status ( ) ; } return ( vdsStatus != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) && ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) ; }
Source:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public static void getAllVnicProfiles ( 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVnicProfiles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public static void getDbGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDbGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public java.lang.StringBuilder GetTagNameAndChildrenNames ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_name ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : _children ) { builder.append ( ( "," + ( tag.GetTagNameAndChildrenNames ( ) ) ) ) ; } return builder ; }

Target:
public java.lang.StringBuilder getTagNameAndChildrenNames ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_name ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : _children ) { builder.append ( ( "," + ( tag.getTagNameAndChildrenNames ( ) ) ) ) ; } return builder ; }
Source:
protected void endMoveVmCommand ( ) { boolean vmExists = ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) != null ; if ( vmExists ) { incrementDbGeneration ( ) ; } org.ovirt.engine.core.bll.MoveVmCommand.endActionOnAllImageGroups ( ) ; if ( vmExists ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) ; } else { org.ovirt.engine.core.bll.MoveVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveVmCommand::EndMoveVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.MoveVmCommand.setSucceeded ( true ) ; }

Target:
protected void endMoveVmCommand ( ) { boolean vmExists = ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) != null ; if ( vmExists ) { incrementDbGeneration ( ) ; } org.ovirt.engine.core.bll.MoveVmCommand.endActionOnAllImageGroups ( ) ; if ( vmExists ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) ; } else { org.ovirt.engine.core.bll.MoveVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveVmCommand::EndMoveVmCommand: Vm is null - not performing full endAction" ) ; } org.ovirt.engine.core.bll.MoveVmCommand.setSucceeded ( true ) ; }
Source:
public static void getAAAProfilesList ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getRoleList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void lunsMatch ( ) { org.ovirt.engine.core.common.businessentities.LUNs lun = new org.ovirt.engine.core.common.businessentities.LUNs ( ) ; lun.setLUN_id ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; lun.setphysical_volume_id ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > lunsFromVgInfo = java.util.Arrays.asList ( lun , lun ) ; java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > lunsFromDb = java.util.Arrays.asList ( lun , lun ) ; boolean isMismatch = command.isLunsInfoMismatch ( lunsFromVgInfo , lunsFromDb ) ; org.junit.Assert.assertFalse ( isMismatch ) ; }

Target:
public void lunsMatch ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun.setLUN_id ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; lun.setphysical_volume_id ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromVgInfo = java.util.Arrays.asList ( lun , lun ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromDb = java.util.Arrays.asList ( lun , lun ) ; boolean isMismatch = command.isLunsInfoMismatch ( lunsFromVgInfo , lunsFromDb ) ; org.junit.Assert.assertFalse ( isMismatch ) ; }
Source:
public void reportCompleted ( ) { try { super . reportCompleted ( ) ; } finally { if ( ( getDestinationVdsId ( ) ) != null ) { decreasePendingVms ( getDestinationVdsId ( ) ) ; } } }

Target:
private org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters createMigrateVDSCommandParameters ( ) { java.lang.String srcVdsHost = org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getHostName ( ) ; java.lang.String dstVdsHost = java.lang.String.format ( "%1$s:%2$s" , getDestinationVds ( ) . getHostName ( ) , getDestinationVds ( ) . getPort ( ) ) ; return new org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) , srcVdsHost , getDestinationVdsId ( ) , dstVdsHost , org.ovirt.engine.core.common.businessentities.MigrationMethod.ONLINE , isTunnelMigrationUsed ( ) , getMigrationNetworkIp ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getVdsGroupCompatibilityVersion ( ) , getMaximumMigrationDowntime ( ) ) ; }
Source:
protected void mockGetImageDomainsListVdsCommand ( int availableDiskSizeFirstDomain , int availableDiskSizeSecondDomain ) { mockGetStorageDomainList ( availableDiskSizeFirstDomain , availableDiskSizeSecondDomain ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( mockStorageGuidList ( storageDomainsList ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetImageDomainsList ) , org.mockito.Matchers.< org.ovirt.engine.core.common.vdscommands.VDSParametersBase > any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( returnValue ) ; }

Target:
protected void mockGetImageDomainsListVdsCommand ( int availableDiskSizeFirstDomain , int availableDiskSizeSecondDomain ) { mockGetStorageDomainList ( availableDiskSizeFirstDomain , availableDiskSizeSecondDomain ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.mockStorageGuidList ( storageDomainsList ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetImageDomainsList ) , org.mockito.Matchers.< org.ovirt.engine.core.common.vdscommands.VDSParametersBase > any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( returnValue ) ; }
Source:
public static boolean isSpecialDevice ( java.lang.String device , java.lang.String type ) { return ( ( VmDeviceType.SOUND.getName ( ) . equals ( type ) ) || ( VmDeviceType.USB.getName ( ) . equals ( device ) ) ) || ( ( VmDeviceType.SPICEVMC.getName ( ) . equals ( device ) ) && ( VmDeviceType.REDIR.getName ( ) . equals ( type ) ) ) ; }

Target:
public static boolean isSpecialDevice ( java.lang.String device , java.lang.String type ) { return ( ( ( VmDeviceType.SOUND.getName ( ) . equals ( type ) ) || ( VmDeviceType.USB.getName ( ) . equals ( device ) ) ) || ( ( VmDeviceType.SPICEVMC.getName ( ) . equals ( device ) ) && ( VmDeviceType.REDIR.getName ( ) . equals ( type ) ) ) ) || ( ( VmDeviceType.MEMBALLOON.getName ( ) . equals ( device ) ) && ( VmDeviceType.BALLOON.getName ( ) . equals ( type ) ) ) ; }
Source:
public void testCheckVmOnlyOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( inClusterUpgradeValidator ) . isVmReadyForUpgrade ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isVmReadyForUpgrade ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void testShouldCheckVmOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( inClusterUpgradeValidator ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; group.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
public static void GetVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void GetDiskMaxSize ( 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.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxBlockDiskSize ) , aQuery ) ; }
Source:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.lang.Object [ ] keys = new java.lang.Object [ getSelectedItems ( ) . size ( ) ] ; for ( int i = 0 ; i < ( getSelectedItems ( ) . size ( ) ) ; i ++ ) { keys [ i ] = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItems ( ) . get ( i ) ) ) . getId ( ) ; } return keys ; } }

Target:
public org.ovirt.engine.ui.uicommonweb.models.gluster.HostGlusterStorageDevicesListModel getGlusterStorageDeviceListModel ( ) { return glusterStorageDeviceListModel ; }