auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusReturnForXmlRpc migrateStatus ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.getMigrationStatus" ) . withParameter ( "vmID" , vmId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "response" ) . withResponseType ( java.lang.Long.class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusReturn migrateStatus ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.getMigrationStatus" ) . withParameter ( "vmID" , vmId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "response" ) . withResponseType ( java.lang.Long.class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusReturn ( response ) ; }
Source:
public static org.ovirt.engine.core.bll.context.CommandContext createDefaultContexForTasks ( org.ovirt.engine.core.bll.job.ExecutionContext parentContext , org.ovirt.engine.core.utils.lock.EngineLock lock ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; if ( parentContext != null ) { if ( ( parentContext.getJob ( ) ) != null ) { org.ovirt.engine.core.common.job.Step parentStep = parentContext.getParentTasksStep ( ) ; if ( parentStep != null ) { executionContext.setParentTasksStep ( parentStep ) ; } } else { executionContext.setParentTasksStep ( parentContext.getParentTasksStep ( ) ) ; } } return new org.ovirt.engine.core.bll.context.CommandContext ( executionContext , lock ) ; }

Target:
public static org.ovirt.engine.core.bll.context.CommandContext createDefaultContextForTasks ( org.ovirt.engine.core.bll.context.CommandContext commandContext , org.ovirt.engine.core.utils.lock.EngineLock lock ) { return commandContext.clone ( ) . withLock ( lock ) . withoutCompensationContext ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { if ( ( getProfile ( ) . getSelectedItem ( ) ) != null ) { namespacesMap = ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( result ) ) ; populateNamespaces ( ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { populateRoles ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Role > ) ( result ) ) ) ; }
Source:
public org.ovirt.optimizer.solver.test.TestOptimizer addMigration ( org.ovirt.engine.sdk.entities.VM vm , org.ovirt.engine.sdk.entities.Host destination ) { if ( destination != null ) { bestSolution.getHosts ( ) . add ( destination ) ; } if ( vm != null ) { bestSolution.getVms ( ) . add ( vm ) ; } bestSolution.getSteps ( ) . add ( new org.ovirt.optimizer.solver.problemspace.Migration ( vm , destination ) ) ; return this ; }

Target:
public org.ovirt.optimizer.solver.test.TestOptimizer addVm ( org.ovirt.engine.sdk.entities.VM vm ) { bestSolution.getVms ( ) . put ( vm.getId ( ) , vm ) ; final org.ovirt.optimizer.solver.facts.Instance instance = new org.ovirt.optimizer.solver.facts.Instance ( vm ) ; primaryInstances.put ( vm , instance ) ; bestSolution.getInstances ( ) . add ( instance ) ; return this ; }
Source:
public void canDoActionSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.getPeers ( org.mockito.Matchers.any ( org.ovirt.engine.core.bll.utils.EngineSSHClient.class ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.Assert.assertTrue ( commandMock.canDoAction ( ) ) ; }

Target:
public void validateSucceedsOnEmptyClusterEvenWhenGlusterServerHasPeers ( ) throws java.lang.Exception { setupGlusterMock ( false , null , true ) ; org.junit.Assert.assertTrue ( commandMock.validate ( ) ) ; }
Source:
private static void assertCorrectGetAllResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDaoTest.VM_COUNT , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : result ) { org.junit.Assert.assertEquals ( "Vm db generation wasn't loaded as expected" , 1 , vm.getDbGeneration ( ) ) ; } }

Target:
private static void assertCorrectGetAllResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > result ) { org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.VmDaoTest.VM_COUNT , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : result ) { org.junit.jupiter.api.Assertions.assertEquals ( 1 , vm.getDbGeneration ( ) , "Vm db generation wasn't loaded as expected" ) ; } }
Source:
java.io.File getFile ( final java.io.File brandingRootPath , final java.lang.String path ) { java.io.File result = null ; java.lang.String mergedPath = new java.io.File ( brandingRootPath.getAbsolutePath ( ) , ( path == null ? "" : path ) ) . getAbsolutePath ( ) ; if ( ( path != null ) && ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( mergedPath ) ) ) { result = new java.io.File ( mergedPath ) ; } else { org.ovirt.engine.ui.frontend.server.gwt.BrandingServlet.log.error ( ( ( "The path \"" + mergedPath ) + "\" is not sane" ) ) ; } return result ; }

Target:
java.io.File getFile ( final java.io.File brandingRootPath , final java.lang.String path ) { java.io.File result = null ; java.lang.String mergedPath = new java.io.File ( brandingRootPath.getAbsolutePath ( ) , ( path == null ? "" : path ) ) . getAbsolutePath ( ) ; if ( ( path != null ) && ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( mergedPath ) ) ) { result = new java.io.File ( mergedPath ) ; } else { org.ovirt.engine.core.utils.branding.BrandingServlet.log.error ( ( ( "The path \"" + mergedPath ) + "\" is not sane" ) ) ; } return result ; }
Source:
private void endCopyCollapseOperations ( org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setvmt_guid ( VmTemplateHandler.BlankVmTemplateId ) ; vm.setvmt_name ( null ) ; org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . getId ( vm.getId ( ) , SnapshotType.ACTIVE ) ) ; vm.setSnapshots ( java.util.Arrays.asList ( activeSnapshot ) ) ; updateCopyVmInSpm ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) . getstorage_pool_id ( ) , vm , org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getStorageDomainId ( ) ) ; }

Target:
private void endCopyCollapseOperations ( org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setVmtGuid ( VmTemplateHandler.BlankVmTemplateId ) ; vm.setVmtName ( null ) ; org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . getId ( vm.getId ( ) , SnapshotType.ACTIVE ) ) ; vm.setSnapshots ( java.util.Arrays.asList ( activeSnapshot ) ) ; updateCopyVmInSpm ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) . getStoragePoolId ( ) , vm , org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getStorageDomainId ( ) ) ; }
Source:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVm ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; 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 ) ; initVmDiskImage ( ) ; initVmForFail ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; 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 void onTimer ( ) { manager.onTimer ( ) ; }

Target:
public void onTimer ( ) { manager.onTimer ( ) ; org.mockito.Mockito.verify ( backendMock , org.mockito.Mockito.times ( vdss.size ( ) ) ) . runInternalAction ( org.mockito.Matchers.eq ( VdcActionType.ActivateVds ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ) ; org.mockito.Mockito.verify ( backendMock , org.mockito.Mockito.times ( storageDomains.size ( ) ) ) . runInternalAction ( org.mockito.Matchers.eq ( VdcActionType.ActivateStorageDomain ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ) ; }
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 getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isInternal = ( ( java.lang.Boolean ) ( getIsInternal ( ) . getEntity ( ) ) ) ; if ( isInternal ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( isShareableDiskEnabled ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { if ( ( acceptEmptyInput ) && ( ( value == null ) || ( ( value instanceof java.lang.String ) && ( value.equals ( "" ) ) ) ) ) { return new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; } return super . validate ( value ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { if ( ( acceptEmptyInput ) && ( ( value == null ) || ( ( value instanceof java.lang.String ) && ( value.equals ( "" ) ) ) ) ) { return new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; } return super . validate ( ( value instanceof java.lang.String ? ( ( java.lang.String ) ( value ) ) . trim ( ) : value ) ) ; }
Source:
private boolean isNewerVersion ( org.ovirt.engine.core.compat.Version isoClusterVersion ) { org.ovirt.engine.core.common.businessentities.VDS vds = getVdsByVdsId ( org.ovirt.engine.core.bll.hostdeploy.GetoVirtISOsQuery.getParameters ( ) . getId ( ) ) ; org.ovirt.engine.core.compat.Version vdsClusterVersion = vds.getVdsGroupCompatibilityVersion ( ) ; log.debug ( "vdsClusterVersion '{}' isoClusterVersion '{}'" , vdsClusterVersion , isoClusterVersion ) ; return ( ( vdsClusterVersion.getMajor ( ) ) == ( isoClusterVersion.getMajor ( ) ) ) && ( ( vdsClusterVersion.getMinor ( ) ) <= ( isoClusterVersion.getMinor ( ) ) ) ; }

Target:
private boolean isNewerVersion ( org.ovirt.engine.core.compat.Version isoClusterVersion ) { org.ovirt.engine.core.common.businessentities.VDS vds = getVdsByVdsId ( org.ovirt.engine.core.bll.hostdeploy.GetoVirtISOsQuery.getParameters ( ) . getId ( ) ) ; org.ovirt.engine.core.compat.Version vdsClusterVersion = vds.getClusterCompatibilityVersion ( ) ; log.debug ( "vdsClusterVersion '{}' isoClusterVersion '{}'" , vdsClusterVersion , isoClusterVersion ) ; return ( ( vdsClusterVersion.getMajor ( ) ) == ( isoClusterVersion.getMajor ( ) ) ) && ( ( vdsClusterVersion.getMinor ( ) ) <= ( isoClusterVersion.getMinor ( ) ) ) ; }
Source:
private static void addConsoleDevice ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmId ) , VmDeviceGeneralType.CONSOLE , VmDeviceType.CONSOLE , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , false , null ) ; }

Target:
public static void updateVirtioScsiController ( org.ovirt.engine.core.compat.Guid vmId , java.lang.Boolean isVirtioScsiEnabled ) { if ( isVirtioScsiEnabled == null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > controllers = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.CONTROLLER , VmDeviceType.VIRTIOSCSI.getName ( ) ) ; if ( isVirtioScsiEnabled ) { if ( controllers.isEmpty ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addVirtioScsiController ( vmId ) ; } } else { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : controllers ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } }
Source:
private void override_EntityChanged ( org.ovirt.engine.ui.uicompat.EventArgs e ) { boolean isChangeable = ( ( java.lang.Boolean ) ( getOverride ( ) . getEntity ( ) ) ) ; getVersion ( ) . setIsChangeable ( isChangeable ) ; getRetransmissions ( ) . setIsChangeable ( isChangeable ) ; getTimeout ( ) . setIsChangeable ( isChangeable ) ; getMountOptions ( ) . setIsChangeable ( isChangeable ) ; getMountOptions ( ) . setTitle ( ( isChangeable ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . mountOptionsHint ( ) : null ) ) ; }

Target:
public void prepareForEdit ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { super . prepareForEdit ( storage ) ; boolean isStorageEditable = isEditable ( storage ) ; getVersion ( ) . setIsChangeable ( isStorageEditable ) ; getRetransmissions ( ) . setIsChangeable ( isStorageEditable ) ; getTimeout ( ) . setIsChangeable ( isStorageEditable ) ; getMountOptions ( ) . setIsChangeable ( isStorageEditable ) ; }
Source:
private org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase createAuditLog ( final org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( iface.getVmId ( ) ) ; logable.addCustomValue ( "MACAddr" , iface.getMacAddress ( ) ) ; logable.addCustomValue ( "IfaceName" , iface.getName ( ) ) ; return logable ; }

Target:
private org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase createAuditLog ( final org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( iface.getVmId ( ) ) ; logable.addCustomValue ( "MACAddr" , iface.getMacAddress ( ) ) ; logable.addCustomValue ( "IfaceName" , iface.getName ( ) ) ; return logable ; }
Source:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveUser , org.ovirt.engine.core.common.action.IdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveUser , org.ovirt.engine.core.common.action.IdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: remove ) , detail ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetQuotasByAdElementIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetQuotasByAdElementIdQuery.getDbFacade ( ) . getQuotaDao ( ) . getQuotaByAdElementId ( org.ovirt.engine.core.bll.GetQuotasByAdElementIdQuery.getParameters ( ) . getAdElementId ( ) , org.ovirt.engine.core.bll.GetQuotasByAdElementIdQuery.getParameters ( ) . getStoragePoolId ( ) , false ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetQuotasByAdElementIdQuery.getQueryReturnValue ( ) . setReturnValue ( quotaDao.getQuotaByAdElementId ( org.ovirt.engine.core.bll.GetQuotasByAdElementIdQuery.getParameters ( ) . getAdElementId ( ) , org.ovirt.engine.core.bll.GetQuotasByAdElementIdQuery.getParameters ( ) . getStoragePoolId ( ) , false ) ) ; }
Source:
private org.ovirt.engineextensions.aaa.ldap.MapProperties applyDefault ( org.ovirt.engineextensions.aaa.ldap.MapProperties props ) throws java.io.IOException { org.ovirt.engineextensions.aaa.ldap.MapProperties ret = new org.ovirt.engineextensions.aaa.ldap.MapProperties ( ) ; try ( java.io.InputStream is = this . getClass ( ) . getResourceAsStream ( "profile-defaults.properties" ) ; java.io.Reader reader = new java.io.InputStreamReader ( is , java.nio.charset.Charset.forName ( "UTF-8" ) ) ) { java.util.Properties p = new java.util.Properties ( ) ; p.load ( reader ) ; ret.load ( new org.ovirt.engineextensions.aaa.ldap.MapProperties ( p ) ) ; } ret.load ( props ) ; return ret ; }

Target:
private org.ovirt.engineextensions.aaa.ldap.MapProperties applyDefault ( org.ovirt.engineextensions.aaa.ldap.MapProperties props ) throws java.io.IOException { org.ovirt.engineextensions.aaa.ldap.MapProperties ret = new org.ovirt.engineextensions.aaa.ldap.MapProperties ( ) ; try ( java.io.InputStream is = this . getClass ( ) . getResourceAsStream ( "profile-defaults.properties" ) ; java.io.Reader reader = new java.io.InputStreamReader ( is , java.nio.charset.StandardCharsets.UTF_8 ) ) { java.util.Properties p = new java.util.Properties ( ) ; p.load ( reader ) ; ret.load ( new org.ovirt.engineextensions.aaa.ldap.MapProperties ( p ) ) ; } ret.load ( props ) ; return ret ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Quota quota ) { validateParameters ( quota , "name" ) ; org.ovirt.engine.api.model.Quota entity = map ( quota ) ; entity.setStoragePoolId ( dataCenterId ) ; return performCreate ( VdcActionType.AddQuota , new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetQuotaByQuotaId , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Quota quota ) { validateParameters ( quota , "name" ) ; org.ovirt.engine.api.model.Quota entity = map ( quota ) ; entity.setStoragePoolId ( dataCenterId ) ; return performCreate ( ActionType.AddQuota , new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetQuotaByQuotaId , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
private void mockDiskImageDAO ( ) { org.mockito.Mockito.when ( dbFacada.getDiskImageDAO ( ) ) . thenReturn ( diskImageDAO ) ; org.mockito.Mockito.when ( diskImageDAO.getSnapshotById ( org.mockito.Matchers.< org.ovirt.engine.core.compat.Guid > any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getDiskImageList ( ) . get ( 0 ) ) ; }

Target:
private void mockDiskImageDAO ( ) { org.mockito.Mockito.when ( diskImageDAO.getSnapshotById ( org.mockito.Matchers.< org.ovirt.engine.core.compat.Guid > any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.getDiskImageList ( ) . get ( 0 ) ) ; }
Source:
public static java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceBondNameIsEmpty ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getBondName ( ) ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i ) { return org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getBondName ( ) ) ; }
Source:
public void validateFails ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( cmd ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getSingleBrickVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getMultiBrickVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; }
Source:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( containerID , disk ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcRetValue.getFault ( ) . getError ( ) , "Failed during ExportVmCommand" ) ; } org.ovirt.engine.core.bll.ExportVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }

Target:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( containerID , disk ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcRetValue.getFault ( ) . getError ( ) , "Failed during ExportVmCommand" ) ; } org.ovirt.engine.core.bll.ExportVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVmName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; org.ovirt.engine.core.utils.ovf.OvfVmWriterTest.initInterfaces ( vm ) ; return vm ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; org.ovirt.engine.core.utils.ovf.OvfVmWriterTest.initInterfaces ( vm ) ; return vm ; }
Source:
protected java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel > createLineModels ( java.util.Set < java.lang.String > usedKeys ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel > lineModels = new java.util.ArrayList < > ( ) ; for ( java.lang.String key : usedKeys ) { org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel lineModel = createNewLineModel ( key ) ; lineModel.getKeys ( ) . setSelectedItem ( key ) ; lineModels.add ( lineModel ) ; } return lineModels ; }

Target:
protected java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel > createLineModels ( java.util.Set < java.lang.String > usedKeys ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel > lineModels = new java.util.ArrayList < > ( ) ; for ( java.lang.String key : usedKeys ) { org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel lineModel = createNewLineModel ( key ) ; lineModel.getKeys ( ) . setSelectedItem ( key ) ; setValueByKey ( lineModel , key ) ; lineModels.add ( lineModel ) ; } return lineModels ; }
Source:
protected boolean canDoAction ( ) { if ( ( disk ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } buildSharedLockMap ( ) ; if ( ! ( org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ) ) { return false ; } return ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? canRemoveDiskBasedOnImageStorageCheck ( ) : canRemoveLunDisk ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Disk getDisk ( ) { if ( ( disk ) == null ) { disk = getDiskDao ( ) . get ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getEntityId ( ) ) ) ) ; } return disk ; }
Source:
public void testPosixDcAndNotMatchingCompatiblityVersion ( ) { storagePool.setcompatibility_version ( Version.v3_0 ) ; storagePool.setIsLocal ( false ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.isPosixSupportedInDC ( ) ; org.junit.Assert.assertFalse ( result.isValid ( ) ) ; org.ovirt.engine.core.bll.storage.StoragePoolValidatorTest.assertMessage ( result , VdcBllMessages.DATA_CENTER_POSIX_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; }

Target:
public void testPosixDcAndNotMatchingCompatiblityVersion ( ) { storagePool.setcompatibility_version ( Version.v3_0 ) ; storagePool.setIsLocal ( false ) ; org.junit.Assert.assertThat ( validator.isPosixSupportedInDC ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.DATA_CENTER_POSIX_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ) ; }
Source:
public void testUpdateStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics before = dao.get ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.EXISTING_VM_ID ) ; before.setUsageMemPercent ( 17 ) ; before.setDisksUsage ( "java.util.map { [ ] }" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.VmStatistics after = dao.get ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testUpdateStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics before = dao.get ( FixturesTool.VM_RHEL5_POOL_57 ) ; before.setUsageMemPercent ( 17 ) ; before.setDisksUsage ( "java.util.map { [ ] }" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.VmStatistics after = dao.get ( FixturesTool.VM_RHEL5_POOL_57 ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
protected boolean wasSkippedDueToPolicy ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { boolean skipped = false ; if ( ( result.getActionReturnValue ( ) ) instanceof org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue fenceReturnValue = result.getActionReturnValue ( ) ; if ( ( fenceReturnValue.getReturnValue ( ) ) instanceof org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) { skipped = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( fenceReturnValue.getReturnValue ( ) ) ) . getIsSkippedDueToPolicy ( ) ; } } return skipped ; }

Target:
protected boolean wasSkippedDueToPolicy ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { boolean skipped = false ; if ( ( result.getActionReturnValue ( ) ) instanceof org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceResult = result.getActionReturnValue ( ) ; skipped = ( fenceResult.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SKIPPED_DUE_TO_POLICY ) ; } return skipped ; }
Source:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { parent.setConsoleDevice ( model ) ; parent.setVirtioScsiController ( model ) ; parent.setSoundcard ( model ) ; parent.setVmOvfConfiguration ( model , entity ) ; parent.setRngDevice ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Vm doPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity ) { parent.setConsoleDevice ( model ) ; parent.setVirtioScsiController ( model ) ; parent.setSoundcard ( model ) ; parent.setVmOvfConfiguration ( model , entity ) ; parent.setRngDevice ( model ) ; return model ; }
Source:
private void sendTicket ( ) { final org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; final boolean sent = runVdsCommand ( VDSCommandType.SetVmTicket , new org.ovirt.engine.core.common.vdscommands.SetVmTicketVDSCommandParameters ( org.ovirt.engine.core.bll.SetVmTicketCommand.getVdsId ( ) , org.ovirt.engine.core.bll.SetVmTicketCommand.getVmId ( ) , mTicket , mValidTime , user.getLoginName ( ) , user.getId ( ) ) ) . getSucceeded ( ) ; if ( sent ) { org.ovirt.engine.core.bll.SetVmTicketCommand.setActionReturnValue ( mTicket ) ; } org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( sent ) ; }

Target:
private void sendTicket ( ) { final org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; final boolean sent = runVdsCommand ( VDSCommandType.SetVmTicket , new org.ovirt.engine.core.common.vdscommands.SetVmTicketVDSCommandParameters ( org.ovirt.engine.core.bll.SetVmTicketCommand.getVdsId ( ) , org.ovirt.engine.core.bll.SetVmTicketCommand.getVmId ( ) , mTicket , mValidTime , user.getLoginName ( ) , user.getId ( ) ) ) . getSucceeded ( ) ; if ( sent ) { org.ovirt.engine.core.bll.SetVmTicketCommand.setActionReturnValue ( mTicket ) ; } org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( sent ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.PostUpdatePriority ( ) ; }

Target:
protected void updateSelectedCdImage ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { getModel ( ) . getCdImage ( ) . setSelectedItem ( vmBase.getIsoPath ( ) ) ; boolean hasCd = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vmBase.getIsoPath ( ) ) ) ; getModel ( ) . getCdImage ( ) . setIsChangable ( hasCd ) ; getModel ( ) . getCdAttached ( ) . setEntity ( hasCd ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { titleLabel.setText ( constants.configurePopupTitle ( ) ) ; closeButton.setText ( constants.closeButtonLabel ( ) ) ; rolesTab.setLabel ( constants.configureRoleTabLabel ( ) ) ; clusterPoliciesTab.setLabel ( constants.configureClusterPolicyTabLabel ( ) ) ; systemPermissionsTab.setLabel ( constants.configureSystemPermissionTabLabel ( ) ) ; instanceTypesTab.setLabel ( constants.instanceTypes ( ) ) ; macPoolsTab.setLabel ( constants.configureMacPoolsTabLabel ( ) ) ; }

Target:
void localize ( ) { titleLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.configure.ConfigurePopupView.constants.configurePopupTitle ( ) ) ; closeButton.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.configure.ConfigurePopupView.constants.closeButtonLabel ( ) ) ; rolesTab.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.configure.ConfigurePopupView.constants.configureRoleTabLabel ( ) ) ; clusterPoliciesTab.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.configure.ConfigurePopupView.constants.configureClusterPolicyTabLabel ( ) ) ; systemPermissionsTab.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.configure.ConfigurePopupView.constants.configureSystemPermissionTabLabel ( ) ) ; instanceTypesTab.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.configure.ConfigurePopupView.constants.instanceTypes ( ) ) ; macPoolsTab.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.configure.ConfigurePopupView.constants.configureMacPoolsTabLabel ( ) ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void setUpEntityQueryExpectations ( int times , org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.ISCSI_BOND_ID } , iscsiBond ) ; } }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.ISCSI_BOND_ID } , getIscsiBondContainingNetwork ( ) ) ; setUpActionExpectations ( VdcActionType.EditIscsiBond , org.ovirt.engine.core.common.action.EditIscsiBondParameters.class , new java.lang.String [ ] { "IscsiBond" } , new java.lang.Object [ ] { getIscsiBondWithNoNetworks ( ) } , true , true , null ) ; javax.ws.rs.core.Response response = resource.remove ( ) ; assertNotNull ( response ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
protected void doV0 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { try { registerV0 ( request , response ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.services.RegisterServlet.log.error ( "Registration failed" , e ) ; response.sendError ( response.SC_INTERNAL_SERVER_ERROR , e.getMessage ( ) ) ; } }

Target:
protected void doV0 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { try { registerV0 ( request , response ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.services.RegisterServlet.log.error ( "Registration failed: {}" , e.getMessage ( ) ) ; org.ovirt.engine.core.services.RegisterServlet.log.debug ( "Exception" , e ) ; response.sendError ( response.SC_INTERNAL_SERVER_ERROR , e.getMessage ( ) ) ; } }
Source:
public void getGlusterVolumeGeoRepRecommendationViolations ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId , org.ovirt.engine.core.compat.Guid slaveVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return returnValue == null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ) ( returnValue ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNonEligibilityReasonsOfVolumeForGeoRepSession , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeGeoRepEligibilityParameters ( masterVolumeId , slaveVolumeId ) , aQuery ) ; }

Target:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 1 ) ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void validateFailsDiffInterface ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 , getBricks ( volumeId1 , 2 ) , 0 , 4 , false ) ) ; prepareMocks ( cmd ) ; prepareInterfaceMocks ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsDiffInterface ( ) { initTestCommand ( volumeId1 , getBricks ( volumeId1 , 2 ) , 0 , 4 , false ) ; prepareInterfaceMocks ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
protected void persistCollectedData ( ) { super . persistCollectedData ( ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . updateIfNeeded ( getVds ( ) . getDynamicData ( ) ) ; }

Target:
protected void persistCollectedData ( ) { super . persistCollectedData ( ) ; org.ovirt.engine.core.dao.VdsDynamicDAO vdsDynamicDao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic hostFromDb = vdsDynamicDao.get ( getVds ( ) . getId ( ) ) ; hostFromDb.setsupported_cluster_levels ( getVds ( ) . getDynamicData ( ) . getsupported_cluster_levels ( ) ) ; vdsDynamicDao.update ( hostFromDb ) ; }
Source:
public void setupMocks ( ) { vmInterfaceManager = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.VmInterfaceManager ( macPool ) ) ; org.mockito.Mockito.doReturn ( vmNetworkStatisticsDao ) . when ( vmInterfaceManager ) . getVmNetworkStatisticsDao ( ) ; org.mockito.Mockito.doReturn ( vmNicDao ) . when ( vmInterfaceManager ) . getVmNicDao ( ) ; org.mockito.Mockito.doNothing ( ) . when ( vmInterfaceManager ) . removeFromExternalNetworks ( org.mockito.Matchers.anyList ( ) ) ; }

Target:
public void setupMocks ( ) { vmInterfaceManager = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.VmInterfaceManager ( macPool ) ) ; org.mockito.Mockito.doReturn ( vmNetworkStatisticsDao ) . when ( vmInterfaceManager ) . getVmNetworkStatisticsDao ( ) ; org.mockito.Mockito.doReturn ( vmNicDao ) . when ( vmInterfaceManager ) . getVmNicDao ( ) ; org.mockito.Mockito.doNothing ( ) . when ( vmInterfaceManager ) . removeFromExternalNetworks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
public static void getClusterGlusterServices ( 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 ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( connectAutomatically.readConnectAutomatically ( ) ) && ( model.getCanConnectAutomatically ( ) ) ) && ( ! ( alreadyOpened ) ) ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel userPortalItemModel = model.GetUpVms ( model.getItems ( ) ) . get ( 0 ) ; if ( userPortalItemModel != null ) { userPortalItemModel.getDefaultConsole ( ) . getConnectCommand ( ) . Execute ( ) ; alreadyOpened = true ; } } unregisterModels ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( connectAutomatically.readConnectAutomatically ( ) ) && ( model.getCanConnectAutomatically ( ) ) ) && ( ! ( alreadyOpened ) ) ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel userPortalItemModel = model.GetUpVms ( model.getItems ( ) ) . get ( 0 ) ; if ( userPortalItemModel != null ) { org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol selectedProtocol = consoleUtils.determineConnectionProtocol ( userPortalItemModel ) ; consoleManager.connectToConsole ( selectedProtocol , userPortalItemModel ) ; alreadyOpened = true ; } } unregisterModels ( ) ; }
Source:
protected javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.CpuProfile cpuProfile ) { validateParameters ( cpuProfile ) ; org.ovirt.engine.core.common.action.CpuProfileParameters parameters = new org.ovirt.engine.core.common.action.CpuProfileParameters ( ) ; org.ovirt.engine.api.model.CpuProfile map = map ( cpuProfile ) ; parameters.setProfile ( map ) ; return performCreate ( VdcActionType.AddCpuProfile , parameters , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetCpuProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
protected javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.CpuProfile cpuProfile ) { validateParameters ( cpuProfile ) ; org.ovirt.engine.core.common.action.CpuProfileParameters parameters = new org.ovirt.engine.core.common.action.CpuProfileParameters ( ) ; org.ovirt.engine.api.model.CpuProfile map = map ( cpuProfile ) ; parameters.setProfile ( map ) ; parameters.setAddPermissions ( true ) ; return performCreate ( VdcActionType.AddCpuProfile , parameters , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetCpuProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }