auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeQueryCommand ( ) { boolean succeeded = true ; if ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.getInstance ( ) . isSessionExists ( org.ovirt.engine.core.bll.aaa.GetDbUserBySessionQuery.getParameters ( ) . getSessionId ( ) ) ) { setReturnValue ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.getInstance ( ) . getUser ( org.ovirt.engine.core.bll.aaa.GetDbUserBySessionQuery.getParameters ( ) . getSessionId ( ) , false ) ) ; } else { succeeded = false ; } org.ovirt.engine.core.bll.aaa.GetDbUserBySessionQuery.getQueryReturnValue ( ) . setSucceeded ( succeeded ) ; }

Target:
protected void executeQueryCommand ( ) { boolean succeeded = true ; if ( sessionDataContainer.isSessionExists ( org.ovirt.engine.core.bll.aaa.GetDbUserBySessionQuery.getParameters ( ) . getSessionId ( ) ) ) { setReturnValue ( sessionDataContainer.getUser ( org.ovirt.engine.core.bll.aaa.GetDbUserBySessionQuery.getParameters ( ) . getSessionId ( ) , false ) ) ; } else { succeeded = false ; } org.ovirt.engine.core.bll.aaa.GetDbUserBySessionQuery.getQueryReturnValue ( ) . setSucceeded ( succeeded ) ; }
Source:
public void testGetAllRoleGroupMaps ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RoleGroupMap > result = dao.getAllForRole ( FixturesTool.ROLE_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.RoleGroupMap map : result ) { org.junit.Assert.assertEquals ( FixturesTool.ROLE_ID , map.getRoleId ( ) ) ; } }

Target:
public void testGetAllRoleGroupMaps ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RoleGroupMap > result = dao.getAllForRole ( FixturesTool.ROLE_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.RoleGroupMap map : result ) { org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.ROLE_ID , map.getRoleId ( ) ) ; } }
Source:
public void updateGlusterServerHook ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook , org.ovirt.engine.core.compat.Guid hostId ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterServerHook" , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , hook.getId ( ) ) . addValue ( "host_id" , hostId ) . addValue ( "checksum" , hook.getChecksum ( ) ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( hook.getStatus ( ) ) ) ) ; }

Target:
public void updateGlusterServerHookChecksum ( org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId , java.lang.String checksum ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterServerHookChecksum" , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , hookId ) . addValue ( "server_id" , serverId ) . addValue ( "checksum" , checksum ) ) ; }
Source:
private void onSaveSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; if ( ( confirmationModel != null ) && ( ! ( confirmationModel.validate ( ) ) ) ) { return ; } cancelConfirm ( ) ; getWindow ( ) . startProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveSan" } ) ) ) . Run ( ) ; }

Target:
private void onSaveSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; if ( ( confirmationModel != null ) && ( ! ( confirmationModel.validate ( ) ) ) ) { return ; } cancelConfirm ( ) ; getWindow ( ) . startProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveSan" } ) ) ) . run ( ) ; }
Source:
private void assertGetAllForVdsCorrectResult ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.network.InterfaceDaoTest.VDS_ID , iface.getVdsId ( ) ) ; } }

Target:
private void assertGetAllForVdsCorrectResult ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.network.InterfaceDaoImplTest.VDS_ID , iface.getVdsId ( ) ) ; } }
Source:
public void compensate ( ) { deleteImageGroup ( ) ; }

Target:
public void compensate ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RemoveDisk , new org.ovirt.engine.core.common.action.RemoveDiskParameters ( enclosingCommand.getParameters ( ) . getImageGroupID ( ) ) ) ; enclosingCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; }
Source:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( getModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > createQueryParameterList ( final org.ovirt.engine.core.common.queries.VdcQueryParametersBase parameters , final int count ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > result = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { result.add ( parameters ) ; } return result ; }

Target:
private java.util.List < org.ovirt.engine.core.common.queries.QueryParametersBase > createQueryParameterList ( final org.ovirt.engine.core.common.queries.QueryParametersBase parameters , final int count ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryParametersBase > result = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { result.add ( parameters ) ; } return result ; }
Source:
private void fillReportedConfigurations ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkNameToNicMap , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap , org.ovirt.engine.core.bll.network.host.QosDaoCache qosDaoCache , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.core.common.businessentities.network.Network network = networkMap.get ( networkAttachment.getNetworkId ( ) ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos networkQos = qosDaoCache.get ( network.getQosId ( ) ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = getNicToWhichIsNetworkAttached ( networkNameToNicMap , networkMap , networkAttachment ) ; if ( nic != null ) { org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations reportedConfigurations = createNetworkInSyncWithVdsNetworkInterface ( network , networkQos , nic ) . reportConfigurationsOnHost ( ) ; networkAttachment.setReportedConfigurations ( reportedConfigurations ) ; } }

Target:
org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface createNetworkInSyncWithVdsNetworkInterface ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos = effectiveHostNetworkQos.getQos ( networkAttachment , network ) ; return new org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface ( nic , network , hostNetworkQos ) ; }
Source:
public static < T extends org.ovirt.engine.core.common.businessentities.VmBase > void updateVmDevices ( T entity , org.ovirt.engine.core.compat.Guid newId ) { if ( entity != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateCdInVmDevice ( entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateBootOrderInVmDeviceAndStoreToDB ( entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateNumOfMonitorsInVmDevice ( null , entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateUSBSlots ( null , entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateMemoryBalloon ( null , entity , true ) ; } }

Target:
private static void updateSmartcardDevice ( org.ovirt.engine.core.common.businessentities.VM oldVm , org.ovirt.engine.core.common.businessentities.VmBase newVm ) { if ( ( newVm.isSmartcardEnabled ( ) ) == ( oldVm.isSmartcardEnabled ( ) ) ) { return ; } org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateSmartcardDevice ( newVm.getId ( ) , newVm.isSmartcardEnabled ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImageById ( org.ovirt.engine.core.compat.Guid id , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImages ) { if ( diskImage.getId ( ) . equals ( id ) ) { return diskImage ; } } return null ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImageById ( org.ovirt.engine.core.compat.Guid id , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { return org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( diskImages , new org.ovirt.engine.ui.uicommonweb.Linq.IdPredicate ( id ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > getHostLuns ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > ) ( runVdsCommand ( VDSCommandType.GetDeviceList , new org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getstorage_type ( ) ) ) . getReturnValue ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { getResult ( ) . setFailedVds ( vds ) ; throw e ; } }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > getHostLuns ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > ) ( runVdsCommand ( VDSCommandType.GetDeviceList , new org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getStorageType ( ) ) ) . getReturnValue ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { getResult ( ) . setFailedVds ( vds ) ; throw e ; } }
Source:
private void setUpAddUserExpectations ( java.lang.String query ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( query , SearchType.AdUser , getAdUser ( 0 ) ) ; setUpCreationExpectations ( VdcActionType.AddUser , org.ovirt.engine.core.common.action.AddUserParameters.class , new java.lang.String [ ] { "VdcUser.UserId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true , null , VdcQueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; }

Target:
private void setUpAddUserExpectations ( java.lang.String query ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( query , SearchType.AdUser , getAdUser ( 0 ) ) ; setUpCreationExpectations ( VdcActionType.AddUser , org.ovirt.engine.core.common.action.AddUserParameters.class , new java.lang.String [ ] { "AdUser.UserId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true , null , VdcQueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; }
Source:
public void setUp ( ) { disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; metadataDiskDescriptionHandler = org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.getInstance ( ) ; }

Target:
public void setUp ( ) { disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; metadataDiskDescriptionHandler = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.getInstance ( ) ) ; org.mockito.Mockito.doReturn ( auditLogDirector ) . when ( metadataDiskDescriptionHandler ) . getAuditLogDirector ( ) ; org.mockito.Mockito.doNothing ( ) . when ( auditLogDirector ) . log ( org.mockito.Matchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; }
Source:
void initFrontend ( ) { org.ovirt.engine.ui.frontend.Frontend.initEventsHandler ( frontendEventsHandler ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { user.logout ( ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }

Target:
protected void initFrontend ( ) { org.ovirt.engine.ui.frontend.Frontend.setEventsHandler ( frontendEventsHandler ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { user.logout ( ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult glusterNetworkInUseAndUnset ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_NETWORK_INUSE ) . when ( ( ( ( ( cluster.supportsGlusterService ( ) ) && ( oldNetworkCluster.isGluster ( ) ) ) && ( ! ( networkCluster.isGluster ( ) ) ) ) && ( isGlusterNetworkInUse ( ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult glusterNetworkInUseAndUnset ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_NETWORK_INUSE ) . when ( ( ( ( ( cluster.supportsGlusterService ( ) ) && ( oldNetworkCluster.isGluster ( ) ) ) && ( ! ( networkCluster.isGluster ( ) ) ) ) && ( isGlusterNetworkInUse ( ) ) ) ) ; }
Source:
public void auditInvalidInterfaces ( java.lang.String entityName ) { if ( ! ( invalidNetworkNames.isEmpty ( ) ) ) { 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 ( "EntityName" , entityName ) ; logable.addCustomValue ( "Networks" , org.apache.commons.lang.StringUtils.join ( invalidNetworkNames , ',' ) ) ; logable.addCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( invalidIfaceNames , ',' ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , logType ) ; } }

Target:
public void auditInvalidInterfaces ( java.lang.String entityName ) { if ( ! ( invalidNetworkNames.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "EntityName" , entityName ) ; logable.addCustomValue ( "Networks" , org.apache.commons.lang.StringUtils.join ( invalidNetworkNames , ',' ) ) ; logable.addCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( invalidIfaceNames , ',' ) ) ; createAuditLogDirector ( ) . log ( logable , logType ) ; } }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; 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 { setUpGetEntityExpectations ( QueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void canDoPass ( ) { org.mockito.Mockito.when ( hostedEngineHelper.getStorageDomain ( ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; int i = new java.util.Random ( ) . nextInt ( SUPPORTED_DOMAIN_TYPES.length ) ; sd.setStorageType ( org.ovirt.engine.core.bll.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES [ i ] ) ; sd.setStorageName ( org.ovirt.engine.core.bll.ImportHostedEngineStorageDomainCommandTest.HOSTED_STORAGE_NAME ) ; cmd.init ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void validatePass ( ) { org.mockito.Mockito.when ( hostedEngineHelper.getStorageDomain ( ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; int i = new java.util.Random ( ) . nextInt ( SUPPORTED_DOMAIN_TYPES.length ) ; sd.setStorageType ( org.ovirt.engine.core.bll.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES [ i ] ) ; sd.setStorageName ( org.ovirt.engine.core.bll.ImportHostedEngineStorageDomainCommandTest.HOSTED_STORAGE_NAME ) ; cmd.init ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }
Source:
public void checkServerTrusted ( java.security.cert.X509Certificate [ ] certs , java.lang.String authType ) { }

Target:
protected java.net.HttpURLConnection create ( java.net.URL url ) throws java.io.IOException , java.security.GeneralSecurityException { return new org.ovirt.engine.core.uutils.net.HttpURLConnectionBuilder ( url ) . setHttpsProtocol ( httpsProtocol ) . setReadTimeout ( readTimeout ) . setTrustManagerAlgorithm ( trustManagerAlgorithm ) . setTrustStore ( trustStore ) . setTrustStorePassword ( trustStorePassword ) . setTrustStoreType ( trustStoreType ) . setURL ( url ) . setVerifyChain ( verifyChain ) . setVerifyHost ( verifyHost ) . create ( ) ; }
Source:
private static void computeSmallByLargeIconId ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { if ( ( vmBase.getLargeIconId ( ) ) == null ) { return ; } final java.util.List < org.ovirt.engine.core.common.businessentities.VmIconDefault > iconDefaultsByLargeIconId = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmIconsDefaultDao ( ) . getByLargeIconId ( vmBase.getLargeIconId ( ) ) ; if ( ! ( iconDefaultsByLargeIconId.isEmpty ( ) ) ) { vmBase.setSmallIconId ( iconDefaultsByLargeIconId.get ( 0 ) . getSmallIconId ( ) ) ; } else { vmBase.setSmallIconId ( org.ovirt.engine.core.bll.utils.IconUtils.ensureSmallIconInDatabase ( vmBase.getLargeIconId ( ) ) ) ; } }

Target:
private void computeSmallByLargeIconId ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { if ( ( vmBase.getLargeIconId ( ) ) == null ) { return ; } final java.util.List < org.ovirt.engine.core.common.businessentities.VmIconDefault > iconDefaultsByLargeIconId = vmIconDefaultDao.getByLargeIconId ( vmBase.getLargeIconId ( ) ) ; if ( ! ( iconDefaultsByLargeIconId.isEmpty ( ) ) ) { vmBase.setSmallIconId ( iconDefaultsByLargeIconId.get ( 0 ) . getSmallIconId ( ) ) ; } else { vmBase.setSmallIconId ( ensureSmallIconInDatabase ( vmBase.getLargeIconId ( ) ) ) ; } }
Source:
public void testNotManagementNetworkNegative ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( DEFAULT_GUID ) ) . thenReturn ( false ) ; org.junit.Assert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotManagementNetworkNegative ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) . thenReturn ( false ) ; org.junit.Assert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testGetAllMultiClusterSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( "Clusters:" , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( vdsGroupResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllClusterSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Cluster" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( vdsGroupResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }
Source:
public void hideSuggestionBox ( ) { ( ( org.ovirt.engine.ui.webadmin.widget.autocomplete.SearchSuggestionDisplay ) ( searchStringInput.getSuggestionDisplay ( ) ) ) . hideSuggestions ( ) ; }

Target:
public void setHasSelectedTags ( boolean hasSelectedTags ) { if ( hasSelectedTags ) { searchStringPrefixLabel.addStyleName ( style.hasSelectedTags ( ) ) ; searchStringInput.addStyleName ( style.hasSelectedTags ( ) ) ; searchBoxClear.addStyleName ( style.hasSelectedTags ( ) ) ; } else { searchStringPrefixLabel.removeStyleName ( style.hasSelectedTags ( ) ) ; searchStringInput.removeStyleName ( style.hasSelectedTags ( ) ) ; searchBoxClear.removeStyleName ( style.hasSelectedTags ( ) ) ; } }
Source:
public void testNetworkNotAttachedToHostWhenAttached ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( vdsDaoMock.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( host ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) , host ) . networkNotAttachedToHost ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_ALREADY_ATTACHED_TO_HOST ) ) ; }

Target:
public void testNetworkNotAttachedToHostWhenAttached ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( vdsDaoMock.getAllForNetwork ( org.mockito.Matchers.eq ( networkId ) ) ) . thenReturn ( java.util.Collections.singletonList ( host ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( networkId ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotAttachedToHost ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_ALREADY_ATTACHED_TO_HOST ) ) ; }
Source:
protected org.ovirt.engine.api.model.Clusters mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > entities ) { org.ovirt.engine.api.model.Clusters collection = new org.ovirt.engine.api.model.Clusters ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup entity : entities ) { collection.getClusters ( ) . add ( addLinks ( map ( entity ) ) ) ; } return collection ; }

Target:
protected org.ovirt.engine.api.model.Clusters mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > entities ) { org.ovirt.engine.api.model.Clusters collection = new org.ovirt.engine.api.model.Clusters ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup entity : entities ) { collection.getClusters ( ) . add ( addLinks ( populate ( map ( entity ) , entity ) ) ) ; } return collection ; }
Source:
private org.ovirt.engine.core.common.vdscommands.GetVmsInfoVDSCommandParameters buildGetVmsInfoParameters ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage ) { org.ovirt.engine.core.common.vdscommands.GetVmsInfoVDSCommandParameters parameters = new org.ovirt.engine.core.common.vdscommands.GetVmsInfoVDSCommandParameters ( org.ovirt.engine.core.bll.storage.export.GetAllFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; parameters.setStorageDomainId ( storage.getId ( ) ) ; parameters.setVmIdList ( org.ovirt.engine.core.bll.storage.export.GetAllFromExportDomainQuery.getParameters ( ) . getIds ( ) ) ; return parameters ; }

Target:
private org.ovirt.engine.core.common.vdscommands.GetVmsInfoVDSCommandParameters buildGetVmsInfoParameters ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage ) { org.ovirt.engine.core.common.vdscommands.GetVmsInfoVDSCommandParameters parameters = new org.ovirt.engine.core.common.vdscommands.GetVmsInfoVDSCommandParameters ( org.ovirt.engine.core.bll.exportimport.GetAllFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; parameters.setStorageDomainId ( storage.getId ( ) ) ; parameters.setVmIdList ( org.ovirt.engine.core.bll.exportimport.GetAllFromExportDomainQuery.getParameters ( ) . getIds ( ) ) ; return parameters ; }
Source:
private void executeFenceVdsManuallyAction ( ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVdsId ( ) ) ; fenceVdsManuallyParams.setSessionId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getParameters ( ) . getSessionId ( ) ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getExecutionContext ( ) , new org.ovirt.engine.core.utils.lock.EngineLock ( getExclusiveLocks ( ) , null ) ) ) ; }

Target:
private void executeFenceVdsManuallyAction ( ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVdsId ( ) ) ; fenceVdsManuallyParams.setSessionId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getParameters ( ) . getSessionId ( ) ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.dupContext ( ) . withoutCompensationContext ( ) . withLock ( new org.ovirt.engine.core.utils.lock.EngineLock ( getExclusiveLocks ( ) , null ) ) ) ; }
Source:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "fencingEnabled" , fencingEnabled ) . append ( "skipFencingIfSDActive" , skipFencingIfSDActive ) . append ( "skipFencingIfConnectivityBroken" , skipFencingIfConnectivityBroken ) . append ( "hostsWithBrokenConnectivityThreshold" , hostsWithBrokenConnectivityThreshold ) . build ( ) ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "fencingEnabled" , fencingEnabled ) . append ( "skipFencingIfSDActive" , skipFencingIfSDActive ) . append ( "skipFencingIfConnectivityBroken" , skipFencingIfConnectivityBroken ) . append ( "hostsWithBrokenConnectivityThreshold" , hostsWithBrokenConnectivityThreshold ) . append ( "skipFencingIfGlusterBricksUp" , skipFencingIfGlusterBricksUp ) . append ( "skipFencingIfGlusterQuorumNotMet" , skipFencingIfGlusterQuorumNotMet ) . build ( ) ; }
Source:
protected void selectionChanged ( java.lang.Boolean value ) { for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model : getNetworksTableItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkManageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel ) ( model ) ) ; if ( canEditRequired ( clusterNetworkManageModel ) ) { clusterNetworkManageModel.setRequired ( value ) ; } refreshNetworksTable ( ) ; } }

Target:
protected void selectionChanged ( java.lang.Boolean value ) { for ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel : getNetworksTableItems ( ) ) { if ( canEditRequired ( clusterNetworkModel ) ) { clusterNetworkModel.setRequired ( value ) ; } refreshNetworksTable ( ) ; } }
Source:
public void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testGetListForSpmSelection ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getListForSpmSelection ( FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertTrue ( ( ( result.get ( 0 ) . getVdsSpmPriority ( ) ) >= ( result.get ( 1 ) . getVdsSpmPriority ( ) ) ) ) ; }

Target:
public void testGetListForSpmSelection ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getListForSpmSelection ( FixturesTool.DATA_CENTER ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( result.get ( 0 ) . getVdsSpmPriority ( ) ) >= ( result.get ( 1 ) . getVdsSpmPriority ( ) ) ) ) ; }
Source:
private void buildEntryStrings ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locks , java.lang.StringBuilder message ) { if ( locks != null ) { for ( java.util.Map.Entry < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > entry : locks.entrySet ( ) ) { message.append ( "key: " ) . append ( entry.getKey ( ) ) . append ( " value: " ) . append ( entry.getValue ( ) . getFirst ( ) ) . append ( '\n' ) ; } } }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "exclusiveLocks" , exclusiveLocks ) . append ( "sharedLocks" , sharedLocks ) . build ( ) ; }
Source:
void initTable ( ) { initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; }

Target:
void initTable ( ) { initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminButtonDefinition < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > ( constants.setupHostNetworksInterface ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getDetailModel ( ) . getSetupNetworksCommand ( ) ; } } ) ; }
Source:
private void ChangePassword ( ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.ChangeUserPassword , new org.ovirt.engine.core.common.action.ChangeUserPasswordParameters ( ( ( java.lang.String ) ( getUserName ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getPassword ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getNewPassword ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getDomain ( ) . getSelectedItem ( ) ) ) ) ) ; }

Target:
private void changePassword ( ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.ChangeUserPassword , new org.ovirt.engine.core.common.action.ChangeUserPasswordParameters ( ( ( java.lang.String ) ( getUserName ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getPassword ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getNewPassword ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getDomain ( ) . getSelectedItem ( ) ) ) ) ) ; }
Source:
public void setUp ( ) throws java.io.IOException { org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getImages ( ) ; mockCluster ( ) ; setXmlOvfData ( ) ; }

Target:
public void setUp ( ) throws java.io.IOException { ovfManager.setOsRepository ( osRepository ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getImages ( ) ; mockCluster ( ) ; setXmlOvfData ( ) ; }
Source:
private void executeFenceVdsManuallyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , getContext ( ) ) ; }

Target:
private boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( org.ovirt.engine.core.bll.RestartVdsCommand.isInternalExecution ( ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getName ( ) , AuditLogType.USER_VDS_RESTART.name ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addCanDoActionMessage ( VdcBllMessages.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.RestartVdsCommand.addCanDoActionMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.DiskImage x , org.ovirt.engine.core.common.businessentities.DiskImage y ) { if ( x.getcreation_date ( ) . before ( y.getcreation_date ( ) ) ) { return - 1 ; } if ( x.getcreation_date ( ) . after ( y.getcreation_date ( ) ) ) { return 1 ; } return 0 ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.DiskImage x , org.ovirt.engine.core.common.businessentities.DiskImage y ) { if ( x.getCreationDate ( ) . before ( y.getCreationDate ( ) ) ) { return - 1 ; } if ( x.getCreationDate ( ) . after ( y.getCreationDate ( ) ) ) { return 1 ; } return 0 ; }
Source:
private void updateDisksQuota ( java.lang.Object sender ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel ) ( sender ) ) . getSelectedItem ( ) ) ) ; if ( storageDomain != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel innerDisk : disks ) { if ( innerDisk.getStorageDomain ( ) . equals ( sender ) ) { updateQuota ( storageDomain.getId ( ) , innerDisk.getQuota ( ) ) ; break ; } } } }

Target:
private void updateDisks ( java.lang.Object sender ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel ) ( sender ) ) . getSelectedItem ( ) ) ) ; if ( storageDomain != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel innerDisk : disks ) { if ( innerDisk.getStorageDomain ( ) . equals ( sender ) ) { updateQuota ( storageDomain.getId ( ) , innerDisk.getQuota ( ) ) ; updateDiskProfile ( storageDomain.getId ( ) , innerDisk.getDiskProfile ( ) ) ; break ; } } } }
Source:
private void updateConflictActionsAvailability ( boolean isRemove ) { getResolveContentConflict ( ) . setEntity ( ( ! isRemove ) ) ; getResolveContentConflict ( ) . setIsChangable ( ( ! isRemove ) ) ; getResolveStatusConflict ( ) . setEntity ( ( ! isRemove ) ) ; getResolveStatusConflict ( ) . setIsChangable ( ( ! isRemove ) ) ; }

Target:
private void updateConflictActionsAvailability ( boolean isRemove ) { getResolveContentConflict ( ) . setEntity ( ( ! isRemove ) ) ; getResolveContentConflict ( ) . setIsChangeable ( ( ! isRemove ) ) ; getResolveStatusConflict ( ) . setEntity ( ( ! isRemove ) ) ; getResolveStatusConflict ( ) . setIsChangeable ( ( ! isRemove ) ) ; }
Source:
public static java.lang.String getOauth2CallbackUrl ( javax.servlet.http.HttpServletRequest request ) { return java.lang.String.format ( org.ovirt.engine.core.WelcomeUtils.OAUTH_CALLBACK_URL_FORMAT , request.getScheme ( ) , request.getServerName ( ) , request.getServerPort ( ) , org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( org.ovirt.engine.core.WelcomeUtils.ENGINE_URI ) ) ; }

Target:
public static java.lang.String getOauth2CallbackUrl ( javax.servlet.http.HttpServletRequest request ) { return java.lang.String.format ( org.ovirt.engine.core.WelcomeUtils.OAUTH_CALLBACK_URL_FORMAT , request.getScheme ( ) , org.ovirt.engine.core.aaa.filters.FiltersHelper.getRedirectUriServerName ( request.getServerName ( ) ) , request.getServerPort ( ) , org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( org.ovirt.engine.core.WelcomeUtils.ENGINE_URI ) ) ; }
Source:
public java.lang.String getServerFingerprint ( java.lang.String serverName ) { java.lang.String fingerPrint = null ; org.ovirt.engine.core.utils.ssh.EngineSSHDialog dialog = getEngineSSHDialog ( ) ; try { dialog.setHost ( serverName ) ; dialog.connect ( ) ; fingerPrint = dialog.getHostFingerprint ( ) ; } catch ( java.lang.Throwable e ) { log.errorFormat ( "Could not fetch fingerprint of host {0} with message: {1}" , serverName , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } finally { dialog.disconnect ( ) ; } return fingerPrint ; }

Target:
public java.lang.String getServerFingerprint ( java.lang.String serverName ) { java.lang.String fingerPrint = null ; org.ovirt.engine.core.bll.utils.EngineSSHDialog dialog = getEngineSSHDialog ( ) ; try { dialog.setHost ( serverName ) ; dialog.connect ( ) ; fingerPrint = dialog.getHostFingerprint ( ) ; } catch ( java.lang.Throwable e ) { log.errorFormat ( "Could not fetch fingerprint of host {0} with message: {1}" , serverName , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } finally { dialog.disconnect ( ) ; } return fingerPrint ; }
Source:
public static org.ovirt.engine.api.model.VmPool map ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.api.model.VmPool template ) { org.ovirt.engine.api.model.VmPool model = ( template != null ) ? template : new org.ovirt.engine.api.model.VmPool ( ) ; org.ovirt.engine.api.restapi.types.Vm vmModel = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.restapi.types.Vm ) ( null ) ) ) ; vmModel.setCluster ( null ) ; vmModel.setTemplate ( null ) ; vmModel.setVmPool ( null ) ; model.setVm ( vmModel ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.VmPool map ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.api.model.VmPool template ) { org.ovirt.engine.api.model.VmPool model = ( template != null ) ? template : new org.ovirt.engine.api.model.VmPool ( ) ; org.ovirt.engine.api.restapi.types.Vm vmModel = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.restapi.types.Vm ) ( null ) ) ) ; vmModel.setCluster ( null ) ; vmModel.setTemplate ( null ) ; vmModel.setVmPool ( null ) ; model.setVm ( vmModel ) ; model.setUseLatestTemplateVersion ( vm.isUseLatestVersion ( ) ) ; return model ; }
Source:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand.getVds ( ) ) == null ) { return ; } vdsInitialStatus = org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand.getVds ( ) . getStatus ( ) ; if ( isOvirtReInstallOrUpgrade ( ) ) { upgradeNode ( ) ; } }

Target:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand.getVds ( ) ) == null ) { return ; } org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand.reestablishConnectionIfNeeded ( ) ; vdsInitialStatus = org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand.getVds ( ) . getStatus ( ) ; if ( isOvirtReInstallOrUpgrade ( ) ) { upgradeNode ( ) ; } }
Source:
public final void setData ( java.lang.String sessionId , java.lang.String key , java.lang.Object value ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo == null ) { sessionInfo = new org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo ( ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo oldSessionInfo = sessionInfoMap.putIfAbsent ( sessionId , sessionInfo ) ; if ( oldSessionInfo != null ) { sessionInfo = oldSessionInfo ; } } sessionInfo.contentOfSession.put ( key , value ) ; }

Target:
public final void setData ( java.lang.String sessionId , java.lang.String key , java.lang.Object value ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo == null ) { sessionInfo = new org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo ( ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID , sessionId ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SOFT_LIMIT_INTERVAL_PARAMETER_NAME , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.UserSessionTimeOutInterval ) ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo oldSessionInfo = sessionInfoMap.putIfAbsent ( sessionId , sessionInfo ) ; if ( oldSessionInfo != null ) { sessionInfo = oldSessionInfo ; } } sessionInfo.contentOfSession.put ( key , value ) ; }
Source:
public void testStorageDomainLinks ( ) { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; storageDomain.setStorage ( new org.ovirt.engine.api.model.HostStorage ( ) ) ; storageDomain.getStorage ( ) . setPath ( "foo" ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( storageDomain ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , storageDomain.getHref ( ) ) ; org.junit.Assert.assertNull ( storageDomain.getStorage ( ) . getHref ( ) ) ; }

Target:
public void testStorageDomainLinks ( ) { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; storageDomain.setStorage ( new org.ovirt.engine.api.model.HostStorage ( ) ) ; storageDomain.getStorage ( ) . setPath ( "foo" ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( storageDomain ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , storageDomain.getHref ( ) ) ; org.junit.jupiter.api.Assertions.assertNull ( storageDomain.getStorage ( ) . getHref ( ) ) ; }
Source:
public void shouldDetectNonMigratableVMs ( ) { invalidVM.setMigrationSupport ( org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( UpgradeError.VM_NOT_MIGRATABLE ) ; }

Target:
public void shouldDetectPassThroughDeviceOnVM ( ) { org.mockito.Mockito.when ( hostDeviceManager.checkVmNeedsDirectPassthrough ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( true ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( EngineMessage.CLUSTER_UPGRADE_DETAIL_VM_NEEDS_PASSTHROUGH.name ( ) ) ; }