auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void logToAudit ( ) { if ( isPolicyResetMessage ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerCommand.getReturnStatus ( ) . message ) ) { return ; } org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( vds.getId ( ) ) ) ; auditLogableBase.setVds ( vds ) ; auditLogableBase.addCustomValue ( "message" , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerCommand.getReturnStatus ( ) . message ) ; auditLogDirector.log ( auditLogableBase , AuditLogType.VDS_BROKER_COMMAND_FAILURE ) ; }

Target:
protected void logToAudit ( ) { if ( isPolicyResetMessage ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerCommand.getReturnStatus ( ) . message ) ) { return ; } org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( vds.getId ( ) ) ) ; auditLogableBase.setVds ( vds ) ; auditLogableBase.addCustomValue ( "CommandName" , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerCommand.getCommandName ( ) ) ; auditLogableBase.addCustomValue ( "message" , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerCommand.getReturnStatus ( ) . message ) ; auditLogDirector.log ( auditLogableBase , AuditLogType.VDS_BROKER_COMMAND_FAILURE ) ; }
Source:
public void migrateVMs ( java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.Guid > > list ) { for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.Guid > pair : list ) { org.ovirt.engine.core.common.action.MigrateVmToServerParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmToServerParameters ( false , pair.getFirst ( ) , pair.getSecond ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.MigrateVmToServer , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; } }

Target:
public void migrateVM ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > initialHosts , org.ovirt.engine.core.compat.Guid vmToMigrate ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vmToMigrate ) ; parameters.setInitialHosts ( initialHosts ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.MigrateVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
public void testList_LimitResults_BadFormat ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( true ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.Tag > results = getCollection ( ) ; assertNotNull ( collection ) ; assertEquals ( 4 , results.size ( ) ) ; }

Target:
public void testList_LimitResults_BadFormat ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( true ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , null ) ; control.replay ( ) ; collection.setUriInfo ( uriInfo ) ; getCollection ( ) ; fail ( "Expected WebFaultException" ) ; }
Source:
private void setUpParentExpectations ( ) { org.ovirt.engine.api.restapi.resource.aaa.BackendDomainUsersResource parent = control.createMock ( org.ovirt.engine.api.restapi.resource.aaa.BackendDomainUsersResource.class ) ; org.ovirt.engine.api.model.Domain domain = new org.ovirt.engine.api.model.Domain ( ) ; domain.setName ( org.ovirt.engine.api.restapi.resource.aaa.DOMAIN ) ; org.easymock.EasyMock.expect ( parent.getDirectory ( ) ) . andReturn ( domain ) . anyTimes ( ) ; resource.setParent ( parent ) ; }

Target:
private void setUpParentExpectations ( ) { org.ovirt.engine.api.restapi.resource.aaa.BackendDomainUsersResource parent = org.mockito.Mockito.mock ( org.ovirt.engine.api.restapi.resource.aaa.BackendDomainUsersResource.class ) ; org.ovirt.engine.api.model.Domain domain = new org.ovirt.engine.api.model.Domain ( ) ; domain.setName ( org.ovirt.engine.api.restapi.resource.aaa.DOMAIN ) ; org.mockito.Mockito.when ( parent.getDirectory ( ) ) . thenReturn ( domain ) ; resource.setParent ( parent ) ; }
Source:
private void writeDoc ( org.ovirt.api.metamodel.concepts.Concept concept ) { java.lang.String doc = concept.getDoc ( ) ; if ( doc != null ) { writer.writeElement ( "doc" , doc ) ; } }

Target:
private void writeDoc ( org.ovirt.api.metamodel.concepts.Concept concept ) { java.lang.String doc = concept.getDoc ( ) ; if ( doc != null ) { writer.writeElement ( "doc" , doc ) ; java.lang.String html = htmlGenerator.toHtml ( doc ) ; if ( html != null ) { writer.writeElement ( "html" , html ) ; } } }
Source:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public void loadVmsFromXen ( ) { clearProblem ( ) ; if ( ! ( validateXenConfiguration ( ) ) ) { return ; } org.ovirt.engine.core.compat.Guid proxyId = ( ( getXenProxyHosts ( ) . getSelectedItem ( ) ) != null ) ? getXenProxyHosts ( ) . getSelectedItem ( ) . getId ( ) : null ; loadVMsFromExternalProvider ( OriginType.XEN , getXenUri ( ) . getEntity ( ) , "" , "" , proxyId ) ; }

Target:
public void loadVmsFromXen ( ) { clearForLoad ( ) ; if ( ! ( validateXenConfiguration ( ) ) ) { return ; } org.ovirt.engine.core.compat.Guid proxyId = ( ( getXenProxyHosts ( ) . getSelectedItem ( ) ) != null ) ? getXenProxyHosts ( ) . getSelectedItem ( ) . getId ( ) : null ; loadVMsFromExternalProvider ( OriginType.XEN , getXenUri ( ) . getEntity ( ) , "" , "" , proxyId ) ; }
Source:
private void runAndAssertCanDoActionSuccess ( ) { boolean canDoAction = command.canDoAction ( ) ; java.lang.System.out.println ( command.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; org.junit.Assert.assertTrue ( canDoAction ) ; }

Target:
public void canDoActionSucceedsWithForceOption ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , true ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void testExecuteQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.Role role = new org.ovirt.engine.core.common.businessentities.Role ( ) ; role.setName ( "test role" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Role > result = java.util.Collections.singletonList ( role ) ; org.mockito.Mockito.when ( roleDaoMock.getAll ( ) ) . thenReturn ( result ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( "Wrong roles returned" , result , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testExecuteQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.Role role = new org.ovirt.engine.core.common.businessentities.Role ( ) ; role.setName ( "test role" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Role > result = java.util.Collections.singletonList ( role ) ; org.mockito.Mockito.when ( roleDaoMock.getAll ( ) ) . thenReturn ( result ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( result , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) , "Wrong roles returned" ) ; }
Source:
private static org.ovirt.engine.core.compat.Guid getVmToAttach ( org.ovirt.engine.core.compat.NGuid poolId ) { org.ovirt.engine.core.compat.Guid vmGuid = org.ovirt.engine.core.compat.Guid.Empty ; vmGuid = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getPrestartedVmToAttach ( poolId ) ; if ( ( vmGuid == null ) || ( Guid.Empty.equals ( vmGuid ) ) ) { vmGuid = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getNonPrestartedVmToAttach ( poolId ) ; } return vmGuid ; }

Target:
private org.ovirt.engine.core.compat.Guid getVmToAttach ( org.ovirt.engine.core.compat.NGuid poolId ) { if ( ( vmToAttach ) == null ) { org.ovirt.engine.core.compat.Guid vmGuid = getPrestartedVmToAttach ( poolId ) ; if ( ( vmGuid == null ) || ( Guid.Empty.equals ( vmGuid ) ) ) { vmGuid = getNonPrestartedVmToAttach ( poolId ) ; } vmToAttach = vmGuid ; } return vmToAttach ; }
Source:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( ( ( ( "CREATIONDATE" . equals ( fieldName ) ) || ( "SIZE" . equals ( fieldName ) ) ) || ( "ACTUAL_SIZE" . equals ( fieldName ) ) ) || ( "PROVISIONED_SIZE" . equals ( fieldName ) ) ) { return BiggerOrSmallerRelationAutoCompleter.INTSANCE ; } else if ( "NUMBER_OF_VMS" . equals ( fieldName ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }

Target:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( ( ( ( "CREATIONDATE" . equals ( fieldName ) ) || ( "SIZE" . equals ( fieldName ) ) ) || ( "ACTUAL_SIZE" . equals ( fieldName ) ) ) || ( "PROVISIONED_SIZE" . equals ( fieldName ) ) ) { return BiggerOrSmallerRelationAutoCompleter.INSTANCE ; } else if ( "NUMBER_OF_VMS" . equals ( fieldName ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }
Source:
private java.lang.Object getVmsFromExternalProvider ( ) { try { return runVdsCommand ( VDSCommandType.GetVmsFromExternalProvider , buildGetRemoteVmsInfoParameters ( ) ) . getReturnValue ( ) ; } catch ( java.lang.RuntimeException e ) { if ( ! ( e instanceof java.lang.IllegalArgumentException ) ) { logFailureToGetVms ( ) ; } throw e ; } }

Target:
private java.lang.Object getVmsFromExternalProvider ( ) { try { if ( ( isGetNamesOfVmsFromExternalProviderSupported ( ) ) && ( ( org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getNamesOfVms ( ) ) == null ) ) { return runVdsCommand ( VDSCommandType.GetVmsNamesFromExternalProvider , buildGetRemoteVmsInfoParameters ( ) ) . getReturnValue ( ) ; } else { return runVdsCommand ( VDSCommandType.GetVmsFullInfoFromExternalProvider , buildGetRemoteVmsInfoParameters ( ) ) . getReturnValue ( ) ; } } catch ( java.lang.RuntimeException e ) { if ( ! ( e instanceof java.lang.IllegalArgumentException ) ) { logFailureToGetVms ( ) ; } throw e ; } }
Source:
private void runOnce ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.AsyncQuery getVmInitQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getVmInitQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel runOnceModel = new org.ovirt.engine.ui.uicommonweb.models.vms.WebadminRunOnceModel ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( result ) ) , org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.this ) ; setWindow ( runOnceModel ) ; runOnceModel.init ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmById ( getVmInitQuery , vm.getId ( ) ) ; }

Target:
private void runOnce ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.AsyncQuery getVmInitQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getVmInitQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel runOnceModel = new org.ovirt.engine.ui.uicommonweb.models.vms.WebadminRunOnceModel ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( result ) ) , org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.this ) ; setWindow ( runOnceModel ) ; runOnceModel.init ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmById ( getVmInitQuery , vm.getId ( ) ) ; }
Source:
private void buildExclusiveLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsDiskPluggedTo ) { if ( newDisk.isBoot ( ) ) { exclusiveLockMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsDiskPluggedTo ) { exclusiveLockMap.put ( vm.getId ( ) . toString ( ) , LockMessagesMatchUtil.VM_DISK_BOOT ) ; } } }

Target:
private void buildExclusiveLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsDiskPluggedTo ) { if ( newDisk.isBoot ( ) ) { exclusiveLockMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsDiskPluggedTo ) { exclusiveLockMap.put ( vm.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_DISK_BOOT , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } } }
Source:
private org.ovirt.engine.ui.uicommonweb.action.UiAction unlabelNics ( java.util.List < org.ovirt.engine.core.common.action.LabelNicParameters > removedLabelsParameters ) { org.ovirt.engine.ui.uicommonweb.action.UiVdcAction uiVdcAction = new org.ovirt.engine.ui.uicommonweb.action.UiVdcAction ( org.ovirt.engine.core.common.action.VdcActionType.UnlabelNic , removedLabelsParameters.get ( 0 ) , this , true ) ; int size = removedLabelsParameters.size ( ) ; if ( size == 1 ) { return uiVdcAction ; } else { return uiVdcAction.then ( unlabelNics ( removedLabelsParameters.subList ( 1 , size ) ) ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getExistingAttachmentByNetworkId ( org.ovirt.engine.core.compat.Guid networkId ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingNetworkAttachment = new org.ovirt.engine.core.common.utils.MapNetworkAttachments ( existingNetworkAttachments ) . byNetworkId ( ) . get ( networkId ) ; return existingNetworkAttachment ; }
Source:
private static int setNetworkBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isBridge ( device ) ) { if ( device.getIsPlugged ( ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } } } return bootOrder ; }

Target:
private static int setNetworkBootOrder ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice pluggedInterface : org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.sortInterfacesByName ( vm , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.getPluggedInterfaces ( devices ) ) ) { pluggedInterface.setBootOrder ( ( ++ bootOrder ) ) ; } return bootOrder ; }
Source:
private void updateStorageSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType ) { for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : storageModel.getItems ( ) ) { if ( ( ( model.getType ( ) ) == storageType ) && ( ( model.getRole ( ) ) == domainType ) ) { storageModel.setSelectedItem ( model ) ; break ; } } }

Target:
private void updateStorageItem ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel ) { storageModel.updateCurrentStorageItem ( ) ; }
Source:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }

Target:
public void getClusterNetworkList ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.storage_pool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
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 ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; if ( pool != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getStorageDomainList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }
Source:
public void syncWithBackend ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool dc = getSelectedDc ( ) ; if ( dc == null ) { return ; } boolean isSupportBridgesReportByVDSM = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.SupportBridgesReportByVDSM , dc.getcompatibility_version ( ) . toString ( ) ) ) ) ; setSupportBridgesReportByVDSM ( isSupportBridgesReportByVDSM ) ; boolean isMTUOverrideSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MTUOverrideSupported , dc.getcompatibility_version ( ) . toString ( ) ) ) ) ; setMTUOverrideSupported ( isMTUOverrideSupported ) ; }

Target:
public void syncWithBackend ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool dc = getSelectedDc ( ) ; if ( dc == null ) { return ; } boolean isSupportBridgesReportByVDSM = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.SupportBridgesReportByVDSM , dc.getcompatibility_version ( ) . toString ( ) ) ) ) ; setSupportBridgesReportByVDSM ( isSupportBridgesReportByVDSM ) ; boolean isMTUOverrideSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MTUOverrideSupported , dc.getcompatibility_version ( ) . toString ( ) ) ) ) ; setMTUOverrideSupported ( isMTUOverrideSupported ) ; onExportChanged ( ) ; }
Source:
protected void disconnectFromStorage ( ) { org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters connectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , Guid.Empty , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) . getstorage_type ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ; boolean isDisconnectSucceeded = runVdsCommand ( VDSCommandType.DisconnectStorageServer , connectionParametersForVdsm ) . getSucceeded ( ) ; if ( ! isDisconnectSucceeded ) { log.warn ( ( "Failed to disconnect storage connection " + ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ) ) ; } }

Target:
protected void disconnectFromStorage ( ) { org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters connectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , Guid.Empty , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) . getstorage_type ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ; boolean isDisconnectSucceeded = runVdsCommand ( VDSCommandType.DisconnectStorageServer , connectionParametersForVdsm ) . getSucceeded ( ) ; if ( ! isDisconnectSucceeded ) { log.warn ( "Failed to disconnect storage connection {}" , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getDisksList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( ( ( disk.getQuotaId ( ) ) != null ? disk.getQuotaId ( ) : org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getQuotaId ( ) ) , disk.getstorage_ids ( ) . get ( 0 ) , disk.getSizeInGigabytes ( ) ) ) ; } return list ; }

Target:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getDisksList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( ( ( disk.getQuotaId ( ) ) != null ? disk.getQuotaId ( ) : org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getQuotaId ( ) ) , disk.getstorage_ids ( ) . get ( 0 ) , disk.getActualSize ( ) ) ) ; } return list ; }
Source:
private org.ovirt.engine.api.model.RSDL construct ( ) throws java.io.IOException , java.lang.ClassNotFoundException { org.ovirt.engine.api.model.RSDL rsdl = new org.ovirt.engine.api.model.RSDL ( ) ; rsdl.setLinks ( new org.ovirt.engine.api.model.DetailedLinks ( ) ) ; for ( org.ovirt.engine.api.model.DetailedLink link : getLinks ( ) ) { rsdl.getLinks ( ) . getLinks ( ) . add ( link ) ; } return rsdl ; }

Target:
private org.ovirt.engine.api.model.RSDL construct ( ) throws java.io.IOException , java.lang.ClassNotFoundException { org.ovirt.engine.api.model.RSDL rsdl = new org.ovirt.engine.api.model.RSDL ( ) ; rsdl.setLinks ( new org.ovirt.engine.api.model.DetailedLinks ( ) ) ; for ( org.ovirt.engine.api.model.DetailedLink link : getLinks ( ) ) { rsdl.getLinks ( ) . getLinks ( ) . add ( link ) ; } uniteDuplicateLinks ( rsdl ) ; return rsdl ; }
Source:
private org.ovirt.engine.core.bll.validator.StorageDomainValidator getValidator ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid domainId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageById ( imageId ) ; return new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( getStorageDomainById ( domainId , diskImage.getStoragePoolId ( ) . getValue ( ) ) ) ; }

Target:
private boolean validateSourceStorageDomain ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageById ( imageId ) ; org.ovirt.engine.core.compat.Guid domainId = diskImage.getStorageIds ( ) . get ( 0 ) ; org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = getValidator ( domainId , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) . getValue ( ) ) ; return validate ( validator.isDomainExistAndActive ( ) ) ; }
Source:
private static void setPath ( org.ovirt.engine.core.common.businessentities.StorageServerConnections entity , org.ovirt.engine.api.model.Storage model ) { if ( entity.getconnection ( ) . contains ( ":" ) ) { java.lang.String [ ] parts = entity.getconnection ( ) . split ( ":" ) ; model.setAddress ( parts [ 0 ] ) ; model.setPath ( parts [ 1 ] ) ; } else { model.setPath ( entity.getconnection ( ) ) ; } }

Target:
private static void setPath ( org.ovirt.engine.core.common.businessentities.StorageServerConnections entity , org.ovirt.engine.api.model.StorageConnection model ) { if ( entity.getconnection ( ) . contains ( ":" ) ) { java.lang.String [ ] parts = entity.getconnection ( ) . split ( ":" ) ; model.setAddress ( parts [ 0 ] ) ; model.setPath ( parts [ 1 ] ) ; } else { model.setPath ( entity.getconnection ( ) ) ; } }
Source:
public void testGetAllQuotaSearch ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Quota" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.Quota ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( quotaResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testGetAllQuotaSearch ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Quota" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.Quota ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( quotaResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public static org.ovirt.engine.api.model.CdRom map ( org.ovirt.engine.core.common.businessentities.VmTemplate entity , org.ovirt.engine.api.model.CdRom template ) { org.ovirt.engine.api.model.CdRom model = ( template != null ) ? template : new org.ovirt.engine.api.model.CdRom ( ) ; model.setId ( org.ovirt.engine.api.restapi.types.CdRomMapper.CDROM_ID.toString ( ) ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( entity.getIsoPath ( ) ) ) ) { model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; model.getFile ( ) . setId ( entity.getIsoPath ( ) ) ; } return model ; }

