auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void IsShareableDiskEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters params = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ShareableDiskEnabled ) ; params.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( params , aQuery ) ; }

Target:
public static void GetVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public static void getClusterDesktopMemoryOverCommit ( 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 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue addStoragePoolInIrs ( ) { return runVdsCommand ( VDSCommandType.CreateStoragePool , new org.ovirt.engine.core.common.vdscommands.CreateStoragePoolVDSCommandParameters ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getName ( ) , masterStorageDomain.getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getParameters ( ) . getStorages ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getmaster_domain_version ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue addStoragePoolInIrs ( ) { return runVdsCommand ( VDSCommandType.CreateStoragePool , new org.ovirt.engine.core.common.vdscommands.CreateStoragePoolVDSCommandParameters ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getName ( ) , masterStorageDomain.getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getParameters ( ) . getStorages ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getMasterDomainVersion ( ) ) ) ; }
Source:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vm.getStaticData ( ) . setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vm.getStaticData ( ) . setOsId ( osRepository.getOsIdByUniqueName ( node.InnerText ) ) ; } }

Target:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vm.getStaticData ( ) . setId ( new org.ovirt.engine.core.compat.Guid ( section.attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vm.getStaticData ( ) . setOsId ( osRepository.getOsIdByUniqueName ( node.innerText ) ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Quota quota ) { if ( ( quota.getQuotaEnforcementType ( ) ) == null ) { return getApplicationResources ( ) . iconDisable ( ) ; } setEnumTitle ( quota.getQuotaEnforcementType ( ) ) ; switch ( quota.getQuotaEnforcementType ( ) ) { case HARD_ENFORCEMENT : return getApplicationResources ( ) . iconEnforce ( ) ; case SOFT_ENFORCEMENT : return getApplicationResources ( ) . iconAudit ( ) ; case DISABLED : return getApplicationResources ( ) . iconDisable ( ) ; default : return getApplicationResources ( ) . iconDisable ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Quota quota ) { if ( ( quota.getQuotaEnforcementType ( ) ) == null ) { return org.ovirt.engine.ui.webadmin.widget.table.column.QuotaDcStatusColumn.resources.iconDisable ( ) ; } setEnumTitle ( quota.getQuotaEnforcementType ( ) ) ; switch ( quota.getQuotaEnforcementType ( ) ) { case HARD_ENFORCEMENT : return org.ovirt.engine.ui.webadmin.widget.table.column.QuotaDcStatusColumn.resources.iconEnforce ( ) ; case SOFT_ENFORCEMENT : return org.ovirt.engine.ui.webadmin.widget.table.column.QuotaDcStatusColumn.resources.iconAudit ( ) ; case DISABLED : return org.ovirt.engine.ui.webadmin.widget.table.column.QuotaDcStatusColumn.resources.iconDisable ( ) ; default : return org.ovirt.engine.ui.webadmin.widget.table.column.QuotaDcStatusColumn.resources.iconDisable ( ) ; } }
Source:
protected void executeCommand ( ) { setSucceeded ( org.ovirt.engine.core.bll.adbroker.LdapFactory.getInstance ( org.ovirt.engine.core.bll.ChangeUserPasswordCommand.getParameters ( ) . getDomain ( ) ) . RunAdAction ( AdActionType.ChangeUserPassword , new org.ovirt.engine.core.bll.adbroker.LdapChangeUserPasswordParameters ( org.ovirt.engine.core.bll.ChangeUserPasswordCommand.getParameters ( ) . getDomain ( ) , getUserName ( ) , org.ovirt.engine.core.bll.ChangeUserPasswordCommand.getParameters ( ) . getUserPassword ( ) , org.ovirt.engine.core.bll.ChangeUserPasswordCommand.getParameters ( ) . getNewPassword ( ) ) ) . getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { setSucceeded ( org.ovirt.engine.core.bll.adbroker.LdapFactory.getInstance ( org.ovirt.engine.core.bll.ChangeUserPasswordCommand.getParameters ( ) . getDomain ( ) ) . runAdAction ( AdActionType.ChangeUserPassword , new org.ovirt.engine.core.bll.adbroker.LdapChangeUserPasswordParameters ( org.ovirt.engine.core.bll.ChangeUserPasswordCommand.getParameters ( ) . getDomain ( ) , getUserName ( ) , org.ovirt.engine.core.bll.ChangeUserPasswordCommand.getParameters ( ) . getUserPassword ( ) , org.ovirt.engine.core.bll.ChangeUserPasswordCommand.getParameters ( ) . getNewPassword ( ) ) ) . getSucceeded ( ) ) ; }
Source:
protected com.google.gwt.user.cellview.client.CellTree createDataDisplayWidget ( org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeModelProvider modelProvider ) { org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.SystemTreeResources res = com.google.gwt.core.client.GWT.create ( org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.SystemTreeResources.class ) ; display = new com.google.gwt.user.cellview.client.CellTree ( modelProvider , null , res ) ; display.setAnimationEnabled ( true ) ; display.setKeyboardSelectionPolicy ( KeyboardSelectionPolicy.BOUND_TO_SELECTION ) ; return display ; }

Target:
protected com.google.gwt.user.cellview.client.CellTree createDataDisplayWidget ( org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeModelProvider modelProvider ) { org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.SystemTreeResources res = com.google.gwt.core.client.GWT.create ( org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.SystemTreeResources.class ) ; display = new com.google.gwt.user.cellview.client.CellTree ( modelProvider , null , res ) { protected void onLoad ( ) { expandTree ( display.getRootTreeNode ( ) , false , 2 ) ; } } ; display.setAnimationEnabled ( true ) ; display.setKeyboardSelectionPolicy ( KeyboardSelectionPolicy.BOUND_TO_SELECTION ) ; return display ; }
Source:
public void executeQueryCommand ( ) { clusterId = org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getParameters ( ) . getClusterId ( ) ; volume = org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getGlusterVolumeDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getParameters ( ) . getVolumeId ( ) ) ; if ( ( volume ) == null ) { throw new java.lang.RuntimeException ( VdcBllMessages.GLUSTER_VOLUME_ID_INVALID.toString ( ) ) ; } if ( ( clusterId ) == null ) { clusterId = volume.getClusterId ( ) ; } org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getQueryReturnValue ( ) . setReturnValue ( fetchTaskStatusDetails ( ) ) ; }

Target:
public void executeQueryCommand ( ) { clusterId = org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getParameters ( ) . getClusterId ( ) ; volume = org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getGlusterVolumeDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getParameters ( ) . getVolumeId ( ) ) ; if ( ( volume ) == null ) { throw new java.lang.RuntimeException ( EngineMessage.GLUSTER_VOLUME_ID_INVALID.toString ( ) ) ; } if ( ( clusterId ) == null ) { clusterId = volume.getClusterId ( ) ; } org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getQueryReturnValue ( ) . setReturnValue ( fetchTaskStatusDetails ( ) ) ; }
Source:
public void nicActuallyExistsOrReferencesNewBondTrue ( ) { org.ovirt.engine.core.bll.network.host.NicLabelValidator validator = org.mockito.Mockito.spy ( createNicLabelValidator ( ) ) ; mockIsNicActuallyExistsOrReferencesNewBond ( validator , true ) ; org.ovirt.engine.core.common.businessentities.network.NicLabel nicLabel = new org.ovirt.engine.core.common.businessentities.network.NicLabel ( ) ; nicLabel.setNicName ( "anyName" ) ; org.junit.Assert.assertThat ( validator.nicActuallyExistsOrReferencesNewBond ( nicLabel ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nicActuallyExistsOrReferencesNewBondTrue ( ) { org.ovirt.engine.core.bll.network.host.NicLabelValidator validator = org.mockito.Mockito.spy ( createNicLabelValidator ( ) ) ; mockIsNicActuallyExistsOrReferencesNewBond ( validator , true ) ; org.ovirt.engine.core.common.businessentities.network.NicLabel nicLabel = new org.ovirt.engine.core.common.businessentities.network.NicLabel ( ) ; nicLabel.setNicName ( "anyName" ) ; org.hamcrest.MatcherAssert.assertThat ( validator.nicActuallyExistsOrReferencesNewBond ( nicLabel ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static org.ovirt.engine.api.model.SSHPublicKey map ( org.ovirt.engine.core.common.businessentities.UserProfile entity , org.ovirt.engine.api.model.SSHPublicKey template ) { org.ovirt.engine.api.model.SSHPublicKey model = ( template != null ) ? template : new org.ovirt.engine.api.model.SSHPublicKey ( ) ; model.setId ( entity.getSshPublicKeyId ( ) . toString ( ) ) ; model.setContent ( entity.getSshPublicKey ( ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.SshPublicKey map ( org.ovirt.engine.core.common.businessentities.UserProfile entity , org.ovirt.engine.api.model.SshPublicKey template ) { org.ovirt.engine.api.model.SshPublicKey model = ( template != null ) ? template : new org.ovirt.engine.api.model.SshPublicKey ( ) ; model.setId ( entity.getSshPublicKeyId ( ) . toString ( ) ) ; model.setContent ( entity.getSshPublicKey ( ) ) ; return model ; }
Source:
private static int getFirstImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( curr.getParentId ( ) . equals ( images.get ( i ) . getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Snapshot addActiveSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { return snapshotsManager.addActiveSnapshot ( snapshotId , getVm ( ) , getMemoryVolumeForNewActiveSnapshot ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) ) ; }
Source:
private void removeMemoryVolumes ( java.lang.String memoryVolume , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryVolume , vmId ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.log.errorFormat ( "Failed to remove memory volumes: {0}" , memoryVolume ) ; } }

Target:
private void removeMemoryVolumes ( java.lang.String memoryVolume , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryVolume , vmId ) , org.ovirt.engine.core.bll.ImportVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.log.error ( "Failed to remove memory volumes '{}'" , memoryVolume ) ; } }
Source:
private org.apache.http.conn.ClientConnectionManager createPoolingClientConnectionManager ( java.lang.String url , int port ) { org.apache.http.conn.scheme.SchemeRegistry schemeRegistry = createSchemeRegistry ( url , port ) ; org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager cm = new org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager ( schemeRegistry ) ; cm.setMaxTotal ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS ) ; cm.setDefaultMaxPerRoute ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_ROUTE ) ; cm.setMaxForRoute ( new org.apache.http.conn.routing.HttpRoute ( new org.apache.http.HttpHost ( getHost ( url ) , getPort ( url , port ) ) ) , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_HOST ) ; return cm ; }

Target:
private org.apache.http.conn.ClientConnectionManager createPoolingClientConnectionManager ( java.lang.String url , int port ) { org.apache.http.conn.scheme.SchemeRegistry schemeRegistry = createSchemeRegistry ( url , port ) ; org.apache.http.impl.conn.PoolingClientConnectionManager cm = new org.apache.http.impl.conn.PoolingClientConnectionManager ( schemeRegistry ) ; cm.setMaxTotal ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS ) ; cm.setDefaultMaxPerRoute ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_ROUTE ) ; cm.setMaxPerRoute ( new org.apache.http.conn.routing.HttpRoute ( new org.apache.http.HttpHost ( getHost ( url ) , getPort ( url , port ) ) ) , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_HOST ) ; return cm ; }
Source:
public void testMigrateWithClusterId ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVm , org.ovirt.engine.core.common.action.MigrateVmParameters.class , new java.lang.String [ ] { "VmId" , "ForceMigrationForNonMigratableVm" , "TargetClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE , GUIDS [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; action.setCluster ( cluster ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }

Target:
public void testMigrateWithClusterId ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVm , org.ovirt.engine.core.common.action.MigrateVmParameters.class , new java.lang.String [ ] { "VmId" , "ForceMigrationForNonMigratableVm" , "TargetClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE , GUIDS [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; org.ovirt.engine.api.restapi.resource.Cluster cluster = new org.ovirt.engine.api.restapi.resource.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; action.setCluster ( cluster ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }
Source:
protected org.ovirt.engine.api.model.Disk deprecatedPopulate ( org.ovirt.engine.api.model.Disk model , org.ovirt.engine.api.model.Disk entity ) { return ( ( org.ovirt.engine.api.restapi.resource.BackendVmDisksResource ) ( collection ) ) . deprecatedPopulate ( model , entity ) ; }

Target:
private void addStatistics ( org.ovirt.engine.api.model.Disk model , org.ovirt.engine.api.model.Disk entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.utils.LinkHelper.addLinks ( uriInfo , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; } } , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; } } , this ) ; }
Source:
public void testAddIncompleteParametersNoName ( ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "id|name" ) ; } }

Target:
public void testAddIncompleteParametersNoName ( ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "id|name" ) ; } }
Source:
public void canAddCloneVmFromSnapshotSnapshotDoesNotExist ( ) { final int domainSizeGB = 15 ; final org.ovirt.engine.core.compat.Guid sourceSnapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = setupCanAddVmFromSnapshotTests ( domainSizeGB , sourceSnapshotId ) ; cmd.getVm ( ) . setName ( "vm1" ) ; mockNonInterestingMethodsForCloneVmFromSnapshot ( cmd ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST ) ; }

Target:
public void canAddCloneVmFromSnapshotSnapshotDoesNotExist ( ) { final int domainSizeGB = 15 ; final org.ovirt.engine.core.compat.Guid sourceSnapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = setupCanAddVmFromSnapshotTests ( domainSizeGB , sourceSnapshotId ) ; cmd.getVm ( ) . setName ( "vm1" ) ; mockNonInterestingMethodsForCloneVmFromSnapshot ( cmd ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST ) ; }
Source:
public boolean match ( org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel source ) { return ( ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( source.getName ( ) , target.getName ( ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( source.getAddress ( ) , target.getAddress ( ) ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( source.getPort ( ) , target.getPort ( ) ) ) ; }

Target:
public boolean match ( org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel source ) { return ( ( java.util.Objects.equals ( source.getName ( ) , target.getName ( ) ) ) && ( java.util.Objects.equals ( source.getAddress ( ) , target.getAddress ( ) ) ) ) && ( java.util.Objects.equals ( source.getPort ( ) , target.getPort ( ) ) ) ; }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public static boolean canRemoveVmPool ( org.ovirt.engine.core.compat.Guid vmPoolId , java.util.ArrayList < java.lang.String > reasons ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolsMapByVmPoolId ( vmPoolId ) . size ( ) ) != 0 ) { returnValue = false ; reasons.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_VM_POOL_WITH_VMS.toString ( ) ) ; } return returnValue ; }

Target:
public static boolean canRemoveVmPool ( org.ovirt.engine.core.compat.Guid vmPoolId , java.util.ArrayList < java.lang.String > reasons ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolsMapByVmPoolId ( vmPoolId ) . size ( ) ) != 0 ) { returnValue = false ; reasons.add ( EngineMessage.VM_POOL_CANNOT_REMOVE_VM_POOL_WITH_VMS.toString ( ) ) ; } return returnValue ; }
Source:
public static void GetVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters params = new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public static void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testNetworksOnNicMatchMtuWhenNoNetworksAreProvided ( ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > networksOnNics = java.util.Collections.singletonMap ( "nicName" , java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.bll.network.host.NetworkMtuValidator networkMtuValidator = new org.ovirt.engine.core.bll.network.host.NetworkMtuValidator ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.emptyList ( ) ) ) ; org.junit.Assert.assertThat ( networkMtuValidator.validateMtu ( networksOnNics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworksOnNicMatchMtuWhenNoNetworksAreProvided ( ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > networksOnNics = java.util.Collections.singletonMap ( "nicName" , java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.bll.network.host.NetworkMtuValidator networkMtuValidator = new org.ovirt.engine.core.bll.network.host.NetworkMtuValidator ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.emptyList ( ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( networkMtuValidator.validateMtu ( networksOnNics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void removeDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.core.compat.Guid vmId ) { try { removeDiskFromVm ( vmId , diskImage.getId ( ) ) ; removeImage ( diskImage ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.error ( "Failed to remove disk image and related entities from db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }

Target:
public static void removeDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.removeDiskFromVm ( vmId , diskImage.getId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.removeImage ( diskImage ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.error ( "Failed to remove disk image and related entities from db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }
Source:
private static boolean canPlugInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface , org.ovirt.engine.core.compat.Guid vdsGroupId ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVdsGroupDao ( ) . get ( vdsGroupId ) ; org.ovirt.engine.core.compat.Guid dataCenterId = ( vdsGroup == null ) ? null : vdsGroup.getStoragePoolId ( ) ; java.lang.String macAddress = iface.getMacAddress ( ) ; boolean canPlugInterface = org.ovirt.engine.core.bll.utils.VmDeviceUtils.canPlugInterfaceInDc ( macAddress , dataCenterId ) ; if ( ! canPlugInterface ) { new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) . auditLogMacInUseUnplug ( iface ) ; } return canPlugInterface ; }

Target:
public static boolean shouldOverrideSoundDevice ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic , org.ovirt.engine.core.compat.Version compatibilityVersion , java.lang.Boolean soundDeviceEnabled ) { return ( ( soundDeviceEnabled == null ) && ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository.isSoundDeviceEnabled ( vmStatic.getOsId ( ) , compatibilityVersion ) ) ) && ( ( vmStatic.getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) ; }
Source:
private java.util.Set < java.lang.String > getLunConnections ( java.util.List < org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map > lunConns ) { java.util.Set < java.lang.String > conns = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map lun_storage_server_connection_map1 : lunConns ) { conns.add ( lun_storage_server_connection_map1.getstorage_server_connection ( ) ) ; } return conns ; }

Target:
private java.util.Set < java.lang.String > getLunConnections ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUN_storage_server_connection_map > lunConns ) { java.util.Set < java.lang.String > conns = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUN_storage_server_connection_map lun_storage_server_connection_map1 : lunConns ) { conns.add ( lun_storage_server_connection_map1.getstorage_server_connection ( ) ) ; } return conns ; }
Source:
public void setUp ( ) { super . setUp ( ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . initTemplateDisks ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . checkNumberOfMonitors ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; initCommandMethods ( ) ; initDestSDs ( ) ; generateStorageToDisksMap ( ) ; cmd.init ( ) ; }

Target:
public void setUp ( ) { super . setUp ( ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . initTemplateDisks ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . checkNumberOfMonitors ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; initCommandMethods ( ) ; mockStorageDomainDaoGetAllForStoragePool ( ) ; cmd.init ( ) ; }
Source:
private double getTotalSizeForDisksByMethod ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages , org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.SizeAssessment sizeAssessment ) { double totalSizeForDisks = 0.0 ; if ( diskImages != null ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { double sizeForDisk = sizeAssessment.getSizeForDisk ( diskImage ) ; totalSizeForDisks += sizeForDisk ; } } return totalSizeForDisks ; }

Target:
private double getTotalSizeForDisksByMethod ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages , org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.SizeAssessment sizeAssessment ) { double totalSizeForDisks = 0.0 ; if ( diskImages != null ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImages ) { double sizeForDisk = sizeAssessment.getSizeForDisk ( diskImage ) ; totalSizeForDisks += sizeForDisk ; } } return totalSizeForDisks ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > RunMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > multipleParams , boolean isRunOnlyIfAllCanDoPass , boolean isWaitForResult ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( ( ( "Server: RunMultipleAction invoked! [amount of actions: " + ( multipleParams.size ( ) ) ) + "]" ) ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase params : multipleParams ) { params.setSessionId ( getSessionId ( ) ) ; } java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues = getBackend ( ) . runMultipleActions ( actionType , multipleParams , isRunOnlyIfAllCanDoPass , isWaitForResult ) ; return returnValues ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > RunMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > multipleParams , boolean isRunOnlyIfAllCanDoPass , boolean isWaitForResult ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( ( ( "Server: RunMultipleAction invoked! [amount of actions: " + ( multipleParams.size ( ) ) ) + "]" ) ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase params : multipleParams ) { params.setSessionId ( getSession ( ) . getId ( ) ) ; } java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues = getBackend ( ) . runMultipleActions ( actionType , multipleParams , isRunOnlyIfAllCanDoPass , isWaitForResult ) ; return returnValues ; }
Source:
public org.ovirt.engine.sdk.decorators.VMHostDevice get ( java.util.UUID id ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ) + ( SLASH ) ) + ( id.toString ( ) ) ; return getProxy ( ) . get ( url , org.ovirt.engine.sdk.entities.HostDevice.class , org.ovirt.engine.sdk.decorators.VMHostDevice.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.TemplateNic get ( java.util.UUID id ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ) + ( SLASH ) ) + ( id.toString ( ) ) ; return getProxy ( ) . get ( url , org.ovirt.engine.sdk.entities.Nic.class , org.ovirt.engine.sdk.decorators.TemplateNic.class ) ; }
Source:
public void refreshHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { org.ovirt.engine.core.common.businessentities.VDSStatus newStatus = refreshCapabilities ( new java.util.concurrent.atomic.AtomicBoolean ( ) , vds ) ; if ( org.ovirt.engine.core.vdsbroker.VdsManager.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Succeeded to refreshCapabilities for host {0} , new status will be {1} " , getVdsId ( ) , newStatus ) ; } } finally { if ( vds != null ) { updateDynamicData ( vds.getDynamicData ( ) ) ; monitoringStrategy.processHardwareCapabilities ( vds ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . handleVdsVersion ( vds.getId ( ) ) ; } } }

Target:
public void refreshHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { refreshCapabilities ( new java.util.concurrent.atomic.AtomicBoolean ( ) , vds ) ; } finally { if ( vds != null ) { updateDynamicData ( vds.getDynamicData ( ) ) ; updateNumaData ( vds ) ; monitoringStrategy.processHardwareCapabilities ( vds ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . handleVdsVersion ( vds.getId ( ) ) ; } } }
Source:
public static void updateConsoleDevice ( org.ovirt.engine.core.compat.Guid vmId , java.lang.Boolean consoleEnabled ) { if ( consoleEnabled == null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > consoles = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.CONSOLE , VmDeviceType.CONSOLE.getName ( ) ) ; if ( consoleEnabled ) { if ( consoles.isEmpty ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addConsoleDevice ( vmId ) ; } } else { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : consoles ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > getConsoleDevices ( org.ovirt.engine.core.compat.Guid vmId ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.CONSOLE , VmDeviceType.CONSOLE.getName ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( bond.getName ( ) , nicId , nicName , message , existingInterfacesMap ) ; }

Target:
private boolean isNicActuallyExistsOrReferencesNewBond ( java.lang.String nicName , org.ovirt.engine.core.compat.Guid nicId ) { return hostSetupNetworksValidatorHelper.isNicActuallyExistsOrReferencesNewBond ( existingInterfacesMap , createOrUpdateBondBusinessEntityMap , nicName , nicId ) ; }
Source:
private java.lang.String getVmIsBeingRemovedFromExportDomainMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_BEING_REMOVED_FROM_EXPORT_DOMAIN.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getVmName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getVmName ( ) ) ) ; } return builder.toString ( ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.REMOTE_VM , new org.ovirt.engine.core.bll.LockMessage ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_BEING_REMOVED_FROM_EXPORT_DOMAIN ) . withOptional ( "VmName" , org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getVmName ( ) ) ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateStorageServerConnectionExtension , org.ovirt.engine.core.common.action.StorageServerConnectionExtensionParameters.class , new java.lang.String [ ] { "StorageServerConnectionExtension" } , new java.lang.Object [ ] { getDefaultEntity ( ) } , true , true ) ) ; org.ovirt.engine.api.model.StorageConnectionExtension extension = resource.update ( getDefaultModel ( ) ) ; assertNotNull ( extension ) ; assertEquals ( extension.getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionResourceTest.extensionID.toString ( ) ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateStorageServerConnectionExtension , org.ovirt.engine.core.common.action.StorageServerConnectionExtensionParameters.class , new java.lang.String [ ] { "StorageServerConnectionExtension" } , new java.lang.Object [ ] { getDefaultEntity ( ) } , true , true ) ) ; org.ovirt.engine.api.model.StorageConnectionExtension extension = resource.update ( getDefaultModel ( ) ) ; org.junit.Assert.assertNotNull ( extension ) ; org.junit.Assert.assertEquals ( extension.getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionResourceTest.extensionID.toString ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { final java.util.Map < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > result = new java.util.HashMap < > ( ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.VmIconDefault > iconDefaults = vmIconDefaultDao.getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmIconDefault iconDefault : iconDefaults ) { result.put ( iconDefault.getOsId ( ) , new org.ovirt.engine.core.common.queries.VmIconIdSizePair ( iconDefault.getSmallIconId ( ) , iconDefault.getLargeIconId ( ) ) ) ; } setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { final java.util.Map < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > result = new java.util.HashMap < > ( ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.VmIconDefault > iconDefaults = vmIconDefaultDao.getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmIconDefault iconDefault : iconDefaults ) { result.put ( iconDefault.getOsId ( ) , new org.ovirt.engine.core.common.queries.VmIconIdSizePair ( iconDefault.getSmallIconId ( ) , iconDefault.getLargeIconId ( ) ) ) ; } if ( ! ( result.containsKey ( OsRepository.DEFAULT_X86_OS ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DefaultIconPairNotFound ) ; } setReturnValue ( result ) ; }
Source:
private org.ovirt.engine.extensions.aaa.builtin.kerberosldap.BrokerCommandBase CreateCommand ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.AdActionType action , org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapBrokerBaseParameters parameters ) { try { java.lang.Class type = java.lang.Class.forName ( GetCommandTypeName ( action ) ) ; java.lang.reflect.Constructor info = org.ovirt.engine.core.utils.ReflectionUtils.findConstructor ( type , parameters.getClass ( ) ) ; java.lang.Object tempVar = info.newInstance ( parameters ) ; return ( ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.BrokerCommandBase ) ( tempVar instanceof org.ovirt.engine.extensions.aaa.builtin.kerberosldap.BrokerCommandBase ? tempVar : null ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapBrokerBase.log.errorFormat ( "LdapBrokerCommandBase: Failed to get type information using reflection for Action: {0}" , action ) ; return null ; } }

Target:
private org.ovirt.engine.extensions.aaa.builtin.kerberosldap.BrokerCommandBase CreateCommand ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.AdActionType action , org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapBrokerBaseParameters parameters ) { try { java.lang.Class type = java.lang.Class.forName ( GetCommandTypeName ( action ) ) ; java.lang.reflect.Constructor info = org.ovirt.engine.core.utils.ReflectionUtils.findConstructor ( type , parameters.getClass ( ) ) ; java.lang.Object tempVar = info.newInstance ( parameters ) ; return ( ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.BrokerCommandBase ) ( tempVar instanceof org.ovirt.engine.extensions.aaa.builtin.kerberosldap.BrokerCommandBase ? tempVar : null ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapBrokerBase.log.error ( "LdapBrokerCommandBase: Failed to get type information using reflection for Action: {}" , action ) ; return null ; } }
Source:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.tags_vm_map > all = getTagDAO ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags_vm_map tagVm : all ) { getTagDAO ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }

Target:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.tags_vm_map > all = getTagDao ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags_vm_map tagVm : all ) { getTagDao ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }