auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , true , true ) ) ; org.ovirt.engine.api.model.Nic nic = resource.update ( getNic ( false ) ) ; assertNotNull ( nic ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , true , true ) ) ; org.ovirt.engine.api.model.Nic nic = resource.update ( getNic ( false ) ) ; org.junit.Assert.assertNotNull ( nic ) ; }
Source:
public static void GetVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }
Source:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.VmPool > aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > findAllInterfaceNetworkNameNotEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.VM v1 , org.ovirt.engine.core.common.businessentities.VM v2 ) { return org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator.comp ( v1.getName ( ) , v2.getName ( ) ) ; }
Source:
private void UpdateVolumeFormat ( ) { org.ovirt.engine.core.common.businessentities.VolumeType volumeType = ( ( getVolumeType ( ) . getSelectedItem ( ) ) == null ) ? org.ovirt.engine.core.common.businessentities.VolumeType.Unassigned : ( ( org.ovirt.engine.core.common.businessentities.VolumeType ) ( getVolumeType ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = ( ( getStorageDomain ( ) . getSelectedItem ( ) ) == null ) ? org.ovirt.engine.core.common.businessentities.StorageType.UNKNOWN : ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) . getstorage_type ( ) ; setVolumeFormat ( org.ovirt.engine.ui.uicommonweb.DataProvider.GetDiskVolumeFormat ( volumeType , storageType ) ) ; }

Target:
private void updateVolumeFormat ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { setVolumeFormat ( org.ovirt.engine.ui.uicommonweb.DataProvider.GetDiskVolumeFormat ( volumeType , storageType ) ) ; }
Source:
public void testUpdate ( ) { existingVmStatic.setDescription ( "updated" ) ; existingVmStatic.setCpuProfileId ( FixturesTool.CPU_PROFILE_2 ) ; dao.update ( existingVmStatic ) ; org.ovirt.engine.core.common.businessentities.VmStatic result = dao.get ( org.ovirt.engine.core.dao.VmStaticDAOTest.EXISTING_VM_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingVmStatic , result ) ; }

Target:
public void testUpdate ( ) { org.junit.Assert.assertEquals ( existingVmStatic.getProviderId ( ) , org.ovirt.engine.core.dao.VmStaticDAOTest.EXISTING_PROVIDER_ID ) ; existingVmStatic.setDescription ( "updated" ) ; existingVmStatic.setCpuProfileId ( FixturesTool.CPU_PROFILE_2 ) ; existingVmStatic.setProviderId ( null ) ; dao.update ( existingVmStatic ) ; org.ovirt.engine.core.common.businessentities.VmStatic result = dao.get ( org.ovirt.engine.core.dao.VmStaticDAOTest.EXISTING_VM_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingVmStatic , result ) ; org.junit.Assert.assertNull ( result.getProviderId ( ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid findImageForSameDrive ( org.ovirt.engine.core.compat.Guid snapshotId ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesFromSanpshot = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDAO ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : imagesFromSanpshot ) { if ( getDiskImage ( ) . getId ( ) . equals ( diskImage.getId ( ) ) ) { return diskImage.getImageId ( ) ; } } return null ; }

Target:
protected org.ovirt.engine.core.compat.Guid findImageForSameDrive ( org.ovirt.engine.core.compat.Guid snapshotId ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesFromSanpshot = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDAO ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : imagesFromSanpshot ) { if ( getDiskImage ( ) . getId ( ) . equals ( diskImage.getId ( ) ) ) { return diskImage.getImageId ( ) ; } } return null ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isDomainExistAndActive ( ) { org.ovirt.engine.core.bll.ValidationResult domainExistValidation = isDomainExist ( ) ; if ( ! ( ValidationResult.VALID.equals ( domainExistValidation ) ) ) { return domainExistValidation ; } if ( ( storageDomain.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 , java.lang.String.format ( "$%1$s %2$s" , "status" , storageDomain.getStatus ( ) . name ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isDomainExistAndActive ( ) { org.ovirt.engine.core.bll.ValidationResult domainExistValidation = isDomainExist ( ) ; if ( ! ( ValidationResult.VALID.equals ( domainExistValidation ) ) ) { return domainExistValidation ; } if ( ( storageDomain.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 , java.lang.String.format ( "$%1$s %2$s" , "status" , storageDomain.getStatus ( ) . name ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , 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:
private final < T extends org.ovirt.engine.core.common.businessentities.IVdcQueryable > java.util.List < T > genericSearch ( final org.ovirt.engine.core.dao.SearchDAO < T > dao , final boolean useCache , final org.ovirt.engine.core.common.utils.ListUtils.Filter < T > filter ) { final org.ovirt.engine.core.bll.QueryData data = initQueryData ( useCache ) ; if ( data == null ) { return new java.util.ArrayList < T > ( ) ; } return org.ovirt.engine.core.common.utils.ListUtils.filter ( dao.getAllWithQuery ( data.getQuery ( ) ) , filter ) ; }

Target:
private final < T extends org.ovirt.engine.core.common.businessentities.IVdcQueryable > java.util.List < T > genericSearch ( final org.ovirt.engine.core.dao.SearchDAO < T > dao , final boolean useCache , final org.ovirt.engine.core.common.utils.ListUtils.Filter < T > filter ) { final org.ovirt.engine.core.bll.QueryData data = initQueryData ( useCache ) ; if ( data == null ) { return new java.util.ArrayList < T > ( ) ; } log.debug ( ( "Executing generic query: " + ( data.getQuery ( ) ) ) ) ; return org.ovirt.engine.core.common.utils.ListUtils.filter ( dao.getAllWithQuery ( data.getQuery ( ) ) , filter ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configList" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterSnapshotConfigList ( org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configList" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , response ) ; }
Source:
private void translateErrors ( final java.util.Collection < org.ovirt.engine.core.common.action.VdcReturnValueBase > errors ) { for ( org.ovirt.engine.core.common.action.VdcReturnValueBase retVal : errors ) { if ( ! ( retVal.getCanDoAction ( ) ) ) { retVal.setCanDoActionMessages ( ( ( java.util.ArrayList < java.lang.String > ) ( translateError ( retVal ) ) ) ) ; } else if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.common.errors.VdcFault fault = retVal.getFault ( ) ; fault.setMessage ( translateVdcFault ( fault ) ) ; } } }

Target:
private void translateErrors ( final java.util.Collection < org.ovirt.engine.core.common.action.VdcReturnValueBase > errors ) { for ( org.ovirt.engine.core.common.action.VdcReturnValueBase retVal : errors ) { if ( ! ( retVal.getCanDoAction ( ) ) ) { retVal.setCanDoActionMessages ( ( ( java.util.ArrayList < java.lang.String > ) ( translateError ( retVal ) ) ) ) ; } else if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.common.errors.EngineFault fault = retVal.getFault ( ) ; fault.setMessage ( translateEngineFault ( fault ) ) ; } } }
Source:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; validateFailedWithReason ( EngineMessage.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }

Target:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createDefaultCluster ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createDefaultCluster ( ) ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }
Source:
public java.lang.Integer runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getByVdsmTaskId ( vdsmTaskId ) ; int retVal = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . removeByVdsmTaskId ( vdsmTaskId ) ; if ( ( asyncTask != null ) && ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( asyncTask.getCommandId ( ) ) ) ) ) { commandsCache.remove ( asyncTask.getCommandId ( ) ) ; } return retVal ; }

Target:
private void initChildHierarchy ( ) { if ( ! ( childHierarchyInitialized ) ) { synchronized ( LOCK ) { if ( ! ( childHierarchyInitialized ) ) { childHierarchy.clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmd : getCommandsWithCallBackEnabled ( ) ) { buildCmdHierarchy ( cmd ) ; } } childHierarchyInitialized = true ; } } }
Source:
private void addDefaultClusterToPool ( ) { org.ovirt.engine.core.common.businessentities.Cluster defaultCluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; defaultCluster.setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; defaultCluster.setId ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.DEFAULT_CLUSTER_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = new java.util.ArrayList < > ( ) ; clusters.add ( defaultCluster ) ; org.mockito.Mockito.when ( clusterDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( clusters ) ; }

Target:
private void addDefaultClusterToPool ( ) { org.ovirt.engine.core.common.businessentities.Cluster defaultCluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; defaultCluster.setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; defaultCluster.setId ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.DEFAULT_CLUSTER_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = new java.util.ArrayList < > ( ) ; clusters.add ( defaultCluster ) ; org.mockito.Mockito.when ( clusterDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( clusters ) ; }
Source:
private void mockHostDevices ( java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > extraDevices ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > devices = new java.util.ArrayList < > ( ) ; devices.add ( pciDevice ) ; devices.add ( netDevice ) ; devices.addAll ( extraDevices ) ; org.mockito.Mockito.when ( hostDeviceDao.getHostDevicesByHostId ( org.ovirt.engine.core.bll.network.host.HostNicVfsConfigHelperImplTest.HOST_ID ) ) . thenReturn ( devices ) ; }

Target:
private void mockHostDevices ( java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > extraDevices ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > devices = new java.util.ArrayList < > ( ) ; devices.add ( pciDevice ) ; devices.add ( netDevice ) ; devices.addAll ( extraDevices ) ; org.mockito.Mockito.when ( hostDeviceDao.getHostDevicesByHostId ( org.ovirt.engine.core.bll.network.host.HostNicVfsConfigHelperImplTest.HOST_ID ) ) . thenReturn ( devices ) ; org.mockito.Mockito.when ( hostDeviceDao.getAll ( ) ) . thenReturn ( devices ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { if ( user.isAdmin ( ) ) { return getApplicationResources ( ) . adminImage ( ) ; } if ( user.isGroup ( ) ) { return getApplicationResources ( ) . userGroupImage ( ) ; } return getApplicationResources ( ) . userImage ( ) ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { if ( user.isAdmin ( ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.resources.adminImage ( ) ; } if ( user.isGroup ( ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.resources.userGroupImage ( ) ; } return org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.resources.userImage ( ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.UserTagMapBase.getTagId ( ) ) != null ) && ( ! ( org.ovirt.engine.core.bll.UserTagMapBase.getTagId ( ) . equals ( Guid.Empty ) ) ) ) { return true ; } else { addCanDoActionMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } }

Target:
protected boolean validate ( ) { if ( ( ( org.ovirt.engine.core.bll.UserTagMapBase.getTagId ( ) ) != null ) && ( ! ( org.ovirt.engine.core.bll.UserTagMapBase.getTagId ( ) . equals ( Guid.Empty ) ) ) ) { return true ; } else { addValidationMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } }
Source:
private java.lang.String [ ] createIncoherentNicIdentificationErrorReplacements ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName ) { return new java.lang.String [ ] { java.lang.String.format ( "$id %s" , violatingEntityId ) , java.lang.String.format ( "$nicId %s" , nicId ) , java.lang.String.format ( "$nicName %s" , nicName ) } ; }

Target:
private java.lang.String [ ] createIncoherentIdentificationErrorReplacements ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName ) { return new java.lang.String [ ] { java.lang.String.format ( "$ENTITY_ID %s" , violatingEntityId ) , java.lang.String.format ( "$referringId %s" , referringId ) , java.lang.String.format ( "$referringName %s" , referringName ) } ; }
Source:
private void disableAllTabs ( ) { generalTab.disableContent ( ) ; poolTab.disableContent ( ) ; windowsSysPrepTab.disableContent ( ) ; consoleTab.disableContent ( ) ; hostTab.disableContent ( ) ; highAvailabilityTab.disableContent ( ) ; resourceAllocationTab.disableContent ( ) ; bootOptionsTab.disableContent ( ) ; customPropertiesTab.disableContent ( ) ; }

Target:
private void disableAllTabs ( ) { generalTab.disableContent ( ) ; poolTab.disableContent ( ) ; initialRunTab.disableContent ( ) ; consoleTab.disableContent ( ) ; hostTab.disableContent ( ) ; highAvailabilityTab.disableContent ( ) ; resourceAllocationTab.disableContent ( ) ; bootOptionsTab.disableContent ( ) ; customPropertiesTab.disableContent ( ) ; }
Source:
public void failedFenceWithSameProxyRetry ( ) { mockProxyHost ( false ) ; mockFenceFailure ( false ) ; org.ovirt.engine.core.common.businessentities.FenceAgent agent = createAgent ( ) ; org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result = executor.fence ( FenceActionType.Start , agent ) ; org.junit.Assert.assertFalse ( result.getSucceeded ( ) ) ; org.mockito.Mockito.verify ( proxyLocator ) . findProxyHost ( true , org.ovirt.engine.core.bll.FenceExecutorTest.PROXY_HOST_ID ) ; }

Target:
public void failedFenceWithSameProxyRetry ( ) { mockProxyHost ( false ) ; mockFenceFailure ( false ) ; org.ovirt.engine.core.common.businessentities.FenceAgent agent = createAgent ( ) ; org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result = executor.fence ( FenceActionType.START , agent ) ; org.junit.Assert.assertFalse ( result.getSucceeded ( ) ) ; org.mockito.Mockito.verify ( proxyLocator ) . findProxyHost ( true , org.ovirt.engine.core.bll.FenceExecutorTest.PROXY_HOST_ID ) ; }
Source:
public static boolean needsAlert ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ( ( ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasDifferentTimezone ( vm ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasDifferentOSType ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.isUpdateNeeded ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasPauseError ( vm ) ) ; }

Target:
public static boolean needsAlert ( org.ovirt.engine.core.common.businessentities.VM vm ) { boolean alertRequired = false ; if ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { alertRequired = ( ( ! ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasGuestAgent ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasDifferentTimezone ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasDifferentOSType ( vm ) ) ; } return ( alertRequired || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.isUpdateNeeded ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasPauseError ( vm ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsVirtioScsiEnabled ( ) . setEntity ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; }

Target:
private void setSelectedOSTypeById ( int osId ) { for ( java.lang.Integer osIdList : getModel ( ) . getOSType ( ) . getItems ( ) ) { if ( ( osIdList.intValue ( ) ) == osId ) { getModel ( ) . getOSType ( ) . setSelectedItem ( osIdList ) ; break ; } } }
Source:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntityStronglyTyped ( ) , getEntityStronglyTyped ( ) . getStoragePoolId ( ) , cluster.getcompatibility_version ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntity ( ) , getEntity ( ) . getStoragePoolId ( ) , cluster.getCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
private void writeStructType ( org.ovirt.api.metamodel.concepts.StructType type ) { writer.writeStartElement ( "struct" ) ; writeCommon ( type ) ; type.attributes ( ) . forEach ( this :: writeAttribute ) ; type.links ( ) . forEach ( this :: writeStructLink ) ; writer.writeEndElement ( ) ; }

Target:
private void writePrimitiveType ( org.ovirt.api.metamodel.concepts.PrimitiveType type ) { writer.writeStartElement ( "primitive" ) ; writeCommon ( type ) ; writer.writeEndElement ( ) ; }
Source:
private void restartVdsVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVmDao ( ) . getAllRunningForVds ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVdsId ( ) ) ; if ( ! ( vms.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getContext ( ) , org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) ) ; restartVmsOper.restartVms ( vms ) ; runVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) . getId ( ) ) ) ; } }

Target:
private void restartVdsVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAllRunningForVds ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVdsId ( ) ) ; if ( ! ( vms.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getContext ( ) , org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) ) ; restartVmsOper.restartVms ( vms ) ; runVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) . getId ( ) ) ) ; } }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; boolean force = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmResource.FORCE , true , false ) ; org.ovirt.engine.core.common.action.RemoveVmParameters params = new org.ovirt.engine.core.common.action.RemoveVmParameters ( guid , force ) ; boolean detachOnly = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmResource.DETACH_ONLY , true , false ) ; if ( detachOnly ) { params.setRemoveDisks ( false ) ; } return performAction ( VdcActionType.RemoveVm , params ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; boolean force = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmResource.FORCE , true , false ) ; org.ovirt.engine.core.common.action.RemoveVmParameters params = new org.ovirt.engine.core.common.action.RemoveVmParameters ( guid , force ) ; boolean detachOnly = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmResource.DETACH_ONLY , true , false ) ; if ( detachOnly ) { params.setRemoveDisks ( false ) ; } return performAction ( VdcActionType.RemoveVm , params ) ; }
Source:
public void testGetNotFound ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 1 , true ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 1 , true ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: get ) ) ; }
Source:
protected java.util.List < java.lang.String > getUrlParameterDeclarations ( java.util.List < org.ovirt.engine.sdk.entities.Parameter > params ) { java.util.List < java.lang.String > paramDecls = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.sdk.entities.Parameter param : params ) { java.lang.String paramName = org.ovirt.engine.sdk.generator.java.utils.UrlUtils.toQueryParam ( param.getName ( ) ) ; java.lang.String paramType = org.ovirt.engine.sdk.generator.java.utils.TypeUtils.toJava ( param.getType ( ) ) ; org.ovirt.engine.sdk.generator.java.templates.MethodParameterTemplate paramDeclTemplate = new org.ovirt.engine.sdk.generator.java.templates.MethodParameterTemplate ( ) ; java.lang.String paramDecl = paramDeclTemplate.evaluate ( paramType , paramName ) ; paramDecls.add ( paramDecl ) ; } return paramDecls ; }

Target:
protected java.lang.String getHeaderBuilderCode ( java.util.List < org.ovirt.engine.sdk.generator.java.ParameterData > parameters ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.sdk.generator.java.ParameterData parameter : parameters ) { if ( ( parameter.getType ( ) ) == ( org.ovirt.engine.sdk.generator.java.ParameterType.HEADER ) ) { org.ovirt.engine.sdk.generator.java.templates.HeaderBuilderParameterTemplate template = new org.ovirt.engine.sdk.generator.java.templates.HeaderBuilderParameterTemplate ( ) ; buffer.append ( "\n" ) ; buffer.append ( template.evaluate ( parameter ) ) ; } } return buffer.toString ( ) ; }
Source:
private org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > setupCanAddVmFromSnapshotTests ( final int domainSizeGB , final int sizeRequired , final int pctRequired , org.ovirt.engine.core.compat.Guid sourceSnapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired , pctRequired ) ; initializeVmDAOMock ( vm ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = createVmFromSnapshotCommand ( vm , sourceSnapshotId ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM initializeMock ( final int domainSizeGB , final int sizeRequired ) { mockVmTemplateDAOReturnVmTemplate ( ) ; mockDiskImageDAOGetSnapshotById ( ) ; mockStorageDomainDAOGetForStoragePool ( domainSizeGB ) ; mockStorageDomainDAOGet ( domainSizeGB ) ; mockGetImageDomainsListVdsCommand ( ) ; mockConfig ( ) ; mockConfigSizeRequirements ( sizeRequired ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.AddVmCommandTest.createVm ( ) ; return vm ; }
Source:
public static java.lang.String getDiskAliasWithDefault ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , java.lang.String aliasIfNull ) { java.lang.String diskAlias = disk.getDiskAlias ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( diskAlias ) ) { org.ovirt.engine.core.bll.ImagesHandler.log.infoFormat ( "Disk alias retrieved from the client is null or empty, the suggested default disk alias to be used is {0}" , aliasIfNull ) ; return aliasIfNull ; } return diskAlias ; }

Target:
public static java.lang.String getDiskAliasWithDefault ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , java.lang.String aliasIfNull ) { java.lang.String diskAlias = disk.getDiskAlias ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( diskAlias ) ) { org.ovirt.engine.core.bll.ImagesHandler.log.info ( ( "Disk alias retrieved from the client is null or empty, the suggested default disk alias to be" + " used is '{}'" ) , aliasIfNull ) ; return aliasIfNull ; } return diskAlias ; }
Source:
public static void setRollbackOnly ( ) { try { org.ovirt.engine.core.utils.transaction.TransactionManager tm = org.ovirt.engine.core.utils.transaction.TransactionSupport.findTransactionManager ( ) ; org.ovirt.engine.core.utils.transaction.Transaction transaction = tm.getTransaction ( ) ; if ( transaction != null ) { transaction.setRollbackOnly ( ) ; } } catch ( org.ovirt.engine.core.utils.transaction.SystemException e ) { throw new java.lang.RuntimeException ( "Failed to mark transaction for rollback" , e ) ; } }

Target:
public static void setRollbackOnly ( ) { try { javax.transaction.TransactionManager tm = org.ovirt.engine.core.utils.transaction.TransactionSupport.findTransactionManager ( ) ; javax.transaction.Transaction transaction = tm.getTransaction ( ) ; if ( transaction != null ) { transaction.setRollbackOnly ( ) ; } } catch ( javax.transaction.SystemException e ) { throw new java.lang.RuntimeException ( "Failed to mark transaction for rollback" , e ) ; } }
Source:
public void testAddHostedEngineStorageSucceeds ( ) { parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testAddHostedEngineStorageSucceeds ( ) { parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
protected void build ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setVmtGuid ( model.getTemplate ( ) . getSelectedItem ( ) . getId ( ) ) ; vm.setCustomProperties ( model.getCustomPropertySheet ( ) . serialize ( ) ) ; }

Target:
protected void build ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setVmtGuid ( model.getTemplate ( ) . getSelectedItem ( ) . getId ( ) ) ; vm.setCustomProperties ( model.getCustomPropertySheet ( ) . serialize ( ) ) ; vm.setInstanceTypeId ( model.getInstanceTypes ( ) . getSelectedItem ( ) . getId ( ) ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > allocate ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile , org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.businessentities.VDS host ) { java.util.Map < java.lang.String , java.lang.String > runtimeProperties = new java.util.HashMap < > ( ) ; runtimeProperties.put ( "provider_type" , "unmanaged" ) ; runtimeProperties.put ( "plugin_type" , org.apache.commons.lang.StringUtils.defaultString ( provider.getAdditionalProperties ( ) . getPluginType ( ) ) ) ; return runtimeProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > allocate ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile , org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.businessentities.VDS host , boolean ignoreSecurityGroups ) { java.util.Map < java.lang.String , java.lang.String > runtimeProperties = new java.util.HashMap < > ( ) ; runtimeProperties.put ( "provider_type" , "unmanaged" ) ; runtimeProperties.put ( "plugin_type" , org.apache.commons.lang.StringUtils.defaultString ( provider.getAdditionalProperties ( ) . getPluginType ( ) ) ) ; return runtimeProperties ; }
Source:
protected org.ovirt.engine.api.model.Snapshot addVmConfiguration ( org.ovirt.engine.api.model.Snapshot entity , org.ovirt.engine.api.model.Snapshot snapshot ) { if ( entity.isVmConfigurationAvailable ( ) ) { snapshot.setVm ( new org.ovirt.engine.api.model.VM ( ) ) ; getMapper ( org.ovirt.engine.api.model.VM.class , org.ovirt.engine.api.model.VM.class ) . map ( getVmPreview ( snapshot ) , snapshot.getVm ( ) ) ; } else { snapshot.setVm ( null ) ; snapshot.getLinks ( ) . clear ( ) ; } return snapshot ; }

Target:
protected org.ovirt.engine.api.model.Snapshot addVmConfiguration ( org.ovirt.engine.api.model.Snapshot entity , org.ovirt.engine.api.model.Snapshot snapshot ) { if ( entity.isVmConfigurationAvailable ( ) ) { snapshot.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; getMapper ( org.ovirt.engine.core.common.businessentities.VM.class , org.ovirt.engine.api.model.Vm.class ) . map ( getVmPreview ( snapshot ) , snapshot.getVm ( ) ) ; } else { snapshot.setVm ( null ) ; snapshot.getLinks ( ) . clear ( ) ; } return snapshot ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; for ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters parameters : org.ovirt.engine.core.bll.MoveDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageDao ( ) . get ( parameters.getImageId ( ) ) ; if ( diskImage != null ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskImage.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.CONFIGURE_DISK_STORAGE ) ) ; } } return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; for ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters parameters : org.ovirt.engine.core.bll.MoveDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageDao ( ) . get ( parameters.getImageId ( ) ) ; if ( diskImage != null ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskImage.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.CONFIGURE_DISK_STORAGE ) ) ; } } return permissionList ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc glusterSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "snapName" , snapshotName ) . withOptionalParameter ( "snapDescription" , description ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturnForXmlRpc glusterSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "snapName" , snapshotName ) . withOptionalParameter ( "snapDescription" , description ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturnForXmlRpc ( response ) ; }
Source:
public void setStorageItems ( ) { super . setStorageItems ( ) ; if ( getSelectableModels ( ) . isEmpty ( ) ) { getModel ( ) . getDataCenterAlert ( ) . setIsAvailable ( true ) ; getModel ( ) . getDataCenterAlert ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . noStoragesToImport ( ) ) ; } }

Target:
public void setStorageTypeItems ( ) { super . setStorageTypeItems ( ) ; if ( getSelectableModels ( ) . isEmpty ( ) ) { getModel ( ) . getDataCenterAlert ( ) . setIsAvailable ( true ) ; getModel ( ) . getDataCenterAlert ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . noStoragesToImport ( ) ) ; } }
Source:
public void cancelTasks ( final org.ovirt.engine.core.bll.CommandBase command ) { if ( command.hasTasks ( ) ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.log.infoFormat ( "Rollback for command: {0}." , command.getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( command.getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.log.errorFormat ( "Failed to cancel tasks for command: {0}." , command.getClass ( ) . getName ( ) ) ; } } } ) ; } }

Target:
public void cancelTasks ( final org.ovirt.engine.core.bll.CommandBase command ) { coCoAsyncTaskHelper.cancelTasks ( command , org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.log ) ; }
Source:
private javax.net.ssl.TrustManager [ ] createTrustManager ( final java.util.List < java.security.cert.X509Certificate > chain ) { return new javax.net.ssl.TrustManager [ ] { new javax.net.ssl.X509TrustManager ( ) { public java.security.cert.X509Certificate [ ] getAcceptedIssuers ( ) { return new java.security.cert.X509Certificate [ ] { } ; } public void checkClientTrusted ( java.security.cert.X509Certificate [ ] certs , java.lang.String authType ) { } public void checkServerTrusted ( java.security.cert.X509Certificate [ ] certs , java.lang.String authType ) { for ( java.security.cert.X509Certificate cert : certs ) { chain.add ( cert ) ; } } } } ; }

Target:
void handle ( final java.net.HttpURLConnection connection ) throws java.io.IOException ;
Source:
public static void GetStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit ) , aQuery ) ; }

Target:
public static void GetStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }