auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initInfoIcons ( org.ovirt.engine.ui.webadmin.ApplicationResources resources , org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationTemplates templates ) { memoryOptimizationInfo = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( templates.italicFixedWidth ( "465px" , constants.clusterPopupMemoryOptimizationInfo ( ) ) , resources ) ; cpuThreadsInfo = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( templates.italicFixedWidth ( "600px" , constants.clusterPopupCpuThreadsInfo ( ) ) , resources ) ; }

Target:
private void initInfoIcons ( org.ovirt.engine.ui.webadmin.ApplicationResources resources , org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationTemplates templates ) { memoryOptimizationInfo = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( templates.italicFixedWidth ( "465px" , constants.clusterPopupMemoryOptimizationInfo ( ) ) , resources ) ; cpuThreadsInfo = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( templates.italicFixedWidth ( "600px" , constants.clusterPopupCpuThreadsInfo ( ) ) , resources ) ; schedulerOptimizationInfoIcon = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( com.google.gwt.safehtml.shared.SafeHtmlUtils.EMPTY_SAFE_HTML , resources ) ; allowOverbookingInfoIcon = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( com.google.gwt.safehtml.shared.SafeHtmlUtils.EMPTY_SAFE_HTML , resources ) ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStoragePool ( ) . getcompatibility_version ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getCurrentUser ( ) ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( ( succeeded ? ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( retVal.getActionReturnValue ( ) ) ) : null ) , succeeded ) ; }

Target:
private void postAddNetwork ( org.ovirt.engine.core.common.action.VdcReturnValueBase retVal ) { if ( isActionSucceeded ( retVal ) ) { postSaveAction ( ( ( org.ovirt.engine.core.compat.Guid ) ( retVal.getActionReturnValue ( ) ) ) , null ) ; } else { failedPostSaveAction ( ) ; } }
Source:
private boolean hasFreeSpace ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( getDiskImageInfo ( ) . getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeType.Preallocated ) ) { return doesStorageDomainhaveSpaceForRequest ( storageDomain ) ; } return isStorageDomainWithinThresholds ( storageDomain ) ; }

Target:
private boolean isShareableDiskOnGlusterDomain ( ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . isShareable ( ) ) && ( ( org.ovirt.engine.core.bll.AddDiskCommand.getStorageDomain ( ) . getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISKS_NOT_SUPPORTED_ON_GLUSTER_DOMAIN ) ; return true ; } return false ; }
Source:
protected void onReveal ( ) { super . onReveal ( ) ; roleModelProvider.getModel ( ) . search ( ) ; systemPermissionModelProvider.refresh ( ) ; systemPermissionModelProvider.getModel ( ) . search ( ) ; if ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.isModeSupported ( ApplicationMode.VirtOnly ) ) { clusterPolicyModelProvider.getModel ( ) . search ( ) ; } else { getView ( ) . hideClusterPolicyTab ( ) ; } }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; roleModelProvider.getModel ( ) . search ( ) ; systemPermissionModelProvider.refresh ( ) ; systemPermissionModelProvider.getModel ( ) . search ( ) ; if ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.isModeSupported ( ApplicationMode.VirtOnly ) ) { clusterPolicyModelProvider.getModel ( ) . search ( ) ; } else { getView ( ) . hideClusterPolicyTab ( ) ; } instanceTypeModelProvider.getModel ( ) . search ( ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( isRngSupportedByCluster ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } if ( getRngDevices ( ) . isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_RNG_NOT_FOUND ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( isRngSupportedByCluster ( ) ) ) && ( ( getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } if ( getRngDevices ( ) . isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_RNG_NOT_FOUND ) ; } return true ; }
Source:
private void mockVdsSingleAgent ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createHost ( ) ; vds.getFenceAgents ( ) . remove ( 1 ) ; org.mockito.Mockito.when ( vdsDao.get ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ) . thenReturn ( vds ) ; }

Target:
private void mockVdsDynamicDao ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic currentVds = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; currentVds.setId ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ; currentVds.setStatus ( VDSStatus.NonResponsive ) ; org.mockito.Mockito.when ( vdsDynamicDAO.get ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ) . thenReturn ( currentVds ) ; org.mockito.Mockito.when ( dbFacade.getVdsDynamicDao ( ) ) . thenReturn ( vdsDynamicDAO ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.compat.Version > ( ) ; } else { java.util.ArrayList < org.ovirt.engine.core.compat.Version > list = ( ( java.util.ArrayList < org.ovirt.engine.core.compat.Version > ) ( source ) ) ; java.util.Collections.sort ( list ) ; return list ; } }

Target:
public java.util.List < T > convert ( java.lang.Object source ) { java.util.List < T > list = super . convert ( source ) ; java.util.Collections.sort ( list , comparator ) ; return list ; }
Source:
private void setUpGetCertuficateExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.CERTIFICATE ) ; } }

Target:
private void setUpGetCertuficateExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( QueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.CERTIFICATE ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { boolean isAttach = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ; createDiskPanel.setVisible ( ( ! isAttach ) ) ; attachDiskPanel.setVisible ( isAttach ) ; if ( ( ! isAttach ) && ( ! ( isNewLunDiskEnabled ) ) ) { disk.getIsInternal ( ) . setEntity ( true ) ; } revealDiskPanel ( disk ) ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; setTitle ( ( disk.isBoot ( ) ? constants.bootableDisk ( ) : null ) ) ; return disk.isBoot ( ) ? resources.bootableDiskIcon ( ) : null ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.Disk x , org.ovirt.engine.core.common.businessentities.Disk y ) { java.lang.String xAlias = x.getDiskAlias ( ) ; java.lang.String yAlias = y.getDiskAlias ( ) ; if ( xAlias == null ) { return 1 ; } if ( yAlias == null ) { return - 1 ; } return xAlias.compareTo ( yAlias ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.storage.Disk x , org.ovirt.engine.core.common.businessentities.storage.Disk y ) { java.lang.String xAlias = x.getDiskAlias ( ) ; java.lang.String yAlias = y.getDiskAlias ( ) ; if ( xAlias == null ) { return 1 ; } if ( yAlias == null ) { return - 1 ; } return xAlias.compareTo ( yAlias ) ; }
Source:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( ) ; org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAO2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAO2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO2 ) . when ( cmd ) . getStoragePoolDAO ( ) ; setupCpu ( ) ; canDoActionFailedWithReason ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }

Target:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; setupCpu ( ) ; canDoActionFailedWithReason ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }
Source:
public void updateCanSetBoot ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks ) { boolean bootDiskFound = false ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : vmDisks ) { if ( disk.getDiskVmElementForVm ( getVmId ( ) ) . isBoot ( ) ) { getIsBootable ( ) . setIsChangeable ( false ) ; return ; } } }

Target:
public void updateCanSetBoot ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks ) { boolean bootDiskFound = false ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : vmDisks ) { if ( disk.getDiskVmElementForVm ( getVmId ( ) ) . isBoot ( ) ) { bootDiskFound = true ; break ; } } if ( bootDiskFound ) { getIsBootable ( ) . setIsChangeable ( false ) ; } else { addBootChangeListener ( ) ; } }
Source:
private boolean connectStorageToLunByVdsId ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.LUNs lun ) { try { return org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getStorageType ( ) ) . connectStorageToLunByVdsId ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) , vds.getId ( ) , lun , Guid.Empty ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { final org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.ConnectAllHostsToLunCommandReturnValue result = getResult ( ) ; result.setFailedVds ( vds ) ; result.setFailedLun ( lun ) ; throw e ; } }

Target:
private void handleFailure ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.LUNs lun ) { org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.ConnectAllHostsToLunCommandReturnValue result = getResult ( ) ; result.setFailedVds ( vds ) ; result.setFailedLun ( lun ) ; }
Source:
protected void verifyRoot ( org.ovirt.engine.api.model.Tag root ) { assertEquals ( Guid.Empty.toString ( ) , root.getId ( ) ) ; assertEquals ( "root" , root.getName ( ) ) ; assertEquals ( "root" , root.getDescription ( ) ) ; assertNull ( root.getParent ( ) ) ; verifyLinks ( root ) ; }

Target:
protected void verifyRoot ( org.ovirt.engine.api.model.Tag root ) { org.junit.Assert.assertEquals ( Guid.Empty.toString ( ) , root.getId ( ) ) ; org.junit.Assert.assertEquals ( "root" , root.getName ( ) ) ; org.junit.Assert.assertEquals ( "root" , root.getDescription ( ) ) ; org.junit.Assert.assertNull ( root.getParent ( ) ) ; verifyLinks ( root ) ; }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void poolHasDefaultCluster ( ) { org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.mcr.mockConfigValue ( ConfigValues.AutoRegistrationDefaultVdsGroupID , org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.DEFAULT_VDS_GROUP_ID ) ; addDefaultClusterToPool ( ) ; storagePoolWithLocalFS ( ) ; canDoActionFailed ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS ) ; }

Target:
public void poolHasDefaultCluster ( ) { org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.mcr.mockConfigValue ( ConfigValues.AutoRegistrationDefaultVdsGroupID , org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.DEFAULT_VDS_GROUP_ID ) ; addDefaultClusterToPool ( ) ; storagePoolWithLocalFS ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS ) ) . when ( poolValidator ) . isNotLocalfsWithDefaultCluster ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig before = dao.get ( FixturesTool.HOST_NIC_VFS_CONFIG_ALL_NETWORKS_ALLOWED ) ; before.setNicId ( FixturesTool.VDS_NETWORK_INTERFACE2 ) ; before.setAllNetworksAllowed ( ( ! ( before.isAllNetworksAllowed ( ) ) ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig after = dao.get ( FixturesTool.HOST_NIC_VFS_CONFIG_ALL_NETWORKS_ALLOWED ) ; org.junit.Assert.assertNotNull ( after ) ; assertHostNicVfsConfigEquals ( before , after ) ; }

Target:
public void testRemoveWithNetworkAndLabels ( ) { commonRemove ( FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_1 ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > networks = ( ( org.ovirt.engine.core.dao.network.HostNicVfsConfigDaoDbFacadeImpl ) ( dao ) ) . getNetworksByVfsConfigId ( FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_1 ) ; java.util.Set < java.lang.String > labels = ( ( org.ovirt.engine.core.dao.network.HostNicVfsConfigDaoDbFacadeImpl ) ( dao ) ) . getLabelsByVfsConfigId ( FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_1 ) ; checkNetworks ( networks , 0 ) ; checkLabels ( labels , 0 ) ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( "%s, srcHost=%s, dstVdsId=%s, dstHost=%s, migrationMethod=%s, tunnelMigration=%s, migrationDowntime=%s" , super . toString ( ) , getSrcHost ( ) , getDstVdsId ( ) , getDstHost ( ) , getMigrationMethod ( ) , isTunnelMigration ( ) , getMigrationDowntime ( ) ) ; }

Target:
public java.lang.String toString ( ) { return java.lang.String.format ( "%s, srcHost=%s, dstVdsId=%s, dstHost=%s, migrationMethod=%s, tunnelMigration=%s, migrationDowntime=%s, autoConverge=%s, migrateCompressed=%s" , super . toString ( ) , getSrcHost ( ) , getDstVdsId ( ) , getDstHost ( ) , getMigrationMethod ( ) , isTunnelMigration ( ) , getMigrationDowntime ( ) , getAutoConverge ( ) , getMigrateCompressed ( ) ) ; }
Source:
public void noVms ( ) { vmJobsMonitoring.process ( java.util.Collections.emptyMap ( ) ) ; org.mockito.Mockito.verify ( vmJobsMonitoring , org.mockito.Mockito.never ( ) ) . getExistingJobsForVm ( org.mockito.Matchers.any ( ) ) ; org.mockito.Mockito.verify ( vmJobsMonitoring , org.mockito.Mockito.never ( ) ) . updateJobs ( org.mockito.Matchers.any ( ) ) ; org.mockito.Mockito.verify ( vmJobsMonitoring , org.mockito.Mockito.never ( ) ) . removeJobs ( org.mockito.Matchers.any ( ) ) ; }

Target:
public void noVms ( ) { vmJobsMonitoring.process ( java.util.Collections.emptyMap ( ) ) ; org.mockito.Mockito.verify ( vmJobsMonitoring , org.mockito.Mockito.never ( ) ) . getExistingJobsForVm ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( vmJobsMonitoring , org.mockito.Mockito.never ( ) ) . updateJobs ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( vmJobsMonitoring , org.mockito.Mockito.never ( ) ) . removeJobs ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public static void GetRpmVersionViaPublic ( 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.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public void connect ( ) { org.ovirt.engine.ui.common.uicommon.SpicePluginImpl.logger.warning ( "Connecting via spice..." ) ; if ( configurator.isClientLinuxFirefox ( ) ) { connectNativelyViaXPI ( ) ; } else if ( configurator.isClientWindowsExplorer ( ) ) { connectNativelyViaActiveX ( ) ; } }

Target:
public void connect ( ) { org.ovirt.engine.ui.common.uicommon.SpicePluginImpl.logger.warning ( "Connecting via spice..." ) ; if ( configurator.isClientLinuxFirefox ( ) ) { connectNativelyViaXPI ( ) ; } else if ( ( configurator.isClientWindowsExplorer ( ) ) || ( cu.isIE11 ( ) ) ) { connectNativelyViaActiveX ( ) ; } }
Source:
public void qosValidCommitmentReportedNicSpeed ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmentNicSetup ( ( ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) / 2 ) , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
private void mockCalculateBaseNicWhenBaseNicIsPassed ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( nic ) ) ) . thenReturn ( nic ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( nic ) , org.mockito.Matchers.any ( java.util.Map.class ) ) ) . thenReturn ( nic ) ; }
Source:
public void testIsNetworkInSyncWhenStaticBootProtocolNetmaskDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocolNetmask ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
private void initIpv4ConfigurationBootProtocol ( boolean sameBootProtocol ) { initIpv4Configuration ( ) ; ipv4Address.setBootProtocol ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL ) ; org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol ifaceBootProtocol = ( sameBootProtocol ) ? org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL : org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ; iface.setIpv4BootProtocol ( ifaceBootProtocol ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQuery.getBackendResourceManager ( ) . RunVdsCommand ( VDSCommandType.GetGlusterVolumeProfileInfo , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeProfileInfoVDSParameters ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQuery.getParameters ( ) . getClusterId ( ) , getUpServerId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQuery.getParameters ( ) . getClusterId ( ) ) , getGlusterVolumeName ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQuery.getParameters ( ) . getVolumeId ( ) ) ) ) ; org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQuery.getQueryReturnValue ( ) . setReturnValue ( returnValue.getReturnValue ( ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.GetGlusterVolumeProfileInfo , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeProfileInfoVDSParameters ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQuery.getParameters ( ) . getClusterId ( ) , getUpServerId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQuery.getParameters ( ) . getClusterId ( ) ) , getGlusterVolumeName ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQuery.getParameters ( ) . getVolumeId ( ) ) ) ) ; org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQuery.getQueryReturnValue ( ) . setReturnValue ( returnValue.getReturnValue ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.network.macpool.MacPool createDecoratedPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { org.ovirt.engine.core.bll.network.macpool.MacPool decoratedPool = decoratePool ( macPool , decorators ) ; return lockedObjectFactory.createLockingInstance ( decoratedPool , org.ovirt.engine.core.bll.network.macpool.MacPool.class , lockForMacPool ( macPool.getId ( ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.network.macpool.MacPool createDecoratedPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { org.ovirt.engine.core.bll.network.macpool.MacPool lockedPool = lockedObjectFactory.createLockingInstance ( macPool , org.ovirt.engine.core.bll.network.macpool.MacPool.class , lockForMacPool ( macPool.getId ( ) ) ) ; org.ovirt.engine.core.bll.network.macpool.MacPool decoratedPool = decoratePool ( lockedPool , decorators ) ; org.ovirt.engine.core.bll.network.macpool.DecoratedMacPoolFactory.log.debug ( "MacPool decorated as {}." , macPool , decoratedPool ) ; return decoratedPool ; }
Source:
public void testAlreadyExistStorageDomain ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.domain.AddExistingBlockStorageDomainCommandTest.getStorageDomain ( ) ) ; org.junit.Assert.assertFalse ( "Storage Domain already exists" , command.canAddDomain ( ) ) ; org.junit.Assert.assertTrue ( "Import block Storage Domain should have failed due to already existing Storage Domain" , command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST.toString ( ) ) ) ; }

Target:
public void testAlreadyExistStorageDomain ( ) { org.mockito.Mockito.when ( storageDomainStaticDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.domain.AddExistingBlockStorageDomainCommandTest.getStorageDomain ( ) ) ; org.junit.Assert.assertFalse ( "Storage Domain already exists" , command.canAddDomain ( ) ) ; org.junit.Assert.assertTrue ( "Import block Storage Domain should have failed due to already existing Storage Domain" , command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST.toString ( ) ) ) ; }
Source:
protected void updateModelDataCenterFromVds ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( dataCenters != null ) { getDataCenter ( ) . setItems ( dataCenters ) ; getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterPredicate ( vds.getStoragePoolId ( ) ) ) ) ; if ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) { getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters ) ) ; } } }

Target:
protected void updateModelDataCenterFromVds ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( dataCenters != null ) { getDataCenter ( ) . setItems ( dataCenters ) ; getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters , new org.ovirt.engine.ui.uicommonweb.Linq.IdPredicate < > ( vds.getStoragePoolId ( ) ) ) ) ; if ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) { getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters ) ) ; } } }
Source:
public void testUpdateCantDo ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( ) ; resource.setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.ROOT_PASSWORD } , false , true , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" , 409 ) ; } }

Target:
public void testUpdateCantDo ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( ) ; resource.setUriInfo ( setUpActionExpectations ( ActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.ROOT_PASSWORD } , false , true , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" , 409 ) ; } }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( getDiskImage ( ) . getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , getDiskIsBeingExportedMessage ( ) ) ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImage ( ) ; if ( diskImage == null ) { return null ; } return java.util.Collections.singletonMap ( diskImage.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , getDiskIsBeingExportedMessage ( ) ) ) ; }
Source:
public void diskSnapshotsCannotBePreviewed ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( activeSnapshot ) ; org.mockito.Mockito.when ( diskImageDao.get ( disk1.getImageId ( ) ) ) . thenReturn ( disk1 ) ; org.mockito.Mockito.when ( diskImageDao.get ( disk2.getImageId ( ) ) ) . thenReturn ( disk2 ) ; org.junit.Assert.assertThat ( validator.canDiskSnapshotsBePreviewed ( activeSnapshot.getId ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_PREVIEW_ACTIVE_SNAPSHOT ) ) ; }

Target:
public void diskSnapshotsCannotBePreviewed ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( activeSnapshot ) ; org.mockito.Mockito.when ( diskImageDao.get ( disk1.getImageId ( ) ) ) . thenReturn ( disk1 ) ; org.mockito.Mockito.when ( diskImageDao.get ( disk2.getImageId ( ) ) ) . thenReturn ( disk2 ) ; org.junit.Assert.assertThat ( validator.canDiskSnapshotsBePreviewed ( activeSnapshot.getId ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_PREVIEW_ACTIVE_SNAPSHOT ) ) ; }
Source:
private static java.util.List < org.ovirt.engine.api.extensions.ExtMap > flatGroups ( java.util.List < java.util.Map > groupIds , java.util.List < org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( java.util.Map group : groupIds ) { accumulator.add ( ( ( org.ovirt.engine.api.extensions.ExtMap ) ( group ) ) ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( ( ( org.ovirt.engine.api.extensions.ExtMap ) ( group ) ) , Authz.GroupRecord.GROUPS , accumulator ) ; } return accumulator ; }

Target:
private static void flatGroups ( java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > groupIds , java.util.List < java.lang.String > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : groupIds ) { if ( ! ( accumulator.contains ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.add ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > filterDestinationDomainsByDiskStorageSubtype ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > destDomains , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > filteredDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain sd : destDomains ) { if ( ( sd.getStorageType ( ) . getStorageSubtype ( ) ) == ( disk.getStorageTypes ( ) . get ( 0 ) . getStorageSubtype ( ) ) ) { filteredDomains.add ( sd ) ; } } return filteredDomains ; }

Target:
private boolean isDiskValidForStorage ( org.ovirt.engine.core.common.businessentities.DiskImage disk , org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { if ( ( disk.isShareable ( ) ) && ( ( storage.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) ) { return false ; } return true ; }
Source:
public static java.lang.String encryptPassword ( java.lang.String password ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( password ) ) { return password ; } java.lang.String keyFile = org.ovirt.engine.core.common.config.Config.resolveKeyStorePath ( ) ; java.lang.String passwd = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.keystorePass , Config.DefaultConfigurationVersion ) ; java.lang.String alias = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.CertAlias , Config.DefaultConfigurationVersion ) ; try { return org.ovirt.engine.core.engineencryptutils.EncryptionUtils.encrypt ( password , keyFile , passwd , alias ) ; } catch ( java.lang.Exception e ) { throw new java.lang.SecurityException ( e ) ; } }

Target:
public static java.lang.String encryptPassword ( java.lang.String password ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( password ) ) { return password ; } java.lang.String keyFile = org.ovirt.engine.core.common.config.Config.resolveKeyStorePath ( ) ; java.lang.String passwd = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.keystorePass , ConfigCommon.defaultConfigurationVersion ) ; java.lang.String alias = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.CertAlias , ConfigCommon.defaultConfigurationVersion ) ; try { return org.ovirt.engine.core.engineencryptutils.EncryptionUtils.encrypt ( password , keyFile , passwd , alias ) ; } catch ( java.lang.Exception e ) { throw new java.lang.SecurityException ( e ) ; } }
Source:
public void testOsNameUpperCasedAndUnderscored ( ) throws java.lang.Exception { org.ovirt.engine.core.common.osinfo.Assert.assertEquals ( "RHEL_6" , org.ovirt.engine.core.common.osinfo.OsRepositoryImpl.osNameUpperCasedAndUnderscored ( "Rhel6" ) ) ; org.ovirt.engine.core.common.osinfo.Assert.assertEquals ( "RHEL_6X64" , org.ovirt.engine.core.common.osinfo.OsRepositoryImpl.osNameUpperCasedAndUnderscored ( "rhel6x64" ) ) ; org.ovirt.engine.core.common.osinfo.Assert.assertEquals ( "OTHER_LINUX" , org.ovirt.engine.core.common.osinfo.OsRepositoryImpl.osNameUpperCasedAndUnderscored ( "OtherLinux" ) ) ; }

Target:
public void testOsNameUpperCasedAndUnderscored ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "RHEL_6" , OsRepositoryImpl.INSTANCE.osNameUpperCasedAndUnderscored ( "Rhel6" ) ) ; org.junit.Assert.assertEquals ( "RHEL_6X64" , OsRepositoryImpl.INSTANCE.osNameUpperCasedAndUnderscored ( "rhel6x64" ) ) ; org.junit.Assert.assertEquals ( "OTHER_LINUX" , OsRepositoryImpl.INSTANCE.osNameUpperCasedAndUnderscored ( "OtherLinux" ) ) ; }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) , aQuery ) ; }

Target:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
protected < T > Q resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver ) { try { return entityResolver.resolve ( result.getActionReturnValue ( ) ) ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.handleError ( e , false ) ; } }

Target:
protected < T > Q resolveCreated ( org.ovirt.engine.core.common.action.ActionReturnValue result , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver ) { try { return entityResolver.resolve ( result.getActionReturnValue ( ) ) ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.handleError ( e , false ) ; } }
Source:
public static void GetTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters ( templateId ) , aQuery ) ; }

Target:
public static void 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.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runInternalMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters ) { return getBackend ( ) . runInternalMultipleActions ( actionType , parameters ) ; }
Source:
public void removeAllIllegalDisks ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ) { if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL ) ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage , vmId ) ; } } }

Target:
public void removeAllIllegalDisks ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ) { if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL ) ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.removeDiskImage ( diskImage , vmId ) ; } } }