auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean canScheduleVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.compat.Guid > blacklist = new java.util.ArrayList < > ( ) ; if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) != null ) { blacklist.add ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) ; } return schedulingManager.canSchedule ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsGroup ( ) , vm , blacklist , java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptyList ( ) , vm.getDedicatedVmForVdsList ( ) , new java.util.ArrayList < > ( ) ) ; }

Target:
private boolean canScheduleVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.compat.Guid > blacklist = new java.util.ArrayList < > ( ) ; if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) != null ) { blacklist.add ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) ; } return schedulingManager.canSchedule ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getCluster ( ) , vm , blacklist , java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptyList ( ) , vm.getDedicatedVmForVdsList ( ) , new java.util.ArrayList < > ( ) ) ; }
Source:
protected < T extends org.ovirt.engine.core.dao.DAO > T getDao ( java.lang.Class < T > daoType ) { T dao = org.ovirt.engine.core.dao.DaoFactory.get ( daoType ) ; if ( dao instanceof org.ovirt.engine.core.dao.BaseDAODbFacade ) { org.ovirt.engine.core.dao.BaseDAODbFacade dbFacadeDAO = ( ( org.ovirt.engine.core.dao.BaseDAODbFacade ) ( dao ) ) ; dbFacadeDAO.setTemplate ( jdbcTemplate ) ; dbFacadeDAO.setDialect ( dbEngineDialect ) ; dbFacadeDAO.setDbFacade ( this ) ; } return dao ; }

Target:
private void init ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.log.info ( "Initializing the DbFacade" ) ; dbFacadeLocator.configure ( this ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.instance = this ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }

Target:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.ValidationResult slavesValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE_ENTITY , "slaveA" ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_NAME , "networkName" ) ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , slavesValidationResult , slavesValidationResult ) ; }
Source:
public static java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getIsoStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ( ) ; models.add ( localIsoModel ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : models ) { model.setRole ( StorageDomainType.ISO ) ; } return models ; }

Target:
public java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getIsoStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ( ) ; models.add ( localIsoModel ) ; addTypeToStorageModels ( StorageDomainType.ISO , models ) ; return models ; }
Source:
public void testNoStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( "AppErrors" ) ; java.util.List < java.lang.String > error = et.TranslateErrorText ( java.util.Arrays.asList ( "DB_NO_SUCH_VM" ) ) ; assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; assertEquals ( "String should equal" , "VM not found" , error.get ( 0 ) ) ; }

Target:
public void testNoStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( "AppErrors" ) ; java.util.List < java.lang.String > error = et.TranslateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) ) ; assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; assertEquals ( "String should equal" , "VM not found" , error.get ( 0 ) ) ; }
Source:
private void removeAllNetworksByVfsConfigId ( org.ovirt.engine.core.compat.Guid vfsConfigId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = createVfsConfigIdParameter ( vfsConfigId ) ; getCallsHandler ( ) . executeModification ( "DeleteAllvfsConfigNetworks" , parameterSource ) ; }

Target:
private void massNetworksUpdate ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.util.Set < org.ovirt.engine.core.compat.Guid > networks ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList ( networks.size ( ) ) ; for ( org.ovirt.engine.core.compat.Guid networkId : networks ) { executions.add ( createNetworkParametersMapper ( vfsConfigId , networkId ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "InsertVfsConfigNetwork" , executions ) ; }
Source:
public void replaceBrick ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity oldBrick , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newBrick ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterVolumeBrick" , getCustomMapSqlParameterSource ( ) . addValue ( "id" , oldBrick.getId ( ) ) . addValue ( "new_id" , newBrick.getId ( ) ) . addValue ( "new_server_id" , newBrick.getServerId ( ) ) . addValue ( "new_status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( newBrick.getStatus ( ) ) ) ) ; }

Target:
public void replaceBrick ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity oldBrick , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newBrick ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterVolumeBrick" , getCustomMapSqlParameterSource ( ) . addValue ( "id" , oldBrick.getId ( ) ) . addValue ( "new_id" , newBrick.getId ( ) ) . addValue ( "new_server_id" , newBrick.getServerId ( ) ) . addValue ( "new_brick_dir" , newBrick.getBrickDirectory ( ) ) . addValue ( "new_status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( newBrick.getStatus ( ) ) ) ) ; }
Source:
public void isValidVmNetworkForValidNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNewNetwork ( true , NETWORK_NAME ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = createNewInterface ( ) ; iface.setNetworkName ( network.getName ( ) ) ; org.junit.Assert.assertTrue ( vmInterfaceManager.isValidVmNetwork ( iface , java.util.Collections.singletonMap ( network.getName ( ) , network ) ) ) ; }

Target:
public void isValidVmNetworkForValidNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNewNetwork ( true , NETWORK_NAME ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = createNewViewableInterface ( ) ; iface.setNetworkName ( network.getName ( ) ) ; org.junit.Assert.assertTrue ( vmInterfaceManager.isValidVmNetwork ( iface , java.util.Collections.singletonMap ( network.getName ( ) , network ) , version ) ) ; }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public void writeData ( java.io.ObjectOutputStream dos ) { try { dos.writeInt ( this . history_id ) ; writeDate ( this . history_datetime , dos ) ; dos.writeObject ( this . datacenter_id ) ; dos.writeShort ( this . datacenter_status ) ; dos.writeDouble ( this . minutes_in_status ) ; dos.writeInt ( this . datacenter_configuration_version ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void writeData ( java.io.ObjectOutputStream dos ) { try { dos.writeLong ( this . history_id ) ; writeDate ( this . history_datetime , dos ) ; dos.writeObject ( this . datacenter_id ) ; dos.writeShort ( this . datacenter_status ) ; dos.writeDouble ( this . minutes_in_status ) ; dos.writeInt ( this . datacenter_configuration_version ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public void checkEmptyIdHost ( ) { 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 ) ; parameters.setVdsId ( Guid.Empty ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VDS_EMPTY_NAME_OR_ID ) ; }

Target:
public void checkEmptyIdHost ( ) { 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 ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > findAllInterfaceNetworkNameNotEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.VmTemplate t1 , org.ovirt.engine.core.common.businessentities.VmTemplate t2 ) { return org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator.comp ( t1.getName ( ) , t2.getName ( ) ) ; }
Source:
public void testUpdate ( ) { setUpGetEntityExpectations ( 2 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , true , true ) ) ; org.ovirt.engine.api.model.Nic nic = resource.update ( getNic ( false ) ) ; org.junit.Assert.assertNotNull ( nic ) ; }

Target:
public void testUpdate ( ) { setUpGetEntityExpectations ( 2 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , true , true ) ) ; org.ovirt.engine.api.model.Nic nic = resource.update ( getNic ( false ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( nic ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; return disk.isBoot ( ) ? resources.bootableDiskIcon ( ) : null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isShareable ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.shareable ( ) ) ; } return null ; }
Source:
private void mockVMDao ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.mockito.Mockito.when ( vmDao.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( vmDao.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }
Source:
public void subnetChanged ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicOnNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.StaticIp ) ; nic.setSubnet ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; mockExistingIfaces ( nic ) ; nic.setSubnet ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }

Target:
public void subnetChanged ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.StaticIp ) ; nic.setSubnet ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; mockExistingIfaces ( nic ) ; nic.setSubnet ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult assignFirstCpuProfile ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Guid userId ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > cpuProfileWithPermissions = cpuProfileDao.getAllForCluster ( vmBase.getClusterId ( ) , userId , ( userId != null ) , ActionGroup.ASSIGN_CPU_PROFILE ) ; if ( cpuProfileWithPermissions.isEmpty ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_CPU_PROFILE_EMPTY ) ; } vmBase.setCpuProfileId ( cpuProfileWithPermissions.get ( 0 ) . getId ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult assignFirstCpuProfile ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Guid userId ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > cpuProfileWithPermissions = cpuProfileDao.getAllForCluster ( vmBase.getClusterId ( ) , userId , ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( userId ) ) ) , ActionGroup.ASSIGN_CPU_PROFILE ) ; if ( cpuProfileWithPermissions.isEmpty ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_CPU_PROFILE_EMPTY ) ; } vmBase.setCpuProfileId ( cpuProfileWithPermissions.get ( 0 ) . getId ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters ( ) ; final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.AttachNetworkToClusterInternal , attachNetworkToClusterParameter ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { attachLabeledNetwork ( ) ; } else { propagateFailure ( returnValue ) ; } }

Target:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters ( ) ; final org.ovirt.engine.core.common.action.ActionReturnValue returnValue = runInternalAction ( ActionType.AttachNetworkToClusterInternal , attachNetworkToClusterParameter ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { attachLabeledNetwork ( ) ; } else { propagateFailure ( returnValue ) ; } }
Source:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getAuthzGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAuthzGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public java.lang.String call ( ) { com.woorea.openstack.cinder.model.VolumeForCreate cinderVolume = new com.woorea.openstack.cinder.model.VolumeForCreate ( ) ; cinderVolume.setName ( cinderDisk.getDiskAlias ( ) ) ; cinderVolume.setDescription ( cinderDisk.getDiskDescription ( ) ) ; cinderVolume.setSize ( ( ( int ) ( cinderDisk.getSizeInGigabytes ( ) ) ) ) ; cinderVolume.setSourceVolid ( cinderDisk.getImageId ( ) . toString ( ) ) ; return proxy.createVolume ( cinderVolume ) ; }

Target:
public java.lang.String cloneDisk ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( ( ) -> { com.woorea.openstack.cinder.model.VolumeForCreate cinderVolume = new com.woorea.openstack.cinder.model.VolumeForCreate ( ) ; cinderVolume.setName ( cinderDisk.getDiskAlias ( ) ) ; cinderVolume.setDescription ( cinderDisk.getDiskDescription ( ) ) ; cinderVolume.setSize ( ( ( int ) ( cinderDisk.getSizeInGigabytes ( ) ) ) ) ; cinderVolume.setSourceVolid ( cinderDisk.getImageId ( ) . toString ( ) ) ; return proxy.createVolume ( cinderVolume ) ; } ) ; }
Source:
public static java.util.ResourceBundle.Control getBrandingControl ( ) { return new java.util.ResourceBundle.Control ( ) { @ java.lang.Override public java.util.ResourceBundle newBundle ( final java.lang.String baseName , final java.util.Locale locale , final java.lang.String format , final java.lang.ClassLoader loader , final boolean reload ) throws java.io.IOException , java.lang.IllegalAccessException , java.lang.InstantiationException { return new org.ovirt.engine.core.utils.branding.BrandingWelcomeResourceBundle ( ) ; } } ; }

Target:
public static java.util.ResourceBundle.Control getBrandingControl ( final java.lang.String brandingGroupKey ) { return new java.util.ResourceBundle.Control ( ) { @ java.lang.Override public java.util.ResourceBundle newBundle ( final java.lang.String baseName , final java.util.Locale locale , final java.lang.String format , final java.lang.ClassLoader loader , final boolean reload ) throws java.io.IOException , java.lang.IllegalAccessException , java.lang.InstantiationException { return new org.ovirt.engine.core.utils.branding.BrandingResourceBundle ( brandingGroupKey ) ; } } ; }
Source:
private java.lang.String getItemTitle ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) ; if ( networkModel.hasVlan ( ) ) { return ( ( ( networkModel.getName ( ) ) + " (vlan " ) + ( networkModel.getVlanId ( ) ) ) + ")" ; } return item.getName ( ) ; }

Target:
private java.lang.String getItemTitle ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) ; if ( networkModel.hasVlan ( ) ) { return messages.vlanNetwork ( networkModel.getName ( ) , java.lang.String.valueOf ( networkModel.getVlanId ( ) ) ) ; } return item.getName ( ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.queries.VdcQueryType > createQueryList ( final org.ovirt.engine.core.common.queries.VdcQueryType queryType , final int count ) { java.util.List < org.ovirt.engine.core.common.queries.VdcQueryType > result = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { result.add ( queryType ) ; } return result ; }

Target:
private java.util.List < org.ovirt.engine.core.common.queries.QueryType > createQueryList ( final org.ovirt.engine.core.common.queries.QueryType queryType , final int count ) { java.util.List < org.ovirt.engine.core.common.queries.QueryType > result = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { result.add ( queryType ) ; } return result ; }
Source:
public boolean evaluate ( java.lang.Object disk ) { return ( ( ( org.ovirt.engine.core.common.businessentities.storage.Disk ) ( disk ) ) . getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult canDisableVirtioScsi ( java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks ) { if ( vmDisks == null ) { vmDisks = getDiskDao ( ) . getAllForVm ( vms.iterator ( ) . next ( ) . getId ( ) , true ) ; } boolean isVirtioScsiDiskExist = vmDisks.stream ( ) . anyMatch ( ( d ) -> ( d.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ) ; if ( isVirtioScsiDiskExist ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void initializeStorageDomain ( ) { org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; if ( ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . getWipeAfterDelete ( ) ) == null ) { org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . setWipeAfterDelete ( org.ovirt.engine.core.bll.utils.WipeAfterDeleteUtils.getDefaultWipeAfterDeleteFlag ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . getStorageType ( ) ) ) ; } }

Target:
protected void initializeStorageDomain ( ) { org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; updateStorageDomainWipeAfterDelete ( ) ; }
Source:
protected void addStoragePoolToDb ( ) { org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . setStatus ( StoragePoolStatus.Uninitialized ) ; org.ovirt.engine.core.compat.Guid requestedMacPoolId = org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . getMacPoolId ( ) ; org.ovirt.engine.core.compat.Guid macPoolIdToUse = ( requestedMacPoolId == null ) ? org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getMacPoolDao ( ) . getDefaultPool ( ) . getId ( ) : requestedMacPoolId ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . setMacPoolId ( macPoolIdToUse ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePoolDAO ( ) . save ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) ) ; }

Target:
protected void addStoragePoolToDb ( ) { org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . setStatus ( StoragePoolStatus.Uninitialized ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . setMacPoolId ( calculateMacPoolIdToUse ( ) ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePoolDAO ( ) . save ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) ) ; }
Source:
protected void setGetVmQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , vm ) ; } }

Target:
protected void setGetVmQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , vm ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendInstanceTypeWatchdogResourceTest.INSTANCE_TYPE_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendInstanceTypeWatchdogResourceTest.INSTANCE_TYPE_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void testUnsubscribe ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > before = dao.getAllForSubscriber ( existingSubscriber ) ; assertFalse ( before.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.event_subscriber subscriber : before ) { dao.unsubscribe ( subscriber ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > after = dao.getAllForSubscriber ( existingSubscriber ) ; assertNotNull ( after ) ; assertTrue ( after.isEmpty ( ) ) ; }

Target:
public void testUnsubscribe ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > before = dao.getAllForSubscriber ( existingSubscriber ) ; org.junit.Assert.assertFalse ( before.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.event_subscriber subscriber : before ) { dao.unsubscribe ( subscriber ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > after = dao.getAllForSubscriber ( existingSubscriber ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertTrue ( after.isEmpty ( ) ) ; }
Source:
public void testGeneralTimeZones ( ) { java.util.Map < java.lang.String , java.lang.String > map = org.ovirt.engine.core.common.TimeZoneTypeTest.general.getTimeZoneList ( ) ; org.junit.Assert.assertNotNull ( map ) ; org.junit.Assert.assertNull ( map.get ( "Asia/Riyadh78" ) ) ; org.junit.Assert.assertEquals ( "(GMT+02:00) Israel Standard Time" , map.get ( "Asia/Jerusalem" ) ) ; }

Target:
public void testGeneralTimeZones ( ) { java.util.Map < java.lang.String , java.lang.String > map = org.ovirt.engine.core.common.TimeZoneTypeTest.general.getTimeZoneList ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( map ) ; org.junit.jupiter.api.Assertions.assertNull ( map.get ( "Asia/Riyadh78" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "(GMT+02:00) Israel Standard Time" , map.get ( "Asia/Jerusalem" ) ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getSharedLocks ( ) { if ( ( ( org.ovirt.engine.core.bll.ImageSpmCommand.getStoragePool ( ) ) != null ) && ( ( getPoolSpmId ( ) ) != null ) ) { return java.util.Collections.singletonMap ( getPoolSpmId ( ) . toString ( ) , new org.ovirt.engine.core.common.utils.Pair ( LockingGroup.VDS_EXECUTION.toString ( ) , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED.toString ( ) ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getSharedLocks ( ) { if ( ( ( org.ovirt.engine.core.bll.ImageSpmCommand.getStoragePool ( ) ) != null ) && ( ( getPoolSpmId ( ) ) != null ) ) { return java.util.Collections.singletonMap ( getPoolSpmId ( ) . toString ( ) , new org.ovirt.engine.core.common.utils.Pair ( LockingGroup.VDS_EXECUTION.toString ( ) , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED.toString ( ) ) ) ; } return null ; }
Source:
private void executeActionInTransactionScope ( ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.registerRollbackHandler ( this ) ; } if ( ! ( executeWithoutTransaction ( ) ) ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) == null ) { cancelTasks ( ) ; } org.ovirt.engine.core.utils.transaction.TransactionSupport.setRollbackOnly ( ) ; } }

Target:
private void executeActionInTransactionScope ( ) { registerRollbackHandler ( new DefaultCommandTransactionCompletionListener ( ) ) ; if ( ! ( executeWithoutTransaction ( ) ) ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) == null ) { cancelTasks ( ) ; } org.ovirt.engine.core.utils.transaction.TransactionSupport.setRollbackOnly ( ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.equals ( HostGeneralModel.RequestEditEventDefinition ) ) { getEditWithPMemphasisCommand ( ) . Execute ( ) ; } if ( ev.equals ( HostGeneralModel.RequestGOToEventsTabEventDefinition ) ) { GoToEventsTab ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( HostGeneralModel.RequestEditEventDefinition ) ) { getEditWithPMemphasisCommand ( ) . Execute ( ) ; } if ( ev.matchesDefinition ( HostGeneralModel.RequestGOToEventsTabEventDefinition ) ) { GoToEventsTab ( ) ; } }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView network : importModel.getNetworkProfiles ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : importModel.getNetworks ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }
Source:
protected boolean canDoAction ( ) { Q validator = getProfileValidator ( ) ; return ( ( validate ( validator.profileIsSet ( ) ) ) && ( validate ( validator.profileExists ( ) ) ) ) && ( validate ( validator.isLastProfileInParentEntity ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { Q validator = getProfileValidator ( ) ; return ( ( ( validate ( validator.profileIsSet ( ) ) ) && ( validate ( validator.profileExists ( ) ) ) ) && ( validate ( validator.isLastProfileInParentEntity ( ) ) ) ) && ( validate ( validator.profileNotUsed ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runAction ( org.ovirt.engine.core.bll.CommandBase < ? > command , boolean runAsInternal ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = evaluateCorrelationId ( command ) ; if ( returnValue != null ) { return returnValue ; } command.setInternalExecution ( runAsInternal ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , runAsInternal ) ; returnValue = actionExecutor.get ( ) . execute ( command ) ; returnValue.setCorrelationId ( command.getParameters ( ) . getCorrelationId ( ) ) ; returnValue.setJobId ( command.getJobId ( ) ) ; return returnValue ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runAction ( org.ovirt.engine.core.bll.CommandBase < ? > command , boolean runAsInternal ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = evaluateCorrelationId ( command ) ; if ( returnValue != null ) { return returnValue ; } command.setInternalExecution ( runAsInternal ) ; executionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , runAsInternal ) ; returnValue = actionExecutor.get ( ) . execute ( command ) ; returnValue.setCorrelationId ( command.getParameters ( ) . getCorrelationId ( ) ) ; returnValue.setJobId ( command.getJobId ( ) ) ; return returnValue ; }
Source:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getSucceeded ( ) ) && ( ! ( vmDisksToAttach.isEmpty ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , attemptToAttachDisksToImportedVm ( vmDisksToAttach ) ) ; } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getId ( ) ) ; }

Target:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.VM_IMPORT_FROM_CONFIGURATION_EXECUTED_SUCCESSFULLY ) ; } else if ( ! ( vmDisksToAttach.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , attemptToAttachDisksToImportedVm ( vmDisksToAttach ) ) ; } } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getId ( ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getImages ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getImages ( ) , failure ) ; }
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 ( ) { 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 ( ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.isUserCanBeAuthenticated ( ) ; if ( autheticated ) { autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.getCurrentUser ( ) . isAdmin ( ) ; if ( ! autheticated ) { addCanDoActionMessage ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } else { autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.attachUserToSession ( ) ; } } return autheticated ; }

Target:
protected boolean canDoAction ( ) { boolean autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.isUserCanBeAuthenticated ( ) ; if ( autheticated ) { autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.getCurrentUser ( ) . isAdmin ( ) ; if ( ! autheticated ) { addCanDoActionMessage ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } else { autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.attachUserToSession ( ) ; } } if ( ! autheticated ) { org.ovirt.engine.core.bll.LoginAdminUserCommand.logAutheticationFailure ( ) ; } return autheticated ; }
Source:
public void rerun ( org.ovirt.engine.core.compat.Guid vmId ) { final org.ovirt.engine.core.common.businessentities.IVdsAsyncCommand command = backend.getResourceManager ( ) . GetAsyncCommandForVm ( vmId ) ; if ( command != null ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { command.rerun ( ) ; } } ) ; } }

Target:
public void rerun ( org.ovirt.engine.core.compat.Guid vmId ) { final org.ovirt.engine.core.common.businessentities.IVdsAsyncCommand command = vdsBroker.GetAsyncCommandForVm ( vmId ) ; if ( command != null ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { command.rerun ( ) ; } } ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
protected org.ovirt.engine.core.utils.lock.EngineLock getLock ( ) { return context.getLock ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmTemplate getTemplateByName ( org.ovirt.engine.api.model.Template template ) { return lookupTemplateByName ( template.getName ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmTemplate lookupTemplate ( org.ovirt.engine.api.model.Template template , org.ovirt.engine.core.compat.Guid datacenterId ) { if ( template.isSetId ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( asGuid ( template.getId ( ) ) ) , "GetVmTemplate" ) ; } else if ( template.isSetName ( ) ) { org.ovirt.engine.core.common.queries.GetVmTemplateParameters params = new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( template.getName ( ) ) ; params.setDataCenterId ( datacenterId ) ; return getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , VdcQueryType.GetVmTemplate , params , "GetVmTemplate" ) ; } return null ; }
Source:
void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VmTemplate > nameColumn = new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VmTemplate object ) { return object.getName ( ) ; } } ; getTable ( ) . addColumn ( nameColumn , constants.nameTemplate ( ) , "300px" ) ; }

Target:
void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VmTemplate > nameColumn = new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VmTemplate object ) { return object.getName ( ) ; } } ; nameColumn.makeSortable ( ) ; getTable ( ) . addColumn ( nameColumn , constants.nameTemplate ( ) , "300px" ) ; }
Source:
private void importCertificate ( ) { }

Target:
private void importCertificate ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.ImportProviderCertificate , importCertificateParams ( ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { testProviderConnectivity ( ) ; } } , null , false ) ; sourceListModel.setConfirmWindow ( null ) ; }