auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updateSpiceUsbAutoShare ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getSpiceUsbAutoShare ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.setUsbAutoShare ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ) ; }

Target:
private void updateSpiceUsbAutoShare ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getSpiceUsbAutoShare ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.getOptions ( ) . setUsbAutoShare ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ) ; }
Source:
public void managedNetworkAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( net.getName ( ) ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNetworkModified ( helper , net ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; }

Target:
public void managedNetworkAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( net.getName ( ) ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }
Source:
private void findNegotiatingProfiles ( ) { if ( ( profiles ) == null ) { synchronized ( this ) { if ( ( profiles ) == null ) { profiles = new java.util.ArrayList < org.ovirt.engine.core.aaa.AuthenticationProfile > ( 1 ) ; for ( org.ovirt.engine.core.aaa.AuthenticationProfile profile : org.ovirt.engine.core.aaa.AuthenticationProfileManager.getInstance ( ) . getProfiles ( ) ) { if ( profile != null ) { org.ovirt.engine.core.aaa.Authenticator authenticator = profile.getAuthenticator ( ) ; if ( authenticator instanceof org.ovirt.engine.core.aaa.NegotiatingAuthenticator ) { profiles.add ( 0 , profile ) ; } } } } } } }

Target:
private void findNegotiatingProfiles ( ) { if ( ( profiles ) == null ) { synchronized ( this ) { if ( ( profiles ) == null ) { profiles = new java.util.ArrayList < org.ovirt.engine.core.aaa.AuthenticationProfile > ( 1 ) ; for ( org.ovirt.engine.core.aaa.AuthenticationProfile profile : org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getProfiles ( ) ) { if ( profile != null ) { org.ovirt.engine.core.aaa.Authenticator authenticator = profile.getAuthenticator ( ) ; if ( authenticator instanceof org.ovirt.engine.core.aaa.NegotiatingAuthenticator ) { profiles.add ( 0 , profile ) ; } } } } } } }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( getReturnStatus ( ) ) ; switch ( returnStatus ) { case GetStorageDomainListError : org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , getReturnStatus ( ) . mMessage ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . ProceedProxyReturnValue ( ) ; break ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( getReturnStatus ( ) ) ; switch ( returnStatus ) { case GetStorageDomainListError : org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , getReturnStatus ( ) . mMessage ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . proceedProxyReturnValue ( ) ; break ; } }
Source:
public org.apache.http.HttpResponse send ( org.apache.http.client.methods.HttpUriRequest request ) { try { injectHeaders ( request ) ; return client.execute ( request ) ; } catch ( java.lang.Exception e ) { throw new java.lang.Error ( "Failed to send request" , e ) ; } }

Target:
public org.apache.http.HttpResponse send ( org.apache.http.client.methods.HttpUriRequest request ) { try { injectHeaders ( request ) ; org.apache.http.HttpResponse response = client.execute ( request ) ; checkContentType ( org.ovirt.engine.sdk4.internal.HttpConnection.XML_CONTENT_TYPE_RE , "XML" , response.getFirstHeader ( "content-type" ) . getValue ( ) ) ; return response ; } catch ( java.lang.Exception e ) { throw new java.lang.Error ( "Failed to send request" , e ) ; } }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.network_cluster , org.ovirt.engine.core.common.businessentities.VDSGroup > object ) { if ( object.getFirst ( ) . getis_display ( ) ) { return templates.image ( dispalyImage ) ; } return templates.image ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( "" ) ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network_cluster > object ) { if ( ( object.getSecond ( ) ) != null ) { if ( object.getSecond ( ) . getis_display ( ) ) { return templates.image ( dispalyImage ) ; } return null ; } return templates.image ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( "" ) ) ; }
Source:
public void canDoActionVmInPreview ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , null , diskImageId ) ; setVmInPreview ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void canDoActionVmInPreview ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , null , diskImageId ) ; setVmInPreview ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
public static void GetMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetSpiceUsbAutoShare ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
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 ) ; 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 ) ) ; }

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 ( ActionType.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 ) ) ; }
Source:
protected boolean validateStpProperty ( ) { boolean stpIsAllowed = true ; if ( ( ! ( org.ovirt.engine.core.bll.storage.NetworkCommon.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) && ( org.ovirt.engine.core.bll.storage.NetworkCommon.getParameters ( ) . getNetwork ( ) . getstp ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_CANNOT_SUPPORT_STP ) ; stpIsAllowed = false ; } return stpIsAllowed ; }

Target:
protected boolean validateStpProperty ( ) { boolean stpIsAllowed = true ; if ( ( ! ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) && ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getParameters ( ) . getNetwork ( ) . getstp ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_CANNOT_SUPPORT_STP ) ; stpIsAllowed = false ; } return stpIsAllowed ; }
Source:
public void testExecuteNoTaskHandlers ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameterMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ; org.mockito.Mockito.when ( parameterMock.getTransactionScopeOption ( ) ) . thenReturn ( TransactionScopeOption.Required ) ; org.mockito.Mockito.when ( parameterMock.getLockProperties ( ) ) . thenReturn ( org.ovirt.engine.core.common.action.LockProperties.create ( LockProperties.Scope.None ) ) ; org.ovirt.engine.core.bll.CommandBase < org.ovirt.engine.core.common.action.VdcActionParametersBase > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.CommandBaseTest.CommandBaseDummy ( parameterMock ) ) ; command.executeAction ( ) ; org.mockito.Mockito.verify ( command ) . executeCommand ( ) ; }

Target:
protected org.ovirt.engine.core.bll.aaa.SessionDataContainer getSessionDataContainer ( ) { return sessionDataContainer ; }
Source:
void initialize ( ) { org.ovirt.engine.core.bll.AutoRecoveryManager.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleACronJob ( this , "onTimer" , new java.lang.Class < ? > [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AutoRecoverySchedule ) ) ; org.ovirt.engine.core.bll.AutoRecoveryManager.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; }

Target:
void initialize ( ) { org.ovirt.engine.core.bll.AutoRecoveryManager.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleACronJob ( this , "onTimer" , new java.lang.Class < ? > [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AutoRecoverySchedule ) ) ; org.ovirt.engine.core.bll.AutoRecoveryManager.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute sync getIsUserLoggedIn: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.onFailure ( null ) ; }

Target:
public static void RunMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback successCallback ) { org.ovirt.engine.ui.frontend.Frontend.RunMultipleActions ( actionType , parameters , successCallback , null ) ; }
Source:
private java.lang.String resolveHostManagementNetworkAddress ( java.lang.String managementNetworkName ) { if ( managementNetworkName == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( host.getInterfaces ( ) , new org.ovirt.engine.core.utils.network.predicate.InterfaceByNetworkNamePredicate ( managementNetworkName ) ) ; return iface != null ? iface.getAddress ( ) : null ; }

Target:
private java.lang.String resolveHostManagementNetworkAddress ( java.lang.String managementNetworkName ) { if ( managementNetworkName == null ) { return null ; } return host.getInterfaces ( ) . stream ( ) . filter ( new org.ovirt.engine.core.utils.network.predicate.InterfaceByNetworkNamePredicate ( managementNetworkName ) ) . map ( VdsNetworkInterface :: getAddress ) . findFirst ( ) . orElse ( null ) ; }
Source:
private void overrideInjector ( org.ovirt.engine.core.di.Injector mockedInjector ) { try { java.lang.reflect.Field holdingMember = org.ovirt.engine.core.di.Injector.class . getDeclaredField ( "injector" ) ; holdingMember.setAccessible ( true ) ; holdingMember.set ( org.ovirt.engine.core.di.Injector.class , mockedInjector ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public < U extends T > javax.enterprise.inject.Instance < U > select ( java.lang.Class < U > aClass , java.lang.annotation.Annotation ... annotations ) { return new org.ovirt.engine.core.di.InjectorRule.SimpleInstanceIdGenerator < U > ( ( ( U ) ( org.ovirt.engine.core.di.InjectorRule.beansCache.get ( aClass.getName ( ) ) ) ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook ( ) ; entity.setHookId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "hook_id" ) ) ) ; entity.setServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "server_id" ) ) ) ; entity.setStatus ( rs.getString ( "hook_status" ) ) ; entity.setContentType ( rs.getString ( "content_type" ) ) ; entity.setChecksum ( rs.getString ( "checksum" ) ) ; entity.setServerName ( rs.getString ( "server_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook ( ) ; entity.setHookId ( getGuidDefaultEmpty ( rs , "hook_id" ) ) ; entity.setServerId ( getGuidDefaultEmpty ( rs , "server_id" ) ) ; entity.setStatus ( rs.getString ( "hook_status" ) ) ; entity.setContentType ( rs.getString ( "content_type" ) ) ; entity.setChecksum ( rs.getString ( "checksum" ) ) ; entity.setServerName ( rs.getString ( "server_name" ) ) ; return entity ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , false ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , false ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public static boolean setDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.common.businessentities.VM vm ) { if ( disk != null ) { java.lang.String vmName = "" ; int count = 1 ; if ( vm != null ) { vmName = vm.getvm_name ( ) ; count = ( vm.getDiskMapCount ( ) ) + 1 ; } disk.setDiskAlias ( org.ovirt.engine.core.bll.ImagesHandler.getSuggestedDiskAlias ( disk , vmName , count ) ) ; return true ; } else { org.ovirt.engine.core.bll.ImagesHandler.log.errorFormat ( "Disk object is null" ) ; return false ; } }

Target:
public static boolean setDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.common.businessentities.VM vm ) { if ( disk != null ) { java.lang.String vmName = "" ; int count = 1 ; if ( vm != null ) { vmName = vm.getVmName ( ) ; count = ( vm.getDiskMapCount ( ) ) + 1 ; } disk.setDiskAlias ( org.ovirt.engine.core.bll.ImagesHandler.getSuggestedDiskAlias ( disk , vmName , count ) ) ; return true ; } else { org.ovirt.engine.core.bll.ImagesHandler.log.errorFormat ( "Disk object is null" ) ; return false ; } }
Source:
public void calculateNetworkImplementationDetailsNetworkIsSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , true , iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , null ) ; }

Target:
public void caluculateNetworkImplementationDetailsNetworkInSyncWithoutQos ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setQos ( null ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , true , iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , null ) ; }
Source:
private void addFenceAgents ( ) { if ( ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getFenceAgents ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.FenceAgent agent : org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getFenceAgents ( ) ) { agent.setHostId ( org.ovirt.engine.core.bll.AddVdsCommand.getVdsId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getFenceAgentDao ( ) . save ( agent ) ; } } }

Target:
private void addFenceAgents ( ) { if ( ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getFenceAgents ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent : org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getFenceAgents ( ) ) { agent.setHostId ( org.ovirt.engine.core.bll.AddVdsCommand.getVdsId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getFenceAgentDao ( ) . save ( agent ) ; } } }
Source:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry : entries ) { org.junit.Assert.assertFalse ( entry.getStorageDomainId ( ) . equals ( FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }

Target:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry : entries ) { org.junit.Assert.assertNotEquals ( entry.getStorageDomainId ( ) , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }
Source:
private void auditLogOvfLoadError ( java.lang.String machineName , java.lang.String errorMessage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "Template" , machineName ) ; logable.addCustomValue ( "ErrorMessage" , errorMessage ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_FAILED_TO_IMPORT_TEMPLATE ) ; }

Target:
private void auditLogOvfLoadError ( java.lang.String machineName , java.lang.String errorMessage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; logable.addCustomValue ( "Template" , machineName ) ; logable.addCustomValue ( "ErrorMessage" , errorMessage ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_FAILED_TO_IMPORT_TEMPLATE ) ; }
Source:
public void addStatistics ( org.ovirt.engine.api.model.Host model , org.ovirt.engine.core.common.businessentities.VDS entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.HostStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.utils.LinkHelper.addLinks ( uriInfo , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }

Target:
public void addStatistics ( org.ovirt.engine.api.model.Host model , org.ovirt.engine.core.common.businessentities.VDS entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.HostStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( uriInfo , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }
Source:
protected void initVmForSpace ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( vm ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmList = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.utils.Pair ( vm , vmDevice ) ) ; org.mockito.Mockito.when ( vmDao.getVmsWithPlugInfo ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( vmList ) ; }

Target:
protected void initVmForSpace ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vm ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmList = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.utils.Pair ( vm , vmDevice ) ) ; org.mockito.Mockito.when ( vmDao.getVmsWithPlugInfo ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vmList ) ; }
Source:
protected boolean validateImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesToValidate = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) , true , false ) ; return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , true , true , true , true , imagesToValidate ) ; }

Target:
protected boolean validateImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesToValidate = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) , true , false ) ; org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( imagesToValidate ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , true , true , true , imagesToValidate ) ) ; }
Source:
private void internalEndSuccessfully ( ) { log.infoFormat ( "Ending command successfully: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endSuccessfully ( ) ; getParameters ( ) . incrementExecutionIndex ( ) ; if ( ( getExecutionIndex ( ) ) < ( getTaskHandlers ( ) . size ( ) ) ) { _actionState = CommandActionState.EXECUTE ; execute ( ) ; } } else { endSuccessfully ( ) ; } }

Target:
private void internalEndWithFailure ( ) { log.error ( "Ending command '{}' with failure." , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { if ( hasStepsToRevert ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } else { getReturnValue ( ) . setEndActionTryAgain ( false ) ; } startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }
Source:
public static org.ovirt.engine.core.bll.adbroker.LdapQueryExecutionBuilder getInstance ( ) { return org.ovirt.engine.core.bll.adbroker.LdapQueryExecutionBuilderImpl.instance ; }

Target:
public static org.ovirt.engine.core.bll.adbroker.LdapQueryExecutionBuilder getInstance ( ) { if ( ( org.ovirt.engine.core.bll.adbroker.LdapQueryExecutionBuilderImpl.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.adbroker.LdapQueryExecutionBuilderImpl.class ) { if ( ( org.ovirt.engine.core.bll.adbroker.LdapQueryExecutionBuilderImpl.instance ) == null ) { org.ovirt.engine.core.bll.adbroker.LdapQueryExecutionBuilderImpl.instance = new org.ovirt.engine.core.bll.adbroker.LdapQueryExecutionBuilderImpl ( ) ; } } } return org.ovirt.engine.core.bll.adbroker.LdapQueryExecutionBuilderImpl.instance ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachmentWithIpConfiguration ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol staticIp , java.lang.String address , java.lang.String netmask ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryAddress = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryAddress.setAddress ( address ) ; primaryAddress.setNetmask ( netmask ) ; ipConfiguration.getIPv4Addresses ( ) . add ( primaryAddress ) ; ipConfiguration.setBootProtocol ( staticIp ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( ipConfiguration ) ; return attachment ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachmentWithIpConfiguration ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol bootProtocol , java.lang.String address , java.lang.String netmask ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryAddress = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryAddress.setAddress ( address ) ; primaryAddress.setNetmask ( netmask ) ; primaryAddress.setBootProtocol ( bootProtocol ) ; ipConfiguration.getIPv4Addresses ( ) . add ( primaryAddress ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( ipConfiguration ) ; return attachment ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipals ( extension , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , true ) ) ; } return results ; }

Target:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipals ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , true ) ) ; } return results ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { updateDisksStorage ( storageDomain , memoryDisks ) ; org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = getStorageDomainValidator ( storageDomain ) ; return ( storageDomainValidator.isDomainWithinThresholds ( ) . isValid ( ) ) && ( storageDomainValidator.hasSpaceForClonedDisks ( memoryDisks ) . isValid ( ) ) ; }

Target:
protected java.util.function.Predicate < org.ovirt.engine.core.common.businessentities.StorageDomain > getPredicate ( final java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks ) { return ( storageDomain ) -> { updateDisksStorage ( storageDomain , memoryDisks ) ; org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = getStorageDomainValidator ( storageDomain ) ; return ( storageDomainValidator.isDomainWithinThresholds ( ) . isValid ( ) ) && ( storageDomainValidator.hasSpaceForClonedDisks ( memoryDisks ) . isValid ( ) ) ; } ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { final P params = org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.getParameters ( ) ; final java.lang.String storagePoolId = params.getStoragePoolId ( ) . toString ( ) ; final java.lang.String targetVersion = params.getCompatibilityVersion ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.log.infoFormat ( "Upgrading storage pool {0} to version {1}" , storagePoolId , targetVersion ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.getIrsProxy ( ) . upgradeStoragePool ( storagePoolId , targetVersion ) ; org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteIrsBrokerCommand ( ) { final P params = org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.getParameters ( ) ; final java.lang.String storagePoolId = params.getStoragePoolId ( ) . toString ( ) ; final java.lang.String targetVersion = params.getCompatibilityVersion ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.log.infoFormat ( "Upgrading storage pool {0} to version {1}" , storagePoolId , targetVersion ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.getIrsProxy ( ) . upgradeStoragePool ( storagePoolId , targetVersion ) ; org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
private void setDisks ( java.lang.Iterable value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; super . setItems ( disks ) ; }

Target:
private void setDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; super . setItems ( disks ) ; }
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 = 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 ( "message" , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerCommand.getReturnStatus ( ) . message ) ; auditLogDirector.log ( auditLogableBase , AuditLogType.VDS_BROKER_COMMAND_FAILURE ) ; }
Source:
public void eventRaised ( com.google.gwt.user.client.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "SearchString" . equals ( args.propertyName ) ) { if ( ! ( model.isSearchValidForServerSideSorting ( ) ) ) { model.clearSortOptions ( ) ; clearColumnSort ( ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "SearchString" . equals ( args.propertyName ) ) { if ( ! ( model.isSearchValidForServerSideSorting ( ) ) ) { model.clearSortOptions ( ) ; clearColumnSort ( ) ; } } }
Source:
private org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilderBase createBuilder ( ) { if ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isOldClusterVersion ( vm.getVdsGroupCompatibilityVersion ( ) ) ) { return new org.ovirt.engine.core.vdsbroker.vdsbroker.VmOldInfoBuilder ( vm , createInfo ) ; } else { return new org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder ( vm , org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getParameters ( ) . getVdsId ( ) , createInfo ) ; } }

Target:
private org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilderBase createBuilder ( ) { if ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isOldClusterVersion ( vm.getCompatibilityVersion ( ) ) ) { return new org.ovirt.engine.core.vdsbroker.vdsbroker.VmOldInfoBuilder ( vm , createInfo ) ; } else { return new org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder ( vm , org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getParameters ( ) . getVdsId ( ) , createInfo ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.NetworkCluster mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.NetworkCluster entity = new org.ovirt.engine.core.common.businessentities.NetworkCluster ( ) ; entity.setcluster_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "cluster_id" ) ) ) ; entity.setnetwork_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "network_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.NetworkStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setis_display ( rs.getBoolean ( "is_display" ) ) ; entity.setRequired ( rs.getBoolean ( "required" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkCluster mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkCluster entity = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; entity.setcluster_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "cluster_id" ) ) ) ; entity.setnetwork_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "network_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setis_display ( rs.getBoolean ( "is_display" ) ) ; entity.setRequired ( rs.getBoolean ( "required" ) ) ; return entity ; }
Source:
public void testUpdate ( ) { dao.save ( dummyPolicy ) ; dummyPolicy.setName ( "Altered dummy policy" ) ; dao.update ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.Assert.assertEquals ( result , dummyPolicy ) ; }

Target:
public void testUpdate ( ) { dao.save ( dummyPolicy ) ; dummyPolicy.setName ( "Altered dummy policy" ) ; dao.update ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( result , dummyPolicy ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( disk ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } buildSharedLockMap ( ) ; return ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ) && ( validateAllVmsForDiskAreDown ( ) ) ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) ? canRemoveDiskBasedOnImageStorageCheck ( ) : true ; }

Target:
protected boolean canDoAction ( ) { if ( ( getDisk ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } buildSharedLockMap ( ) ; return ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ) && ( validateAllVmsForDiskAreDown ( ) ) ) && ( canRemoveDiskBasedOnStorageTypeCheck ( ) ) ; }
Source:
private void MoveVdssToGoingToMaintananceMode ( ) { for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdssToMaintenance.values ( ) ) { if ( ( ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) && ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) ; } } }

Target:
private void MoveVdssToGoingToMaintananceMode ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > spms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdssToMaintenance.values ( ) ) { if ( ( vds.getspm_status ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.SPM ) ) { setVdsStatusToPrepareForMaintaice ( vds ) ; } else { spms.add ( vds ) ; } } for ( org.ovirt.engine.core.common.businessentities.VDS vds : spms ) { setVdsStatusToPrepareForMaintaice ( vds ) ; } org.ovirt.engine.core.bll.MaintananceNumberOfVdssCommand.freeLock ( ) ; }
Source:
protected boolean validateCanUpdateReadOnly ( org.ovirt.engine.core.bll.validator.DiskValidator diskValidator ) { if ( updateReadOnlyRequested ( ) ) { if ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return validate ( diskValidator.isReadOnlyPropertyCompatibleWithInterface ( ) ) ; } return true ; }

Target:
protected boolean validateCanUpdateReadOnly ( org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator ) { if ( updateReadOnlyRequested ( ) ) { if ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return validate ( diskValidator.isReadOnlyPropertyCompatibleWithInterface ( ) ) ; } return true ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_ATTACHMENT_NOT_EXISTS_ENTITY , networkAttachmentId.toString ( ) ) ) ; }

Target:
private boolean isNewAttachment ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { return networkAttachmentId == null ; }
Source:
public static org.ovirt.engine.core.vdsbroker.VMStatsRefresher create ( final org.ovirt.engine.core.vdsbroker.VdsManager manager ) { return new org.ovirt.engine.core.vdsbroker.PollVMStatsRefresher ( manager ) ; }

Target:
public static org.ovirt.engine.core.vdsbroker.VMStatsRefresher create ( final org.ovirt.engine.core.vdsbroker.VdsManager manager , final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector auditLogDirector , final org.ovirt.engine.core.utils.timer.SchedulerUtil scheduler ) { org.ovirt.engine.core.compat.Version version = manager.getCompatibilityVersion ( ) ; if ( ( ( org.ovirt.engine.core.common.FeatureSupported.jsonProtocol ( version ) ) && ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.STOMP ) == ( manager.getCopyVds ( ) . getProtocol ( ) ) ) ) && ( org.ovirt.engine.core.common.FeatureSupported.vmStatsEvents ( version ) ) ) { return new org.ovirt.engine.core.vdsbroker.jsonrpc.EventVMStatsRefresher ( manager , auditLogDirector , scheduler ) ; } return new org.ovirt.engine.core.vdsbroker.PollVMStatsRefresher ( manager , auditLogDirector , scheduler ) ; }