auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void isConnWithSameDetailsExistSameConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; connections.add ( newNFSConnection ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getConnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistSameConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = java.util.Collections.singletonList ( newNFSConnection ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getConnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }
Source:
protected static java.lang.String getMessageOrNull ( org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String key = logType.name ( ) ; try { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resourceBundle.getString ( key ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( ( ( ( ( "Key '" + key ) + "' is not translated in '" ) + ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getResourceBundleName ( ) ) ) + "'" ) ) ; return null ; } }

Target:
protected static java.lang.String getMessageOrNull ( org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String key = logType.name ( ) ; try { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resourceBundle.getString ( key ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( "Key '{}' is not translated in '{}'" , key , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getResourceBundleName ( ) ) ; return null ; } }
Source:
public void appendCustomValue ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String sep = "_" ; b.appendCustomValue ( key , value , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , s ) ; }

Target:
public void appendCustomValue ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String sep = "_" ; b.appendCustomValue ( key , value , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.jupiter.api.Assertions.assertEquals ( value , s ) ; }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void canDoActionInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Paused , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }

Target:
public void canDoActionInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Unknown , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }
Source:
public void testNotRemovingUsedPoolRecordNotUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( macPoolDaoMock.getDcUsageCount ( org.mockito.Matchers.eq ( macPool.getId ( ) ) ) ) . thenReturn ( 0 ) ; final org.ovirt.engine.core.bll.ValidationResult validationResult = new org.ovirt.engine.core.bll.MacPoolValidator ( macPool ) . notRemovingUsedPool ( ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotRemovingUsedPoolRecordNotUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.getAllDataCentersByMacPoolId ( macPool.getId ( ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.StoragePool > emptyList ( ) ) ; org.junit.Assert.assertThat ( macPoolValidator.notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected boolean checkCanBeMoveInVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsForDisk = getVmsForDiskId ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM currVm : vmsForDisk ) { if ( ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) != ( currVm.getStatus ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = getVmDeviceDAO ( ) . get ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getId ( ) , currVm.getId ( ) ) ) ; if ( vmDevice.getIsPlugged ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; return false ; } } } return true ; }

Target:
protected boolean checkCanBeMoveInVm ( ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmsForDisk = getVmsWithVmDeviceInfoForDiskId ( ) ; for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > pair : vmsForDisk ) { org.ovirt.engine.core.common.businessentities.VM currVm = pair.getFirst ( ) ; if ( ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) != ( currVm.getStatus ( ) ) ) { if ( pair.getSecond ( ) . getIsPlugged ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; return false ; } } } return true ; }
Source:
public static void GetVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void GetDiskMaxSize ( 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.MaxBlockDiskSize , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map > result = dao.getAll ( existingLUNStorageMap.getId ( ) . lunId ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map mapping : result ) { assertEquals ( existingLUNStorageMap.getId ( ) . lunId , mapping.getId ( ) . lunId ) ; } }

Target:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map > result = dao.getAll ( existingLUNStorageMap.getId ( ) . lunId ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map mapping : result ) { org.junit.Assert.assertEquals ( existingLUNStorageMap.getId ( ) . lunId , mapping.getId ( ) . lunId ) ; } }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.DiskImage x , org.ovirt.engine.core.common.businessentities.DiskImage y ) { return ( x.getActualSize ( ) ) < ( y.getActualSize ( ) ) ? - 1 : ( x.getActualSize ( ) ) < ( y.getActualSize ( ) ) ? 1 : 0 ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.storage.DiskImage x , org.ovirt.engine.core.common.businessentities.storage.DiskImage y ) { return ( x.getActualSize ( ) ) < ( y.getActualSize ( ) ) ? - 1 : ( x.getActualSize ( ) ) < ( y.getActualSize ( ) ) ? 1 : 0 ; }
Source:
public void testDetachDisk ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDettachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID , org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setDetach ( true ) ; verifyRemove ( collection.remove ( org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID.toString ( ) , action ) ) ; }

Target:
public void testDetachDisk ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDettachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityId" } , new java.lang.Object [ ] { PARENT_ID , org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setDetach ( true ) ; verifyRemove ( collection.remove ( org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID.toString ( ) , action ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.Host host ) { if ( host.isSetCluster ( ) ) { org.ovirt.engine.api.model.Cluster cluster = host.getCluster ( ) ; if ( cluster.isSetId ( ) ) { return asGuid ( cluster.getId ( ) ) ; } if ( cluster.isSetName ( ) ) { return getClusterIdByName ( cluster.getName ( ) ) ; } } return getClusterIdByName ( org.ovirt.engine.api.restapi.resource.BackendHostsResource.DEFAULT_NAME ) ; }

Target:
private org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.Host host ) { if ( host.isSetCluster ( ) ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = host.getCluster ( ) ; if ( cluster.isSetId ( ) ) { return asGuid ( cluster.getId ( ) ) ; } if ( cluster.isSetName ( ) ) { return getClusterIdByName ( cluster.getName ( ) ) ; } } return getClusterIdByName ( org.ovirt.engine.api.restapi.resource.BackendHostsResource.DEFAULT_NAME ) ; }
Source:
private static java.lang.String getDiskLabelList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks ) { if ( disks.isEmpty ( ) ) { return null ; } final java.util.List < java.lang.String > labels = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { labels.add ( disk.getDiskAlias ( ) ) ; } return org.ovirt.engine.ui.uicompat.external.StringUtils.join ( labels , ", " ) ; }

Target:
private static java.lang.String getDiskLabelList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( disks.isEmpty ( ) ) { return null ; } final java.util.List < java.lang.String > labels = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { labels.add ( disk.getDiskAlias ( ) ) ; } return org.ovirt.engine.ui.uicompat.external.StringUtils.join ( labels , ", " ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void onUiCommonInit ( org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent event ) { setAccessible ( tabData.getModelProvider ( ) . getModel ( ) . getIsAvailable ( ) ) ; registerModelEventListeners ( tabData.getModelProvider ( ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "IsAvailable" . equals ( pcArgs.propertyName ) ) { boolean isAvailable = modelProvider.getModel ( ) . getIsAvailable ( ) ; setAccessible ( isAvailable ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity getGlusterServerHook ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity entity , org.ovirt.engine.core.compat.Guid hostId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterServerHook = getCallsHandler ( ) . executeRead ( "GetGlusterServerHook" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterServerHookRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , entity.getId ( ) ) . addValue ( "host_id" , hostId ) ) ; if ( glusterServerHook != null ) { entity.setChecksum ( glusterServerHook.getChecksum ( ) ) ; entity.setStatus ( glusterServerHook.getStatus ( ) ) ; } return entity ; }

Target:
public java.lang.String getGlusterHookContent ( org.ovirt.engine.core.compat.Guid hookId ) { java.lang.String content = getCallsHandler ( ) . executeRead ( "GetGlusterHookById" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.GlusterHookContentRowMapper , createIdParameterMapper ( hookId ) . addValue ( "includeContent" , true ) ) ; return content ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc refreshStoragePool ( java.lang.String spUUID , java.lang.String msdUUID , int masterVersion ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.refreshStoragePool ( spUUID , msdUUID , masterVersion ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc getHostJobs ( java.lang.String jobType , java.util.List < java.lang.String > jobIds ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getHostJobs ( jobType , jobIds ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected Q getEntity ( org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , boolean notFoundAs404 ) { try { return entityResolver.resolve ( guid ) ; } catch ( java.lang.Exception e ) { return handleError ( entityType , e , notFoundAs404 ) ; } }

Target:
protected < T > Q getEntity ( org.ovirt.engine.api.restapi.resource.EntityIdResolver < T > entityResolver , boolean notFoundAs404 ) { try { return entityResolver.resolve ( ( ( T ) ( guid ) ) ) ; } catch ( java.lang.Exception e ) { return handleError ( entityType , e , notFoundAs404 ) ; } }
Source:
protected void disposePassFile ( java.io.File file ) { if ( file != null ) { if ( file.exists ( ) ) { if ( ! ( file.delete ( ) ) ) { org.ovirt.engine.extensions.aaa.builtin.tools.ConfigurationProvider.log.info ( ( ( "Failed deleting file " + ( file.getAbsolutePath ( ) ) ) + ". Continuing anyway." ) ) ; } } } }

Target:
protected void disposePassFile ( java.io.File file ) { if ( file != null ) { if ( file.exists ( ) ) { if ( ! ( file.delete ( ) ) ) { org.ovirt.engine.extensions.aaa.builtin.tools.ConfigurationProvider.log.info ( "Failed deleting file {}. Continuing anyway." , file.getAbsolutePath ( ) ) ; } } } }
Source:
protected org.ovirt.engine.core.compat.Guid createTaskInCurrentTransaction ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { return createTaskImpl ( asyncTaskCreationInfo , parentCommand , null , entityType , entityIds ) ; }

Target:
public java.lang.Void runInTransaction ( ) { buildChildCommandInfos ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > entry : childCommandInfoMap.entrySet ( ) ) { org.ovirt.engine.core.bll.CommandBase < ? > command = getBackendCommandObjectsHandler ( ) . createAction ( entry.getValue ( ) . getFirst ( ) , entry.getValue ( ) . getSecond ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; childCommandsMap.put ( entry.getKey ( ) , command ) ; } return null ; }
Source:
public boolean IsBetter ( org.ovirt.engine.core.bll.VDS x , org.ovirt.engine.core.bll.VDS y , org.ovirt.engine.core.bll.VM vm ) { return ( ( x.getphysical_mem_mb ( ) ) - ( x.getmem_commited ( ) ) ) < ( ( y.getphysical_mem_mb ( ) ) - ( y.getmem_commited ( ) ) ) ; }

Target:
public boolean IsBetter ( org.ovirt.engine.core.bll.VDS x , org.ovirt.engine.core.bll.VDS y , org.ovirt.engine.core.bll.VM vm ) { return ( ( x.getPhysicalMemMb ( ) ) - ( x.getMemCommited ( ) ) ) < ( ( y.getPhysicalMemMb ( ) ) - ( y.getMemCommited ( ) ) ) ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { if ( isDiskImage ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getNewDisk ( ) ) ) ; java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; } return true ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { if ( isDiskImage ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getNewDisk ( ) ) ) ; java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) ; } return true ; }
Source:
public void testQuotaClusterByQuotaGuidWithGeneralDefaultWithDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByQuotaGuidWithGeneralDefault ( FixturesTool.QUOTA_GENERAL ) ; org.junit.Assert.assertNotNull ( quotaClusterList ) ; org.junit.Assert.assertEquals ( "wrong number of quotas returned" , 1 , quotaClusterList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaCluster group : quotaClusterList ) { org.junit.Assert.assertEquals ( "VDS ID should be empty in general mode" , Guid.Empty , group.getClusterId ( ) ) ; org.junit.Assert.assertNull ( "VDS name should be null in general mode" , group.getClusterName ( ) ) ; } }

Target:
public void testQuotaClusterByQuotaGuidWithGeneralDefaultWithDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByQuotaGuidWithGeneralDefault ( FixturesTool.QUOTA_GENERAL ) ; org.junit.jupiter.api.Assertions.assertNotNull ( quotaClusterList ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , quotaClusterList.size ( ) , "wrong number of quotas returned" ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaCluster group : quotaClusterList ) { org.junit.jupiter.api.Assertions.assertEquals ( Guid.Empty , group.getClusterId ( ) , "VDS ID should be empty in general mode" ) ; org.junit.jupiter.api.Assertions.assertNull ( group.getClusterName ( ) , "VDS name should be null in general mode" ) ; } }
Source:
public void showNfsProfileStats ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileInfo entity ) { final java.util.List < org.ovirt.engine.core.common.businessentities.gluster.NfsProfileDetails > nfsProfileDetails = entity.getNfsProfileDetails ( ) ; getNfsServers ( ) . setItems ( nfsProfileDetails ) ; getNfsServers ( ) . setSelectedItem ( nfsProfileDetails.get ( 0 ) ) ; }

Target:
public void showNfsProfileStats ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileInfo entity ) { if ( entity != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats > nfsProfileDetails = entity.getNfsProfileDetails ( ) ; getNfsServers ( ) . setItems ( nfsProfileDetails ) ; if ( ( nfsProfileDetails.size ( ) ) > 0 ) { getNfsServers ( ) . setSelectedItem ( nfsProfileDetails.get ( 0 ) ) ; } } }
Source:
protected void executeQueryCommand ( ) { java.lang.String directoryName = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) ; org.ovirt.engine.core.common.utils.ExternalId id = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.aaa.Directory directory = org.ovirt.engine.core.aaa.DirectoryManager.getInstance ( ) . getDirectory ( directoryName ) ; if ( directory == null ) { org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; } else { org.ovirt.engine.core.aaa.DirectoryUser user = directory.findUser ( id ) ; org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setReturnValue ( user ) ; } }

Target:
protected void executeQueryCommand ( ) { java.lang.String directoryName = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) ; org.ovirt.engine.core.common.utils.ExternalId id = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.aaa.Directory directory = org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getDirectory ( directoryName ) ; if ( directory == null ) { org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; } else { org.ovirt.engine.core.aaa.DirectoryUser user = directory.findUser ( id ) ; org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setReturnValue ( user ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangable ( true ) ; setEnableSearchHost ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangable ( true ) ; setEnableSearchHost ( true ) ; getProviders ( ) . setIsChangable ( true ) ; }
Source:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { if ( ( getDiskStorageType ( ) . getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }

Target:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { if ( ( getDiskStorageType ( ) . getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.directLUNDiskNotSupported ( ) : "" ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.PersistentSetupNetworks , new org.ovirt.engine.core.bll.network.RemoveNetworksByLabelParametersBuilder ( org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getContext ( ) ) . buildParameters ( getNic ( ) , getLabel ( ) , org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getVds ( ) . getVdsGroupId ( ) ) , org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { addCustomValue ( "NicName" , getNic ( ) . getName ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.PersistentSetupNetworks , new org.ovirt.engine.core.bll.network.RemoveNetworksByLabelParametersBuilder ( org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getContext ( ) ) . buildParameters ( getNic ( ) , getLabel ( ) , org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getVds ( ) . getVdsGroupId ( ) ) , org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }
Source:
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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.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 ) ; }

Target:
public void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public static void getAAAProfilesList ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getAAAProfilesEntriesList ( 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.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage i = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return i ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setSizeInGigabytes ( size ) ; diskImage.setActualSize ( size ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return diskImage ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM getInverse ( org.ovirt.engine.core.common.businessentities.VmStatic to ) { org.ovirt.engine.core.common.businessentities.VmStatistics statistics = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; statistics.setcpu_user ( 10.0 ) ; statistics.setcpu_sys ( 20.0 ) ; org.ovirt.engine.core.common.businessentities.VmDynamic dynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; dynamic.setStatus ( VMStatus.Up ) ; dynamic.setBootSequence ( to.getDefaultBootSequence ( ) ) ; dynamic.getGraphicsInfos ( ) . put ( GraphicsType.SPICE , new org.ovirt.engine.core.common.businessentities.GraphicsInfo ( ) ) ; org.ovirt.engine.api.restapi.types.VM ret = new org.ovirt.engine.api.restapi.types.VM ( to , dynamic , statistics ) ; ret.setUsageMemPercent ( 50 ) ; return ret ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getInverse ( org.ovirt.engine.core.common.businessentities.VmStatic to ) { org.ovirt.engine.core.common.businessentities.VmStatistics statistics = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; statistics.setCpuUser ( 10.0 ) ; statistics.setCpuSys ( 20.0 ) ; org.ovirt.engine.core.common.businessentities.VmDynamic dynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; dynamic.setStatus ( VMStatus.Up ) ; dynamic.setBootSequence ( to.getDefaultBootSequence ( ) ) ; dynamic.getGraphicsInfos ( ) . put ( GraphicsType.SPICE , new org.ovirt.engine.core.common.businessentities.GraphicsInfo ( ) ) ; org.ovirt.engine.api.restapi.types.VM ret = new org.ovirt.engine.api.restapi.types.VM ( to , dynamic , statistics ) ; ret.setUsageMemPercent ( 50 ) ; return ret ; }
Source:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void canDoActionVmInPreview ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Down , null , diskImageId ) ; setVmInPreview ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW.toString ( ) ) ) ; }

Target:
public void moveFloatingDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( ( ( command.getMoveDiskParametersList ( ) . size ( ) ) == 1 ) ) ; }
Source:
public java.lang.String render ( T storageDomain ) { if ( storageDomain == null ) { return "" ; } if ( ( storageDomain.getAvailableDiskSize ( ) ) == null ) { return storageDomain.getStorageName ( ) ; } return org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer.messages.storageDomainFreeSpace ( storageDomain.getStorageName ( ) , storageDomain.getAvailableDiskSize ( ) , storageDomain.getTotalDiskSize ( ) ) ; }

Target:
public java.lang.String render ( T storageDomain ) { if ( storageDomain == null ) { return "" ; } if ( ( ( storageDomain.getAvailableDiskSize ( ) ) == null ) || ( ( storageDomain.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.CINDER ) ) ) { return storageDomain.getStorageName ( ) ; } return org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer.messages.storageDomainFreeSpace ( storageDomain.getStorageName ( ) , storageDomain.getAvailableDiskSize ( ) , storageDomain.getTotalDiskSize ( ) ) ; }
Source:
public void testGetStorageDomainsWithAndWithoutStatusAreEqual ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > resultWithoutStatus = dao.getStorageDomains ( FixturesTool.STORAGE_POOL_NFS_INACTIVE_ISO , StorageDomainType.ISO ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > resultWithStatus = dao.getStorageDomains ( FixturesTool.STORAGE_POOL_NFS_INACTIVE_ISO , StorageDomainType.ISO , null ) ; org.junit.Assert.assertFalse ( resultWithoutStatus.isEmpty ( ) ) ; org.junit.Assert.assertFalse ( resultWithStatus.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( resultWithoutStatus , resultWithStatus ) ; }

Target:
public void testGetStorageDomainsWithAndWithoutStatusAreEqual ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > resultWithoutStatus = dao.getStorageDomains ( FixturesTool.STORAGE_POOL_NFS_INACTIVE_ISO , StorageDomainType.ISO ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > resultWithStatus = dao.getStorageDomains ( FixturesTool.STORAGE_POOL_NFS_INACTIVE_ISO , StorageDomainType.ISO , null ) ; org.junit.jupiter.api.Assertions.assertFalse ( resultWithoutStatus.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( resultWithStatus.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( resultWithoutStatus , resultWithStatus ) ; }
Source:
com.google.gwt.http.client.RequestBuilder createRequest ( ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , java.lang.String.valueOf ( restApiSessionTimeout ) ) ; builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.PREFER_HEADER , "persistent-auth, csrf-protection" ) ; if ( ( restApiSessionId ) != null ) { builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.CSRF_HEADER , restApiSessionId ) ; } return builder ; }

Target:
com.google.gwt.http.client.RequestBuilder createRequest ( ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , java.lang.String.valueOf ( restApiSessionTimeout ) ) ; builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.PREFER_HEADER , "persistent-auth, csrf-protection" ) ; if ( ( restApiSessionId ) != null ) { builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.CSRF_HEADER , restApiSessionId ) ; } return builder ; }
Source:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDiskHotpluggableInterfaces ( getEntity ( ) . getOs ( ) , clusterCompatibilityVersion ) . isEmpty ( ) ) ) ) ) ; } }

Target:
protected void updateExtendImageSizeSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; model.setExtendImageSizeSupported ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isCommandCompatible ( query , VdcActionType.ExtendImageSize , vm.getVdsGroupCompatibilityVersion ( ) , dataCenterVersion ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > allocate ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile , org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.businessentities.VDS host , boolean ignoreSecurityGroups ) { java.util.Map < java.lang.String , java.lang.String > runtimeProperties = new java.util.HashMap < > ( ) ; runtimeProperties.put ( "provider_type" , "unmanaged" ) ; runtimeProperties.put ( "plugin_type" , org.apache.commons.lang.StringUtils.defaultString ( provider.getAdditionalProperties ( ) . getPluginType ( ) ) ) ; return runtimeProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > allocate ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile , org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.businessentities.VDS host , boolean ignoreSecurityGroups , java.lang.String hostBindingId ) { java.util.Map < java.lang.String , java.lang.String > runtimeProperties = new java.util.HashMap < > ( ) ; runtimeProperties.put ( "provider_type" , "unmanaged" ) ; runtimeProperties.put ( "plugin_type" , org.apache.commons.lang.StringUtils.defaultString ( provider.getAdditionalProperties ( ) . getPluginType ( ) ) ) ; return runtimeProperties ; }