auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void updateDetailsAvailability ( ) { super . updateDetailsAvailability ( ) ; if ( ( ( getSelectedItem ( ) ) != null ) && ( ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSelectedItem ( ) ) ) . getQuotaEnforcementType ( ) ) != ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) ) { quotaListModel.setIsAvailable ( true ) ; } else { quotaListModel.setIsAvailable ( false ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { boolean hasIscsiStorage = false ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : connections ) { if ( ( connection.getstorage_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.ISCSI ) ) { hasIscsiStorage = true ; break ; } } iscsiBondListModel.setIsAvailable ( hasIscsiStorage ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkOutOfSyncWithMtuUnset ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , 0 , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkOutOfSyncWithMtuUnset ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , 0 , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) , createQos ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc monitorCommand ( java.lang.String vmId , java.lang.String monitorCommand ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.monitorCommand" ) . withParameter ( "vmID" , vmId ) . withParameter ( "command" , monitorCommand ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn reduceDomain ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > reduceParams ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.reduce_domain" ) . withParameter ( "job_id" , jobId ) . withParameter ( "reduce_params" , reduceParams ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void testGetAllStorageDomainsByImageGroup ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > result = dao.getAllStorageDomainsByImageGroup ( new org.ovirt.engine.core.compat.Guid ( "1b26a52b-b60f-44cb-9f46-3ef333b04a34" ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.get ( 0 ) , existingDomain.getId ( ) ) ; }

Target:
public void testGetAllStorageDomainsByNotExistingImageId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > result = dao.getAllStorageDomainsByImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }
Source:
private boolean isIpv4GatewayInSync ( ) { java.lang.String gatewayDesiredValue = getIpv4PrimaryAddress ( ) . getGateway ( ) ; java.lang.String gatewayActualValue = iface.getIpv4Gateway ( ) ; boolean bothBlank = ( org.apache.commons.lang.StringUtils.isBlank ( gatewayDesiredValue ) ) && ( org.apache.commons.lang.StringUtils.isBlank ( gatewayActualValue ) ) ; return bothBlank || ( java.util.Objects.equals ( gatewayDesiredValue , gatewayActualValue ) ) ; }

Target:
private boolean isIpv6GatewayInSync ( ) { java.lang.String gatewayDesiredValue = getIpv6PrimaryAddress ( ) . getGateway ( ) ; java.lang.String gatewayActualValue = iface.getIpv6Gateway ( ) ; return java.util.Objects.equals ( gatewayDesiredValue , gatewayActualValue ) ; }
Source:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
private static void initSuspendSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.suspendSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetSuspendSupport ) , callback ) ; }

Target:
private void initMemorySnapshotSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { memorySnapshotSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetMemorySnapshotSupport ) , callback ) ; }
Source:
public 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 ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . get ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommandTest.serverId ) ; org.mockito.Mockito.doReturn ( getCluster ( true , Version.v4_1 ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
public void testFetchNotExistingRepoFileListById ( ) { org.ovirt.engine.core.compat.Guid falseGuid = new org.ovirt.engine.core.compat.Guid ( "11111111-1111-1111-1111-111111111111" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( falseGuid , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertSame ( true , listOfRepoFiles.isEmpty ( ) ) ; }

Target:
public void testFetchNotExistingRepoFileListById ( ) { org.ovirt.engine.core.compat.Guid falseGuid = new org.ovirt.engine.core.compat.Guid ( "11111111-1111-1111-1111-111111111111" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( falseGuid , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertTrue ( listOfRepoFiles.isEmpty ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getEntitySpecific ( int index ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setName ( NAMES [ index ] ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setSpeed ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_SPEED ) ; entity = org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , GUIDS [ index ] ) ; entity.getStatistics ( ) . setStatus ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_STATUS ) ; entity.setBootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return entity ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getEntitySpecific ( int index ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setName ( NAMES [ index ] ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setSpeed ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_SPEED ) ; entity = org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , GUIDS [ index ] ) ; entity.getStatistics ( ) . setStatus ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_STATUS ) ; entity.setIpv4BootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return entity ; }
Source:
public org.ovirt.engine.api.model.RSDL loadRsdl ( org.ovirt.engine.core.common.mode.ApplicationMode applicationMode ) throws java.io.IOException { java.io.InputStream stream = ( applicationMode == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) ? this . getClass ( ) . getResourceAsStream ( org.ovirt.engine.api.rsdl.RsdlManager.GLUSTER_RSDL_FILE_NAME ) : this . getClass ( ) . getResourceAsStream ( org.ovirt.engine.api.rsdl.RsdlManager.RSDL_FILE_NAME ) ; return javax.xml.bind.JAXB.unmarshal ( stream , org.ovirt.engine.api.model.RSDL.class ) ; }

Target:
public static org.ovirt.engine.api.model.RSDL loadRsdl ( org.ovirt.engine.core.common.mode.ApplicationMode applicationMode ) throws java.io.IOException { java.lang.String fileName = ( applicationMode == ( org.ovirt.engine.core.common.mode.ApplicationMode.AllModes ) ) ? "/" + ( RsdlIOManager.RSDL_RESOURCE_NAME ) : "/" + ( RsdlIOManager.GLUSTER_RSDL_RESOURCE_NAME ) ; java.io.InputStream rsdlAsStrem = null ; try { rsdlAsStrem = org.ovirt.engine.api.rsdl.RsdlIOManager.loadAsStream ( fileName ) ; return javax.xml.bind.JAXB.unmarshal ( rsdlAsStrem , org.ovirt.engine.api.model.RSDL.class ) ; } finally { if ( rsdlAsStrem != null ) { rsdlAsStrem.close ( ) ; } } }
Source:
public static org.ovirt.engine.core.compat.Version SelectHighestVersion ( java.util.ArrayList < org.ovirt.engine.core.compat.Version > versions ) { org.ovirt.engine.core.compat.Version retVersion = org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( versions ) ; for ( org.ovirt.engine.core.compat.Version version : versions ) { if ( ( version.compareTo ( retVersion ) ) > 0 ) { retVersion = version ; } } return retVersion ; }

Target:
public static org.ovirt.engine.core.compat.Version selectHighestVersion ( java.util.ArrayList < org.ovirt.engine.core.compat.Version > versions ) { org.ovirt.engine.core.compat.Version retVersion = org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( versions ) ; for ( org.ovirt.engine.core.compat.Version version : versions ) { if ( ( version.compareTo ( retVersion ) ) > 0 ) { retVersion = version ; } } return retVersion ; }
Source:
protected void expectGetDeviceList ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( setUpLunsFromDeviceList ( ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontendMock.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetDeviceList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters.class ) ) ) . thenReturn ( returnValue ) ; }

Target:
private void expectGetDeviceList ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.setUpLunsFromDeviceList ( ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontendMock.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetDeviceList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters.class ) ) ) . thenReturn ( returnValue ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVDSGroups ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpClusters ( ) , failure ) ; control.replay ( ) ; }
Source:
public void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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 ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage image , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.ImagesHandler.addDiskImage ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) , vmId ) ; }

Target:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.ImagesHandler.addDiskImage ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) , vmId ) ; }
Source:
public void testSave ( ) { dao.save ( newVmTemplate ) ; org.ovirt.engine.core.common.businessentities.VmTemplate result = dbFacade.getVmTemplateDao ( ) . get ( newVmTemplate.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( newVmTemplate , result ) ; }

Target:
public void testSave ( ) { newVmTemplate.setDedicatedVmForVdsList ( java.util.Arrays.asList ( org.ovirt.engine.core.dao.VmTemplateDaoTest.HOST_GUIDS ) ) ; dao.save ( newVmTemplate ) ; org.ovirt.engine.core.common.businessentities.VmTemplate result = dbFacade.getVmTemplateDao ( ) . get ( newVmTemplate.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( org.apache.commons.collections.CollectionUtils.isEqualCollection ( result.getDedicatedVmForVdsList ( ) , newVmTemplate.getDedicatedVmForVdsList ( ) ) ) ; org.junit.Assert.assertEquals ( newVmTemplate , result ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getResolveStatusConflict ( ) . getEntity ( ) ) == null ) { getResolveStatusConflictEnable ( ) . setIsChangable ( false ) ; getResolveStatusConflictDisable ( ) . setIsChangable ( false ) ; } else { getResolveStatusConflictEnable ( ) . setIsChangable ( getResolveStatusConflict ( ) . getEntity ( ) ) ; getResolveStatusConflictDisable ( ) . setIsChangable ( getResolveStatusConflict ( ) . getEntity ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getResolveStatusConflict ( ) . getEntity ( ) ) == null ) { getResolveStatusConflictEnable ( ) . setIsChangeable ( false ) ; getResolveStatusConflictDisable ( ) . setIsChangeable ( false ) ; } else { getResolveStatusConflictEnable ( ) . setIsChangeable ( getResolveStatusConflict ( ) . getEntity ( ) ) ; getResolveStatusConflictDisable ( ) . setIsChangeable ( getResolveStatusConflict ( ) . getEntity ( ) ) ; } }
Source:
protected void ExecuteIrsBrokerCommand ( ) { if ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksStatusesVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) . equals ( Guid.Empty ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksStatusesVDSCommand.setReturnValue ( new java.util.HashMap < org.ovirt.engine.core.vdsbroker.irsbroker.Guid , org.ovirt.engine.core.vdsbroker.irsbroker.AsyncTaskStatus > ( ) ) ; } else { setVDSReturnValue ( org.ovirt.engine.core.vdsbroker.irsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMGetAllTasksStatuses , new org.ovirt.engine.core.vdsbroker.irsbroker.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksStatusesVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) ) ; } }

Target:
protected void ExecuteIrsBrokerCommand ( ) { if ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksStatusesVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) . equals ( Guid.Empty ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksStatusesVDSCommand.setReturnValue ( null ) ; } else { setVDSReturnValue ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMGetAllTasksStatuses , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksStatusesVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) ) ; } }
Source:
protected boolean validateGraphicsAndDisplay ( ) { return org.ovirt.engine.core.bll.VmHandler.isGraphicsAndDisplaySupported ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) . getOs ( ) , getGraphicsTypesForVm ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; }

Target:
protected boolean validateUsbPolicy ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.updateImportedVmUsbPolicy ( vm.getStaticData ( ) ) ; return org.ovirt.engine.core.bll.VmHandler.isUsbPolicyLegal ( vm.getUsbPolicy ( ) , vm.getOs ( ) , getEffectiveCompatibilityVersion ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getReturnValue ( ) . getValidationMessages ( ) ) ; }
Source:
public void testFindExternalMacAddressesVnicsNull ( ) { final java.util.Set < java.lang.String > actual = underTest.findExternalMacAddresses ( vm , org.ovirt.engine.core.bll.network.vm.ExternalVmMacsFinderTest.COMMAND_CONTEXT ) ; org.junit.Assert.assertThat ( actual , org.hamcrest.Matchers.empty ( ) ) ; }

Target:
public void testFindExternalMacAddresses ( ) { org.mockito.Mockito.when ( mockReadMacPool.isMacInRange ( org.ovirt.engine.core.bll.network.vm.ExternalVmMacsFinderTest.MAC_ADDRESS_1 ) ) . thenReturn ( java.lang.Boolean.TRUE ) ; org.mockito.Mockito.when ( mockReadMacPool.isMacInRange ( org.ovirt.engine.core.bll.network.vm.ExternalVmMacsFinderTest.MAC_ADDRESS_2 ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; vm.setInterfaces ( java.util.Arrays.asList ( vNic1 , vNic2 ) ) ; final java.util.Set < java.lang.String > actual = underTest.findExternalMacAddresses ( vm ) ; org.junit.Assert.assertThat ( actual , org.hamcrest.Matchers.contains ( org.ovirt.engine.core.bll.network.vm.ExternalVmMacsFinderTest.MAC_ADDRESS_2 ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDisksByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { java.lang.String targetNicName = attachment.getNicName ( ) ; boolean attachmentReferencesExistingNic = ( existingInterfacesMap.get ( attachment.getNicId ( ) , targetNicName ) ) != null ; if ( attachmentReferencesExistingNic ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentReferencesNewlyCreatedBond = ( targetNicName != null ) && ( ( bondsMap.get ( targetNicName ) ) != null ) ; if ( attachmentReferencesNewlyCreatedBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( java.lang.String.valueOf ( violatingEntityId ) , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }
Source:
public void shouldPass ( ) { org.ovirt.engine.core.common.console.ConsoleOptions options = new org.ovirt.engine.core.common.console.ConsoleOptions ( org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ) ; options.setVmId ( Guid.Empty ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( options ) ; org.junit.Assert.assertTrue ( getQuery ( ) . validateInputs ( ) ) ; }

Target:
public void shouldPass ( ) { org.ovirt.engine.core.common.console.ConsoleOptions options = new org.ovirt.engine.core.common.console.ConsoleOptions ( org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ) ; options.setVmId ( Guid.Empty ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( options ) ; org.junit.jupiter.api.Assertions.assertTrue ( getQuery ( ) . validateInputs ( ) ) ; }
Source:
public void init ( javax.servlet.FilterConfig filterConfig ) throws javax.servlet.ServletException { if ( ( org.ovirt.engine.core.utils.servlet.CachingFilter.cachePattern ) == null ) { org.ovirt.engine.core.utils.servlet.CachingFilter.cachePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.core.utils.servlet.CachingFilter.CACHE_INIT_PARAM ) ; } if ( ( org.ovirt.engine.core.utils.servlet.CachingFilter.noCachePattern ) == null ) { org.ovirt.engine.core.utils.servlet.CachingFilter.noCachePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.core.utils.servlet.CachingFilter.NO_CACHE_INIT_PARAM ) ; } if ( ( org.ovirt.engine.core.utils.servlet.CachingFilter.noStorePattern ) == null ) { org.ovirt.engine.core.utils.servlet.CachingFilter.noStorePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.core.utils.servlet.CachingFilter.NO_STORE_INIT_PARAM ) ; } }

Target:
public void init ( javax.servlet.FilterConfig filterConfig ) throws javax.servlet.ServletException { if ( ( cachePattern ) == null ) { cachePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.core.utils.servlet.CachingFilter.CACHE_INIT_PARAM ) ; } if ( ( noCachePattern ) == null ) { noCachePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.core.utils.servlet.CachingFilter.NO_CACHE_INIT_PARAM ) ; } if ( ( noStorePattern ) == null ) { noStorePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.core.utils.servlet.CachingFilter.NO_STORE_INIT_PARAM ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc list ( java.lang.String mode , java.lang.String [ ] vmIds ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.list ( mode , vmIds ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc teardownImage ( java.lang.String sdID , java.lang.String spID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.teardownImage ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void getGlusterSwiftServerServices ( 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
private void internalFreeMac ( java.lang.String mac ) { if ( ( allocatedMacs.get ( mac ) ) != null ) { removeMacFromMap ( allocatedMacs , mac ) ; availableMacs.add ( mac ) ; } else if ( ( allocatedCustomMacs.get ( mac ) ) != null ) { removeMacFromMap ( allocatedCustomMacs , mac ) ; } }

Target:
private void internalFreeMac ( java.lang.String mac ) { if ( allocatedMacs.containsKey ( mac ) ) { removeMacFromMap ( allocatedMacs , mac ) ; if ( ! ( allocatedMacs.containsKey ( mac ) ) ) { availableMacs.add ( mac ) ; } } else if ( allocatedCustomMacs.containsKey ( mac ) ) { removeMacFromMap ( allocatedCustomMacs , mac ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult vmNotRunningStateless ( ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.dal.VdcBllMessages message = ( vm.isRunning ( ) ) ? org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS : org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_HAS_STATELESS_SNAPSHOT_LEFTOVER ; return new org.ovirt.engine.core.bll.ValidationResult ( message ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult vmNotRunningStateless ( ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.common.errors.VdcBllMessages message = ( vm.isRunning ( ) ) ? org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS : org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_HAS_STATELESS_SNAPSHOT_LEFTOVER ; return new org.ovirt.engine.core.bll.ValidationResult ( message ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmStatistics ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksUsageInXmlRpc ( null ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertNull ( vmStatistics.getDisksUsage ( ) ) ; }

Target:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmStatistics ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksUsage ( null ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertNull ( vmStatistics.getDisksUsage ( ) ) ; }
Source:
public void testUpdateBrickStatus ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.EXISTING_BRICK_ID ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( GlusterStatus.UP , existingBrick.getStatus ( ) ) ; dao.updateBrickStatus ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.EXISTING_BRICK_ID , GlusterStatus.DOWN ) ; existingBrick = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.EXISTING_BRICK_ID ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( GlusterStatus.DOWN , existingBrick.getStatus ( ) ) ; }

Target:
public void testUpdateBrickTask ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask = new org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask ( ) ; asyncTask.setTaskId ( new org.ovirt.engine.core.compat.Guid ( "61c94fc7-26b0-43e3-9d26-fc9d8cd6a763" ) ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( GlusterStatus.UP , existingBrick.getStatus ( ) ) ; dao.updateBrickTask ( existingBrick.getId ( ) , FixturesTool.GLUSTER_ASYNC_TASK_ID1 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newEnity = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_ASYNC_TASK_ID1 , newEnity.getAsyncTask ( ) . getTaskId ( ) ) ; }
Source:
protected void itemsChanged ( T selectedItem ) { if ( selectedItem == null ) { itemsChanged ( ) ; } else { java.util.List < T > selectedItems = new java.util.ArrayList < > ( ) ; selectedItems.add ( selectedItem ) ; setSelectedItem ( selectedItem ) ; setSelectedItems ( selectedItems ) ; } }

Target:
protected void itemsChanged ( T selectedItem ) { if ( selectedItem == null ) { itemsChanged ( ) ; } else { java.util.List < T > selectedItems = new java.util.ArrayList < > ( ) ; selectedItems.add ( selectedItem ) ; setSelectedItem ( selectedItem ) ; setSelectedItems ( selectedItems ) ; getSelectionModel ( ) . setSelected ( selectedItem , true ) ; } }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) != null ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) != null ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }
Source:
public void hostNameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }

Target:
public void hostNameNotUsed ( ) { org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > emptyList ( ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetImagesListParameters ( asGuid ( storageDomainId ) , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.storage.RepoImage.class , VdcQueryType.GetImagesList , queryParams ) ; java.util.List < java.lang.String > fileNames = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage file : files ) { fileNames.add ( file.getRepoImageId ( ) ) ; } return fileNames ; }

Target:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetImagesListParameters ( asGuid ( storageDomainId ) , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.storage.RepoImage.class , VdcQueryType.GetImagesList , queryParams ) ; return files.stream ( ) . map ( RepoImage :: getRepoImageId ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
protected boolean checkStoragePoolStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getStatus ( ) ) == status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL.toString ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; } } return returnValue ; }

Target:
protected boolean checkStoragePoolStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getStatus ( ) ) == status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL.toString ( ) ) ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; } } return returnValue ; }
Source:
public void validateFailureOnMovingVmLunDisk ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.LunDisk ( ) ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE ) ; }

Target:
public void validateVmInPreview ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
public void updateInitialRunFields ( ) { getIsSysprepPossible ( ) . setEntity ( getIsWindowsOS ( ) ) ; getIsSysprepEnabled ( ) . setEntity ( ( ( getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ) ) ; getIsCloudInitPossible ( ) . setEntity ( getIsLinuxOS ( ) ) ; getIsCloudInitEnabled ( ) . setEntity ( ( ( getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.CloudInit ) ) ) ; }

Target:
public void updateInitialRunFields ( ) { getIsSysprepPossible ( ) . setEntity ( getIsWindowsOS ( ) ) ; getIsSysprepEnabled ( ) . setEntity ( ( ( getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ) ) ; getIsCloudInitPossible ( ) . setEntity ( ( ! ( getIsWindowsOS ( ) ) ) ) ; getIsCloudInitEnabled ( ) . setEntity ( ( ( getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.CloudInit ) ) ) ; getIsCloudInitEnabled ( ) . setIsAvailable ( ( ! ( getIsWindowsOS ( ) ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase removeVmImages ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.RemoveAllVmImages , buildRemoveAllVmImagesParameters ( images ) ) ; if ( vdcRetValue.getSucceeded ( ) ) { getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return vdcRetValue ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase removeVmImages ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.RemoveAllVmImages , buildRemoveAllVmImagesParameters ( images ) ) ; if ( vdcRetValue.getSucceeded ( ) ) { getTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return vdcRetValue ; }