Target:
public static org.ovirt.engine.api.model.CdRom map ( org.ovirt.engine.core.common.businessentities.VmTemplate entity , org.ovirt.engine.api.model.CdRom template ) { org.ovirt.engine.api.model.CdRom model = ( template != null ) ? template : new org.ovirt.engine.api.model.CdRom ( ) ; model.setId ( org.ovirt.engine.api.restapi.types.CdRomMapper.CDROM_ID.toString ( ) ) ; if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getIsoPath ( ) ) ) ) { model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; model.getFile ( ) . setId ( entity.getIsoPath ( ) ) ; } return model ; }
Source:
private org.ovirt.engine.core.bll.RemoveQuotaCommand createCommand ( ) { org.ovirt.engine.core.common.action.QuotaCRUDParameters param = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( ) ; param.setQuotaId ( generalGuidQuota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveQuotaCommand ( param , null ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( command ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; org.mockito.Mockito.doReturn ( quotaManager ) . when ( command ) . getQuotaManager ( ) ; return command ; }

Target:
private org.ovirt.engine.core.bll.RemoveQuotaCommand createCommand ( org.ovirt.engine.core.compat.Guid guid ) { org.ovirt.engine.core.common.action.IdParameters param = new org.ovirt.engine.core.common.action.IdParameters ( guid ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveQuotaCommand ( param , null ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( command ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; org.mockito.Mockito.doReturn ( quotaManager ) . when ( command ) . getQuotaManager ( ) ; return command ; }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StorageDomainAccessError : org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.common.errors.VDSError tempVar = new org.ovirt.engine.core.common.errors.VDSError ( ) ; tempVar.setCode ( VdcBllErrors.StorageDomainAccessError ) ; tempVar.setMessage ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getReturnStatus ( ) . mMessage ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getVDSReturnValue ( ) . setVdsError ( tempVar ) ; break ; default : super . ProceedProxyReturnValue ( ) ; InitializeVdsError ( returnStatus ) ; break ; } }

Target:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StorageDomainAccessError : org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.common.errors.VDSError tempVar = new org.ovirt.engine.core.common.errors.VDSError ( ) ; tempVar.setCode ( VdcBllErrors.StorageDomainAccessError ) ; tempVar.setMessage ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getReturnStatus ( ) . mMessage ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getVDSReturnValue ( ) . setVdsError ( tempVar ) ; break ; default : super . ProceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "IsLinuxOS" . equals ( propName ) ) { linuxBootOptionsPanel.setVisible ( vm.getIsLinuxOS ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "IsLinuxOS" . equals ( propName ) ) { changeApplicationLevelVisibility ( linuxBootOptionsPanel , vm.getIsLinuxOS ( ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec , java.lang.String connectionAction , java.util.Map < java.lang.String , java.lang.String > params ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.setVmTicket ( vmId , otp64 , sec , connectionAction , params ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extend_image_ticket ( java.lang.String ticketId , long timeout ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.extend_image_ticket ( ticketId , timeout ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void onAction ( ) { item.edit ( ) ; }

Target:
protected void onAction ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel network = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) ; if ( network.isManaged ( ) ) { item.edit ( ) ; } else { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperationFactory.OperationMap operationMap = item.getSetupModel ( ) . commandsFor ( item ) ; final org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand detach = operationMap.get ( NetworkOperation.DETACH_NETWORK ) . get ( 0 ) ; item.getSetupModel ( ) . onOperation ( NetworkOperation.DETACH_NETWORK , detach ) ; } }
Source:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getStatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.info ( "VM moved from --> {}" , vmToUpdate.getName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getStatus ( ) . name ( ) ) ; if ( ( vmToUpdate.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.logVmStatusTransionFromUnknown ( vmToUpdate , runningVm ) ; } } }

Target:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getStatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.HostMonitoring.log.info ( "VM moved from --> {}" , vmToUpdate.getName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getStatus ( ) . name ( ) ) ; if ( ( vmToUpdate.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) { org.ovirt.engine.core.vdsbroker.HostMonitoring.logVmStatusTransionFromUnknown ( vmToUpdate , runningVm ) ; } } }
Source:
private void deactivateInstanceTypeManagerAndUpdateFields ( ) { getBehavior ( ) . deactivateInstanceTypeManager ( new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ActivatedListener ( ) { @ java.lang.Override public void activated ( ) { if ( ( getBehavior ( ) . getInstanceTypeManager ( ) ) != null ) { getBehavior ( ) . getInstanceTypeManager ( ) . updateFields ( ) ; } } } ) ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( NumaSupportModel.SUBMIT_NUMA_SUPPORT.equals ( command.getName ( ) ) ) { onNumaSupport ( ) ; } }
Source:
public org.ovirt.engine.ui.common.uicommon.model.MainModelProvider < org.ovirt.engine.core.common.businessentities.AuditLog , org.ovirt.engine.ui.uicommonweb.models.events.EventListModel > getEventListProvider ( org.ovirt.engine.ui.webadmin.gin.ClientGinjector ginjector ) { return new org.ovirt.engine.ui.common.uicommon.model.MainTabModelProvider < org.ovirt.engine.core.common.businessentities.AuditLog , org.ovirt.engine.ui.uicommonweb.models.events.EventListModel > ( ginjector , org.ovirt.engine.ui.uicommonweb.models.events.EventListModel.class ) ; }

Target:
public org.ovirt.engine.ui.common.uicommon.model.MainModelProvider < org.ovirt.engine.core.common.businessentities.AuditLog , org.ovirt.engine.ui.uicommonweb.models.events.EventListModel > getEventListProvider ( org.ovirt.engine.ui.webadmin.gin.ClientGinjector ginjector , final com.google.inject.Provider < org.ovirt.engine.ui.webadmin.section.main.presenter.popup.event.EventPopupPresenterWidget > popupProvider ) { return new org.ovirt.engine.ui.common.uicommon.model.MainTabModelProvider < org.ovirt.engine.core.common.businessentities.AuditLog , org.ovirt.engine.ui.uicommonweb.models.events.EventListModel > ( ginjector , org.ovirt.engine.ui.uicommonweb.models.events.EventListModel.class ) { @ java.lang.Override public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.events.EventListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getDetailsCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } } } ; }
Source:
private static org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( int availableSpace , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setStorageDomainType ( StorageDomainType.Master ) ; sd.setStatus ( StorageDomainStatus.Active ) ; sd.setAvailableDiskSize ( availableSpace ) ; sd.setStorageType ( StorageType.ISCSI ) ; sd.setStoragePoolId ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_POOLD_ID ) ; sd.setId ( storageDomainId ) ; return sd ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > mockDisksList ( int numberOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( numberOfDisks ) ; for ( int index = 0 ; index < numberOfDisks ; index ++ ) { org.ovirt.engine.core.common.businessentities.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; disksList.add ( image ) ; } org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSnapshotsDummiesForStorageAllocations ( ) ; return disksList ; }
Source:
public void testCanDoActionWithEmptySnapshotGuid ( ) { org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters params = new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vmId , org.ovirt.engine.core.compat.Guid.Empty ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.snapshots.TryBackToAllSnapshotsOfVmCommand ( params ) ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . updateVmDisksFromDb ( ) ; org.mockito.Mockito.doReturn ( snapshotDao ) . when ( cmd ) . getSnapshotDao ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CORRUPTED_VM_SNAPSHOT_ID ) ; }

Target:
public void testValidateWithEmptySnapshotGuid ( ) { org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters params = new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vmId , org.ovirt.engine.core.compat.Guid.Empty ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.snapshots.TryBackToAllSnapshotsOfVmCommand ( params , null ) ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . updateVmDisksFromDb ( ) ; org.mockito.Mockito.doReturn ( snapshotDao ) . when ( cmd ) . getSnapshotDao ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CORRUPTED_VM_SNAPSHOT_ID ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangable ( true ) ; setEnableSearchHost ( true ) ; getProviders ( ) . setIsChangable ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalHostGroup > hostGroups = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalHostGroup > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalHostGroupsListModel = getExternalHostGroups ( ) ; externalHostGroupsListModel.setItems ( hostGroups ) ; externalHostGroupsListModel.setIsChangable ( true ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( "onRemove" . equals ( command.getName ( ) ) ) { onRemove ( ) ; } else if ( "cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( "onRemove" . equals ( command.getName ( ) ) ) { onRemove ( ) ; } else if ( "cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }