auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initTableColumns ( ) { contentSourcesTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity ) { return entity.getServerName ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.cluster.GlusterHookResolveConflictsPopupView.constants.sourceGlusterHook ( ) ) ; contentSourcesTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelEnumColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus getEnum ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity ) { return entity.getStatus ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.cluster.GlusterHookResolveConflictsPopupView.constants.statusGlusterHook ( ) ) ; }

Target:
private void initTableColumns ( ) { contentSourcesTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity ) { return entity.getServerName ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.cluster.GlusterHookResolveConflictsPopupView.constants.sourceGlusterHook ( ) ) ; contentSourcesTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelEnumColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus getEnum ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity ) { return entity.getStatus ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.cluster.GlusterHookResolveConflictsPopupView.constants.statusGlusterHook ( ) ) ; }
Source:
protected boolean CheckStoragePoolStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getstatus ( ) ) == status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL.toString ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; } } return returnValue ; }

Target:
protected boolean CheckStoragePoolStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getstatus ( ) ) == status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL.toString ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; } } return returnValue ; }
Source:
public static void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , sp , aQuery ) ; }

Target:
public static void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , sp , aQuery ) ; }
Source:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassValidate ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmBase.class ) , org.mockito.ArgumentMatchers.any ( java.util.ArrayList.class ) ) ; vmStatic.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "validate should have failed with invalid dedicated host." , command.validate ( ) ) ; }

Target:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassValidate ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; vmStatic.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "validate should have failed with invalid dedicated host." , command.validate ( ) ) ; }
Source:
public void testCanAttachSingleISOOrExport ( ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomainType type : java.util.Arrays.asList ( StorageDomainType.ISO , StorageDomainType.ImportExport ) ) { storageDomain.setStorageDomainType ( type ) ; spyValidator ( ) ; org.junit.Assert.assertThat ( validator.validateDomainCanBeAttachedToPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; } }

Target:
public void testCanAttachSingleISOOrExport ( ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomainType type : java.util.Arrays.asList ( StorageDomainType.ISO , StorageDomainType.ImportExport ) ) { storageDomain.setStorageDomainType ( type ) ; org.junit.Assert.assertThat ( validator.validateDomainCanBeAttachedToPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; } }
Source:
private boolean shouldCopyDevice ( boolean isCompatibleWithCluster , org.ovirt.engine.core.compat.Guid templateId , org.ovirt.engine.core.compat.Guid instanceTypeId ) { if ( ( instanceTypeId == null ) && ( templateId == null ) ) { return false ; } if ( ( instanceTypeId == null ) && ( templateId != null ) ) { return true ; } if ( ( instanceTypeId != null ) && isCompatibleWithCluster ) { return true ; } return false ; }

Target:
private boolean shouldCopyDevice ( boolean isCompatibleWithCluster , org.ovirt.engine.core.compat.Guid templateId , org.ovirt.engine.core.compat.Guid instanceTypeId ) { if ( ( instanceTypeId == null ) && ( templateId == null ) ) { return false ; } return isCompatibleWithCluster ; }
Source:
private boolean isVmNumaPinned ( java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > nodes ) { if ( ( nodes == null ) || ( nodes.isEmpty ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.VmNumaNode vmNumaNode : nodes ) { for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > > pair : vmNumaNode.getVdsNumaNodeList ( ) ) { if ( ( ( pair.getSecond ( ) ) != null ) && ( pair.getSecond ( ) . getFirst ( ) ) ) { return true ; } } } return false ; }

Target:
private boolean isVmNumaPinned ( java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > nodes ) { if ( ( nodes == null ) || ( nodes.isEmpty ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.VmNumaNode vmNumaNode : nodes ) { if ( ! ( vmNumaNode.getVdsNumaNodeList ( ) . isEmpty ( ) ) ) { return true ; } } return false ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachmentForNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { if ( networkId == null ) { throw new java.lang.IllegalArgumentException ( ) ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment updatedAttachment = new org.ovirt.engine.core.common.utils.MapNetworkAttachments ( hostSetupNetworksParametersData.newOrModifiedNetworkAttachments ) . byNetworkId ( ) . get ( networkId ) ; if ( updatedAttachment != null ) { return updatedAttachment ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment = getExistingAttachmentByNetworkId ( networkId ) ; if ( ( existingAttachment != null ) && ( ! ( shouldBeRemoved ( existingAttachment.getId ( ) ) ) ) ) { return existingAttachment ; } throw new java.lang.IllegalArgumentException ( ( "Unable to find network attachment for network id " + networkId ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachmentForNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { if ( networkId == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment updatedAttachment = new org.ovirt.engine.core.common.utils.MapNetworkAttachments ( hostSetupNetworksParametersData.newOrModifiedNetworkAttachments ) . byNetworkId ( ) . get ( networkId ) ; if ( updatedAttachment != null ) { return updatedAttachment ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment = getExistingAttachmentByNetworkId ( networkId ) ; if ( ( existingAttachment != null ) && ( ! ( shouldBeRemoved ( existingAttachment.getId ( ) ) ) ) ) { return existingAttachment ; } return null ; }
Source:
protected boolean validateVdsCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; return vdsGroup == null ? failValidation ( EngineMessage.VDS_CLUSTER_IS_NOT_VALID ) : ( vdsGroup.getArchitecture ( ) ) != ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getClusterArch ( ) ) ? failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_IMPORT_VM_ARCHITECTURE_NOT_SUPPORTED_BY_CLUSTER ) : true ; }

Target:
protected boolean validateVdsCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; return vdsGroup == null ? failValidation ( EngineMessage.VDS_CLUSTER_IS_NOT_VALID ) : ( vdsGroup.getArchitecture ( ) ) != ( getVm ( ) . getClusterArch ( ) ) ? failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_IMPORT_VM_ARCHITECTURE_NOT_SUPPORTED_BY_CLUSTER ) : true ; }
Source:
public void init ( ) { injectorRule.bind ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class , org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class ) ) ; injectorRule.bind ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.class , org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.class ) ) ; syncJob = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.gluster.GlusterSyncJob.getInstance ( ) ) ; }

Target:
public void init ( ) { injectorRule.bind ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class , org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class ) ) ; }
Source:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.addCpuProfileCommand.getPermissionCheckSubjects ( ) ; org.junit.Assert.assertEquals ( permissions.size ( ) , 1 ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.CLUSTER_ID , permissionSubject.getObjectId ( ) ) ; org.junit.Assert.assertEquals ( VdcObjectType.Cluster , permissionSubject.getObjectType ( ) ) ; }

Target:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.addCpuProfileCommand.getPermissionCheckSubjects ( ) ; org.junit.Assert.assertEquals ( 1 , permissions.size ( ) ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.CLUSTER_ID , permissionSubject.getObjectId ( ) ) ; org.junit.Assert.assertEquals ( VdcObjectType.Cluster , permissionSubject.getObjectType ( ) ) ; }
Source:
private boolean checkExceedingMaxBlockDiskSize ( ) { if ( isExceedMaxBlockDiskSize ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_MAX_SIZE_EXCEEDED ) ; org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$max_disk_size %1$s" , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxBlockDiskSize ) ) ) ; return false ; } return true ; }

Target:
private boolean checkExceedingMaxBlockDiskSize ( ) { if ( isExceedMaxBlockDiskSize ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_MAX_SIZE_EXCEEDED ) ; org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$max_disk_size %1$s" , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxBlockDiskSize ) ) ) ; return false ; } return true ; }
Source:
private org.ovirt.engine.api.restapi.resource.aaa.BackendUserResource getUserResource ( ) { if ( ( this . userResource ) == null ) { org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResource usersResource = new org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResource ( ) ; inject ( usersResource ) ; org.ovirt.engine.api.resource.aaa.UserResource userResource = usersResource.getUserSubResource ( "" ) ; this . userResource = ( ( org.ovirt.engine.api.restapi.resource.aaa.BackendUserResource ) ( userResource ) ) ; } return this . userResource ; }

Target:
private org.ovirt.engine.api.restapi.resource.aaa.BackendUserResource getUserResource ( ) { if ( ( this . userResource ) == null ) { org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResource usersResource = new org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResource ( ) ; inject ( usersResource ) ; org.ovirt.engine.api.resource.aaa.UserResource userResource = usersResource.getUserResource ( "" ) ; this . userResource = ( ( org.ovirt.engine.api.restapi.resource.aaa.BackendUserResource ) ( userResource ) ) ; } return this . userResource ; }
Source:
public static void isUSBEnabledByDefault ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void isUSBEnabledByDefault ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testListCrashClientLocale ( ) { locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) { locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } }
Source:
protected void postConnect ( org.ovirt.vdsm.jsonrpc.client.utils.OneTimeCallback callback ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { this . nioEngine = new org.ovirt.vdsm.jsonrpc.client.reactors.SSLEngineNioHelper ( channel , createSSLEngine ( false ) , callback ) ; this . nioEngine.beginHandshake ( ) ; int interestedOps = java.nio.channels.SelectionKey.OP_READ ; reactor.wakeup ( ) ; key = this . channel.register ( selector , ( interestedOps |= java.nio.channels.SelectionKey.OP_WRITE ) , this ) ; } catch ( java.nio.channels.ClosedChannelException | javax.net.ssl.SSLException e ) { org.ovirt.vdsm.jsonrpc.client.reactors.stomp.SSLStompListener.log.error ( "Connection issues during ssl client creation" , e ) ; throw new org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ( e ) ; } }

Target:
protected void postConnect ( org.ovirt.vdsm.jsonrpc.client.utils.OneTimeCallback callback ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { this . nioEngine = new org.ovirt.vdsm.jsonrpc.client.reactors.SSLEngineNioHelper ( channel , createSSLEngine ( false ) , callback , this ) ; this . nioEngine.beginHandshake ( ) ; int interestedOps = java.nio.channels.SelectionKey.OP_READ ; reactor.wakeup ( ) ; key = this . channel.register ( selector , ( interestedOps |= java.nio.channels.SelectionKey.OP_WRITE ) , this ) ; } catch ( java.nio.channels.ClosedChannelException | javax.net.ssl.SSLException e ) { org.ovirt.vdsm.jsonrpc.client.reactors.stomp.SSLStompListener.log.error ( "Connection issues during ssl client creation" , e ) ; throw new org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ( e ) ; } }
Source:
public void testDeserializeVdcActionParameters ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase params = new org.ovirt.engine.core.utils.serialization.json.JsonObjectDeserializer ( ) . deserialize ( getVdcActionParamsJson ( ) , org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ; org.junit.Assert.assertNotNull ( params.getLockProperties ( ) ) ; org.junit.Assert.assertTrue ( params.getLockProperties ( ) . isWait ( ) ) ; org.junit.Assert.assertEquals ( params.getLockProperties ( ) . getScope ( ) , Scope.None ) ; }

Target:
public void testDeserializeVdcActionParameters ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase params = new org.ovirt.engine.core.utils.serialization.json.JsonObjectDeserializer ( ) . deserialize ( getVdcActionParamsJson ( ) , org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ; org.junit.Assert.assertNotNull ( params.getLockProperties ( ) ) ; org.junit.Assert.assertTrue ( params.getLockProperties ( ) . isWait ( ) ) ; org.junit.Assert.assertEquals ( Scope.None , params.getLockProperties ( ) . getScope ( ) ) ; }
Source:
private java.lang.String GetValue ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.core.common.businessentities.VM ) { return ( ( org.ovirt.engine.core.common.businessentities.VM ) ( obj ) ) . getName ( ) ; } if ( obj instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { return ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( obj ) ) . getVmPoolName ( ) ; } throw new org.ovirt.engine.core.compat.NotImplementedException ( ) ; }

Target:
private java.lang.String GetValue ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.core.common.businessentities.VM ) { return ( ( org.ovirt.engine.core.common.businessentities.VM ) ( obj ) ) . getName ( ) ; } if ( obj instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { return ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( obj ) ) . getName ( ) ; } throw new org.ovirt.engine.core.compat.NotImplementedException ( ) ; }
Source:
public void getVdsWithVds ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; final org.ovirt.engine.core.common.businessentities.VM vm = null ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( vds , v ) ; }

Target:
public void getVdsWithVds ( ) { final org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; final org.ovirt.engine.core.common.businessentities.VM vm = null ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( vds , v ) ; }
Source:
public void calculateNetworkImplementationDetailsNoNetworkName ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setNetworkName ( null ) ; org.junit.Assert.assertNull ( "Network implementation details should not be filled." , org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( java.util.Collections.< java.lang.String , org.ovirt.engine.core.common.businessentities.Network > emptyMap ( ) , iface ) ) ; }

Target:
public void calculateNetworkImplementationDetailsNoNetworkName ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setNetworkName ( null ) ; org.junit.Assert.assertNull ( "Network implementation details should not be filled." , org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( java.util.Collections.< java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > emptyMap ( ) , iface ) ) ; }
Source:
public java.util.ArrayList < java.lang.Integer > getWindowsOss ( ) { java.util.ArrayList < java.lang.Integer > oss = new java.util.ArrayList < > ( ) ; for ( int osId : getOsIds ( ) ) { if ( isWindows ( osId ) ) { oss.add ( osId ) ; } } return oss ; }

Target:
public java.util.List < java.lang.Integer > getWindowsOss ( ) { java.util.List < java.lang.Integer > oss = new java.util.ArrayList < > ( ) ; for ( int osId : getOsIds ( ) ) { if ( isWindows ( osId ) ) { oss.add ( osId ) ; } } return oss ; }
Source:
public void updateConnectionNoDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( newNFSConnection.getid ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void updateConnectionNoDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getId ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( newNFSConnection.getId ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
private boolean isAlreadyInRequestedStatus ( ) { boolean ret = false ; org.ovirt.engine.core.common.businessentities.pm.FenceActionType action = org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getAction ( ) ; _result = fenceNode ( FenceActionType.STATUS , false ) ; if ( ( _result.power ) != null ) { java.lang.String powerStatus = _result.power.toLowerCase ( ) ; if ( ( ( action == ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.START ) ) && ( powerStatus.equals ( "on" ) ) ) || ( ( action == ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.STOP ) ) && ( powerStatus.equals ( "off" ) ) ) ) ret = true ; } return ret ; }

Target:
private boolean isAlreadyInRequestedStatus ( ) { boolean ret = false ; org.ovirt.engine.core.common.businessentities.pm.FenceActionType action = org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getAction ( ) ; _result = fenceNode ( FenceActionType.STATUS ) ; if ( ( _result.power ) != null ) { java.lang.String powerStatus = _result.power.toLowerCase ( ) ; if ( ( ( action == ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.START ) ) && ( powerStatus.equals ( "on" ) ) ) || ( ( action == ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.STOP ) ) && ( powerStatus.equals ( "off" ) ) ) ) ret = true ; } return ret ; }
Source:
private org.ovirt.engine.core.common.action.ImagesContainterParametersBase buildChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.DiskImage cinderDisk ) { org.ovirt.engine.core.common.action.ImagesContainterParametersBase createParams = new org.ovirt.engine.core.common.action.ImagesContainterParametersBase ( cinderDisk.getId ( ) ) ; createParams.setVmSnapshotId ( newActiveSnapshotId ) ; createParams.setParentHasTasks ( ( ( ! ( cachedImagesDisks.isEmpty ( ) ) ) || ( getMemoryImageBuilder ( ) . isCreateTasks ( ) ) ) ) ; createParams.setDescription ( getParameters ( ) . getDescription ( ) ) ; return withRootCommandInfo ( createParams , getActionType ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.ImagesContainterParametersBase buildChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.DiskImage cinderDisk ) { org.ovirt.engine.core.common.action.ImagesContainterParametersBase createParams = new org.ovirt.engine.core.common.action.ImagesContainterParametersBase ( cinderDisk.getId ( ) ) ; createParams.setVmSnapshotId ( newActiveSnapshotId ) ; createParams.setParentHasTasks ( ( ( ! ( cachedImagesDisks.isEmpty ( ) ) ) || ( getMemoryImageBuilder ( ) . isCreateTasks ( ) ) ) ) ; createParams.setDescription ( getParameters ( ) . getDescription ( ) ) ; return withRootCommandInfo ( createParams ) ; }
Source:
private void cleanConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection , org.ovirt.engine.core.compat.Guid hostId ) { if ( ( ( connection.getid ( ) ) != null ) && ( ! ( connection.getid ( ) . equals ( "" ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveStorageServerConnection , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) , null , this ) ; } }

Target:
private void cleanConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection , org.ovirt.engine.core.compat.Guid hostId ) { if ( ( ( connection.getId ( ) ) != null ) && ( ! ( connection.getId ( ) . equals ( "" ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveStorageServerConnection , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) , null , this ) ; } }
Source:
private java.lang.String getConnectionDescription ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections , java.lang.String connectionId ) { org.ovirt.engine.core.compat.Guid connectionIdGuid = org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( connectionId ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : connections ) { org.ovirt.engine.core.compat.Guid connectionGuid = org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( connection.geIid ( ) ) ; if ( connectionGuid.equals ( connectionIdGuid ) ) { java.lang.String desc = connection.getConnection ( ) ; if ( ( connection.getIqn ( ) ) != null ) { desc += " " + ( connection.getIqn ( ) ) ; } return desc ; } } return "" ; }

Target:
private java.lang.String getConnectionDescription ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections , java.lang.String connectionId ) { org.ovirt.engine.core.compat.Guid connectionIdGuid = org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( connectionId ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : connections ) { org.ovirt.engine.core.compat.Guid connectionGuid = org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( connection.getId ( ) ) ; if ( connectionGuid.equals ( connectionIdGuid ) ) { java.lang.String desc = connection.getConnection ( ) ; if ( ( connection.getIqn ( ) ) != null ) { desc += " " + ( connection.getIqn ( ) ) ; } return desc ; } } return "" ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( ) ; org.ovirt.engine.core.common.queries.ValueObjectMap map = options.getFencingOptionMappingMap ( ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setReturnValue ( map ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setSucceeded ( ( ( map.asMap ( ) . size ( ) ) > 0 ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( ) ; java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > map = options.getFencingOptionMappingMap ( ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setReturnValue ( map ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setSucceeded ( ( ( map.size ( ) ) > 0 ) ) ; }
Source:
private void HandleEndAction ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getParameters ( ) . isRemoveTemplateFromDb ( ) ) { removeTemplateFromDb ( ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmTemplateCommand.setSucceeded ( true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; log.error ( "Encountered a problem removing template from DB, setting the action not to retry." ) ; } }

Target:
private void HandleEndAction ( ) { try { removeTemplateFromDb ( ) ; org.ovirt.engine.core.bll.RemoveVmTemplateCommand.setSucceeded ( true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; log.error ( "Encountered a problem removing template from DB, setting the action not to retry." ) ; } }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( model ) ) ; java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; storageModel.PostUpdateHost ( hosts ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( model ) ) ; java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; storageModel.PostUpdateHost ( hosts ) ; }
Source:
protected void init ( ) { super . init ( ) ; resource.getParent ( ) . backend = backend ; resource.getParent ( ) . mappingLocator = resource.mappingLocator ; resource.getParent ( ) . httpHeaders = httpHeaders ; resource.getParent ( ) . messageBundle = messageBundle ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; }

Target:
protected void init ( ) { super . init ( ) ; resource.getParent ( ) . mappingLocator = resource.mappingLocator ; resource.getParent ( ) . httpHeaders = httpHeaders ; resource.getParent ( ) . messageBundle = messageBundle ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.DestroyImageCheckCommand.getParameters ( ) . setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.bll.DestroyImageCheckCommand.getParameters ( ) . getImageGroupId ( ) ) ) ; java.util.List < org.ovirt.engine.core.compat.Guid > failedGuids = getFailedVolumeIds ( ) ; if ( failedGuids.isEmpty ( ) ) { log.info ( "Requested images were successfully removed" ) ; org.ovirt.engine.core.bll.DestroyImageCheckCommand.setSucceeded ( true ) ; setCommandStatus ( CommandStatus.SUCCEEDED ) ; persistCommand ( org.ovirt.engine.core.bll.DestroyImageCheckCommand.getParameters ( ) . getParentCommand ( ) ) ; } else { log.error ( "The following images were not removed: {}" , failedGuids ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.DestroyImageCheckCommand.getParameters ( ) . setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.bll.DestroyImageCheckCommand.getParameters ( ) . getImageGroupId ( ) ) ) ; java.util.List < org.ovirt.engine.core.compat.Guid > failedGuids = getFailedVolumeIds ( ) ; if ( failedGuids.isEmpty ( ) ) { log.info ( "Requested images were successfully removed" ) ; org.ovirt.engine.core.bll.DestroyImageCheckCommand.setSucceeded ( true ) ; persistCommand ( org.ovirt.engine.core.bll.DestroyImageCheckCommand.getParameters ( ) . getParentCommand ( ) ) ; } else { log.error ( "The following images were not removed: {}" , failedGuids ) ; } }
Source:
public void InternalSetVmStatus ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.VMStatus status ) { vm.setStatus ( status ) ; org.ovirt.engine.core.common.businessentities.VMStatus vmStatus = vm.getStatus ( ) ; boolean isVmStatusDown = org.ovirt.engine.core.common.businessentities.VM.isStatusDown ( vmStatus ) ; if ( isVmStatusDown || ( vmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ) { resetVmAttributes ( vm ) ; if ( isVmStatusDown ) { vm.setRunOnVds ( null ) ; vm.setVmPauseStatus ( VmPauseStatus.NONE ) ; } } }

Target:
public void InternalSetVmStatus ( org.ovirt.engine.core.common.businessentities.VM vm , final org.ovirt.engine.core.common.businessentities.VMStatus status ) { vm.setStatus ( status ) ; boolean isVmStatusDown = org.ovirt.engine.core.common.businessentities.VM.isStatusDown ( status ) ; if ( isVmStatusDown || ( status == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ) { resetVmAttributes ( vm ) ; if ( isVmStatusDown ) { vm.setRunOnVds ( null ) ; vm.setVmPauseStatus ( VmPauseStatus.NONE ) ; } } }
Source:
private void initProfiles ( ) { java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > existingProfiles = getProfiles ( ) . getItems ( ) ; if ( existingProfiles == null ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > profiles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > ( ) ; profiles.add ( getDefaultProfile ( ) ) ; getProfiles ( ) . setItems ( profiles ) ; } else { for ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profile : existingProfiles ) { profile.updateDc ( getSelectedDc ( ) . getcompatibility_version ( ) , getSelectedDc ( ) . getId ( ) ) ; } } }

Target:
private void initProfiles ( ) { for ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profile : ( ( java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > ) ( getProfiles ( ) . getItems ( ) ) ) ) { profile.updateDc ( getSelectedDc ( ) . getcompatibility_version ( ) , getSelectedDc ( ) . getId ( ) ) ; } }
Source:
public java.lang.Object call ( ) throws java.lang.Exception { java.lang.String minimal = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.BootstrapMinimalVdsmVersion ) ; if ( ( minimal.trim ( ) . length ( ) ) == 0 ) { _parser.cliNoop ( ) ; } else { _parser.cliEnvironmentSet ( VdsmEnv.VDSM_MINIMUM_VERSION , minimal ) ; } return null ; }

Target:
public java.lang.Boolean call ( ) throws java.lang.Exception { java.lang.String minimal = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.BootstrapMinimalVdsmVersion ) ; if ( ( minimal.trim ( ) . length ( ) ) == 0 ) { _parser.cliNoop ( ) ; } else { _parser.cliEnvironmentSet ( VdsmEnv.VDSM_MINIMUM_VERSION , minimal ) ; } return true ; }
Source:
private java.lang.Object getSessionsVDSReturnVal ( boolean ret , int count ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsRetValue.setSucceeded ( ret ) ; if ( ret ) { vdsRetValue.setReturnValue ( getSessions ( count , false ) ) ; } else { vdsRetValue.setReturnValue ( null ) ; } return vdsRetValue ; }

Target:
private java.lang.Object getSessionsVDSReturnVal ( int count ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsRetValue.setSucceeded ( true ) ; vdsRetValue.setReturnValue ( getSessions ( count , false ) ) ; return vdsRetValue ; }
Source:
protected void createVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = getDiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setActive ( true ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.mockito.Mockito.when ( osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.HashSet < > ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.DISK_HOTPLUGGABLE_INTERFACES ) ) ; mockVmDevice ( false ) ; }

Target:
protected void createVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = getDiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setActive ( true ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.mockito.Mockito.when ( osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.HashSet < > ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.DISK_HOTPLUGGABLE_INTERFACES ) ) ; }
Source:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource getQuotaClusterParameterMap ( org.ovirt.engine.core.compat.Guid quotaId , org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource clusterQuotaParameterMap = createQuotaIdParameterMapper ( quotaCluster.getQuotaClusterId ( ) ) . addValue ( "quota_id" , quotaId ) . addValue ( "cluster_id" , quotaCluster.getClusterId ( ) ) . addValue ( "storage_id" , null ) . addValue ( "storage_size_gb" , null ) . addValue ( "virtual_cpu" , quotaCluster.getVirtualCpu ( ) ) . addValue ( "mem_size_mb" , quotaCluster.getMemSizeMB ( ) ) ; return clusterQuotaParameterMap ; }

Target:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource getQuotaClusterParameterMap ( org.ovirt.engine.core.compat.Guid quotaId , org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster ) { return createQuotaIdParameterMapper ( quotaCluster.getQuotaClusterId ( ) ) . addValue ( "quota_id" , quotaId ) . addValue ( "cluster_id" , quotaCluster.getClusterId ( ) ) . addValue ( "storage_id" , null ) . addValue ( "storage_size_gb" , null ) . addValue ( "virtual_cpu" , quotaCluster.getVirtualCpu ( ) ) . addValue ( "mem_size_mb" , quotaCluster.getMemSizeMB ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( model.getCluster ( ) . getOptimizationCustom_IsSelected ( ) . getEntity ( ) ) ) ) { optimizationCustomFormatter ( model ) ; optimizationCustomEditor.setVisible ( true ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( model.getCluster ( ) . getOptimizationCustom_IsSelected ( ) . getEntity ( ) ) { optimizationCustomFormatter ( model ) ; optimizationCustomEditor.setVisible ( true ) ; } }
Source:
public static org.ovirt.engine.core.bll.ValidationResult setAndValidateCpuProfile ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Version version ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.cpuQoS ( version ) ) ) return org.ovirt.engine.core.bll.ValidationResult.VALID ; if ( ( vmBase.getCpuProfileId ( ) ) == null ) { return org.ovirt.engine.core.bll.profiles.CpuProfileHelper.assignFirstCpuProfile ( vmBase ) ; } else { return new org.ovirt.engine.core.bll.profiles.CpuProfileValidator ( vmBase.getCpuProfileId ( ) ) . isParentEntityValid ( vmBase.getVdsGroupId ( ) ) ; } }

Target:
public static org.ovirt.engine.core.bll.ValidationResult setAndValidateCpuProfile ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Version version ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.cpuQoS ( version ) ) ) return org.ovirt.engine.core.bll.ValidationResult.VALID ; if ( ( vmBase.getCpuProfileId ( ) ) == null ) { return org.ovirt.engine.core.bll.profiles.CpuProfileHelper.assignFirstCpuProfile ( vmBase , null ) ; } else { return new org.ovirt.engine.core.bll.profiles.CpuProfileValidator ( vmBase.getCpuProfileId ( ) ) . isParentEntityValid ( vmBase.getVdsGroupId ( ) ) ; } }
Source:
public void externalVMWhenMissingInDb ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs data ) { initMocks ( data , false ) ; mockVmStatic ( false ) ; mockVmNotInDb ( data ) ; org.junit.Assume.assumeTrue ( ( ( data.dbVm ( ) ) == null ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) ) != null ) ) ; vmAnalyzer.analyze ( ) ; org.junit.Assert.assertTrue ( vmAnalyzer.isUnmanagedVm ( ) ) ; }

Target:
public void externalVMWhenMissingInDb ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs data ) { initMocks ( data , false ) ; org.junit.Assume.assumeTrue ( ( ( data.dbVm ( ) ) == null ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) ) != null ) ) ; vmAnalyzer.analyze ( ) ; org.junit.Assert.assertTrue ( vmAnalyzer.isUnmanagedVm ( ) ) ; }