auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap domainPoolMap = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( getRecoveryStoragePoolParametersData ( ) . getNewMasterDomainId ( ) , getRecoveryStoragePoolParametersData ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . save ( domainPoolMap ) ; getStoragePool ( ) . setstatus ( StoragePoolStatus.Problematic ) ; executeReconstruct ( ) ; return new org.ovirt.engine.core.common.eventqueue.EventResult ( reconstructOpSucceeded , org.ovirt.engine.core.common.eventqueue.EventType.RECONSTRUCT ) ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap domainPoolMap = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( getParameters ( ) . getNewMasterDomainId ( ) , getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . save ( domainPoolMap ) ; getStoragePool ( ) . setstatus ( StoragePoolStatus.Problematic ) ; executeReconstruct ( ) ; return new org.ovirt.engine.core.common.eventqueue.EventResult ( reconstructOpSucceeded , org.ovirt.engine.core.common.eventqueue.EventType.RECONSTRUCT ) ; }
Source:
public int compare ( org.ovirt.engine.core.bll.CommandBase < ? > o1 , org.ovirt.engine.core.bll.CommandBase < ? > o2 ) { org.ovirt.engine.core.common.businessentities.VM vm1 = vms.get ( o1.getVmId ( ) ) ; org.ovirt.engine.core.common.businessentities.VM vm2 = vms.get ( o2.getVmId ( ) ) ; return vmComparator.Compare ( vm1 , vm2 ) ; }

Target:
public int compare ( org.ovirt.engine.core.bll.CommandBase < ? > o1 , org.ovirt.engine.core.bll.CommandBase < ? > o2 ) { org.ovirt.engine.core.common.businessentities.VM vm1 = vms.get ( o1.getVmId ( ) ) ; org.ovirt.engine.core.common.businessentities.VM vm2 = vms.get ( o2.getVmId ( ) ) ; return vmComparator.compare ( vm1 , vm2 ) ; }
Source:
private void updateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getEntity ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.StorageDomainModel > selectedItems = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.StorageDomainModel > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.StorageDomainModel > ( ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( isRemoveCommandAvailable ( ) ) ; }

Target:
private void updateActionAvailability ( ) { getRemoveCommand ( ) . setIsExecutionAllowed ( isRemoveCommandAvailable ( ) ) ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { log.error ( "Failed adding a Cinder snapshot. snapshot ID: {}" , getDiskId ( ) ) ; super . onFailed ( cmdId , childCmdIds ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; onFinish ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; log.error ( "Failed adding a Cinder snapshot. snapshot ID: {}" , getDiskId ( ) ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; onFinish ( cmdId ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkDefaultMtuAndVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , 0 , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) , createQos ( ) ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkDefaultMtuAndVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , ( ! ( iface.isBridged ( ) ) ) , 0 , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) , createQos ( ) ) ; }
Source:
public void setMainSelectedItem ( org.ovirt.engine.core.common.businessentities.StoragePool selectedItem ) { super . setMainSelectedItem ( selectedItem ) ; cpuModelProvider.activateDetailModel ( ) ; vmNetworkModelProvider.activateDetailModel ( ) ; hostNetworkModelProvider.activateDetailModel ( ) ; getModelProvider ( ) . activateDetailModel ( ) ; }

Target:
public void setMainSelectedItem ( org.ovirt.engine.core.common.businessentities.StoragePool selectedItem ) { super . setMainSelectedItem ( selectedItem ) ; cpuModelProvider.getModel ( ) . setEntity ( selectedItem ) ; cpuModelProvider.activateDetailModel ( ) ; vmNetworkModelProvider.getModel ( ) . setEntity ( selectedItem ) ; vmNetworkModelProvider.activateDetailModel ( ) ; hostNetworkModelProvider.getModel ( ) . setEntity ( selectedItem ) ; hostNetworkModelProvider.activateDetailModel ( ) ; getModelProvider ( ) . activateDetailModel ( ) ; }
Source:
public void testExecuteQuery ( ) { java.lang.String vmName = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getVmName ( ) ) . thenReturn ( vmName ) ; boolean result = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) ; org.mockito.Mockito.doReturn ( result ) . when ( getQuery ( ) ) . isVmWithSameNameExistStatic ( ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( "Wrong result" , result , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testExecuteQuery ( ) { java.lang.String vmName = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getName ( ) ) . thenReturn ( vmName ) ; boolean result = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) ; org.mockito.Mockito.doReturn ( result ) . when ( getQuery ( ) ) . isVmWithSameNameExistStatic ( ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( "Wrong result" , result , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
protected boolean buildAndCheckDestStorageDomains ( ) { boolean retValue = true ; if ( diskInfoDestinationMap.isEmpty ( ) ) { retValue = fillDestMap ( ) ; } else { retValue = validateProvidedDestinations ( ) ; } if ( retValue && ( ( getImagesToCheckDestinationStorageDomains ( ) . size ( ) ) != ( diskInfoDestinationMap.size ( ) ) ) ) { log.error ( "Can not find any default active domain for one of the disks of template with id '{}'" , vmDisksSource.getId ( ) ) ; addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_MISSED_STORAGES_FOR_SOME_DISKS ) ; retValue = false ; } return retValue && ( validateIsImagesOnDomains ( ) ) ; }

Target:
protected boolean buildAndCheckDestStorageDomains ( ) { boolean retValue = true ; if ( diskInfoDestinationMap.isEmpty ( ) ) { retValue = fillDestMap ( ) ; } else { retValue = validateProvidedDestinations ( ) ; } if ( retValue && ( ( getImagesToCheckDestinationStorageDomains ( ) . size ( ) ) != ( diskInfoDestinationMap.size ( ) ) ) ) { log.error ( "Can not find any default active domain for one of the disks of template with id '{}'" , vmDisksSource.getId ( ) ) ; addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_MISSED_STORAGES_FOR_SOME_DISKS ) ; retValue = false ; } return retValue && ( validateIsImagesOnDomains ( ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension conn = org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionExtensionCommand.getParameters ( ) . getStorageServerConnectionExtension ( ) ; return ( validate ( org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionExtensionCommand.getConnectionExtensionValidator ( ) . isConnectionExtensionExists ( conn.getId ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionExtensionCommand.getConnectionExtensionValidator ( ) . isConnectionDoesNotExistForHostAndTarget ( conn ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension conn = org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionExtensionCommand.getParameters ( ) . getStorageServerConnectionExtension ( ) ; return ( validate ( org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionExtensionCommand.getConnectionExtensionValidator ( ) . isConnectionExtensionExists ( conn.getId ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionExtensionCommand.getConnectionExtensionValidator ( ) . isConnectionDoesNotExistForHostAndTarget ( conn ) ) ) ; }
Source:
public void testCompareTo ( ) { org.ovirt.engine.core.compat.NGuid guid1 = org.ovirt.engine.core.compat.NGuid.createGuidFromString ( "5b411bc1-c220-4421-9abd-cfa484aecb6e" ) ; org.ovirt.engine.core.compat.NGuid guid2 = org.ovirt.engine.core.compat.NGuid.createGuidFromString ( "5b411bc1-c220-4421-9abd-cfa484aecb6f" ) ; org.junit.Assert.assertTrue ( ( ( guid1.compareTo ( guid2 ) ) < 0 ) ) ; org.junit.Assert.assertTrue ( ( ( guid1.compareTo ( guid1 ) ) == 0 ) ) ; org.junit.Assert.assertTrue ( ( ( guid2.compareTo ( guid1 ) ) > 0 ) ) ; }

Target:
public void testCompareTo ( ) { org.ovirt.engine.core.compat.NGuid guid1 = new org.ovirt.engine.core.compat.NGuid ( "5b411bc1-c220-4421-9abd-cfa484aecb6e" ) ; org.ovirt.engine.core.compat.NGuid guid2 = new org.ovirt.engine.core.compat.NGuid ( "5b411bc1-c220-4421-9abd-cfa484aecb6f" ) ; org.junit.Assert.assertTrue ( ( ( guid1.compareTo ( guid2 ) ) < 0 ) ) ; org.junit.Assert.assertTrue ( ( ( guid1.compareTo ( guid1 ) ) == 0 ) ) ; org.junit.Assert.assertTrue ( ( ( guid2.compareTo ( guid1 ) ) > 0 ) ) ; }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
private void setupMock ( ) throws java.lang.Exception { mockEngineSSHClient = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.utils.EngineSSHClient.class ) ; org.mockito.Mockito.doNothing ( ) . when ( mockEngineSSHClient ) . connect ( ) ; org.mockito.Mockito.doNothing ( ) . when ( mockEngineSSHClient ) . authenticate ( ) ; org.mockito.Mockito.doReturn ( mockEngineSSHClient ) . when ( getQuery ( ) ) . getEngineSSHClient ( ) ; }

Target:
private void setupMock ( ) throws java.lang.Exception { mockEngineSSHClient = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.utils.EngineSSHClient.class ) ; org.mockito.Mockito.doReturn ( mockEngineSSHClient ) . when ( getQuery ( ) ) . getEngineSSHClient ( ) ; }
Source:
public void setUp ( ) { createStorageDomain ( ) ; parameters = new org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters ( storageDomain.getId ( ) , new java.util.ArrayList < > ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.domain.ExtendSANStorageDomainCommand ( parameters , null ) ) ; command.setStorageDomain ( storageDomain ) ; }

Target:
public void setUp ( ) { command.setStorageDomain ( storageDomain ) ; }
Source:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( true , false ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . getNetwork ( ) ) ; addPermissions ( ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) ) ; addPermissions ( ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }
Source:
public java.lang.String getNetworkNames ( ) { if ( ( org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getParameters ( ) . getNetworkAttachments ( ) . size ( ) ) == 0 ) { org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getParameters ( ) . setNetworkNames ( StringUtils.EMPTY ) ; } else if ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getParameters ( ) . getNetworkNames ( ) ) ) { updateModifiedNetworksNames ( ) ; } return org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getParameters ( ) . getNetworkNames ( ) ; }

Target:
public java.lang.String getNetworkNames ( ) { return org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getParameters ( ) . getNetworkNames ( ) ; }
Source:
private boolean validateInputs ( ) { java.util.Set < javax.validation.ConstraintViolation < P > > violations = org.ovirt.engine.core.bll.QueriesCommandBase.validator.validate ( getParameters ( ) ) ; if ( ! ( violations.isEmpty ( ) ) ) { returnValue.setExceptionString ( violations.toString ( ) ) ; return false ; } return true ; }

Target:
protected boolean validateInputs ( ) { java.util.Set < javax.validation.ConstraintViolation < P > > violations = org.ovirt.engine.core.bll.QueriesCommandBase.validator.validate ( getParameters ( ) ) ; if ( ! ( violations.isEmpty ( ) ) ) { returnValue.setExceptionString ( violations.toString ( ) ) ; return false ; } return true ; }
Source:
public void getVdsWithVdsId ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , v.getId ( ) ) ; }

Target:
public void getVdsWithVdsId ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; b.setVdsId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , v.getId ( ) ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForUpdate ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_UPDATED ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; setUpMocksForUpdate ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_UPDATED ) ; }
Source:
protected void prepareMocks ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.mockito.Mockito.when ( cmd.getCluster ( ) ) . thenReturn ( cluster ) ; org.mockito.Mockito.doReturn ( vds ) . when ( cmd ) . getVds ( ) ; org.mockito.Mockito.doReturn ( status ) . when ( vds ) . getStatus ( ) ; mockIsGlusterEnabled ( true ) ; org.mockito.Mockito.doReturn ( glusterUtil ) . when ( cmd ) . getGlusterUtil ( ) ; }

Target:
protected void prepareMocks ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.mockito.Mockito.when ( cmd.getCluster ( ) ) . thenReturn ( cluster ) ; org.mockito.Mockito.doReturn ( vds ) . when ( cmd ) . getVds ( ) ; org.mockito.Mockito.doReturn ( status ) . when ( vds ) . getStatus ( ) ; mockIsGlusterEnabled ( true ) ; }
Source:
private static void initOsIds ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds = new java.util.ArrayList < java.lang.Integer > ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.keySet ( ) ) ; java.util.Collections.sort ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds , new java.util.Comparator < java.lang.Integer > ( ) { @ java.lang.Override public int compare ( java.lang.Integer o1 , java.lang.Integer o2 ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o1 ) . compareTo ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o2 ) ) ; } } ) ; }

Target:
public int compare ( java.lang.Integer o1 , java.lang.Integer o2 ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o1 ) . compareTo ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o2 ) ) ; }
Source:
public void updateMaxNumOfVmCpus ( ) { java.lang.String version = getClusterCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxNumOfVmCpus ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.maxCpus = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.postUpdateNumOfSockets2 ( ) ; } } , getModel ( ) . getHash ( ) ) , version ) ; }

Target:
public void updateMaxNumOfVmCpus ( ) { java.lang.String version = getClusterCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfVmCpus ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.maxCpus = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.postUpdateNumOfSockets2 ( ) ; } } , getModel ( ) . getHash ( ) ) , version ) ; }
Source:
private void mockStorageDomainDAO ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains ) { org.mockito.Mockito.doReturn ( storageDomainDAO ) . when ( command ) . getStorageDomainDAO ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain : storageDomains ) { org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( storageDomain.getId ( ) , storagePoolId ) ) . thenReturn ( storageDomain ) ; } }

Target:
private void mockStorageDomainDAO ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { org.mockito.Mockito.doReturn ( storageDomainDAO ) . when ( command ) . getStorageDomainDAO ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( storageDomain.getId ( ) , storagePoolId ) ) . thenReturn ( storageDomain ) ; } }
Source:
public static void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void resetPeriodicPauseLogTime ( long ts ) { if ( ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getParameters ( ) . getLastPauseLogTime ( ) ) != ts ) { org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getParameters ( ) . setLastPauseLogTime ( ts ) ; persistCommand ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getParameters ( ) . getParentCommand ( ) , true ) ; } }

Target:
protected void resetPeriodicPauseLogTime ( long ts ) { if ( ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getParameters ( ) . getLastPauseLogTime ( ) ) != ts ) { org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getParameters ( ) . setLastPauseLogTime ( ts ) ; persistCommand ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getParameters ( ) . getParentCommand ( ) , true ) ; } }
Source:
protected void setUpFactory ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand ... commands ) { org.mockito.stubbing.OngoingStubbing stubbing = org.mockito.Mockito.when ( commandFactory.createWrappedCommand ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.bll.context.CommandContext.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.ActionType.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.ActionParametersBase.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) ; for ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand command : commands ) { stubbing = stubbing.thenReturn ( command ) ; } }

Target:
protected void setUpFactory ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand ... commands ) { org.mockito.stubbing.OngoingStubbing stubbing = org.mockito.Mockito.when ( commandFactory.createWrappedCommand ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) ; for ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand command : commands ) { stubbing = stubbing.thenReturn ( command ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage_pool dc ) { setEnumTitle ( dc.getstatus ( ) ) ; switch ( dc.getstatus ( ) ) { case Contend : return getApplicationResources ( ) . waitImage ( ) ; case Maintenance : return getApplicationResources ( ) . maintenanceImage ( ) ; case NotOperational : case Problematic : case Uninitialized : return getApplicationResources ( ) . downImage ( ) ; case Up : return getApplicationResources ( ) . upImage ( ) ; default : break ; } return null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StoragePool dc ) { setEnumTitle ( dc.getstatus ( ) ) ; switch ( dc.getstatus ( ) ) { case Contend : return getApplicationResources ( ) . waitImage ( ) ; case Maintenance : return getApplicationResources ( ) . maintenanceImage ( ) ; case NotOperational : case Problematic : case Uninitialized : return getApplicationResources ( ) . downImage ( ) ; case Up : return getApplicationResources ( ) . upImage ( ) ; default : break ; } return null ; }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.DbUser > getUsers ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.DbUser > users = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; user.setId ( GUIDS [ i ] ) ; user.setFirstName ( NAMES [ i ] ) ; user.setLoginName ( NAMES [ i ] ) ; users.add ( user ) ; } return users ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.DbUser > getUsers ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.DbUser > users = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; user.setId ( GUIDS [ i ] ) ; user.setLoginName ( NAMES [ i ] ) ; users.add ( user ) ; } return users ; }
Source:
public void testAllocateVm ( ) throws java.lang.Exception { setUpGetVmExpectations ( 1 ) ; setUpGetUserExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AttachUserToVmFromPoolAndRun , org.ovirt.engine.core.common.action.VmPoolUserParameters.class , new java.lang.String [ ] { "VmPoolId" , "IsInternal" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , GUIDS [ 0 ] ) ) ; verifyTestAllocateVmActionResponse ( resource.allocatevm ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testAllocateVm ( ) throws java.lang.Exception { setUpGetVmExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AttachUserToVmFromPoolAndRun , org.ovirt.engine.core.common.action.VmPoolUserParameters.class , new java.lang.String [ ] { "VmPoolId" , "IsInternal" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , GUIDS [ 0 ] ) ) ; verifyTestAllocateVmActionResponse ( resource.allocatevm ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; }
Source:
private void updateUserAuthFields ( ) { getUserName ( ) . setIsValid ( true ) ; getUserName ( ) . setIsChangable ( ( ( java.lang.Boolean ) ( getUseUserAuth ( ) . getEntity ( ) ) ) ) ; getPassword ( ) . setIsValid ( true ) ; getPassword ( ) . setIsChangable ( ( ( java.lang.Boolean ) ( getUseUserAuth ( ) . getEntity ( ) ) ) ) ; }

Target:
private void updateUserAuthFields ( ) { getUserName ( ) . setIsValid ( true ) ; getUserName ( ) . setIsChangable ( getUseUserAuth ( ) . getEntity ( ) ) ; getPassword ( ) . setIsValid ( true ) ; getPassword ( ) . setIsChangable ( getUseUserAuth ( ) . getEntity ( ) ) ; }
Source:
public void processOnVmStop ( final java.util.Collection < org.ovirt.engine.core.compat.Guid > vmIds ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.IdParameters ( vmId ) ) ; } } } ) ; }

Target:
public void processOnVmStop ( final java.util.Collection < org.ovirt.engine.core.compat.Guid > vmIds ) { if ( vmIds.isEmpty ( ) ) { return ; } org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.IdParameters ( vmId ) ) ; } } } ) ; }
Source:
public static org.ovirt.engine.core.authentication.Configuration loadFile ( java.io.File file ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; java.io.InputStream in = null ; try { in = new java.io.FileInputStream ( file ) ; properties.load ( in ) ; } finally { if ( in != null ) { in.close ( ) ; } } return new org.ovirt.engine.core.authentication.Configuration.Root ( properties ) ; }

Target:
public static org.ovirt.engine.core.authentication.Configuration loadFile ( java.io.File file ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; java.io.InputStream in = null ; try { in = new java.io.FileInputStream ( file ) ; properties.load ( in ) ; } finally { if ( in != null ) { in.close ( ) ; } } return new org.ovirt.engine.core.authentication.Configuration.Root ( file , properties ) ; }
Source:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.Cluster selectedItem ) { driver.edit ( getDetailModel ( ) ) ; form.update ( ) ; glusterSwiftPanel.setVisible ( ( ( selectedItem.supportsGlusterService ( ) ) && ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterFeaturesUtil.isGlusterSwiftSupported ( selectedItem.getCompatibilityVersion ( ) ) ) ) ) ; }

Target:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.Cluster selectedItem ) { driver.edit ( getDetailModel ( ) ) ; form.update ( ) ; glusterSwiftPanel.setVisible ( false ) ; }
Source:
public void formatValue ( java.lang.String fieldName , org.ovirt.engine.core.compat.RefObject < java.lang.String > relations , org.ovirt.engine.core.compat.RefObject < java.lang.String > value , boolean caseSensitive ) { if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "CREATIONDATE" ) ) { java.util.Date tmp = new java.util.Date ( java.util.Date.parse ( org.ovirt.engine.core.compat.StringHelper.trim ( value.argvalue , '\'' ) ) ) ; value.argvalue = org.ovirt.engine.core.compat.StringFormat.format ( "'%1$s'" , tmp ) ; } else { super . formatValue ( fieldName , relations , value , caseSensitive ) ; } }

Target:
public void formatValue ( java.lang.String fieldName , org.ovirt.engine.core.compat.RefObject < java.lang.String > relations , org.ovirt.engine.core.compat.RefObject < java.lang.String > value , boolean caseSensitive ) { if ( "CREATIONDATE" . equals ( fieldName ) ) { java.util.Date tmp = new java.util.Date ( java.util.Date.parse ( org.ovirt.engine.core.compat.StringHelper.trim ( value.argvalue , '\'' ) ) ) ; value.argvalue = org.ovirt.engine.core.compat.StringFormat.format ( "'%1$s'" , tmp ) ; } else { super . formatValue ( fieldName , relations , value , caseSensitive ) ; } }
Source:
public void setup ( ) { command.setCluster ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( clusterId ) ; org.mockito.Mockito.doReturn ( vmStatic ) . when ( vmStaticDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void setup ( ) { command.setCluster ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( clusterId ) ; org.mockito.Mockito.doReturn ( vmStatic ) . when ( vmStaticDao ) . get ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public org.ovirt.engine.core.utils.ovf.xml.XmlNode selectSingleNode ( java.lang.String string , org.ovirt.engine.core.utils.ovf.xml.XmlNamespaceManager _xmlns ) { try { javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance ( ) ; javax.xml.xpath.XPath xPath = factory.newXPath ( ) ; xPath.setNamespaceContext ( _xmlns ) ; java.lang.Object o = xPath.evaluate ( string , doc , javax.xml.xpath.XPathConstants.NODE ) ; return new org.ovirt.engine.core.utils.ovf.xml.XmlNode ( ( ( org.w3c.dom.Node ) ( o ) ) ) ; } catch ( javax.xml.xpath.XPathExpressionException e ) { throw new java.lang.RuntimeException ( ( "Failed to evaluate xpath: " + string ) , e ) ; } }

Target:
public org.ovirt.engine.core.utils.ovf.xml.XmlNode selectSingleNode ( java.lang.String string , org.ovirt.engine.core.utils.ovf.xml.XmlNamespaceManager _xmlns ) { try { javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance ( ) ; javax.xml.xpath.XPath xPath = factory.newXPath ( ) ; xPath.setNamespaceContext ( _xmlns ) ; java.lang.Object o = xPath.evaluate ( string , doc , javax.xml.xpath.XPathConstants.NODE ) ; return o != null ? new org.ovirt.engine.core.utils.ovf.xml.XmlNode ( ( ( org.w3c.dom.Node ) ( o ) ) ) : null ; } catch ( javax.xml.xpath.XPathExpressionException e ) { throw new java.lang.RuntimeException ( ( "Failed to evaluate xpath: " + string ) , e ) ; } }
Source:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public boolean isWanOptionsAvailable ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel model ) { boolean spiceAvailable = ( ( model.getDefaultConsoleModel ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) && ( isSpiceAvailable ( ) ) ; boolean isWindowsVm = model.getVM ( ) . getOs ( ) . isWindows ( ) ; boolean spiceGuestAgentInstalled = ( model.getVM ( ) . getSpiceDriverVersion ( ) ) != null ; return ( spiceAvailable && isWindowsVm ) && spiceGuestAgentInstalled ; }

Target:
public boolean isWanOptionsAvailable ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel model ) { boolean spiceAvailable = ( model.getDefaultConsoleModel ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ; boolean isWindowsVm = model.getVM ( ) . getOs ( ) . isWindows ( ) ; boolean spiceGuestAgentInstalled = ( model.getVM ( ) . getSpiceDriverVersion ( ) ) != null ; return ( spiceAvailable && isWindowsVm ) && spiceGuestAgentInstalled ; }
Source:
private boolean shouldUseCallback ( ) { org.ovirt.engine.core.common.businessentities.CommandEntity commandEntity = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCommandId ( ) ) ; return ( ( commandEntity != null ) && ( commandEntity.isCallbackEnabled ( ) ) ) || ( ( shouldPerformOvfUpdate ( ) ) && ( ovfOnAnyDomainSupported ( ) ) ) ; }

Target:
private boolean shouldUseCallback ( ) { org.ovirt.engine.core.common.businessentities.CommandEntity commandEntity = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCommandId ( ) ) ; return ( ( commandEntity != null ) && ( commandEntity.isCallbackEnabled ( ) ) ) || ( shouldPerformOvfUpdate ( ) ) ; }
Source:
protected boolean validate ( ) { getInbound ( ) . validate ( ) ; getOutbound ( ) . validate ( ) ; setIsValid ( ( ( getInbound ( ) . getIsValid ( ) ) && ( getOutbound ( ) . getIsValid ( ) ) ) ) ; return getIsValid ( ) ; }

Target:
public boolean validate ( ) { getInbound ( ) . validate ( ) ; getOutbound ( ) . validate ( ) ; setIsValid ( ( ( getInbound ( ) . getIsValid ( ) ) && ( getOutbound ( ) . getIsValid ( ) ) ) ) ; return getIsValid ( ) ; }
Source:
public void updateCpuSharesAmountChangeability ( ) { boolean changeable = ( getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) ) == ( UnitVmModel.CpuSharesAmount.CUSTOM ) ; boolean none = ( getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) ) == ( UnitVmModel.CpuSharesAmount.DISABLED ) ; getModel ( ) . getCpuSharesAmount ( ) . setEntity ( ( changeable || none ? null : getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) . getValue ( ) ) ) ; }

Target:
public void updateCpuSharesAmountChangeability ( ) { boolean changeable = ( getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) ) == ( UnitVmModel.CpuSharesAmount.CUSTOM ) ; boolean none = ( getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) ) == ( UnitVmModel.CpuSharesAmount.DISABLED ) ; getModel ( ) . getCpuSharesAmount ( ) . setEntity ( ( changeable || none ? null : getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) . getValue ( ) ) ) ; getModel ( ) . getCpuSharesAmount ( ) . setIsChangable ( changeable ) ; }
Source:
private void mockDiskDaoGetAllForVm ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks , boolean onlyPluggedDisks ) { org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.doReturn ( disks ) . when ( diskDao ) . getAllForVm ( vm.getId ( ) , onlyPluggedDisks ) ; }

Target:
private void mockDiskDaoGetAllForVm ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks , boolean onlyPluggedDisks ) { org.mockito.Mockito.doReturn ( disks ) . when ( diskDao ) . getAllForVm ( vm.getId ( ) , onlyPluggedDisks ) ; }
Source:
private void bindFrontendInfrastructure ( ) { bind ( org.ovirt.engine.ui.frontend.Frontend.class ) . in ( com.google.inject.Singleton.class ) ; requestStaticInjection ( Frontend.InstanceHolder.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.VdcOperationManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.OperationProcessor.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.CommunicationProvider.class ) . to ( org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
private void bindFrontendInfrastructure ( ) { bind ( org.ovirt.engine.ui.frontend.Frontend.class ) . in ( com.google.inject.Singleton.class ) ; requestStaticInjection ( Frontend.InstanceHolder.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.VdcOperationManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.OperationProcessor.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.CommunicationProvider.class ) . to ( org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
private void updateHasSelectedTags ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > selectedTags = ( ( getTagList ( ) . getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > cast ( getTagList ( ) . getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > ( ) ; setHasSelectedTags ( ( ( ( getSelectedItem ( ) ) != null ) && ( ( selectedTags.size ( ) ) > 0 ) ) ) ; }

Target:
private void updateHasSelectedTags ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > selectedTags = ( ( getTagList ( ) . getSelectedItems ( ) ) != null ) ? getTagList ( ) . getSelectedItems ( ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > ( ) ; setHasSelectedTags ( ( ( ( getSelectedItem ( ) ) != null ) && ( ( selectedTags.size ( ) ) > 0 ) ) ) ; }
Source:
private void doDataCenterSearch ( ) { final org.ovirt.engine.ui.frontend.AsyncQuery dcQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; dcQuery.setModel ( this ) ; dcQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { final org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel systemTreeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel ) ( model ) ) ; systemTreeModel.setDataCenters ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( result ) ) ) ; doNetworksSearch ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterList ( dcQuery ) ; }

Target:
private void doDataCenterSearch ( ) { final org.ovirt.engine.ui.frontend.AsyncQuery dcQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; dcQuery.setModel ( this ) ; dcQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { final org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel systemTreeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel ) ( model ) ) ; systemTreeModel.setDataCenters ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( result ) ) ) ; doNetworksSearch ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterList ( dcQuery , false ) ; }