auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainDynamicDao ( ) ; staticDao = dbFacade.getStorageDomainStaticDao ( ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setStorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setAvailableDiskSize ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainDynamicDao ( ) ; staticDao = dbFacade.getStorageDomainStaticDao ( ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setStorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newStaticDomain.setStorageFormat ( StorageFormatType.V1 ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setAvailableDiskSize ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }
Source:
protected void executeNetworkCommand ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , java.lang.Object ... params ) { assert op1 instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( op1 ) ) ; assert networkToDetach.isAttached ( ) ; org.ovirt.engine.core.compat.Guid networkId = networkToDetach.getNetwork ( ) . getId ( ) ; assert networkId == null ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.detachNetworkWithoutUpdatingHostSetupNetworksParameters ( dataFromHostSetupNetworksModel.allNics , networkToDetach ) ; dataFromHostSetupNetworksModel.removedUnmanagedNetworks.add ( networkToDetach.getNetwork ( ) . getName ( ) ) ; }

Target:
protected void executeNetworkCommand ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , java.lang.Object ... params ) { assert op1 instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( op1 ) ) ; assert networkToDetach.isAttached ( ) ; org.ovirt.engine.core.compat.Guid networkId = networkToDetach.getNetwork ( ) . getId ( ) ; assert networkId == null ; dataFromHostSetupNetworksModel.getRemovedUnmanagedNetworks ( ) . add ( networkToDetach.getNetwork ( ) . getName ( ) ) ; }
Source:
void addStyles ( ) { linuxBootOptionsPanel.setVisible ( false ) ; initialRunPanel.setVisible ( false ) ; hostPanel.setVisible ( true ) ; attachFloppyEditor.addContentWidgetStyleName ( style.attachImageCheckBoxLabel ( ) ) ; attachIsoEditor.addContentWidgetStyleName ( style.attachImageCheckBoxLabel ( ) ) ; floppyImageEditor.addLabelStyleName ( style.attachImageSelectBoxLabel ( ) ) ; isoImageEditor.addLabelStyleName ( style.attachImageSelectBoxLabel ( ) ) ; floppyImageEditor.addContentWidgetStyleName ( style.attachImageSelectbox ( ) ) ; isoImageEditor.addContentWidgetStyleName ( style.attachImageSelectbox ( ) ) ; }

Target:
void addStyles ( ) { linuxBootOptionsPanel.setVisible ( false ) ; initialRunPanel.setVisible ( false ) ; systemPanel.setVisible ( true ) ; hostPanel.setVisible ( true ) ; attachFloppyEditor.addContentWidgetStyleName ( style.attachImageCheckBoxLabel ( ) ) ; attachIsoEditor.addContentWidgetStyleName ( style.attachImageCheckBoxLabel ( ) ) ; floppyImageEditor.addLabelStyleName ( style.attachImageSelectBoxLabel ( ) ) ; isoImageEditor.addLabelStyleName ( style.attachImageSelectBoxLabel ( ) ) ; floppyImageEditor.addContentWidgetStyleName ( style.attachImageSelectbox ( ) ) ; isoImageEditor.addContentWidgetStyleName ( style.attachImageSelectbox ( ) ) ; }
Source:
public java.lang.String getDisplayStringNullSafe ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity data ) { return templates.typeAheadNameDescription ( ( ( data.getName ( ) ) == null ? constants.empty ( ) : data.getName ( ) ) , ( ( data.getVdsGroupName ( ) ) == null ? constants.empty ( ) : data.getVdsGroupName ( ) ) ) . asString ( ) ; }

Target:
public java.lang.String getDisplayStringNullSafe ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity data ) { return templates.typeAheadNameDescription ( ( ( data.getName ( ) ) == null ? constants.empty ( ) : data.getName ( ) ) , ( ( data.getClusterName ( ) ) == null ? constants.empty ( ) : data.getClusterName ( ) ) ) . asString ( ) ; }
Source:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

Target:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.bll.context.CommandContext cmdContext , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) , cmdContext ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { switch ( diskImage.getimageStatus ( ) ) { case OK : return getCommonResources ( ) . upImage ( ) ; case LOCKED : return getCommonResources ( ) . waitImage ( ) ; case ILLEGAL : return getCommonResources ( ) . logErrorImage ( ) ; default : return null ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { setEnumTitle ( diskImage.getimageStatus ( ) ) ; switch ( diskImage.getimageStatus ( ) ) { case OK : return getCommonResources ( ) . upImage ( ) ; case LOCKED : return getCommonResources ( ) . waitImage ( ) ; case ILLEGAL : return getCommonResources ( ) . logErrorImage ( ) ; default : return null ; } }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAllTags , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , failure ) ; if ( failure == null ) { setUpEntityQueryExpectations ( QueryType.GetRootTag , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpRootTag ( ) ) ; } }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.jupiter.api.Assertions.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAllTags , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , failure ) ; if ( failure == null ) { setUpEntityQueryExpectations ( QueryType.GetRootTag , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpRootTag ( ) ) ; } }
Source:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.InstallVdsCommand.getVds ( ) ) == null ) { return ; } if ( isOvirtReInstallOrUpgrade ( ) ) { upgradeNode ( ) ; } else { installHost ( ) ; } }

Target:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.InstallVdsCommand.getVds ( ) ) == null ) { return ; } vdsInitialStatus = org.ovirt.engine.core.bll.InstallVdsCommand.getVds ( ) . getStatus ( ) ; if ( isOvirtReInstallOrUpgrade ( ) ) { upgradeNode ( ) ; } else { installHost ( ) ; } }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected org.ovirt.engine.api.model.VM populate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < org.ovirt.engine.api.common.util.DetailHelper.Detail > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( getHttpHeaders ( ) ) ; parent.addInlineDetails ( details , model ) ; addStatistics ( model , entity , uriInfo , httpHeaders ) ; parent.setPayload ( model ) ; setBallooning ( model ) ; setCertificateInfo ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.VM deprecatedPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < org.ovirt.engine.api.common.util.DetailHelper.Detail > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( getHttpHeaders ( ) ) ; parent.addInlineDetails ( details , model ) ; addStatistics ( model , entity , uriInfo , httpHeaders ) ; parent.setPayload ( model ) ; parent.setBallooning ( model ) ; parent.setCertificateInfo ( model ) ; return model ; }
Source:
protected void failedToMigrate ( ) { try { determineMigrationFailureForAuditLog ( ) ; _isRerun = false ; org.ovirt.engine.core.bll.MigrateVmCommand.setSucceeded ( false ) ; org.ovirt.engine.core.bll.MigrateVmCommand.log ( ) ; failedToRunVm ( ) ; } finally { org.ovirt.engine.core.bll.MigrateVmCommand.freeLock ( ) ; } }

Target:
private boolean perform ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . setStartTime ( new java.util.Date ( ) ) ; try { if ( ( connectLunDisks ( getDestinationVdsId ( ) ) ) && ( migrateVm ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.MigrateVmCommand.getExecutionContext ( ) , true ) ; return true ; } } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { } org.ovirt.engine.core.bll.MigrateVmCommand.runningFailed ( ) ; return false ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkFilter resolveVnicProfileDefaultNetworkFilter ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableMACAntiSpoofingFilterRules ) ) { return networkFilterDao.getNetworkFilterByName ( NetworkFilter.VDSM_NO_MAC_SPOOFING ) ; } return null ; }

Target:
private void updateDefaultNetworkFilterIfRequired ( ) { if ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getParameters ( ) . isUseDefaultNetworkFiterId ( ) ) { final org.ovirt.engine.core.common.businessentities.network.NetworkFilter networkFilter = org.ovirt.engine.core.bll.network.cluster.NetworkHelper.resolveVnicProfileDefaultNetworkFilter ( networkFilterDao ) ; if ( networkFilter != null ) { final org.ovirt.engine.core.compat.Guid networkFilterId = networkFilter.getId ( ) ; setNetworkFilterId ( networkFilterId ) ; } } }
Source:
private void onRemove ( ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameterList = new java.util.LinkedList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Provider provider : providers ) { parameterList.add ( new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleActions ( VdcActionType.RemoveProvider , parameterList , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; } } ) ; cancel ( ) ; }

Target:
private void onRemove ( ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameterList = new java.util.LinkedList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Provider provider : providers ) { parameterList.add ( new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleActions ( VdcActionType.RemoveProvider , parameterList , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; } } ) ; cancel ( ) ; }
Source:
public void testGetTagUserMapByTagName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsUserMap > result = dao.getTagUserMapByTagName ( existingTag.gettag_name ( ) ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsUserMap mapping : result ) { assertEquals ( existingTag.gettag_id ( ) , mapping.gettag_id ( ) ) ; } }

Target:
public void testGetTagVdsMapByTagName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVdsMap > result = dao.getTagVdsMapByTagName ( existingTag.gettag_name ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVdsMap mapping : result ) { org.junit.Assert.assertEquals ( existingTag.gettag_id ( ) , mapping.gettag_id ( ) ) ; } }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateParameters ( volume , "name" , "volumeType" , "bricks" ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getMapper ( org.ovirt.engine.api.model.GlusterVolume.class , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) . map ( volume , null ) ; volumeEntity.setClusterId ( asGuid ( parent.get ( ) . getId ( ) ) ) ; mapBricks ( volume , volumeEntity ) ; return performCreation ( VdcActionType.CreateGlusterVolume , new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( volumeEntity ) , new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.gluster.IdQueryParameters.class ) , true ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateParameters ( volume , "name" , "volumeType" , "bricks" ) ; validateEnumParameters ( volume ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getMapper ( org.ovirt.engine.api.model.GlusterVolume.class , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) . map ( volume , null ) ; volumeEntity.setClusterId ( asGuid ( parent.get ( ) . getId ( ) ) ) ; mapBricks ( volume , volumeEntity ) ; return performCreation ( VdcActionType.CreateGlusterVolume , new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( volumeEntity ) , new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.gluster.IdQueryParameters.class ) , true ) ; }
Source:
public void checkMissingIpAddressDetailsBootProtocolStatic ( ) { final boolean initAddress = random.nextBoolean ( ) ; initIpConfigurationDetails ( Ipv4BootProtocol.STATIC_IP , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_STATIC_BOOT_PROTOCOL_MISSING_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) ) ) ; }

Target:
public void checkMissingIpv6AddressDetailsBootProtocolStatic ( ) { final boolean initAddress = random.nextBoolean ( ) ; initIpv6ConfigurationDetails ( Ipv6BootProtocol.STATIC_IP , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_STATIC_BOOT_PROTOCOL_MISSING_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) ) ) ; }
Source:
private java.util.Locale determineLocale ( final javax.servlet.http.HttpServletRequest request ) { java.util.Locale locale = org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( request.getParameter ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE ) ) ; if ( locale == null ) { locale = getLocaleFromCookies ( request.getCookies ( ) ) ; } if ( locale == null ) { locale = request.getLocale ( ) ; } if ( locale == null ) { locale = java.util.Locale.US ; } org.ovirt.engine.core.utils.servlet.LocaleFilter.log.debug ( ( "Filter determined locale to be: " + ( locale.toLanguageTag ( ) ) ) ) ; return locale ; }

Target:
private java.util.Locale lookupSupportedLocale ( final java.util.Locale filteredLocale , final java.util.List < java.lang.String > supportedLocales ) { for ( java.lang.String supportedLocale : supportedLocales ) { java.util.Locale locale = org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( supportedLocale ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < java.util.Locale > localeLookupList = org.apache.commons.lang.LocaleUtils.localeLookupList ( locale ) ; for ( java.util.Locale lookupLocale : localeLookupList ) { if ( lookupLocale.equals ( filteredLocale ) ) { return locale ; } } } return org.ovirt.engine.core.utils.servlet.LocaleFilter.DEFAULT_LOCALE ; }
Source:
public void testUpdateLUNsDeviceSize ( ) { int testDeviceSize = 20 ; dao.updateLUNsDeviceSize ( existingLUN.getLUN_id ( ) , testDeviceSize ) ; org.ovirt.engine.core.common.businessentities.LUNs dbLun = dao.get ( existingLUN.getLUN_id ( ) ) ; org.junit.Assert.assertEquals ( "LUN device size wasn't updated" , testDeviceSize , dbLun.getDeviceSize ( ) ) ; }

Target:
public void testUpdateLUNs ( ) { dao.update ( existingLUN ) ; org.ovirt.engine.core.common.businessentities.LUNs result = dao.get ( existingLUN.getLUN_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingLUN , result ) ; }
Source:
public static org.ovirt.engine.api.model.BootProtocol map ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol networkBootProtocol , org.ovirt.engine.api.model.BootProtocol template ) { if ( networkBootProtocol != null ) { switch ( networkBootProtocol ) { case Dhcp : return org.ovirt.engine.api.model.BootProtocol.DHCP ; case StaticIp : return org.ovirt.engine.api.model.BootProtocol.STATIC ; case None : return org.ovirt.engine.api.model.BootProtocol.NONE ; default : return null ; } } return null ; }

Target:
public static org.ovirt.engine.api.model.BootProtocol map ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol networkBootProtocol , org.ovirt.engine.api.model.BootProtocol template ) { if ( networkBootProtocol != null ) { switch ( networkBootProtocol ) { case DHCP : return org.ovirt.engine.api.model.BootProtocol.DHCP ; case STATIC_IP : return org.ovirt.engine.api.model.BootProtocol.STATIC ; case NONE : return org.ovirt.engine.api.model.BootProtocol.NONE ; default : return null ; } } return null ; }
Source:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }

Target:
private void setUpGetBallooningExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , true ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hosts.add ( 0 , null ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangable ( true ) ; setEnableSearchHost ( true ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { discoverHostName_SelectedItemChanged ( ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.isIscsiMultipathingSupported ( org.ovirt.engine.core.bll.storage.connection.iscsibond.AddIscsiBondCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) ) { return failCanDoAction ( EngineMessage.ISCSI_BOND_NOT_SUPPORTED ) ; } org.ovirt.engine.core.bll.validator.IscsiBondValidator validator = new org.ovirt.engine.core.bll.validator.IscsiBondValidator ( ) ; return ( ( validate ( validator.iscsiBondWithTheSameNameExistInDataCenter ( getIscsiBond ( ) ) ) ) && ( validate ( validator.validateAddedLogicalNetworks ( getIscsiBond ( ) ) ) ) ) && ( validate ( validator.validateAddedStorageConnections ( getIscsiBond ( ) ) ) ) ; }

Target:
protected boolean validate ( ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.isIscsiMultipathingSupported ( org.ovirt.engine.core.bll.storage.connection.iscsibond.AddIscsiBondCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) ) { return failValidation ( EngineMessage.ISCSI_BOND_NOT_SUPPORTED ) ; } org.ovirt.engine.core.bll.validator.IscsiBondValidator validator = new org.ovirt.engine.core.bll.validator.IscsiBondValidator ( ) ; return ( ( validate ( validator.iscsiBondWithTheSameNameExistInDataCenter ( getIscsiBond ( ) ) ) ) && ( validate ( validator.validateAddedLogicalNetworks ( getIscsiBond ( ) ) ) ) ) && ( validate ( validator.validateAddedStorageConnections ( getIscsiBond ( ) ) ) ) ; }
Source:
public void testExecuteCommand ( ) { setVolumeId ( volumeWithRemoveBricksTask ) ; mockBackend ( true , null ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 1 ) ) . endStepJobAborted ( org.mockito.Matchers.any ( java.lang.String.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 1 ) ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_STOP , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void testExecuteCommand ( ) { setVolumeId ( volumeWithRemoveBricksTask ) ; mockBackend ( true , null ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 1 ) ) . endStepJobAborted ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 1 ) ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_STOP , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setForce ( true ) ; verifyRemove ( resource.remove ( action ) ) ; }

Target:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendTemplateDiskResource.FORCE , java.lang.Boolean.TRUE.toString ( ) ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void getRoleList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.Role > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected void syncSearch ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.QosQueryParameterBase ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getEntity ( ) . getId ( ) , getQosType ( ) ) ; parameters.setRefresh ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllQosByStoragePoolIdAndType , parameters , new org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.SetItemsAsyncQuery ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.QosQueryParameterBase ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getEntity ( ) . getId ( ) , getQosType ( ) ) ; parameters.setRefresh ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( QueryType.GetAllQosByStoragePoolIdAndType , parameters , new org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.SetItemsAsyncQuery ( ) ) ; }
Source:
public void validateEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public void Execute ( ) { java.util.List < org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread > operations = new java.util.ArrayList < org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread > ( ) ; for ( int i = 0 ; i < ( _numberOfOperations ) ; i ++ ) { operations.add ( new org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread ( i ) ) ; } if ( ( _numberOfOperations ) > 0 ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.invokeAll ( operations ) ; } }

Target:
public void execute ( ) { java.util.List < org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread > operations = new java.util.ArrayList < org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread > ( ) ; for ( int i = 0 ; i < ( _numberOfOperations ) ; i ++ ) { operations.add ( new org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread ( i ) ) ; } if ( ( _numberOfOperations ) > 0 ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.invokeAll ( operations ) ; } }
Source:
public void testQueryFailsIfWrongPassword ( ) { mockQueryParameters ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.NEW_SERVER , org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.WRONG_PASSWORD ) ; try { getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.fail ( "Query didn't fail when wrong password was passed!" ) ; } catch ( java.lang.RuntimeException e ) { org.junit.Assert.assertEquals ( EngineMessage.SSH_AUTHENTICATION_FAILED.toString ( ) , e.getMessage ( ) ) ; } }

Target:
public void testQueryFailsIfWrongPassword ( ) { mockQueryParameters ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.NEW_SERVER , org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.WRONG_PASSWORD ) ; expectedException.expectMessage ( EngineMessage.SSH_AUTHENTICATION_FAILED.toString ( ) ) ; getQuery ( ) . executeQueryCommand ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDelete ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotDelete ( volumeName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDeleteAll ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotDeleteAll ( volumeName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testFetchNotExistingRepoFileListById ( ) { org.ovirt.engine.core.compat.Guid falseGuid = new org.ovirt.engine.core.compat.Guid ( "11111111-1111-1111-1111-111111111111" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( falseGuid , FileTypeExtension.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertSame ( true , listOfRepoFiles.isEmpty ( ) ) ; }

Target:
public void testFetchNotExistingRepoFileListById ( ) { org.ovirt.engine.core.compat.Guid falseGuid = new org.ovirt.engine.core.compat.Guid ( "11111111-1111-1111-1111-111111111111" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( falseGuid , ImageType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertSame ( true , listOfRepoFiles.isEmpty ( ) ) ; }
Source:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; for ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters parameters : org.ovirt.engine.core.bll.MoveDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageDao ( ) . get ( parameters.getImageId ( ) ) ; if ( diskImage != null ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskImage.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.CONFIGURE_DISK_STORAGE ) ) ; } } return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters parameters : org.ovirt.engine.core.bll.MoveDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageDao ( ) . get ( parameters.getImageId ( ) ) ; if ( diskImage != null ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskImage.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.CONFIGURE_DISK_STORAGE ) ) ; } } return permissionList ; }
Source:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setnetwork_id ( network.getId ( ) ) ; network.getCluster ( ) . setcluster_id ( cluster.getVDSGroup ( ) . getId ( ) ) ; performAction ( VdcActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }

Target:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { validateEnums ( org.ovirt.engine.api.model.Network.class , incoming ) ; org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setnetwork_id ( network.getId ( ) ) ; network.getCluster ( ) . setcluster_id ( cluster.getVDSGroup ( ) . getId ( ) ) ; performAction ( VdcActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult managementNetworkRequired ( org.ovirt.engine.core.common.businessentities.network.Network network ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_MANAGEMENT_NETWORK_REQUIRED , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) . when ( ( ( networkCluster.isManagement ( ) ) && ( ! ( networkCluster.isRequired ( ) ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkBelongsToClusterDataCenter ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.network.Network network ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_FROM_DIFFERENT_DC , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) . unless ( cluster.getStoragePoolId ( ) . equals ( network.getDataCenterId ( ) ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Erratum > getErrataForHost ( java.lang.String hostName ) { org.ovirt.engine.core.bll.host.provider.foreman.ContentHost contentHost = findContentHost ( hostName ) ; if ( contentHost == null ) { return java.util.Collections.emptyList ( ) ; } return runErrataListMethod ( java.lang.String.format ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.CONTENT_HOST_ERRATA_ENTRY_POINT , contentHost.getId ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Erratum > getErrataForHost ( java.lang.String hostName ) { org.ovirt.engine.core.bll.host.provider.foreman.ContentHost contentHost = findContentHost ( hostName ) ; if ( contentHost == null ) { log.error ( "Failed to find host on provider '{}' by host name '{}' " , getProvider ( ) . getName ( ) , hostName ) ; return java.util.Collections.emptyList ( ) ; } return runErrataListMethod ( java.lang.String.format ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.CONTENT_HOST_ERRATA_ENTRY_POINT , contentHost.getUuid ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmDevice createVmDeviceForDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.Disk disk , org.ovirt.engine.core.compat.Guid snapshotId , boolean isPlugged ) { org.ovirt.engine.core.common.businessentities.VmDevice device = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; device.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( vm.getId ( ) , disk.getId ( ) ) ) ; device.setSnapshotId ( snapshotId ) ; device.setIsPlugged ( isPlugged ) ; return device ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmDevice createVmDeviceForDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.Disk disk , org.ovirt.engine.core.compat.Guid snapshotId , boolean isPlugged ) { org.ovirt.engine.core.common.businessentities.VmDevice device = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; device.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( vm.getId ( ) , disk.getId ( ) ) ) ; device.setSnapshotId ( snapshotId ) ; device.setPlugged ( isPlugged ) ; return device ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchServers ( org.ovirt.engine.core.common.businessentities.VDS upServer , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchedServers = null ; while ( ( fetchedServers == null ) && ( ! ( existingServers.isEmpty ( ) ) ) ) { fetchedServers = fetchServers ( upServer ) ; if ( fetchedServers == null ) { logServerMessage ( upServer , AuditLogType.GLUSTER_SERVERS_LIST_FAILED ) ; setNonOperational ( upServer ) ; existingServers.remove ( upServer ) ; upServer = getNewUpServer ( existingServers , upServer ) ; } } return fetchedServers ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchServers ( org.ovirt.engine.core.common.businessentities.VDS upServer , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchedServers = null ; while ( ( fetchedServers == null ) && ( ! ( existingServers.isEmpty ( ) ) ) ) { fetchedServers = fetchServers ( upServer ) ; if ( fetchedServers == null ) { logUtil.logServerMessage ( upServer , AuditLogType.GLUSTER_SERVERS_LIST_FAILED ) ; setNonOperational ( upServer ) ; existingServers.remove ( upServer ) ; upServer = getNewUpServer ( existingServers , upServer ) ; } } return fetchedServers ; }
Source:
private void updateDiskImagesToIllegal ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > snapshotDisks = org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getDbFacade ( ) . getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( diskImage.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskSnapshot : snapshotDisks ) { diskSnapshot.setvm_snapshot_id ( null ) ; diskSnapshot.setimageStatus ( ImageStatus.ILLEGAL ) ; org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getDbFacade ( ) . getImageDao ( ) . update ( diskSnapshot.getImage ( ) ) ; } }

Target:
private void updateDiskImagesToIllegal ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > snapshotDisks = org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getDbFacade ( ) . getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( diskImage.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskSnapshot : snapshotDisks ) { diskSnapshot.setvm_snapshot_id ( null ) ; diskSnapshot.setImageStatus ( ImageStatus.ILLEGAL ) ; org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getDbFacade ( ) . getImageDao ( ) . update ( diskSnapshot.getImage ( ) ) ; } }