auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( false ) ; getIsShareable ( ) . setEntity ( false ) ; } else { getIsShareable ( ) . setIsChangable ( ( ( ( getVm ( ) ) != null ) && ( getVm ( ) . isDown ( ) ) ) ) ; } }

Target:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( false ) ; getIsShareable ( ) . setEntity ( false ) ; } else { getIsShareable ( ) . setIsChangable ( isEditEnabled ( ) ) ; } }
Source:
public void testAuditLogMacInUseUnplug ( ) { final org.ovirt.engine.core.common.businessentities.network.VmNic iface = org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) ; vmInterfaceManager.auditLogMacInUseUnplug ( iface , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.VM_NAME ) ; final java.util.Map < java.lang.String , java.lang.String > capturedCustomValues = verifyCommonAuditLogFilledProperly ( AuditLogType.MAC_ADDRESS_IS_IN_USE_UNPLUG , iface ) ; org.junit.Assert.assertThat ( capturedCustomValues , org.hamcrest.Matchers.hasEntry ( "vmname" , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.VM_NAME ) ) ; }

Target:
public void testAuditLogMacInUseUnplug ( ) { final org.ovirt.engine.core.common.businessentities.network.VmNic iface = org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) ; vmInterfaceManager.auditLogMacInUseUnplug ( iface , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.VM_NAME ) ; verifyCommonAuditLogFilledProperly ( AuditLogType.MAC_ADDRESS_IS_IN_USE_UNPLUG , iface ) ; org.junit.Assert.assertEquals ( auditLogableCaptor.getValue ( ) . getVmName ( ) , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.VM_NAME ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getStorageDomainId ( ) { switch ( getDisk ( ) . getDiskStorageType ( ) ) { case IMAGE : return getDiskImage ( ) . getStorageIds ( ) . get ( 0 ) ; case CINDER : return getCinderDisk ( ) . getStorageIds ( ) . get ( 0 ) ; } return null ; }

Target:
protected void updateStorageDomains ( final org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getStorageDomainById ( new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { getStorageDomain ( ) . setSelectedItem ( storageDomain ) ; } } ) , getStorageDomainId ( ) ) ; }
Source:
public void reportCompleted ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean success = ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , success ) ; }

Target:
public void reportCompleted ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean success = ( java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAndPause ( ) ) ) && ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , success ) ; }
Source:
private boolean canEditRequired ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { return ( ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel ) ( model ) ) . isAttached ( ) ) && ( ! ( ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel ) ( model ) ) . isManagement ( ) ) ) ; }

Target:
private boolean canEditRequired ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel ) ( model ) ) ; return ( ( clusterNetworkModel.isAttached ( ) ) && ( ! ( clusterNetworkModel.isManagement ( ) ) ) ) && ( ! ( clusterNetworkModel.isExternal ( ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.volumeSnapshotCreate" ) . withOptionalParameter ( "volumeName" , volumeName ) . withParameter ( "snapName" , snapshotName ) . withParameter ( "description" , description ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDelete ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotDelete" ) . withParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( ( getVmId ( ) ) == null ? 0 : getVmId ( ) . hashCode ( ) ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics ) ) { return false ; } org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics other = ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics ) ( obj ) ) ; return ( super . equals ( obj ) ) && ( java.util.Objects.equals ( vmId , other.vmId ) ) ; }
Source:
private void runCommand ( org.ovirt.engine.core.bll.network.dc.InternalImportExternalNetworkCommand < org.ovirt.engine.core.common.action.InternalImportExternalNetworkParameters > command ) { org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( NETWORK_ID , command.getReturnValue ( ) . getActionReturnValue ( ) ) ; }

Target:
private void runCommand ( org.ovirt.engine.core.bll.network.dc.InternalImportExternalNetworkCommand < org.ovirt.engine.core.common.action.InternalImportExternalNetworkParameters > command ) { org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; command.executeCommand ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( NETWORK_ID , command.getReturnValue ( ) . getActionReturnValue ( ) ) ; }
Source:
protected boolean ValidateAdd ( org.ovirt.engine.core.common.EventNotificationMethod eventNotificationMethod , org.ovirt.engine.core.common.businessentities.event_subscriber event_subscriber , org.ovirt.engine.core.common.businessentities.DbUser user ) { java.lang.String tagName = event_subscriber.gettag_name ( ) ; boolean retValue = ValidateNotificationMethod ( eventNotificationMethod , event_subscriber , user ) ; if ( retValue && ( org.apache.commons.lang.StringUtils.isNotEmpty ( tagName ) ) ) { retValue = ValidateTag ( tagName ) ; } return retValue ; }

Target:
protected boolean ValidateAdd ( org.ovirt.engine.core.common.EventNotificationMethod eventNotificationMethod , org.ovirt.engine.core.common.businessentities.event_subscriber event_subscriber , org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.lang.String tagName = event_subscriber.gettag_name ( ) ; boolean retValue = ValidateNotificationMethod ( eventNotificationMethod , event_subscriber , user ) ; if ( retValue && ( org.apache.commons.lang.StringUtils.isNotEmpty ( tagName ) ) ) { retValue = ValidateTag ( tagName ) ; } return retValue ; }
Source:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "id" , getId ( ) ) . append ( "status" , getStatus ( ) ) . append ( "display" , isDisplay ( ) ) . append ( "required" , isRequired ( ) ) . append ( "migration" , isMigration ( ) ) . append ( "management" , isManagement ( ) ) . append ( "gluster" , isGluster ( ) ) . build ( ) ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "id" , getId ( ) ) . append ( "status" , getStatus ( ) ) . append ( "display" , isDisplay ( ) ) . append ( "required" , isRequired ( ) ) . append ( "migration" , isMigration ( ) ) . append ( "management" , isManagement ( ) ) . append ( "gluster" , isGluster ( ) ) . append ( "defaultRoute" , isDefaultRoute ( ) ) . build ( ) ; }
Source:
private void verifyInvalidValueException ( javax.ws.rs.WebApplicationException wae , java.lang.String value , java.lang.String typeName ) { assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; org.ovirt.engine.api.model.Fault fault = ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) ; assertNotNull ( fault ) ; assertEquals ( "Invalid value" , fault.getReason ( ) ) ; assertEquals ( ( ( value + " is not a member of " ) + typeName ) , fault.getDetail ( ) ) ; }

Target:
private void verifyInvalidValueException ( javax.ws.rs.WebApplicationException wae , java.lang.String value , java.lang.String typeName ) { assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; org.ovirt.engine.api.model.Fault fault = ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) ; assertNotNull ( fault ) ; assertEquals ( "Invalid value" , fault.getReason ( ) ) ; assertEquals ( ( ( ( value + " is not a member of " ) + typeName ) + ". Possible values for State are: new, runnable, blocked, waiting, timed_waiting, terminated" ) , fault.getDetail ( ) ) ; }
Source:
public void getSupportedCpuList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String cpuName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > cpuList = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.ServerCpu > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) ) ; return cpuList ; } return null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSupportedCpuList , new org.ovirt.engine.core.common.queries.GetSupportedCpuListParameters ( cpuName ) , aQuery ) ; }

Target:
public void getSupportedCpuList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.ServerCpu > > aQuery , java.lang.String cpuName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSupportedCpuList , new org.ovirt.engine.core.common.queries.GetSupportedCpuListParameters ( cpuName ) , aQuery ) ; }
Source:
public void testAllocateMacFromRequestForStatelessVmWhenReturningToStateInSnapshot ( ) { nicBeingUpdated.setMacAddress ( org.ovirt.engine.core.bll.network.vm.NEW_MAC ) ; updatingNic.setMacAddress ( org.ovirt.engine.core.bll.network.vm.OLD_MAC ) ; mockOriginalSnapshot ( org.ovirt.engine.core.bll.network.vm.OLD_MAC , org.ovirt.engine.core.bll.network.vm.OTHER_MAC ) ; underTest.initMacPoolData ( ) ; org.junit.Assert.assertThat ( ( "New mac value of nic being updated is same as one in snapshot, thus it is already allocated in" + "mac pool and it must not be allocated again." ) , underTest.allocateMacFromRequest ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testAllocateMacFromRequestForStatelessVmWhenReturningToStateInSnapshot ( ) { nicBeingUpdated.setMacAddress ( org.ovirt.engine.core.bll.network.vm.NEW_MAC ) ; updatingNic.setMacAddress ( org.ovirt.engine.core.bll.network.vm.OLD_MAC ) ; mockOriginalSnapshot ( org.ovirt.engine.core.bll.network.vm.OLD_MAC , org.ovirt.engine.core.bll.network.vm.OTHER_MAC ) ; underTest.initMacPoolData ( ) ; org.hamcrest.MatcherAssert.assertThat ( ( "New mac value of nic being updated is same as one in snapshot, thus it is already allocated in" + "mac pool and it must not be allocated again." ) , underTest.allocateMacFromRequest ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
protected void onHide ( ) { super . onHide ( ) ; ( org.ovirt.engine.ui.common.presenter.AbstractPopupPresenterWidget.activePopups ) -- ; }

Target:
protected void onHide ( ) { super . onHide ( ) ; ( org.ovirt.engine.ui.common.presenter.AbstractPopupPresenterWidget.activePopups ) -- ; if ( ( org.ovirt.engine.ui.common.presenter.AbstractPopupPresenterWidget.activePopups ) == 0 ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { org.ovirt.engine.ui.common.utils.ElementTooltipUtils.reapPopupContentTooltips ( ) ; } } ) ; } }
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 getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }

Target:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }
Source:
public org.ovirt.engine.api.model.VmPool populate ( org.ovirt.engine.api.model.VmPool pool , org.ovirt.engine.core.common.businessentities.vm_pools entity ) { if ( ( pool.isSetSize ( ) ) && ( ( pool.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( pool.getName ( ) ) ) ) ; pool.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; pool.getTemplate ( ) . setId ( vm.getvmt_guid ( ) . toString ( ) ) ; } return pool ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM getVM ( org.ovirt.engine.api.model.VmPool pool ) { if ( isFiltered ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.GetVmdataByPoolIdParameters ( asGuid ( pool.getId ( ) ) ) , pool.getId ( ) ) ; } return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( pool.getName ( ) ) ) ) ; }
Source:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( true , false ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( dbFacadeMock ) . getStoragePoolDao ( ) ; setupCpu ( ) ; validateFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }

Target:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; setupCpu ( ) ; validateFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }
Source:
protected void setGetVdsQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , vds ) ; } }

Target:
protected void setGetVdsQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setClusterId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , vds ) ; } }
Source:
public void testGetValue ( ) { org.junit.Assert.assertFalse ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.CinderProviderSupported , "3.5" ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.CinderProviderSupported , "3.6" ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.CinderProviderSupported , "4.0" ) ) ; }

Target:
public void testGetValue ( ) { org.junit.Assert.assertFalse ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.SriovHotPlugSupported , "3.6" ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.SriovHotPlugSupported , "4.0" ) ) ; }
Source:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
private void initStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; }

Target:
private void initStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDao ( ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; }
Source:
public void removeAllIllegalDisks ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImageDao.getAllSnapshotsForVmSnapshot ( snapshotId ) ) { if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL ) ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.removeDiskImage ( diskImage , vmId ) ; } } }

Target:
public void removeAllIllegalDisks ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImageDao.getAllSnapshotsForVmSnapshot ( snapshotId ) ) { if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL ) ) { imagesHandler.removeDiskImage ( diskImage , vmId ) ; } } }
Source:
private com.google.gwt.user.client.ui.IsWidget createAdditionalInfoPanel ( ) { com.google.gwt.user.client.ui.FlowPanel panel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; panel.addStyleName ( PatternflyConstants.PF_LIST_VIEW_ADDITIONAL_INFO ) ; panel.add ( createGeneralAdditionalInfo ( ) ) ; panel.add ( createDisksAdditionalInfo ( ) ) ; panel.add ( createNicsAdditionalInfo ( ) ) ; panel.add ( createAppsAdditionalInfo ( ) ) ; return panel ; }

Target:
private void createAdditionalInfoPanel ( ) { additionalInfoPanel.add ( createGeneralAdditionalInfo ( ) ) ; additionalInfoPanel.add ( createDisksAdditionalInfo ( ) ) ; additionalInfoPanel.add ( createNicsAdditionalInfo ( ) ) ; additionalInfoPanel.add ( createAppsAdditionalInfo ( ) ) ; }
Source:
static void addAddress ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.util.Map < java.lang.String , java.lang.String > addressMap = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( vmDevice.getAddress ( ) ) ; if ( ! ( addressMap.isEmpty ( ) ) ) { struct.put ( VdsProperties.Address , addressMap ) ; } }

Target:
public void buildVmUsbDevices ( ) { buildVmUsbControllers ( ) ; buildVmUsbSlots ( ) ; buildSmartcardDevice ( ) ; }
Source:
public void canDoActionFailsWithDuplicateVolumeName ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getVolume ( 2 , false ) ) . when ( volumeDao ) . getByName ( clusterId , "vol1" ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NAME_ALREADY_EXISTS ) ; }

Target:
public void validateFailsWithDuplicateVolumeName ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getVolume ( 2 , false ) ) . when ( volumeDao ) . getByName ( clusterId , "vol1" ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NAME_ALREADY_EXISTS ) ; }
Source:
private void onForceSave ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; if ( ( confirmationModel != null ) && ( ! ( confirmationModel.validate ( ) ) ) ) { return ; } cancelConfirm ( ) ; getSanStorageModel ( ) . setForce ( true ) ; onSave ( ) ; }

Target:
private void onForceSave ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; if ( ( confirmationModel != null ) && ( ! ( confirmationModel.validate ( ) ) ) ) { return ; } cancelConfirm ( ) ; getSanStorageModelBase ( ) . setForce ( true ) ; onSave ( ) ; }
Source:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void vdsExistWithHigherVersion ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setVdsGroupCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void vdsExistWithHigherVersion ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setClusterCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }
Source:
public boolean isRDPAvailable ( ) { if ( ( rdpAvailable ) == null ) { rdpAvailable = ( clientAgentType.getBrowser ( ) . toLowerCase ( ) . contains ( "explorer" ) ) && ( clientAgentType.getOS ( ) . toLowerCase ( ) . contains ( "windows" ) ) ; com.google.gwt.core.client.GWT.log ( ( "Determining if RDP console is available on current platform, result:" + ( rdpAvailable ) ) ) ; } return rdpAvailable ; }

Target:
public boolean isRDPAvailable ( ) { if ( ( rdpAvailable ) == null ) { rdpAvailable = ( clientAgentType.getBrowser ( ) . toLowerCase ( ) . contains ( "explorer" ) ) && ( isWindowsClient ( ) ) ; com.google.gwt.core.client.GWT.log ( ( "Determining if RDP console is available on current platform, result:" + ( rdpAvailable ) ) ) ; } return rdpAvailable ; }
Source:
public double getDiskSize ( ) { if ( ( diskSize ) == 0 ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : getDiskMap ( ) . values ( ) ) { if ( ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) == ( disk.getDiskStorageType ( ) ) ) { diskSize += ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getSize ( ) ) / ( java.lang.Double.valueOf ( ( ( 1024 * 1024 ) * 1024 ) ) ) ; } } } return diskSize ; }

Target:
public double getDiskSize ( ) { if ( ( diskSize ) == 0 ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : getDiskMap ( ) . values ( ) ) { if ( ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) == ( disk.getDiskStorageType ( ) ) ) { diskSize += ( ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) . getSize ( ) ) / ( java.lang.Double.valueOf ( ( ( 1024 * 1024 ) * 1024 ) ) ) ; } } } return diskSize ; }
Source:
public void delay ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "try to wait for te engine update the host memory and cpu stats" ) ; try { long t = java.lang.Math.max ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( vdsId ) . getLastUpdateElapsed ( ) , java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( org.ovirt.engine.core.common.config.ConfigValues.VdsRefreshRate ) ) ) ; t = java.lang.Math.max ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ThrottlerMaxWaitForVdsUpdateInMillis ) , t ) ; getBlockingQueue ( vdsId ) . poll ( t , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } catch ( java.lang.InterruptedException e ) { } }

Target:
protected final void decreasePendingVm ( org.ovirt.engine.core.common.businessentities.VmStatic vm ) { org.ovirt.engine.core.compat.Guid vdsId = getCurrentVdsId ( ) ; if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "PendingVms for the guest '{}' running on host '{}' was already released, not releasing again" , vm.getName ( ) , vdsId ) ; return ; } lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVm ( vm , vdsId ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; }
Source:
private java.lang.String createSpiceInvocationInfo ( ) { return new org.ovirt.engine.ui.common.view.popup.ConsolePopupView.KeyValueHtmlRowMaker ( constants.auto ( ) , constants.spiceInvokeAuto ( ) ) . append ( constants.nativeClient ( ) , constants.consoleInvokeNative ( ) ) . append ( constants.browserPlugin ( ) , constants.spiceInvokePlugin ( ) ) . append ( constants.spiceHtml5 ( ) , constants.spiceInvokeHtml5 ( ) ) . toString ( ) ; }

Target:
private java.lang.String createSpiceInvocationInfo ( ) { return new org.ovirt.engine.ui.common.view.popup.ConsolePopupView.KeyValueHtmlRowMaker ( org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.auto ( ) , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.spiceInvokeAuto ( ) ) . append ( org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.nativeClient ( ) , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.consoleInvokeNative ( ) ) . append ( org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.browserPlugin ( ) , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.spiceInvokePlugin ( ) ) . append ( org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.spiceHtml5 ( ) , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.spiceInvokeHtml5 ( ) ) . toString ( ) ; }
Source:
public static void getStorageDomainMaxNameLength ( 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 ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . update ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( cluster.getId ( ) , org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; } org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkDAO ( ) . update ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( cluster.getId ( ) , org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; } org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.setSucceeded ( true ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getVmPoolId ( ) ) == null ) { org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig config = org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig.from ( vm.getVmType ( ) , vm.isStateless ( ) , vm.isNextRunConfigurationExists ( ) ) ; return config.getImageResource ( ) ; } else { if ( ! ( vm.isNextRunConfigurationExists ( ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn.resources.manyDesktopsImage ( ) ; } else { return org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn.resources.manyDesktopsChangesImage ( ) ; } } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getVmPoolId ( ) ) == null ) { org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig config = org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig.from ( vm.getVmType ( ) , vm.isStateless ( ) , vm.isNextRunConfigurationExists ( ) ) ; return config.getImageResource ( ) ; } else { return org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn.getPoolVmImageResource ( vm.getVmType ( ) , vm.isNextRunConfigurationExists ( ) ) ; } }
Source:
public void bondWithNoSlaves ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( null ) ; mockExistingIfaces ( bond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , java.util.Collections.< org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > emptyList ( ) ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }

Target:
public void bondWithNoSlaves ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; mockExistingIfaces ( bond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( bond ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }
Source:
public void validateIsoPrefixNameForInitrdAndNullForKernel ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + initrd ) , null ) ; org.junit.Assert.assertEquals ( vm.getinitrd_url ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + initrd ) ) ; org.junit.Assert.assertEquals ( vm.getkernel_url ( ) , null ) ; }

Target:
public void validateIsoPrefixNameForInitrdAndNullForKernel ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + initrd ) , null ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + initrd ) ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , null ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeReplaceBrickStart ( java.lang.String volumeName , java.lang.String existingBrickDir , java.lang.String newBrickDir ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeReplaceBrickStart ( volumeName , existingBrickDir , newBrickDir ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesHealInfoReturnForXmlRpc glusterVolumeHealInfo ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeHealInfo ( volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesHealInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesHealInfoReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void prepareMocks ( ) { vdsBrokerFrontendMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.interfaces.VDSBrokerFrontend.class ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontendMock ) . when ( getQuery ( ) ) . getVdsBroker ( ) ; }

Target:
private void prepareMocks ( ) { vdsBrokerFrontendMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.interfaces.VDSBrokerFrontend.class ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontendMock ) . when ( getQuery ( ) ) . getVdsBroker ( ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageServerConnectionDao ( ) ) . thenReturn ( storageServerConnectionDao ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageServerConnectionLunMapDao ( ) ) . thenReturn ( storageServerConnectionLunMapDao ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDao ( ) ) . thenReturn ( lunDao ) ; }
Source:
public boolean isManagementNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > networkClusters = getNetworkClusterDao ( ) . getAllForNetwork ( networkId ) ; final org.ovirt.engine.core.common.businessentities.network.NetworkCluster managementNetworkCluster = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( networkClusters , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { return networkCluster.isManagement ( ) ; } } ) ; return managementNetworkCluster != null ; }

Target:
public boolean isManagementNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > networkClusters = networkClusterDao.getAllForNetwork ( networkId ) ; final org.ovirt.engine.core.common.businessentities.network.NetworkCluster managementNetworkCluster = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( networkClusters , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { return networkCluster.isManagement ( ) ; } } ) ; return managementNetworkCluster != null ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepSessionList ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStart ( volumeName , remoteHost , remoteVolumeName , userName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }