auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.Map < java.lang.String , java.lang.Object > convertFencingPolicy ( ) { java.util.Map < java.lang.String , java.lang.Object > map = null ; if ( ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getFencingPolicy ( ) ) != null ) && ( org.ovirt.engine.core.common.utils.FencingPolicyHelper.isFencingPolicySupported ( getProxyVds ( ) . getSupportedClusterVersionsSet ( ) ) ) ) { map = new java.util.HashMap < > ( ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getFencingPolicy ( ) . isSkipFencingIfSDActive ( ) ) { map.put ( VdsProperties.STORAGE_DOMAIN_HOST_ID_MAP , createStorageDomainHostIdMap ( ) ) ; } } return map ; }

Target:
protected java.util.Map < java.lang.String , java.lang.Object > convertFencingPolicy ( ) { java.util.Map < java.lang.String , java.lang.Object > map = null ; if ( ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getFencingPolicy ( ) ) != null ) && ( org.ovirt.engine.core.common.utils.FencingPolicyHelper.isFencingPolicySupported ( getProxyVds ( ) . getSupportedClusterVersionsSet ( ) ) ) ) { map = new java.util.HashMap < > ( ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getFencingPolicy ( ) . isSkipFencingIfSDActive ( ) ) { map.put ( VdsProperties.STORAGE_DOMAIN_HOST_ID_MAP , createStorageDomainHostIdMap ( ) ) ; } } return map ; }
Source:
public void testAllByConnectionId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = dao.getAllByConnectionId ( new org.ovirt.engine.core.compat.Guid ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ) ; org.junit.Assert.assertEquals ( "Unexpected number of storage domains by connection id" , domains.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( "Wrong storage domain id for search by connection id" , domains.get ( 0 ) . getId ( ) , FixturesTool.STORAGE_DOAMIN_NFS_MASTER ) ; }

Target:
public void testAllByConnectionId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = dao.getAllByConnectionId ( new org.ovirt.engine.core.compat.Guid ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ) ; org.junit.Assert.assertEquals ( "Unexpected number of storage domains by connection id" , 1 , domains.size ( ) ) ; org.junit.Assert.assertEquals ( "Wrong storage domain id for search by connection id" , FixturesTool.STORAGE_DOAMIN_NFS_MASTER , domains.get ( 0 ) . getId ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createNotVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.IDE ) ; disk.setactive ( true ) ; disk.setvm_guid ( vmId ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage createNotVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.IDE ) ; disk.setactive ( true ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; return disk ; }
Source:
public void testRefreshStatusNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( false ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.ArgumentMatchers.any ( ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void testRefreshStatusNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( false ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.ArgumentMatchers.any ( ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void testFileLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.File file = new org.ovirt.engine.api.model.File ( ) ; file.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.FILE_ID ) ; file.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; file.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , file ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.FILE_HREF , file.getHref ( ) ) ; }

Target:
public void testFileLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.File file = new org.ovirt.engine.api.model.File ( ) ; file.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.FILE_ID ) ; file.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; file.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( file ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.FILE_HREF , file.getHref ( ) ) ; }
Source:
public void getVmAndTemplatesIdsWithoutAttachedImageDiכsks ( ) { addVmDevice ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS , FixturesTool.IMAGE_GROUP_ID_2 , null ) ; addVmDevice ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS , FixturesTool.DISK_ID , FixturesTool.EXISTING_SNAPSHOT_ID ) ; java.util.List < org.ovirt.engine.core.compat.Guid > ids = dao.getVmAndTemplatesIdsWithoutAttachedImageDisks ( false ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_RHEL5_POOL_51 ) ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_TEMPLATE_RHEL5_2 ) ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS ) ) ; org.junit.Assert.assertFalse ( ids.contains ( FixturesTool.VM_TEMPLATE_RHEL5 ) ) ; }

Target:
public void getVmAndTemplatesIdsWithoutAttachedImageDisks ( ) { addVmDevice ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS , FixturesTool.IMAGE_GROUP_ID_2 , null ) ; addVmDevice ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS , FixturesTool.DISK_ID , FixturesTool.EXISTING_SNAPSHOT_ID ) ; java.util.List < org.ovirt.engine.core.compat.Guid > ids = dao.getVmAndTemplatesIdsWithoutAttachedImageDisks ( false ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_RHEL5_POOL_51 ) ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_TEMPLATE_RHEL5_2 ) ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS ) ) ; org.junit.Assert.assertFalse ( ids.contains ( FixturesTool.VM_TEMPLATE_RHEL5 ) ) ; }
Source:
public void flushToPrivateModel ( ) { flushCheckBoxes ( ctrlAltDel , enableUsbAutoshare , openInFullScreen , enableSpiceProxy , useLocalDrives , wanEnabled , disableSmartcard ) ; if ( spiceRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.SPICE ) ; setSelectedSpiceImpl ( ) ; } else if ( remoteDesktopRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.RDP ) ; } else if ( vncRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.VNC ) ; } }

Target:
public void flushToPrivateModel ( ) { if ( spiceRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.SPICE ) ; setSelectedSpiceImpl ( ) ; } else if ( remoteDesktopRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.RDP ) ; } else if ( vncRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.VNC ) ; } flushCheckBoxes ( ctrlAltDel , enableUsbAutoshare , openInFullScreen , enableSpiceProxy , useLocalDrives , wanEnabled , disableSmartcard ) ; }
Source:
public static void addStatistics ( org.ovirt.engine.api.restapi.resource.BackendResource resource , org.ovirt.engine.api.model.Nic model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.NicStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.NicStatisticalQuery ( model ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( resource.getUriInfo ( ) , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }

Target:
public static void addStatistics ( org.ovirt.engine.api.model.Nic model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.NicStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.NicStatisticalQuery ( model ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }
Source:
public void updateTasksInCluster ( ) { org.mockito.Mockito.doReturn ( getTasks ( ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 2 ) ) . updateSteps ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.Cluster.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask.class ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void updateTasksInCluster ( ) { org.mockito.Mockito.doReturn ( getTasks ( ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 2 ) ) . updateSteps ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
private void updateDisksQuota ( java.lang.Object sender ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel ) ( sender ) ) . getSelectedItem ( ) ) ) ; if ( storageDomain != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel innerDisk : disks ) { if ( innerDisk.getStorageDomain ( ) . equals ( sender ) ) { updateQuota ( storageDomain.getId ( ) , innerDisk.getQuota ( ) ) ; break ; } } } }

Target:
private void updateDisksQuota ( java.lang.Object sender ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel ) ( sender ) ) . getSelectedItem ( ) ) ) ; if ( storageDomain != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel innerDisk : disks ) { if ( innerDisk.getStorageDomain ( ) . equals ( sender ) ) { updateQuota ( storageDomain.getId ( ) , innerDisk.getQuota ( ) ) ; break ; } } } }
Source:
private void RunVMOnSpecificHost_EntityChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getRunVMOnSpecificHost ( ) . getEntity ( ) ) ) == true ) { getDontMigrateVM ( ) . setEntity ( true ) ; getDontMigrateVM ( ) . setIsChangable ( false ) ; } else { getDontMigrateVM ( ) . setIsChangable ( true ) ; } }

Target:
private void RunVMOnSpecificHost_EntityChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getRunVMOnSpecificHost ( ) . getEntity ( ) ) ) == true ) { getDontMigrateVM ( ) . setEntity ( false ) ; getDontMigrateVM ( ) . setIsChangable ( false ) ; } else { getDontMigrateVM ( ) . setIsChangable ( true ) ; } }
Source:
private void rollbackQuota ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.compat.Guid > quotaList ) { org.ovirt.engine.core.bll.quota.QuotaManager.lock.writeLock ( ) . lock ( ) ; try { if ( ! ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.containsKey ( storagePoolId ) ) ) { return ; } synchronized ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.Quota > map = org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) ; for ( org.ovirt.engine.core.compat.Guid quotaId : quotaList ) { map.remove ( quotaId ) ; } } } finally { org.ovirt.engine.core.bll.quota.QuotaManager.lock.writeLock ( ) . unlock ( ) ; } }

Target:
public void rollbackQuota ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.compat.Guid > quotaList ) { org.ovirt.engine.core.bll.quota.QuotaManager.lock.writeLock ( ) . lock ( ) ; try { if ( ! ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.containsKey ( storagePoolId ) ) ) { return ; } synchronized ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.Quota > map = org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) ; for ( org.ovirt.engine.core.compat.Guid quotaId : quotaList ) { map.remove ( quotaId ) ; } } } finally { org.ovirt.engine.core.bll.quota.QuotaManager.lock.writeLock ( ) . unlock ( ) ; } }
Source:
protected void onPreviewNativeEvent ( com.google.gwt.user.client.Event.NativePreviewEvent event ) { super . onPreviewNativeEvent ( event ) ; if ( ( ( keyPressHandler ) != null ) && ( ( ( event.getTypeInt ( ) ) == ( com.google.gwt.user.client.Event.ONKEYPRESS ) ) || ( ( event.getTypeInt ( ) ) == ( com.google.gwt.user.client.Event.ONKEYDOWN ) ) ) ) { keyPressHandler.onKeyPress ( event.getNativeEvent ( ) ) ; } }

Target:
protected void onPreviewNativeEvent ( com.google.gwt.user.client.Event.NativePreviewEvent event ) { super . onPreviewNativeEvent ( event ) ; if ( ( ( keyPressHandler ) != null ) && ( ( event.getTypeInt ( ) ) == ( com.google.gwt.user.client.Event.ONKEYDOWN ) ) ) { keyPressHandler.onKeyPress ( event.getNativeEvent ( ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > computeResources = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalComputeResourceListModel = getExternalComputeResource ( ) ; externalComputeResourceListModel.setItems ( computeResources ) ; externalComputeResourceListModel.setIsChangeable ( true ) ; }

Target:
public void onSuccess ( java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > computeResources = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalComputeResourceListModel = getExternalComputeResource ( ) ; externalComputeResourceListModel.setItems ( computeResources ) ; externalComputeResourceListModel.setIsChangeable ( true ) ; }
Source:
protected void executeCommand ( ) { job = getJobDao ( ) . get ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.ClearExternalJobCommand.getParameters ( ) . getJobId ( ) ) ) ) ; job.setAutoCleared ( true ) ; getJobDao ( ) . update ( job ) ; org.ovirt.engine.core.bll.ClearExternalJobCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { job = getJobDao ( ) . get ( org.ovirt.engine.core.bll.ClearExternalJobCommand.getParameters ( ) . getJobId ( ) ) ; job.setAutoCleared ( true ) ; getJobDao ( ) . update ( job ) ; org.ovirt.engine.core.bll.ClearExternalJobCommand.setSucceeded ( true ) ; }
Source:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.GetAllVdsByStoragePoolParameters ( spId ) , aQuery ) ; }

Target:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
private void fixNetworkLabelsLink ( org.ovirt.engine.api.v3.types.V3Link link ) { link.setRel ( "labels" ) ; java.lang.String href = link.getHref ( ) ; int index = href.lastIndexOf ( "/" ) ; if ( index > 0 ) { href = ( href.substring ( 0 , index ) ) + "labels" ; link.setHref ( href ) ; } }

Target:
private void fixNetworkLabelsLink ( org.ovirt.engine.api.v3.types.V3Link link ) { link.setRel ( "labels" ) ; java.lang.String href = link.getHref ( ) ; int index = href.lastIndexOf ( "/" ) ; if ( index > 0 ) { href = ( href.substring ( 0 , ( index + 1 ) ) ) + "labels" ; link.setHref ( href ) ; } }
Source:
public org.ovirt.engine.ui.common.widget.ImageWithDecorator getValue ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.common.businessentities.VM vm = item.getVM ( ) ; com.google.gwt.resources.client.ImageResource changesImage = null ; if ( ( vm != null ) && ( vm.isNextRunConfigurationExists ( ) ) ) { changesImage = org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.resources.vmDelta ( ) ; } return new org.ovirt.engine.ui.common.widget.ImageWithDecorator ( getMainImage ( item ) , changesImage , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_LEFT , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_TOP ) ; }

Target:
public org.ovirt.engine.ui.common.widget.ImageWithDecorator getValue ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.common.businessentities.VM vm = item.getVM ( ) ; com.google.gwt.resources.client.ImageResource changesImage = null ; if ( ( vm != null ) && ( vm.isNextRunConfigurationExists ( ) ) ) { changesImage = org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.resources.vmDelta ( ) ; } return new org.ovirt.engine.ui.common.widget.ImageWithDecorator ( getMainImage ( item ) , changesImage , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_LEFT , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_TOP , vm.getStatus ( ) . toString ( ) ) ; }
Source:
public void networkExists ( ) { simulateClusterExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( underTest , EngineMessage.NETWORK_ALREADY_ATTACHED_TO_CLUSTER ) ; }

Target:
public void networkExists ( ) { simulateClusterExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( underTest , EngineMessage.NETWORK_ALREADY_ATTACHED_TO_CLUSTER ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getProvider ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , org.ovirt.engine.core.common.queries.ProviderQueryParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getHosts ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getProvider ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , org.ovirt.engine.core.common.queries.ProviderQueryParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getHosts ( ) , failure ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } final org.ovirt.engine.core.bll.MacPoolValidator validator = new org.ovirt.engine.core.bll.MacPoolValidator ( getOldMacPool ( ) ) ; return ( ( validate ( validator.macPoolExists ( ) ) ) && ( validate ( validator.notRemovingUsedPool ( ) ) ) ) && ( validate ( validator.notRemovingDefaultPool ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } final org.ovirt.engine.core.bll.MacPoolValidator validator = new org.ovirt.engine.core.bll.MacPoolValidator ( getOldMacPool ( ) ) ; return ( ( validate ( validator.macPoolExists ( ) ) ) && ( validate ( validator.notRemovingDefaultPool ( ) ) ) ) && ( validate ( validator.notRemovingUsedPool ( ) ) ) ; }
Source:
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 , 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.storage_domains > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , 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 , 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.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }
Source:
public static void getMaxVmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return 100 ; } return source ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getMaxVmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return 100 ; } return source ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.gluster.ReplaceGlusterVolumeBrickCommand createTestCommand1 ( org.ovirt.engine.core.compat.Guid volumeId ) { return new org.ovirt.engine.core.bll.gluster.ReplaceGlusterVolumeBrickCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeReplaceBrickActionParameters ( volumeId , org.ovirt.engine.core.common.businessentities.gluster.GlusterTaskOperation.START , getBricks ( volumeId , "distrib" , 1 ) . get ( 0 ) , getBricks ( volumeId , "new" , 1 ) . get ( 0 ) , false ) ) ; }

Target:
private org.ovirt.engine.core.bll.gluster.ReplaceGlusterVolumeBrickCommand createTestCommand1 ( org.ovirt.engine.core.compat.Guid volumeId ) { return new org.ovirt.engine.core.bll.gluster.ReplaceGlusterVolumeBrickCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeReplaceBrickActionParameters ( volumeId , getBricks ( volumeId , "distrib" , 1 ) . get ( 0 ) , getBricks ( volumeId , "new" , 1 ) . get ( 0 ) ) , null ) ; }
Source:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { validateEnums ( org.ovirt.engine.api.model.Network.class , incoming ) ; org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setNetworkId ( network.getId ( ) ) ; network.getCluster ( ) . setClusterId ( cluster.getCluster ( ) . getId ( ) ) ; performAction ( VdcActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }

Target:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setNetworkId ( network.getId ( ) ) ; network.getCluster ( ) . setClusterId ( cluster.getCluster ( ) . getId ( ) ) ; performAction ( VdcActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }
Source:
void initEditors ( ) { isoEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.compat.RpmVersion > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.compat.RpmVersion > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.compat.RpmVersion version ) { return version.getRpmName ( ) ; } } ) ; rbPassword = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; rbPublicKey = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; publicKeyEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextAreaLabelEditor ( ) ; activateHostAfterInstallEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; overrideIpTablesEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }

Target:
void initEditors ( ) { isoEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.compat.RpmVersion > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.compat.RpmVersion version ) { return version.getRpmName ( ) ; } } ) ; rbPassword = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; rbPublicKey = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; publicKeyEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextAreaLabelEditor ( ) ; activateHostAfterInstallEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; overrideIpTablesEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }
Source:
public void updataMaxVmsInPool ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxVmsInPool ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.setMaxVmsInPool ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; behavior.updateMaxNumOfVmCpus ( ) ; } } ) ) ; }

Target:
public void updataMaxVmsInPool ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmsInPool ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.setMaxVmsInPool ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; behavior.updateMaxNumOfVmCpus ( ) ; } } ) ) ; }
Source:
public final void updateDataCenterAlert ( ) { org.ovirt.engine.core.common.businessentities.StoragePool selectedItem = getModel ( ) . getDataCenter ( ) . getSelectedItem ( ) ; org.ovirt.engine.ui.uicommonweb.models.EntityModel alert = getModel ( ) . getDataCenterAlert ( ) ; if ( shouldShowDataCenterAlert ( selectedItem ) ) { alert.setIsAvailable ( true ) ; alert.setEntity ( getDataCenterAlertMessage ( ) ) ; } else { alert.setIsAvailable ( false ) ; alert.setEntity ( "" ) ; } }

Target:
public final void updateDataCenterAlert ( ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel alert = getModel ( ) . getDataCenterAlert ( ) ; alert.setIsAvailable ( false ) ; alert.setEntity ( "" ) ; }
Source:
public void nGuidGuidCtorNullNGuid ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( null , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 , gu ) ; }

Target:
public void nGuidGuidCtorNullNGuid ( ) { b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( null , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 , gu ) ; }
Source:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaCluster ( getClusterGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; control.replay ( ) ; org.ovirt.engine.api.model.QuotaClusterLimits clusterLimits = collection.list ( ) ; assertClusterLimitsFound ( clusterLimits , 1 ) ; org.ovirt.engine.api.model.QuotaClusterLimit clusterLimit = clusterLimits.getQuotaClusterLimits ( ) . get ( 0 ) ; assertEquals ( clusterLimit.getVcpuLimit ( ) . intValue ( ) , 20 ) ; }

Target:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaCluster ( getClusterGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; control.replay ( ) ; org.ovirt.engine.api.model.QuotaClusterLimits clusterLimits = collection.list ( ) ; assertClusterLimitsFound ( clusterLimits , 1 ) ; org.ovirt.engine.api.model.QuotaClusterLimit clusterLimit = clusterLimits.getQuotaClusterLimits ( ) . get ( 0 ) ; assertEquals ( 20 , clusterLimit.getVcpuLimit ( ) . intValue ( ) ) ; }
Source:
protected static org.dbunit.database.IDatabaseConnection getConnection ( ) throws java.lang.Exception { java.sql.Connection con = org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource.getConnection ( ) ; org.dbunit.database.IDatabaseConnection connection = new org.dbunit.database.DatabaseConnection ( con ) ; connection.getConfig ( ) . setProperty ( DatabaseConfig.PROPERTY_DATATYPE_FACTORY , org.ovirt.engine.core.dao.BaseDAOTestCase.dataFactory ) ; if ( org.ovirt.engine.core.dao.BaseDAOTestCase.needInitializationSql ) { java.sql.Statement stmt = con.createStatement ( ) ; stmt.executeUpdate ( org.ovirt.engine.core.dao.BaseDAOTestCase.initSql ) ; } return connection ; }

Target:
protected static org.dbunit.database.IDatabaseConnection getConnection ( ) throws java.lang.Exception { java.sql.Connection con = org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource.getConnection ( ) ; org.dbunit.database.IDatabaseConnection connection = new org.dbunit.database.DatabaseConnection ( con ) ; connection.getConfig ( ) . setProperty ( DatabaseConfig.PROPERTY_DATATYPE_FACTORY , org.ovirt.engine.core.dao.BaseDAOTestCase.dataFactory ) ; if ( org.ovirt.engine.core.dao.BaseDAOTestCase.needInitializationSql ) { try ( java.sql.Statement stmt = con.createStatement ( ) ) { stmt.executeUpdate ( org.ovirt.engine.core.dao.BaseDAOTestCase.initSql ) ; } } return connection ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { if ( org.ovirt.engine.core.vdsbroker.irsbroker.GetIsoListVDSCommand.getCurrentIrsProxyData ( ) . getIsValid ( ) ) { setReturnValue ( org.ovirt.engine.core.vdsbroker.irsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HsmGetIsoList , new org.ovirt.engine.core.vdsbroker.irsbroker.HSMGetIsoListParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.GetIsoListVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.GetIsoListVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ) . getReturnValue ( ) ) ; } else { org.ovirt.engine.core.vdsbroker.irsbroker.GetIsoListVDSCommand.setReturnValue ( new java.util.ArrayList < java.lang.String > ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GetIsoListVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; } }

Target:
protected void ExecuteIrsBrokerCommand ( ) { setReturnValue ( org.ovirt.engine.core.vdsbroker.irsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HsmGetIsoList , new org.ovirt.engine.core.vdsbroker.irsbroker.HSMGetIsoListParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.GetIsoListVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.GetIsoListVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ) . getReturnValue ( ) ) ; }
Source:
private void addAuthenticationMethods ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.restapi.model.AuthenticationMethod [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_3 ) ) { version.setAuthenticationMethods ( new org.ovirt.engine.api.restapi.model.AuthenticationMethod ( ) ) ; for ( org.ovirt.engine.api.restapi.model.AuthenticationMethod authType : values ) { version.getAuthenticationMethods ( ) . getAuthenticationMethod ( ) . add ( authType.value ( ) ) ; } } }

Target:
private void addAuthenticationMethods ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.restapi.model.AuthenticationMethod [ ] values ) { version.setAuthenticationMethods ( new org.ovirt.engine.api.restapi.model.AuthenticationMethod ( ) ) ; for ( org.ovirt.engine.api.restapi.model.AuthenticationMethod authType : values ) { version.getAuthenticationMethods ( ) . getAuthenticationMethod ( ) . add ( authType.value ( ) ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > generateDisksList ( int size ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < size ; ++ i ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disksList.add ( diskImage ) ; } return disksList ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > generateDisksList ( int size ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < size ; ++ i ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disksList.add ( diskImage ) ; } return disksList ; }
Source:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( 0 , 0 ) ; org.mockito.Mockito.doReturn ( createVdsGroup ( ) ) . when ( cmd ) . getVdsGroup ( ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Collections.singletonList ( "VirtIO_SCSI" ) ) ) ; org.junit.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }

Target:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( 0 ) ; org.mockito.Mockito.doReturn ( createVdsGroup ( ) ) . when ( cmd ) . getVdsGroup ( ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Collections.singletonList ( "VirtIO_SCSI" ) ) ) ; org.junit.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }
Source:
public void testGetCascadingResource ( ) { org.junit.Assert.assertTrue ( "getCascadingResource not reading file from resources.properties" , testTheme.getCascadingResource ( "favicon" ) . getFile ( ) . getAbsolutePath ( ) . contains ( "/01-test.brand/images/favicon.ico" ) ) ; org.junit.Assert.assertTrue ( "getCascadingResource not reading contentType from resources.properties" , testTheme.getCascadingResource ( "favicon" ) . getContentType ( ) . equals ( "someMadeUp/contentType" ) ) ; }

Target:
public void testGetCascadingResource ( ) { org.junit.Assert.assertTrue ( "getCascadingResource not reading file from resources.properties" , testTheme.getCascadingResource ( "favicon" ) . getFile ( ) . getAbsolutePath ( ) . contains ( "/01-test.brand/images/favicon.ico" ) ) ; org.junit.Assert.assertEquals ( "getCascadingResource not reading contentType from resources.properties" , "someMadeUp/contentType" , testTheme.getCascadingResource ( "favicon" ) . getContentType ( ) ) ; }
Source:
private void initParentResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource parent = resource.getParent ( ) . getParent ( ) . getParent ( ) ; parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setValidatorLocator ( validatorLocator ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }

Target:
private void initParentResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource parent = resource.getParent ( ) . getParent ( ) . getParent ( ) ; parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }
Source:
protected void filterVms ( ) { for ( org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm : vdsmVms.values ( ) ) { org.ovirt.engine.core.common.businessentities.VM dbVm = dbVms.get ( vdsmVm.getVmDynamic ( ) . getId ( ) ) ; gatherChangedVms ( dbVm , vdsmVm ) ; gatherVmsWithChangedDevices ( dbVm , vdsmVm ) ; } }

Target:
protected void filterVms ( ) { for ( org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm : vdsmVms.values ( ) ) { org.ovirt.engine.core.common.businessentities.VM dbVm = dbVms.get ( vdsmVm.getVmDynamic ( ) . getId ( ) ) ; gatherChangedVms ( dbVm , vdsmVm ) ; } }
Source:
public void validateVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void validateVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }
Source:
public static org.ovirt.engine.core.compat.RpmVersion getOvirtHostOsVersion ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return new org.ovirt.engine.core.compat.RpmVersion ( vds.getHostOs ( ) , "RHEV Hypervisor -" , true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.VdsHandler.log.error ( "Failed to parse version of Host '{}','{}' and Host OS '{}': {}" , vds.getId ( ) , vds.getName ( ) , vds.getHostOs ( ) , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; org.ovirt.engine.core.bll.VdsHandler.log.debug ( "Exception" , e ) ; } return null ; }

Target:
public static org.ovirt.engine.core.compat.RpmVersion getOvirtHostOsVersion ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return new org.ovirt.engine.core.compat.RpmVersion ( vds.getHostOs ( ) , "RHEV Hypervisor -" , true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.VdsHandler.log.error ( "Failed to parse version of Host '{}','{}' and Host OS '{}': {}" , vds.getId ( ) , vds.getName ( ) , vds.getHostOs ( ) , e.getMessage ( ) ) ; org.ovirt.engine.core.bll.VdsHandler.log.debug ( "Exception" , e ) ; } return null ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( templateExistsInSetup ) { if ( ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ) { getCollapseSnapshots ( ) . setEntity ( true ) ; getCollapseSnapshots ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importCloneVMMustCollapseSnapshots ( ) ) ; getCollapseSnapshots ( ) . setIsChangable ( false ) ; } else { getCollapseSnapshots ( ) . setIsChangable ( true ) ; } } }

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 ( templateExistsInSetup ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > ) ( sender ) ) . getEntity ( ) ) { getCollapseSnapshots ( ) . setEntity ( true ) ; getCollapseSnapshots ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importCloneVMMustCollapseSnapshots ( ) ) ; getCollapseSnapshots ( ) . setIsChangable ( false ) ; } else { getCollapseSnapshots ( ) . setIsChangable ( true ) ; } } }