auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initStoragePool ( ) { storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( command.getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; }

Target:
private void initStoragePool ( ) { storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( command.getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; }
Source:
public void multiQueryValid ( ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryType > queryTypeList = new java.util.ArrayList ( java.util.Arrays.asList ( QueryType.Search , QueryType.Search ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryParametersBase > queryParamsList = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) , new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) ) ) ; underTest.runMultipleQueries ( queryTypeList , queryParamsList ) ; org.mockito.Mockito.verify ( backendLocal , org.mockito.Mockito.times ( 2 ) ) . runQuery ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.QueryType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.QueryParametersBase.class ) ) ; }

Target:
public void multiQueryValid ( ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryType > queryTypeList = new java.util.ArrayList ( java.util.Arrays.asList ( QueryType.Search , QueryType.Search ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryParametersBase > queryParamsList = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) , new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) ) ) ; underTest.runMultipleQueries ( queryTypeList , queryParamsList ) ; org.mockito.Mockito.verify ( backendLocal , org.mockito.Mockito.times ( 2 ) ) . runQuery ( org.mockito.Matchers.any ( ) , org.mockito.Matchers.any ( ) ) ; }
Source:
protected void init ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getNicType ( ) . setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ) ( returnValue ) ) ) ; postNicInit ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getNicTypeList ( getVm ( ) . getOsId ( ) , getClusterCompatibilityVersion ( ) , asyncQuery ) ; }

Target:
protected void init ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getNicType ( ) . setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ) ( returnValue ) ) ) ; postNicInit ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNicTypeList ( getVm ( ) . getOsId ( ) , getClusterCompatibilityVersion ( ) , asyncQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; if ( ( pools != null ) && ( ! ( pools.isEmpty ( ) ) ) ) { pool = pools.get ( 0 ) ; checkVmsDependentOnTemplate ( pool.getId ( ) , getEntity ( ) . getId ( ) ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > pools ) { if ( ( pools != null ) && ( ! ( pools.isEmpty ( ) ) ) ) { pool = pools.get ( 0 ) ; checkVmsDependentOnTemplate ( pool.getId ( ) , getEntity ( ) . getId ( ) ) ; } }
Source:
public final com.google.gwt.safehtml.shared.SafeHtml getValue ( T object ) { java.lang.Integer progressValue = getProgressValue ( object ) ; int progress = ( progressValue != null ) ? progressValue : 0 ; java.lang.String text = getProgressText ( object ) ; java.lang.String color = ( progress < 70 ) ? "#669966" : progress < 95 ? "#FF9900" : "#FF0000" ; return org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.instance ( ) . getApplicationTemplates ( ) . progressBar ( progress , text , color ) ; }

Target:
public final com.google.gwt.safehtml.shared.SafeHtml getValue ( T object ) { java.lang.Integer progressValue = getProgressValue ( object ) ; int progress = ( progressValue != null ) ? progressValue : 0 ; java.lang.String text = getProgressText ( object ) ; java.lang.String color = ( progress < 70 ) ? "#669966" : progress < 95 ? "#FF9900" : "#FF0000" ; return org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.getApplicationTemplates ( ) . progressBar ( progress , text , color ) ; }
Source:
protected < T extends org.ovirt.engine.core.dao.DAO > T getDao ( java.lang.Class < T > daoType ) { T dao = org.ovirt.engine.core.dao.DaoFactory.get ( daoType ) ; if ( dao instanceof org.ovirt.engine.core.dao.BaseDAODbFacade ) { org.ovirt.engine.core.dao.BaseDAODbFacade dbFacadeDAO = ( ( org.ovirt.engine.core.dao.BaseDAODbFacade ) ( dao ) ) ; dbFacadeDAO.setTemplate ( jdbcTemplate ) ; dbFacadeDAO.setDialect ( dbEngineDialect ) ; dbFacadeDAO.setDbFacade ( this ) ; } else { } return dao ; }

Target:
protected < T extends org.ovirt.engine.core.dao.DAO > T getDao ( java.lang.Class < T > daoType ) { T dao = org.ovirt.engine.core.dao.DaoFactory.get ( daoType ) ; if ( dao instanceof org.ovirt.engine.core.dao.BaseDAODbFacade ) { org.ovirt.engine.core.dao.BaseDAODbFacade dbFacadeDAO = ( ( org.ovirt.engine.core.dao.BaseDAODbFacade ) ( dao ) ) ; dbFacadeDAO.setTemplate ( jdbcTemplate ) ; dbFacadeDAO.setDialect ( dbEngineDialect ) ; dbFacadeDAO.setDbFacade ( this ) ; } return dao ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } super . syncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getEntity ( ) ) ) ; super . syncSearch ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters ( template.getId ( ) ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } super . syncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getEntity ( ) ) ) ; super . syncSearch ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( template.getId ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickModel volumeBrickModel = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hostList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; java.util.Iterator < org.ovirt.engine.core.common.businessentities.VDS > iterator = hostList.iterator ( ) ; while ( iterator.hasNext ( ) ) { if ( ( iterator.next ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { iterator.remove ( ) ; } } volumeBrickModel.setHostList ( hostList ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostList ) { java.util.Iterator < org.ovirt.engine.core.common.businessentities.VDS > iterator = hostList.iterator ( ) ; while ( iterator.hasNext ( ) ) { if ( ( iterator.next ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { iterator.remove ( ) ; } } volumeBrickModel.setHostList ( hostList ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getDownloadHeaders ( ) { java.util.HashMap < java.lang.String , java.lang.String > httpHeaders = new java.util.HashMap < > ( ) ; if ( ( getTokenProvider ( ) ) != null ) { httpHeaders.put ( "X-Auth-Token" , getTokenProvider ( ) . getToken ( ) ) ; } return httpHeaders ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getDownloadHeaders ( ) { java.util.Map < java.lang.String , java.lang.String > httpHeaders = new java.util.HashMap < > ( ) ; if ( ( getTokenProvider ( ) ) != null ) { httpHeaders.put ( "X-Auth-Token" , getTokenProvider ( ) . getToken ( ) ) ; } return httpHeaders ; }
Source:
protected void assertNotAllDone ( org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState ) { org.junit.Assert.assertFalse ( flowState.isAllDone ( ) ) ; org.mockito.Mockito.verify ( model ) . startProgress ( org.mockito.Matchers.any ( java.lang.String.class ) ) ; org.mockito.Mockito.verify ( model , org.mockito.Mockito.never ( ) ) . stopProgress ( ) ; }

Target:
protected void assertNotAllDone ( org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState ) { org.junit.Assert.assertFalse ( flowState.isAllDone ( ) ) ; org.mockito.Mockito.verify ( model ) . startProgress ( ) ; org.mockito.Mockito.verify ( model , org.mockito.Mockito.never ( ) ) . stopProgress ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult memoryOptimizationConfiguration ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_GROUP_TO_ALLOW_MEMORY_OPTIMIZATION_YOU_MUST_ALLOW_KSM_OR_BALLOONING ) . when ( ( ( ( ( cluster.getMaxVdsMemoryOverCommit ( ) ) > 100 ) || ( ( cluster.getMaxVdsMemoryOverCommit ( ) ) <= 0 ) ) && ( ! ( ( cluster.isEnableKsm ( ) ) || ( cluster.isEnableBallooning ( ) ) ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult memoryOptimizationConfiguration ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_GROUP_TO_ALLOW_MEMORY_OPTIMIZATION_YOU_MUST_ALLOW_KSM_OR_BALLOONING ) . when ( ( ( ( cluster.getMaxVdsMemoryOverCommit ( ) ) > 100 ) && ( ! ( ( cluster.isEnableKsm ( ) ) || ( cluster.isEnableBallooning ( ) ) ) ) ) ) ; }
Source:
public void testGetStorageDomainIdWithPermissions ( ) { mockStoragePoolDAO ( new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDAO storageDomainDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.when ( storageDomainDAOMock.getIsoStorageDomainIdForPool ( getQueryParameters ( ) . getStoragePoolId ( ) ) ) . thenReturn ( storageDomainId ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStorageDomainDao ( ) ) . thenReturn ( storageDomainDAOMock ) ; org.junit.Assert.assertEquals ( "wrong storage domain id" , storageDomainId , getQuery ( ) . getStorageDomainId ( ) ) ; }

Target:
public void testGetStorageDomainIdWithPermissions ( ) { mockStoragePoolDAO ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDAO storageDomainDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.when ( storageDomainDAOMock.getIsoStorageDomainIdForPool ( getQueryParameters ( ) . getStoragePoolId ( ) ) ) . thenReturn ( storageDomainId ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStorageDomainDao ( ) ) . thenReturn ( storageDomainDAOMock ) ; org.junit.Assert.assertEquals ( "wrong storage domain id" , storageDomainId , getQuery ( ) . getStorageDomainId ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( org.ovirt.engine.core.compat.Guid diskId , org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( diskId , vmId ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 0 , null , true , true , false , "" , null , null , null ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( org.ovirt.engine.core.compat.Guid diskId , org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( diskId , vmId ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 0 , null , true , true , null , "" , null , null , null ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NIC device ) { validateParameters ( device , getRequiredAddFields ( ) ) ; javax.ws.rs.core.Response response = performCreate ( addAction , getAddParameters ( map ( device ) , device ) , getEntityIdResolver ( device.getName ( ) ) ) ; if ( response != null ) { java.lang.Object entity = response.getEntity ( ) ; if ( entity != null ) { org.ovirt.engine.api.model.NIC nic = ( ( org.ovirt.engine.api.model.NIC ) ( entity ) ) ; setNetworkId ( nic ) ; } } return response ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NIC device ) { validateParameters ( device , getRequiredAddFields ( ) ) ; return performCreate ( addAction , getAddParameters ( map ( device ) , device ) , getEntityIdResolver ( device.getName ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase restoreCinderDisk ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk , org.ovirt.engine.core.common.action.ImagesContainterParametersBase params ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RestoreFromCinderSnapshot , params , org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.cloneContextAndDetachFromParent ( ) ) ; try { return future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { e.printStackTrace ( ) ; log.error ( "Error restoring snapshot" ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase restoreCinderDisk ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk , org.ovirt.engine.core.common.action.ImagesContainterParametersBase params ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RestoreFromCinderSnapshot , params , org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.cloneContextAndDetachFromParent ( ) ) ; try { return future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { log.error ( "Error restoring snapshot" , e ) ; } return null ; }
Source:
public void getVdsSwallowsException ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; b.setVds ( vds ) ; b.setVdsId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }

Target:
public void getVdsSwallowsException ( ) { final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; b.setVds ( vds ) ; b.setVdsId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }
Source:
private void setUpGetBallooningExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , true ) ; } }

Target:
private void setUpGetBallooningExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , true ) ; } }
Source:
public void liveMigrateDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( ( ( command.getLiveMigrateVmDisksParametersList ( ) . size ( ) ) == 1 ) ) ; }

Target:
public void liveMigrateDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( 1 , command.getLiveMigrateVmDisksParametersList ( ) . size ( ) ) ; }
Source:
public void validateFailsOnNullCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( null ) ) ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID.toString ( ) ) ) ; }

Target:
public void validateFailsOnNullCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( null ) , null ) ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID.toString ( ) ) ) ; }
Source:
public static void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 java.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 java.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected void onSelectedItemChanging ( java.lang.Object newValue , java.lang.Object oldValue ) { super . onSelectedItemChanging ( newValue , oldValue ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel oldModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( oldValue ) ) ; if ( oldValue != null ) { oldModel.setIsEmpty ( false ) ; oldModel.setItems ( null ) ; org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel listWithDetails = ( ( org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ( ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ? oldValue : null ) ) ; if ( listWithDetails != null ) { listWithDetails.setActiveDetailModel ( null ) ; } oldModel.stopRefresh ( ) ; } }

Target:
protected void onSelectedItemChanging ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel newValue , org.ovirt.engine.ui.uicommonweb.models.SearchableListModel oldValue ) { super . onSelectedItemChanging ( newValue , oldValue ) ; if ( oldValue != null ) { oldValue.setIsEmpty ( false ) ; oldValue.setItems ( null ) ; org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel listWithDetails = ( ( org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ( ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ? oldValue : null ) ) ; if ( listWithDetails != null ) { listWithDetails.setActiveDetailModel ( null ) ; } oldValue.stopRefresh ( ) ; } }
Source:
public void vmTemplateIdRefWithVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; b.setVm ( v ) ; final org.ovirt.engine.core.compat.Guid g = b.getVmTemplateIdRef ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }

Target:
public void vmTemplateIdRefWithVm ( ) { final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; b.setVm ( v ) ; final org.ovirt.engine.core.compat.Guid g = b.getVmTemplateIdRef ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getGuidListFromStringArray ( java.util.List < java.lang.String > strings ) { java.util.ArrayList < org.ovirt.engine.core.compat.Guid > guidList = new java.util.ArrayList < > ( ) ; if ( ( strings != null ) && ( ! ( strings.isEmpty ( ) ) ) ) { for ( java.lang.String guidString : strings ) { guidList.add ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( guidString ) ) ; } } return guidList ; }

Target:
private static java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getGuidListFromStringArray ( java.util.List < java.lang.String > strings ) { java.util.ArrayList < org.ovirt.engine.core.compat.Guid > guidList = new java.util.ArrayList < > ( ) ; if ( ( strings != null ) && ( ! ( strings.isEmpty ( ) ) ) ) { for ( java.lang.String guidString : strings ) { guidList.add ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( guidString ) ) ; } } return guidList ; }
Source:
protected void RemoveChildren ( org.ovirt.engine.core.compat.Guid snapshot ) { java.util.List < org.ovirt.engine.core.compat.Guid > children = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; GetImageChildren ( snapshot , children ) ; java.util.Collections.reverse ( children ) ; for ( org.ovirt.engine.core.compat.Guid child : children ) { RemoveSnapshot ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImageDao ( ) . getSnapshotById ( child ) ) ; } }

Target:
private void RemoveChildren ( org.ovirt.engine.core.compat.Guid snapshot ) { java.util.List < org.ovirt.engine.core.compat.Guid > children = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; GetImageChildren ( snapshot , children ) ; java.util.Collections.reverse ( children ) ; for ( org.ovirt.engine.core.compat.Guid child : children ) { RemoveSnapshot ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImageDao ( ) . getSnapshotById ( child ) ) ; } }
Source:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < > ( ) ; filterValue.add ( "true" ) ; org.easymock.EasyMock.reset ( httpHeaders ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . andReturn ( filterValue ) ; setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; java.util.List < org.ovirt.engine.api.model.Network > networks = getCollection ( ) ; java.util.Collections.sort ( networks , new org.ovirt.engine.api.restapi.resource.BackendNetworksResourceTest.NetworkIdComparator ( ) ) ; verifyCollection ( networks ) ; }

Target:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < > ( ) ; filterValue.add ( "true" ) ; org.mockito.Mockito.reset ( httpHeaders ) ; org.mockito.Mockito.when ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . thenReturn ( filterValue ) ; setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; java.util.List < org.ovirt.engine.api.model.Network > networks = getCollection ( ) ; java.util.Collections.sort ( networks , new org.ovirt.engine.api.restapi.resource.BackendNetworksResourceTest.NetworkIdComparator ( ) ) ; verifyCollection ( networks ) ; }
Source:
public void testParamsUpdated ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage readyImage = initReadyImageForUpload ( ) ; transferImageCommand.handleImageIsReadyForTransfer ( ) ; org.junit.Assert.assertTrue ( transferImageCommand.getParameters ( ) . getStorageDomainId ( ) . equals ( readyImage.getStorageIds ( ) . get ( 0 ) ) ) ; org.junit.Assert.assertTrue ( ( ( transferImageCommand.getParameters ( ) . getTransferSize ( ) ) == ( readyImage.getSize ( ) ) ) ) ; }

Target:
public void testParamsUpdated ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage readyImage = initReadyImageForUpload ( ) ; transferImageCommand.handleImageIsReadyForTransfer ( ) ; org.junit.Assert.assertEquals ( transferImageCommand.getParameters ( ) . getStorageDomainId ( ) , readyImage.getStorageIds ( ) . get ( 0 ) ) ; org.junit.Assert.assertEquals ( transferImageCommand.getParameters ( ) . getTransferSize ( ) , readyImage.getSize ( ) ) ; }
Source:
public void modifiedAttachmentNotRemovedAttachmentModifiedButNotRemovedValid ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( params ) . setHost ( host ) . build ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment modifiedAttachment = createNetworkAttachment ( new org.ovirt.engine.core.common.businessentities.network.Network ( ) ) ; org.junit.Assert.assertThat ( validator.modifiedAttachmentNotRemoved ( modifiedAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void modifiedAttachmentNotRemovedAttachmentModifiedButNotRemovedValid ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . build ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment modifiedAttachment = createNetworkAttachment ( new org.ovirt.engine.core.common.businessentities.network.Network ( ) ) ; org.junit.Assert.assertThat ( validator.modifiedAttachmentNotRemoved ( modifiedAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > getDisksDummiesForStorageAllocations ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > originalDisks ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskDummies = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : originalDisks ) { org.ovirt.engine.core.common.businessentities.DiskImage clone = org.ovirt.engine.core.common.businessentities.DiskImage.copyOf ( diskImage ) ; clone.setVolumeType ( VolumeType.Sparse ) ; clone.setvolumeFormat ( VolumeFormat.COW ) ; diskDummies.add ( clone ) ; } return diskDummies ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getDisksDummiesForStorageAllocations ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > originalDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskDummies = new java.util.ArrayList ( originalDisks.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : originalDisks ) { org.ovirt.engine.core.common.businessentities.DiskImage clone = org.ovirt.engine.core.common.businessentities.DiskImage.copyOf ( diskImage ) ; clone.setVolumeType ( VolumeType.Sparse ) ; clone.setvolumeFormat ( VolumeFormat.COW ) ; diskDummies.add ( clone ) ; } return diskDummies ; }
Source:
public void doParse_unhandledFieldTypeRecursion ( ) throws com.google.gwt.core.ext.UnableToCompleteException { java.util.Set < ? extends com.google.gwt.core.ext.typeinfo.JClassType > ownerTypeParentFieldTypeSubField1TypeFlattenedSupertypeHierarchy = new java.util.HashSet < com.google.gwt.core.ext.typeinfo.JClassType > ( java.util.Arrays.asList ( ownerTypeParentFieldTypeSubField1Type ) ) ; org.mockito.Mockito.doReturn ( ownerTypeParentFieldTypeSubField1TypeFlattenedSupertypeHierarchy ) . when ( ownerTypeParentFieldTypeSubField1Type ) . getFlattenedSupertypeHierarchy ( ) ; org.mockito.Mockito.when ( ownerTypeParentFieldTypeSubField1Type.getFields ( ) ) . thenReturn ( new com.google.gwt.core.ext.typeinfo.JField [ ] { ownerTypeParentField } ) ; tested.doParse ( ownerType , new java.util.ArrayList < com.google.gwt.core.ext.typeinfo.JClassType > ( ) , "." , "IdPrefix" ) ; }

Target:
public void doParse_unhandledFieldTypeRecursion ( ) throws com.google.gwt.core.ext.UnableToCompleteException { java.util.Set < ? extends com.google.gwt.core.ext.typeinfo.JClassType > ownerTypeParentFieldTypeSubField1TypeFlattenedSupertypeHierarchy = new java.util.HashSet ( java.util.Arrays.asList ( ownerTypeParentFieldTypeSubField1Type ) ) ; org.mockito.Mockito.doReturn ( ownerTypeParentFieldTypeSubField1TypeFlattenedSupertypeHierarchy ) . when ( ownerTypeParentFieldTypeSubField1Type ) . getFlattenedSupertypeHierarchy ( ) ; org.mockito.Mockito.when ( ownerTypeParentFieldTypeSubField1Type.getFields ( ) ) . thenReturn ( new com.google.gwt.core.ext.typeinfo.JField [ ] { ownerTypeParentField } ) ; tested.doParse ( ownerType , new java.util.ArrayList < com.google.gwt.core.ext.typeinfo.JClassType > ( ) , "." , "IdPrefix" ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetErrataForVm , org.ovirt.engine.core.common.queries.GetErrataCountsParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getErrataData ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetErrataForVm , org.ovirt.engine.core.common.queries.GetErrataCountsParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getErrataData ( ) , failure ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.queryType , org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.queryParams , new java.lang.String [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.parentIdName } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.PARENT_GUID.toString ( ) } , org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.setUpTags ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.queryType , org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.queryParams , new java.lang.String [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.parentIdName } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.PARENT_GUID.toString ( ) } , org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.setUpTags ( ) , failure ) ; control.replay ( ) ; }
Source:
private boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( org.ovirt.engine.core.bll.RestartVdsCommand.isInternalExecution ( ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getName ( ) , AuditLogType.USER_VDS_RESTART.name ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addCanDoActionMessage ( VdcBllMessages.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.RestartVdsCommand.addCanDoActionMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }

Target:
protected boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( org.ovirt.engine.core.bll.RestartVdsCommand.isInternalExecution ( ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getName ( ) , AuditLogType.USER_VDS_RESTART.name ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addCanDoActionMessage ( VdcBllMessages.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.RestartVdsCommand.addCanDoActionMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }
Source:
protected org.ovirt.engine.api.model.Vm deprecatedPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; parent.addInlineDetails ( details , model ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity , uriInfo ) ; } parent.setPayload ( model ) ; parent.setCertificateInfo ( model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Vm deprecatedPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; parent.addInlineDetails ( details , model ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } parent.setPayload ( model ) ; parent.setCertificateInfo ( model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; return model ; }
Source:
private com.google.gwt.user.client.rpc.XsrfToken extractTokenFromRequest ( ) { java.util.List < java.lang.String > header = java.util.Collections.list ( getThreadLocalRequest ( ) . getHeaders ( XsrfRpcRequestBuilder.XSRF_TOKEN_HEADER ) ) ; com.google.gwt.user.client.rpc.XsrfToken result = null ; if ( ( header != null ) && ( ( header.size ( ) ) == 1 ) ) { result = new com.google.gwt.user.client.rpc.XsrfToken ( header.get ( 0 ) ) ; } return result ; }

Target:
private com.google.gwt.user.client.rpc.XsrfToken extractTokenFromRequest ( ) { java.util.List < java.lang.String > header = java.util.Collections.list ( getThreadLocalRequest ( ) . getHeaders ( XsrfRpcRequestBuilder.XSRF_TOKEN_HEADER ) ) ; com.google.gwt.user.client.rpc.XsrfToken result = null ; if ( ( header.size ( ) ) == 1 ) { result = new com.google.gwt.user.client.rpc.XsrfToken ( header.get ( 0 ) ) ; } return result ; }
Source:
public void canDoActionThinProvisioningSpaceCheckSucceeds ( ) throws java.lang.Exception { final int availableSize = 6 ; final int usedSize = 4 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domains = mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionThinProvisioningSpaceCheckSucceeds ( ) throws java.lang.Exception { final int availableSize = 6 ; final int usedSize = 4 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.VDS vds = org.ovirt.engine.core.vdsbroker.irsbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( this . getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getVdsSpmId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.RemoveIrsProxy ( ) ; }

Target:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( this . getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getVdsSpmId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.RemoveIrsProxy ( ) ; }
Source:
protected void executeCommand ( ) { int missingDiskCount = getMissingDiskCount ( ) ; if ( missingDiskCount <= 0 ) { setOvfUpdateStep ( OvfUpdateStep.OVF_UPLOAD ) ; updateOvfStoreContent ( ) ; } else { setOvfUpdateStep ( OvfUpdateStep.OVF_STORES_CREATION ) ; createOvfStoreDisks ( getMissingDiskCount ( ) ) ; } org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { int missingDiskCount = getMissingDiskCount ( ) ; if ( missingDiskCount <= 0 ) { setOvfUpdateStep ( OvfUpdateStep.OVF_UPLOAD ) ; updateOvfStoreContent ( ) ; org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( true ) ; } else { setOvfUpdateStep ( OvfUpdateStep.OVF_STORES_CREATION ) ; org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( createOvfStoreDisks ( getMissingDiskCount ( ) ) ) ; } }
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.setIsChangeable ( true ) ; setEnableSearchHost ( true ) ; }

Target:
public void onSuccess ( 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.setIsChangeable ( true ) ; setEnableSearchHost ( true ) ; }
Source:
private static void addSoundCard ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Version vdsGroupCompatibilityVersion ) { java.lang.String soundDevice = org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilderBase.getSoundDevice ( vmBase , vdsGroupCompatibilityVersion ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vmBase.getId ( ) ) , VmDeviceGeneralType.SOUND , org.ovirt.engine.core.common.utils.VmDeviceType.getSoundDeviceType ( soundDevice ) , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , true ) ; }

Target:
private static void addSoundCard ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Version vdsGroupCompatibilityVersion ) { java.lang.String soundDevice = org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilderBase.getSoundDevice ( vmBase , vdsGroupCompatibilityVersion ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vmBase.getId ( ) ) , VmDeviceGeneralType.SOUND , org.ovirt.engine.core.common.utils.VmDeviceType.getSoundDeviceType ( soundDevice ) , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , true , null ) ; }
Source:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isInternal = getIsInternal ( ) . getEntity ( ) ; if ( isInternal ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getcompatibility_version ( ) . 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 ) { boolean isInternal = getIsInternal ( ) . getEntity ( ) ; if ( isInternal ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }
Source:
private java.lang.String parseBalanceResults ( java.lang.Object result ) { if ( ( result == null ) || ( ! ( result instanceof java.lang.Object [ ] ) ) ) { java.lang.System.out.println ( "balance error" ) ; } java.lang.Object [ ] castedResult = ( ( java.lang.Object [ ] ) ( result ) ) ; if ( ( castedResult.length ) != 1 ) { java.lang.System.out.println ( "got more then one vm to balance" ) ; } java.lang.String retValue = "Got balance vm:\n" + ( castedResult [ 0 ] . toString ( ) ) ; return retValue ; }

Target:
private java.lang.String parseBalanceResults ( java.lang.Object result ) { if ( ( result == null ) || ( ! ( result instanceof java.lang.Object [ ] ) ) ) { java.lang.System.out.println ( "balance error" ) ; } java.lang.Object [ ] castedResult = ( ( java.lang.Object [ ] ) ( result ) ) ; if ( ( castedResult.length ) != 1 ) { java.lang.System.out.println ( "got more then one vm to balance" ) ; } return castedResult [ 0 ] . toString ( ) ; }
Source:
private static final java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > filterProvidersByProvidedType ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > source , final org.ovirt.engine.core.common.VdcObjectType type ) { return org.ovirt.engine.ui.uicommonweb.Linq.where ( source , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.Provider > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.Provider provider ) { return provider.getType ( ) . getProvidedTypes ( ) . contains ( type ) ; } } ) ; }

Target:
public static final java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > filterProvidersByProvidedType ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > source , final org.ovirt.engine.core.common.VdcObjectType type ) { return org.ovirt.engine.ui.uicommonweb.Linq.where ( source , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.Provider > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.Provider provider ) { return provider.getType ( ) . getProvidedTypes ( ) . contains ( type ) ; } } ) ; }