auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void volumeInfoIsEmpty ( ) { givenListOfImagesAndVolumes ( ) ; mockVdsCommand ( VDSCommandType.GetImageInfo , unsuccessfulReturnValue ( null ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetImageInfo , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.RetrieveImageData , org.mockito.Mockito.never ( ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }

Target:
public void volumeInfoIsEmpty ( ) { givenListOfImagesAndVolumes ( ) ; mockVdsCommand ( VDSCommandType.GetImageInfo , unsuccessfulReturnValue ( null ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetImageInfo , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VdcActionType.RetrieveImageData , org.mockito.Mockito.never ( ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }
Source:
public void update ( int index , org.ovirt.engine.core.common.businessentities.Cluster cluster , java.lang.String value ) { transitionHandler.handlePlaceTransition ( true ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.Cluster cluster , java.lang.String value ) { java.util.Map < java.lang.String , java.lang.String > parameters = new java.util.HashMap < > ( ) ; parameters.put ( FragmentParams.NAME.getName ( ) , cluster.getName ( ) ) ; getPlaceTransitionHandler ( ) . handlePlaceTransition ( WebAdminApplicationPlaces.clusterGeneralSubTabPlace , parameters ) ; }
Source:
private java.lang.String GetValue ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.core.common.businessentities.VM ) { return ( ( org.ovirt.engine.core.common.businessentities.VM ) ( obj ) ) . getVmName ( ) ; } if ( obj instanceof org.ovirt.engine.core.common.businessentities.vm_pools ) { return ( ( org.ovirt.engine.core.common.businessentities.vm_pools ) ( obj ) ) . getvm_pool_name ( ) ; } throw new org.ovirt.engine.core.compat.NotImplementedException ( ) ; }

Target:
private java.lang.String GetValue ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.core.common.businessentities.VM ) { return ( ( org.ovirt.engine.core.common.businessentities.VM ) ( obj ) ) . getVmName ( ) ; } if ( obj instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { return ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( obj ) ) . getvm_pool_name ( ) ; } throw new org.ovirt.engine.core.compat.NotImplementedException ( ) ; }
Source:
protected void removeSnapshot ( org.ovirt.engine.core.common.businessentities.storage.DiskImage snapshot ) { org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesForDisk = diskImageDao.getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }

Target:
protected void removeSnapshot ( org.ovirt.engine.core.common.businessentities.storage.DiskImage snapshot ) { org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesForDisk = diskImageDao.getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { baseDiskDao.remove ( snapshot.getId ( ) ) ; } }
Source:
public void testExecuteQuery ( ) { getQuery ( ) . executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , java.lang.String > result = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( "Wrong number of time zones" , SysprepHandler.timeZoneIndex.size ( ) , result.size ( ) ) ; }

Target:
public void testExecuteQuery ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . isWindowsOS ( ) ) . thenReturn ( true ) ; getQuery ( ) . executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , java.lang.String > result = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; assertEquals ( "Wrong number of time zones" , SysprepHandler.timeZoneIndex.size ( ) , result.size ( ) ) ; }
Source:
public void setSelectedItem ( java.lang.Integer value ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . osNameExists ( value ) ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( dataCenterWithCluster == null ) ? null : dataCenterWithCluster.getCluster ( ) ; if ( cluster == null ) { return ; } super . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultOs ( cluster.getArchitecture ( ) ) ) ; } else { super . setSelectedItem ( value ) ; } }

Target:
public void setSelectedItem ( org.ovirt.engine.core.common.businessentities.VDS value ) { if ( value == null ) { setSelectedItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ) ; } else { setSelectedItems ( new java.util.ArrayList ( java.util.Arrays.asList ( value ) ) ) ; } }
Source:
default void inputDetail ( ) { org.ovirt.api.metamodel.language.ApiLanguage.or ( org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( storageDomain ( ) . id ( ) ) , org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( storageDomain ( ) . name ( ) ) ) ; }

Target:
default void inputDetail ( ) { org.ovirt.api.metamodel.language.ApiLanguage.or ( org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( storageDomain ( ) . id ( ) ) , org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( storageDomain ( ) . name ( ) ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( diskProfile ( ) . id ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( quota ( ) . id ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.ClusterPolicyListModel clusterPolicyListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.ClusterPolicyListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; clusterPolicyListModel.setPolicyUnits ( list ) ; clusterPolicyListModel.fetchClusterPolicies ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.ClusterPolicyListModel clusterPolicyListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.ClusterPolicyListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; clusterPolicyListModel.setPolicyUnits ( list ) ; clusterPolicyListModel.fetchClusterPolicies ( ) ; if ( ( policyUnitModel ) != null ) { policyUnitModel.getPolicyUnits ( ) . setItems ( sort ( policyUnits ) ) ; } }
Source:
protected void onCommonModelChange ( ) { super . onCommonModelChange ( ) ; getModel ( ) . getResetRequestedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > items = getModel ( ) . getItems ( ) ; if ( ( items != null ) && ( ! ( items.isEmpty ( ) ) ) ) { selectionModel.setSelected ( items.get ( 0 ) , true ) ; } } } ) ; }

Target:
protected void onCommonModelChange ( ) { super . onCommonModelChange ( ) ; getModel ( ) . getResetRequestedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > items = getModel ( ) . getItems ( ) ; if ( ( items != null ) && ( ! ( items.isEmpty ( ) ) ) ) { selectionModel.setSelected ( items.get ( 0 ) , true ) ; } } } ) ; }
Source:
public void testGetDataAndSetDataWithSessionParam ( ) { container.setData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE ) ; org.junit.Assert.assertNull ( "Get should return null with an empty session" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; org.junit.Assert.assertEquals ( "Get should return the value with a given session" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }

Target:
public void testGetDataAndSetDataWithSessionParam ( ) { org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( "" ) ; container.setData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE ) ; org.junit.Assert.assertNull ( "Get should return null with an empty session" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; org.junit.Assert.assertEquals ( "Get should return the value with a given session" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }
Source:
public void updateInterface ( org.ovirt.engine.core.common.businessentities.storage_pool datacenter ) { if ( datacenter == null ) { return ; } getInterface ( ) . setItems ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDiskInterfaceList ( VmOsType.Unassigned , datacenter.getcompatibility_version ( ) ) ) ; getInterface ( ) . setSelectedItem ( ( getIsNew ( ) ? org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDefaultDiskInterface ( VmOsType.Unassigned , null ) : getDisk ( ) . getDiskInterface ( ) ) ) ; }

Target:
public void updateInterface ( org.ovirt.engine.core.common.businessentities.storage_pool datacenter ) { if ( datacenter == null ) { return ; } getDiskInterface ( ) . setItems ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDiskInterfaceList ( ) ) ; getDiskInterface ( ) . setSelectedItem ( ( getIsNew ( ) ? org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO : getDisk ( ) . getDiskInterface ( ) ) ) ; }
Source:
public void shouldNotElectInactiveHostedEngineDomain ( ) { prepareStorageDomainForElection ( StorageDomainStatus.Inactive , org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBaseTest.HE_STORAGE_DOMAIN_NAME ) ; org.junit.Assert.assertEquals ( null , cmd.electNewMaster ( false , true , false ) ) ; }

Target:
public void shouldNotElectInactiveHostedEngineDomain ( ) { prepareStorageDomainForElection ( StorageDomainStatus.Inactive , org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBaseTest.HE_STORAGE_DOMAIN_NAME ) ; org.mockito.Mockito.when ( hostedEngineHelper.isHostedEngineStorageDomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ) . thenReturn ( true ) ; org.junit.Assert.assertEquals ( null , cmd.electNewMaster ( false , true , false ) ) ; }
Source:
public void testNotExternalNetworkSucceedsForNonExternalNetwork ( ) throws java.lang.Exception { org.mockito.Mockito.when ( network.isExternal ( ) ) . thenReturn ( false ) ; org.junit.Assert.assertThat ( validator.notExternalNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotLinkedToExternalNetworkPositive ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkDao.getAllExternalNetworksLinkedToPhysicalNetwork ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.notLinkedToExternalNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean retVal = true ; java.util.List < java.lang.String > canDoActionMessages = getReturnValue ( ) . getCanDoActionMessages ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; retVal = canDoAction_beforeCloneVm ( retVal , canDoActionMessages , domainsMap ) ; if ( retVal && ( getParameters ( ) . isImportAsNewEntity ( ) ) ) { initImportClonedVm ( ) ; } return retVal && ( canDoAction_afterCloneVm ( retVal , canDoActionMessages , domainsMap ) ) ; }

Target:
protected boolean canDoAction ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; if ( ! ( canDoActionBeforeCloneVm ( domainsMap ) ) ) { return false ; } if ( getParameters ( ) . isImportAsNewEntity ( ) ) { initImportClonedVm ( ) ; } return canDoActionAfterCloneVm ( domainsMap ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VDS runInTransaction ( ) { return org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getVdsId ( ) ) ; }

Target:
protected void ExecuteVdsIdCommand ( ) { org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.infoFormat ( "AddVds - entered , starting logic to add VDS {0}" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.infoFormat ( "AddVds - VDS {0} was added, will try to add it to the resource manager" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . AddVds ( vds , false ) ; }
Source:
public void storageTypeUnsupported ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; sd.setStorageType ( StorageType.CINDER ) ; sd.setId ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HE_SD_ID ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }

Target:
public void storageTypeUnsupported ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; sd.setStorageType ( StorageType.CINDER ) ; sd.setId ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HE_SD_ID ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.QueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }
Source:
public static void GetCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

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:
public void logAuditMessage ( final org.ovirt.engine.core.compat.Guid clusterId , final org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , final org.ovirt.engine.core.common.businessentities.VDS server , final org.ovirt.engine.core.common.AuditLogType logType , final org.ovirt.engine.core.compat.Guid brickId , final java.lang.String brickPath ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVds ( server ) ; logable.setGlusterVolume ( volume ) ; logable.setClusterId ( clusterId ) ; logable.setBrickId ( brickId ) ; logable.setBrickPath ( brickPath ) ; auditLogDirector.log ( logable , logType ) ; }

Target:
public void logAuditMessage ( final org.ovirt.engine.core.compat.Guid clusterId , final org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , final org.ovirt.engine.core.common.businessentities.VDS server , final org.ovirt.engine.core.common.AuditLogType logType , final org.ovirt.engine.core.compat.Guid brickId , final java.lang.String brickPath ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; logable.setVds ( server ) ; logable.setGlusterVolume ( volume ) ; logable.setClusterId ( clusterId ) ; logable.setBrickId ( brickId ) ; logable.setBrickPath ( brickPath ) ; auditLogDirector.log ( logable , logType ) ; }
Source:
public 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 void getClusterById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic entity ) { return createIdParameterMapper ( entity.getId ( ) ) . addValue ( "read_rate" , entity.getread_rate ( ) ) . addValue ( "write_rate" , entity.getwrite_rate ( ) ) . addValue ( "actual_size" , entity.getactual_size ( ) ) . addValue ( "read_latency_seconds" , entity.getReadLatency ( ) ) . addValue ( "write_latency_seconds" , entity.getWriteLatency ( ) ) . addValue ( "flush_latency_seconds" , entity.getFlushLatency ( ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic entity ) { return createIdParameterMapper ( entity.getId ( ) ) . addValue ( "read_rate" , entity.getReadRate ( ) ) . addValue ( "write_rate" , entity.getWriteRate ( ) ) . addValue ( "actual_size" , entity.getActualSize ( ) ) . addValue ( "read_latency_seconds" , entity.getReadLatency ( ) ) . addValue ( "write_latency_seconds" , entity.getWriteLatency ( ) ) . addValue ( "flush_latency_seconds" , entity.getFlushLatency ( ) ) ; }
Source:
protected void UpdateDetailsAvailability ( ) { if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( getSelectedItem ( ) ) ) ; diskVmListModel.setIsAvailable ( ( ( disk.getVmEntityType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.TEMPLATE ) ) ) ; diskTemplateListModel.setIsAvailable ( ( ( disk.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.TEMPLATE ) ) ) ; } }

Target:
protected void UpdateDetailsAvailability ( ) { if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( getSelectedItem ( ) ) ) ; diskVmListModel.setIsAvailable ( ( ( disk.getVmEntityType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.TEMPLATE ) ) ) ; diskTemplateListModel.setIsAvailable ( ( ( disk.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.TEMPLATE ) ) ) ; diskStorageListModel.setIsAvailable ( ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) ) ; } }
Source:
protected void onSaveMAC ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface nicToSave ) { nicToSave.setMacAddress ( ( getMAC ( ) . getIsChangable ( ) ? ( getMAC ( ) . getEntity ( ) ) == null ? null : ( ( java.lang.String ) ( getMAC ( ) . getEntity ( ) ) ) . toLowerCase ( ) : getDefaultMacAddress ( ) ) ) ; }

Target:
protected void onSaveMAC ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nicToSave ) { nicToSave.setMacAddress ( ( getMAC ( ) . getIsChangable ( ) ? ( getMAC ( ) . getEntity ( ) ) == null ? null : ( ( java.lang.String ) ( getMAC ( ) . getEntity ( ) ) ) . toLowerCase ( ) : getDefaultMacAddress ( ) ) ) ; }
Source:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > items = new java.util.ArrayList < java.lang.Object > ( ) ; for ( java.lang.Object i : getSelectedItems ( ) ) { items.add ( ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( i ) ) . getId ( ) ) ; } return items.toArray ( new java.lang.Object [ ] { } ) ; } }

Target:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel.getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > items = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup : org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel.getSelectedItems ( ) ) { items.add ( vdsGroup.getId ( ) ) ; } return items.toArray ( new java.lang.Object [ ] { } ) ; } }
Source:
public void setSubTabPanelVisible ( boolean subTabPanelVisible ) { if ( ( this . subTabPanelVisible ) != subTabPanelVisible ) { splitPanel.clear ( ) ; if ( subTabPanelVisible ) { splitPanel.addSouth ( subTabPanelContainer , org.ovirt.engine.ui.userportal.section.main.view.AbstractSideTabWithDetailsView.subTabPanelHeight ) ; splitPanel.add ( table ) ; } else { splitPanel.add ( table ) ; } this . subTabPanelVisible = subTabPanelVisible ; } }

Target:
public void setSubTabPanelVisible ( boolean subTabPanelVisible ) { if ( ( this . subTabPanelVisible ) != subTabPanelVisible ) { splitPanel.clear ( ) ; if ( subTabPanelVisible ) { splitPanel.addSouth ( subTabPanelContainer , org.ovirt.engine.ui.userportal.section.main.view.AbstractSideTabWithDetailsView.subTabPanelHeight ) ; splitPanel.add ( table ) ; splitPanel.init ( ) ; } else { splitPanel.add ( table ) ; } this . subTabPanelVisible = subTabPanelVisible ; } }
Source:
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.storage.disk.lun.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 ) ; }

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.storage.disk.lun.GetLunsByVgIdQueryTest.setUpLunsFromDeviceList ( ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontendMock.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetDeviceList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters.class ) ) ) . thenReturn ( returnValue ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName , java.lang.String snapshotName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.info" ) . withOptionalParameter ( "snapName" , snapshotName ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , volumeName , response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotConfigSet ( java.lang.String volumeName , java.lang.String configName , java.lang.String configValue ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotConfigSet" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "option" , configName ) . withParameter ( "value" , configValue ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void updateStatusForVds ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus existing = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; existing.setVdsId ( FixturesTool.HOST_ID ) ; existing.setStatus ( KdumpFlowStatus.FINISHED ) ; existing.setAddress ( "[\"192.168.122.25\", 4444]" ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dao.get ( existing.getVdsId ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( existing , found ) ; }

Target:
public void updateStatusForVds ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus existing = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; existing.setVdsId ( FixturesTool.HOST_ID ) ; existing.setStatus ( KdumpFlowStatus.FINISHED ) ; existing.setAddress ( "[\"192.168.122.25\", 4444]" ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dao.get ( existing.getVdsId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( found ) ; org.junit.jupiter.api.Assertions.assertEquals ( existing , found ) ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsDhcp ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsDhcp ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , false , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
public void setUp ( ) { org.ovirt.engine.core.dal.dbbroker.DbEngineDialect dialectMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.DbEngineDialect.class ) ; org.mockito.Mockito.when ( dialectMock.getParamNamePrefix ( ) ) . thenReturn ( "" ) ; paramSource = new org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource ( dialectMock ) ; paramName = org.apache.commons.lang.RandomStringUtils.randomAlphabetic ( 10 ) ; }

Target:
public void setUp ( ) { org.ovirt.engine.core.dal.dbbroker.DbEngineDialect dialectMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.DbEngineDialect.class ) ; org.mockito.Mockito.when ( dialectMock.getParamNamePrefix ( ) ) . thenReturn ( "" ) ; paramSource = new org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource ( dialectMock ) ; paramName = org.apache.commons.lang.RandomStringUtils.randomAlphabetic ( 10 ) ; this . random = new java.util.Random ( ) ; }
Source:
public void getWANColorDepth ( 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 ? org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth.fromInt ( ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ) : org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth.depth16 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.WANColorDepth , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getWANColorDepth ( 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 ? org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth.fromInt ( ( ( java.lang.Integer ) ( source ) ) ) : org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth.depth16 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.WANColorDepth , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
protected void addCanDoActionMessageVariable ( java.lang.String varName , java.lang.Object varValue ) { getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$%s %s" , varName , varValue ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String remoteUserName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepKeysUpdate ( remoteUserName , geoRepPubKeys ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionResume ( java.lang.String volumeName , java.lang.String slaveHostName , java.lang.String slaveVolumeName , java.lang.String userName , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepSessionResume ( volumeName , slaveHostName , slaveVolumeName , userName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.core.bll.AutoStartVmsRunner.AutoStartVmToRestart ) { return vmId.equals ( ( ( org.ovirt.engine.core.bll.AutoStartVmsRunner.AutoStartVmToRestart ) ( obj ) ) . vmId ) ; } return super . equals ( obj ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.bll.AutoStartVmsRunner.AutoStartVmToRestart ) ) { return false ; } org.ovirt.engine.core.bll.AutoStartVmsRunner.AutoStartVmToRestart other = ( ( org.ovirt.engine.core.bll.AutoStartVmsRunner.AutoStartVmToRestart ) ( obj ) ) ; return java.util.Objects.equals ( vmId , other.vmId ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > getGraphicsTypesOfEntity ( org.ovirt.engine.core.compat.Guid entityId ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > result = new java.util.ArrayList < > ( ) ; if ( entityId != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( entityId , VmDeviceGeneralType.GRAPHICS ) ; if ( devices != null ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { result.add ( org.ovirt.engine.core.common.businessentities.GraphicsType.fromString ( device.getDevice ( ) ) ) ; } } } return result ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > getGraphicsTypesOfEntity ( org.ovirt.engine.core.compat.Guid entityId ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > result = new java.util.ArrayList < > ( ) ; if ( entityId != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.bll.utils.VmDeviceUtils.getGraphicsDevices ( entityId ) ; if ( devices != null ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { result.add ( org.ovirt.engine.core.common.businessentities.GraphicsType.fromString ( device.getDevice ( ) ) ) ; } } } return result ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetDeviceList , org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.HOST_GUID } , setUpLuns ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.jupiter.api.Assertions.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetDeviceList , org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.HOST_GUID } , setUpLuns ( ) , failure ) ; }
Source:
private static org.ovirt.engine.core.compat.Guid getVmToAttach ( org.ovirt.engine.core.compat.NGuid poolId ) { org.ovirt.engine.core.compat.Guid vmGuid = org.ovirt.engine.core.compat.Guid.Empty ; vmGuid = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getPrestartedVmToAttach ( poolId ) ; if ( ( vmGuid == null ) || ( Guid.Empty.equals ( vmGuid ) ) ) { vmGuid = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getNonPrestartedVmToAttach ( poolId ) ; } return vmGuid ; }

Target:
private org.ovirt.engine.core.compat.Guid getVmToAttach ( org.ovirt.engine.core.compat.NGuid poolId ) { if ( ( vmToAttach ) == null ) { org.ovirt.engine.core.compat.Guid vmGuid = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getPrestartedVmToAttach ( poolId ) ; if ( ( vmGuid == null ) || ( Guid.Empty.equals ( vmGuid ) ) ) { vmGuid = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getNonPrestartedVmToAttach ( poolId ) ; } vmToAttach = vmGuid ; } return vmToAttach ; }
Source:
private java.lang.String getRealKey ( java.lang.String agent , java.lang.String displayedKey ) { java.lang.String result = "" ; if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( displayedKey ) ) ) { if ( fenceOptionMapping.containsKey ( agent ) ) { java.util.HashMap < java.lang.String , java.lang.String > agentOptions = fenceOptionMapping.get ( agent ) ; result = ( agentOptions.containsKey ( displayedKey ) ) ? agentOptions.get ( displayedKey ) : displayedKey ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.error ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } } return result ; }

Target:
private java.lang.String getRealKey ( java.lang.String agent , java.lang.String displayedKey ) { java.lang.String result = "" ; if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( displayedKey ) ) ) { if ( fenceOptionMapping.containsKey ( agent ) ) { java.util.HashMap < java.lang.String , java.lang.String > agentOptions = fenceOptionMapping.get ( agent ) ; result = agentOptions.getOrDefault ( displayedKey , displayedKey ) ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.error ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } } return result ; }
Source:
public void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.StopVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full endAction" ) ; } org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }

Target:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) == null ) { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "VM is null, not performing full endAction" ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; return ; } org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.StopVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }
Source:
private void validateProvider ( ) throws org.ovirt.engine.core.domains.ManageDomainsResult { if ( contains ( org.ovirt.engine.core.domains.ManageDomainsArguments.ARG_PROVIDER ) ) { try { org.ovirt.engine.core.ldap.LdapProviderType.valueOfIgnoreCase ( get ( org.ovirt.engine.core.domains.ManageDomainsArguments.ARG_PROVIDER ) ) ; } catch ( java.lang.IllegalArgumentException | java.lang.NullPointerException ex ) { throw new org.ovirt.engine.core.domains.ManageDomainsResult ( ManageDomainsResultEnum.INVALID_ARGUMENT_VALUE , java.lang.String.format ( "Invalid provider, valid providers are %s" , org.apache.commons.lang.StringUtils.join ( new java.lang.String [ ] { org.ovirt.engine.core.domains.ManageDomainsArguments.PROV_AD , org.ovirt.engine.core.domains.ManageDomainsArguments.PROV_IPA , org.ovirt.engine.core.domains.ManageDomainsArguments.PROV_RHDS , org.ovirt.engine.core.domains.ManageDomainsArguments.PROV_ITDS , org.ovirt.engine.core.domains.ManageDomainsArguments.PROV_OLDAP } , ", " ) ) ) ; } } }

Target:
private void validateProvider ( ) throws org.ovirt.engine.core.domains.ManageDomainsResult { if ( contains ( org.ovirt.engine.core.domains.ManageDomainsArguments.ARG_PROVIDER ) ) { try { org.ovirt.engine.core.ldap.LdapProviderType.valueOfIgnoreCase ( get ( org.ovirt.engine.core.domains.ManageDomainsArguments.ARG_PROVIDER ) ) ; } catch ( java.lang.IllegalArgumentException | java.lang.NullPointerException ex ) { throw new org.ovirt.engine.core.domains.ManageDomainsResult ( ManageDomainsResultEnum.INVALID_ARGUMENT_VALUE , java.lang.String.format ( "Invalid provider, valid providers are: '%s'." , org.apache.commons.lang.StringUtils.join ( new java.lang.String [ ] { org.ovirt.engine.core.domains.ManageDomainsArguments.PROV_AD , org.ovirt.engine.core.domains.ManageDomainsArguments.PROV_IPA , org.ovirt.engine.core.domains.ManageDomainsArguments.PROV_RHDS , org.ovirt.engine.core.domains.ManageDomainsArguments.PROV_ITDS , org.ovirt.engine.core.domains.ManageDomainsArguments.PROV_OLDAP } , ", " ) ) ) ; } } }
Source:
public void setTemplate ( org.springframework.jdbc.core.JdbcTemplate template ) { this . jdbcTemplate = template ; callsHandler.setJdbcTemplate ( template ) ; }

Target:
private < T extends org.ovirt.engine.core.dao.DAO > T getDao ( java.lang.Class < T > daoType ) { for ( org.ovirt.engine.core.dao.DAO dao : daos ) { if ( daoType.isAssignableFrom ( dao.getClass ( ) ) ) { return ( ( T ) ( dao ) ) ; } } org.ovirt.engine.core.dal.dbbroker.DbFacade.log.error ( ( "Can't find dao for " + daoType ) ) ; return null ; }