auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getManualFenceCommand ( ) ) ) { return manualFenceConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel < java.lang.Void > source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) || ( lastExecutedCommand == ( getModel ( ) . getMaintenanceCommand ( ) ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getManualFenceCommand ( ) ) ) { return manualFenceConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
private boolean hasReportsModelRefreshEvent ( ) { for ( org.ovirt.engine.ui.uicompat.IEventListener listnr : getModel ( ) . getReportModelRefreshEvent ( ) . getListeners ( ) ) { if ( listnr instanceof org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.ReportsModelRefreshEvent ) { return true ; } } return false ; }

Target:
protected void onReset ( ) { super . onReset ( ) ; if ( ! ( hasReportsModelRefreshEvent ( ) ) ) { org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.reportsWebappDeployed = false ; getModel ( ) . getReportsAvailabilityEvent ( ) . addListener ( new org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.ReportsModelRefreshEvent ( ) ) ; } setSubTabPanelVisible ( false ) ; getModel ( ) . refreshReportModel ( ) ; }
Source:
public static com.google.gwt.i18n.client.DateTimeFormat getFormat ( int dateStyle , int timeStyle ) { switch ( timeStyle ) { case org.ovirt.engine.core.compat.DateFormatCompat.FULL : return com.google.gwt.i18n.client.DateTimeFormat.getFormat ( PredefinedFormat.DATE_TIME_FULL ) ; case org.ovirt.engine.core.compat.DateFormatCompat.LONG : return com.google.gwt.i18n.client.DateTimeFormat.getFormat ( PredefinedFormat.DATE_TIME_LONG ) ; case org.ovirt.engine.core.compat.DateFormatCompat.SHORT : return com.google.gwt.i18n.client.DateTimeFormat.getFormat ( PredefinedFormat.DATE_TIME_SHORT ) ; default : return com.google.gwt.i18n.client.DateTimeFormat.getFormat ( PredefinedFormat.DATE_TIME_MEDIUM ) ; } }

Target:
public static com.google.gwt.i18n.client.DateTimeFormat getFormat ( int dateStyle , int timeStyle ) { switch ( timeStyle ) { case java.text.DateFormat.FULL : return com.google.gwt.i18n.client.DateTimeFormat.getFormat ( PredefinedFormat.DATE_TIME_FULL ) ; case java.text.DateFormat.LONG : return com.google.gwt.i18n.client.DateTimeFormat.getFormat ( PredefinedFormat.DATE_TIME_LONG ) ; case java.text.DateFormat.SHORT : return com.google.gwt.i18n.client.DateTimeFormat.getFormat ( PredefinedFormat.DATE_TIME_SHORT ) ; default : return com.google.gwt.i18n.client.DateTimeFormat.getFormat ( PredefinedFormat.DATE_TIME_MEDIUM ) ; } }
Source:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { if ( ! ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . isRemoveDuringExecution ( ) ) ) { removeImageFromDB ( true ) ; } } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.unLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }
Source:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = getDbFacade ( ) . getStorageDomainDao ( ) . getAllByConnectionId ( provider.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainEntry = storageDomains.get ( 0 ) ; getDbFacade ( ) . getStorageDomainDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; }

Target:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.StorageDomainDao.class ) . getAllByConnectionId ( provider.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainEntry = storageDomains.get ( 0 ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.StorageDomainDao.class ) . remove ( storageDomainEntry.getId ( ) ) ; }
Source:
public java.util.Set < java.lang.String > getHostNamesForVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { java.util.Set < java.lang.String > hosts = new java.util.HashSet < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity currentBrick : volume.getBricks ( ) ) { hosts.add ( currentBrick.getServerName ( ) ) ; } return hosts ; }

Target:
public java.util.Set < org.ovirt.engine.core.common.utils.Pair < java.lang.String , org.ovirt.engine.core.compat.Guid > > getHostNamesForVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { java.util.Set < org.ovirt.engine.core.common.utils.Pair < java.lang.String , org.ovirt.engine.core.compat.Guid > > hosts = new java.util.HashSet < org.ovirt.engine.core.common.utils.Pair < java.lang.String , org.ovirt.engine.core.compat.Guid > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity currentBrick : volume.getBricks ( ) ) { hosts.add ( new org.ovirt.engine.core.common.utils.Pair < java.lang.String , org.ovirt.engine.core.compat.Guid > ( currentBrick.getServerName ( ) , currentBrick.getServerId ( ) ) ) ; } return hosts ; }
Source:
void setAlertCount ( int count ) { java.lang.String countStr = ( count + " " ) + ( constants.alertsEventFooter ( ) ) ; com.google.gwt.safehtml.shared.SafeHtml up = templates.alertEventButton ( alertImage , countStr , buttonUpStart , buttonUpStretch , buttonUpEnd , style.alertButtonUpStyle ( ) ) ; com.google.gwt.safehtml.shared.SafeHtml down = templates.alertEventButton ( alertImage , countStr , buttonDownStart , buttonDownStretch , buttonDownEnd , style.alertButtonDownStyle ( ) ) ; alertButton.getUpFace ( ) . setHTML ( up ) ; alertButton.getDownFace ( ) . setHTML ( down ) ; }

Target:
void setAlertCount ( int count ) { java.lang.String countStr = ( ( ( constants.alertsEventFooter ( ) ) + " (" ) + count ) + ")" ; com.google.gwt.safehtml.shared.SafeHtml up = templates.alertEventButton ( alertImage , countStr , buttonUpStart , buttonUpStretch , buttonUpEnd , style.alertButtonUpStyle ( ) ) ; com.google.gwt.safehtml.shared.SafeHtml down = templates.alertEventButton ( alertImage , countStr , buttonDownStart , buttonDownStretch , buttonDownEnd , style.alertButtonDownStyle ( ) ) ; alertButton.getUpFace ( ) . setHTML ( up ) ; alertButton.getDownFace ( ) . setHTML ( down ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRestoreCommand ( ) ) ) { restore ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } else if ( "CancelConfirm" . equals ( command.getName ( ) ) ) { cancelConfirm ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRestoreCommand ( ) ) ) { restore ( ) ; return ; } if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; return ; } switch ( command.getName ( ) ) { case org.ovirt.engine.ui.uicommonweb.models.storage.ManageBackupModel.CANCEL_COMMAND : cancel ( ) ; break ; case org.ovirt.engine.ui.uicommonweb.models.storage.ManageBackupModel.CANCEL_CONFIRMATION_COMMAND : cancelConfirm ( ) ; break ; } }
Source:
public void testGetNoNetwork ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 , java.util.Collections.< org.ovirt.engine.api.model.Network > emptyList ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; assertNotNull ( nic ) ; assertNull ( nic.getNetwork ( ) . getName ( ) ) ; assertNull ( nic.getNetwork ( ) . getId ( ) ) ; verifyLinks ( nic ) ; }

Target:
public void testGetNoNetwork ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 , java.util.Collections.< org.ovirt.engine.api.model.Network > emptyList ( ) ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; assertNotNull ( nic ) ; assertNull ( nic.getNetwork ( ) . getName ( ) ) ; assertNull ( nic.getNetwork ( ) . getId ( ) ) ; verifyLinks ( nic ) ; }
Source:
private void loadVmPayload ( org.ovirt.engine.core.common.action.AddVmParameters addVmParams ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmTemplateId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) { addVmParams.setVmPayload ( new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ) ; return ; } } }

Target:
private void loadVmPayload ( org.ovirt.engine.core.common.action.AddVmParameters addVmParams ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmTemplateId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) { addVmParams.setVmPayload ( new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ) ; return ; } } }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > allDisks = org.ovirt.engine.core.bll.storage.disk.GetAllDisksPartialDataByVmIdQuery.getDbFacade ( ) . getDiskDao ( ) . getAllForVmPartialData ( org.ovirt.engine.core.bll.storage.disk.GetAllDisksPartialDataByVmIdQuery.getParameters ( ) . getId ( ) , false , org.ovirt.engine.core.bll.storage.disk.GetAllDisksPartialDataByVmIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllDisksPartialDataByVmIdQuery.getParameters ( ) . isFiltered ( ) ) ; org.ovirt.engine.core.bll.storage.disk.GetAllDisksPartialDataByVmIdQuery.getQueryReturnValue ( ) . setReturnValue ( allDisks ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > allDisks = diskDao.getAllForVmPartialData ( org.ovirt.engine.core.bll.storage.disk.GetAllDisksPartialDataByVmIdQuery.getParameters ( ) . getId ( ) , false , org.ovirt.engine.core.bll.storage.disk.GetAllDisksPartialDataByVmIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllDisksPartialDataByVmIdQuery.getParameters ( ) . isFiltered ( ) ) ; org.ovirt.engine.core.bll.storage.disk.GetAllDisksPartialDataByVmIdQuery.getQueryReturnValue ( ) . setReturnValue ( allDisks ) ; }
Source:
public void getLabelListByEntityId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid entityId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLabelByEntityId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( entityId ) , aQuery ) ; }

Target:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.StorageDomain > aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void attestationServerConfigured ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void attestationServerConfigured ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
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 getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
private void RunVMOnSpecificHost_EntityChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getRunVMOnSpecificHost ( ) . getEntity ( ) ) ) == true ) { getDontMigrateVM ( ) . setEntity ( false ) ; getDontMigrateVM ( ) . setIsChangable ( false ) ; } else { getDontMigrateVM ( ) . setIsChangable ( true ) ; } }

Target:
private void DontMigrateVM_EntityChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getDontMigrateVM ( ) . getEntity ( ) ) ) == true ) { clearAndDisable ( getRunVMOnSpecificHost ( ) ) ; getHostCpu ( ) . setIsChangable ( true ) ; } else { clearAndDisable ( getHostCpu ( ) ) ; getRunVMOnSpecificHost ( ) . setIsChangable ( true ) ; } }
Source:
public void fillTagsRecursive ( org.ovirt.engine.core.common.businessentities.Tags tagToFill , java.util.List < org.ovirt.engine.core.common.businessentities.Tags > children ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : children ) { if ( ( tag.gettype ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { list.add ( tag ) ; if ( ( tag.getChildren ( ) ) != null ) { fillTagsRecursive ( tag , tag.getChildren ( ) ) ; } } } tagToFill.setChildren ( list ) ; }

Target:
public void fillTagsRecursive ( org.ovirt.engine.core.common.businessentities.Tags tagToFill , java.util.List < org.ovirt.engine.core.common.businessentities.Tags > children ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : children ) { if ( ( tag.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { list.add ( tag ) ; if ( ( tag.getChildren ( ) ) != null ) { fillTagsRecursive ( tag , tag.getChildren ( ) ) ; } } } tagToFill.setChildren ( list ) ; }
Source:
private void checkIncompatibleIpAddressDetailsBootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol ipv4BootProtocol ) { final boolean initAddress = random.nextBoolean ( ) ; initIpConfigurationDetails ( ipv4BootProtocol , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_INCOMPATIBLE_BOOT_PROTOCOL_AND_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 ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_BOOT_PROTOCOL , ipv4BootProtocol.getDisplayName ( ) ) ) ) ; }

Target:
private void checkIncompatibleIpv4AddressDetailsBootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol ipv4BootProtocol ) { final boolean initAddress = random.nextBoolean ( ) ; initIpv4ConfigurationDetails ( ipv4BootProtocol , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_INCOMPATIBLE_BOOT_PROTOCOL_AND_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 ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_BOOT_PROTOCOL , ipv4BootProtocol.getDisplayName ( ) ) ) ) ; }
Source:
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.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , true ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times , int index ) 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 [ index ] } , payload ) ; } }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 ) ) ; prepareMocks ( cmd ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . startSubStep ( ) ; org.mockito.Mockito.verify ( cmd ) . handleTaskReturn ( asyncTaskToBeReturned ) ; org.mockito.Mockito.verify ( cmd ) . updateBricksWithTaskID ( asyncTaskToBeReturned ) ; org.junit.Assert.assertEquals ( AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommand ( ) { setVolumeId ( volumeId2 ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . startSubStep ( ) ; org.mockito.Mockito.verify ( cmd ) . handleTaskReturn ( asyncTaskToBeReturned ) ; org.mockito.Mockito.verify ( cmd ) . updateBricksWithTaskID ( asyncTaskToBeReturned ) ; org.junit.Assert.assertEquals ( AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
private void initializeMacPool ( org.ovirt.engine.core.common.businessentities.MacPool macPool ) { java.util.List < java.lang.String > macsForMacPool = macPoolDao.getAllMacsForMacPool ( macPool.getId ( ) ) ; final org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy pool = createPoolWithoutLocking ( macPool ) ; for ( java.lang.String mac : macsForMacPool ) { pool.forceAddMac ( mac ) ; } }

Target:
private void initializeMacPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { java.util.List < java.lang.String > macsForMacPool = macPoolDao.getAllMacsForMacPool ( macPool.getId ( ) ) ; final org.ovirt.engine.core.bll.network.macpool.MacPool pool = createPoolWithoutLocking ( macPool ) ; for ( java.lang.String mac : macsForMacPool ) { pool.forceAddMac ( mac ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.VDS_DOES_NOT_EXIST ) ; } if ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return failCanDoAction ( VdcBllMessages.VDS_ALREADY_UP ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.VdsValidator validator = new org.ovirt.engine.core.bll.VdsValidator ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) ; return ( ( validate ( validator.exists ( ) ) ) && ( validate ( validator.validateStatusForActivation ( ) ) ) ) && ( validate ( validator.validateUniqueId ( ) ) ) ; }
Source:
public static boolean isSane ( java.lang.String path ) { final int length = path.length ( ) ; if ( length > ( org.ovirt.engine.core.utils.servlet.ServletUtils.PATH_MAX ) ) { org.ovirt.engine.core.utils.servlet.ServletUtils.log.error ( "The path '{}' is characters long, which is longer than the maximum allowed {}." , path , length , org.ovirt.engine.core.utils.servlet.ServletUtils.PATH_MAX ) ; return false ; } if ( ( ( path.contains ( ".." ) ) || ( path.contains ( "//" ) ) ) || ( path.contains ( "./" ) ) ) { org.ovirt.engine.core.utils.servlet.ServletUtils.log.error ( "The path contains potentially dangerous directory navigation sequences." ) ; return false ; } return true ; }

Target:
public static boolean isSane ( java.lang.String path ) { final int length = path.length ( ) ; if ( length > ( org.ovirt.engine.core.utils.servlet.ServletUtils.PATH_MAX ) ) { org.ovirt.engine.core.utils.servlet.ServletUtils.log.info ( "The path '{}' is characters long, which is longer than the maximum allowed {}." , path , length , org.ovirt.engine.core.utils.servlet.ServletUtils.PATH_MAX ) ; return false ; } if ( ( ( path.contains ( ".." ) ) || ( path.contains ( "//" ) ) ) || ( path.contains ( "./" ) ) ) { org.ovirt.engine.core.utils.servlet.ServletUtils.log.info ( "The path contains potentially dangerous directory navigation sequences." ) ; return false ; } return true ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmPayload getVmPayloadByDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType deviceType ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.RunVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , VmDeviceGeneralType.DISK , deviceType.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( ( vmDevice.getIsManaged ( ) ) && ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) ) { return new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ; } } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmPayload getVmPayloadByDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType deviceType ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = vmDeviceDao.getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , VmDeviceGeneralType.DISK , deviceType.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( ( vmDevice.getIsManaged ( ) ) && ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) ) { return new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ; } } return null ; }
Source:
public void testRemove ( ) { addVmInit ( ) ; org.ovirt.engine.core.common.businessentities.VmInit result = dao.get ( org.ovirt.engine.core.dao.VmInitDaoTest.EXISTING_VM ) ; org.junit.Assert.assertNotNull ( result ) ; dao.remove ( org.ovirt.engine.core.dao.VmInitDaoTest.EXISTING_VM ) ; result = dao.get ( org.ovirt.engine.core.dao.VmInitDaoTest.EXISTING_VM ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testRemove ( ) { addVmInit ( ) ; org.ovirt.engine.core.common.businessentities.VmInit result = dao.get ( org.ovirt.engine.core.dao.VmInitDaoTest.EXISTING_VM ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; dao.remove ( org.ovirt.engine.core.dao.VmInitDaoTest.EXISTING_VM ) ; result = dao.get ( org.ovirt.engine.core.dao.VmInitDaoTest.EXISTING_VM ) ; org.junit.jupiter.api.Assertions.assertNull ( result ) ; }
Source:
protected void init ( ) { super . init ( ) ; initResource ( resource.getCollection ( ) ) ; }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc createVG ( java.lang.String sdUUID , java.lang.String [ ] deviceList ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "LVMVolumeGroup.create" ) . withParameter ( "name" , sdUUID ) . withParameter ( "devlist" , new java.util.ArrayList < > ( java.util.Arrays.asList ( deviceList ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }

Target:
private void waitUntilCheck ( java.util.function.Predicate < org.ovirt.vdsm.jsonrpc.client.JsonRpcClient > check , java.lang.String formatBefore , java.lang.String formatAfter ) throws java.lang.InterruptedException { java.lang.String hostname = client.getHostname ( ) ; org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.debug ( formatBefore , hostname ) ; int retries = 50 ; while ( check.test ( this . client ) ) { if ( retries == 0 ) { throw new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( ( ( "Unable to reconnect to " + hostname ) + " after policy reset" ) ) ; } retries -- ; java.util.concurrent.TimeUnit.MILLISECONDS.sleep ( 200 ) ; } org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.debug ( formatAfter , hostname ) ; }
Source:
public void enableHaReservationCheck ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start HA Reservation check" ) ; java.lang.Integer interval = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsHaReservationIntervalInMinutes ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( this , "performHaResevationCheck" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , interval , interval , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished HA Reservation check" ) ; } }

Target:
public void enableHaReservationCheck ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start HA Reservation check" ) ; java.lang.Integer interval = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsHaReservationIntervalInMinutes ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleAFixedDelayJob ( this , "performHaResevationCheck" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , interval , interval , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished HA Reservation check" ) ; } }
Source:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }

Target:
public void vdsGroupWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }
Source:
public static void GetGlusterHosts ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress , java.lang.String rootPassword , java.lang.String fingerprint ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterServersQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterServersQueryParameters ( hostAddress , rootPassword ) ; parameters.setFingerprint ( fingerprint ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServers , parameters , aQuery ) ; }

Target:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getProvider ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , org.ovirt.engine.core.common.queries.ProviderQueryParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getHosts ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getProvider ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiscoveredHostListFromExternalProvider , org.ovirt.engine.core.common.queries.ProviderQueryParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getHosts ( ) , failure ) ; }
Source:
protected void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( getCommandId ( ) , ( ( getParameters ( ) . getParentParameters ( ) ) == null ? org.ovirt.engine.core.compat.Guid.Empty : getParameters ( ) . getParentParameters ( ) . getCommandId ( ) ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus ) ; }

Target:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack ) ) ; }
Source:
protected void initLists ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { sanStorageLunToTargetList = new org.ovirt.engine.ui.common.widget.uicommon.storage.SanStorageLunToTargetList ( object , true , multiSelection ) ; sanStorageLunToTargetList.activateItemsUpdate ( ) ; sanStorageLunToTargetList.setTreeContainerHeight ( listHeight ) ; contentPanel.getElement ( ) . getStyle ( ) . setHeight ( panelHeight , Unit.PX ) ; listPanel.add ( sanStorageLunToTargetList ) ; }

Target:
protected void initLists ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { sanStorageLunToTargetList = new org.ovirt.engine.ui.common.widget.uicommon.storage.SanStorageLunToTargetList ( object , true , multiSelection ) ; sanStorageLunToTargetList.activateItemsUpdate ( ) ; sanStorageLunToTargetList.setTreeContainerHeight ( listHeight ) ; contentPanel.getElement ( ) . getStyle ( ) . setHeight ( panelHeight , Unit.PX ) ; contentPanel.setWidget ( sanStorageLunToTargetList ) ; }
Source:
private void doTestBadAddMacPool ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.AddMacPool , org.ovirt.engine.core.common.action.MacPoolParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; org.ovirt.engine.api.model.MacPool model = org.ovirt.engine.api.restapi.resource.BackendMacPoolsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddMacPool ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.AddMacPool , org.ovirt.engine.core.common.action.MacPoolParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; org.ovirt.engine.api.model.MacPool model = org.ovirt.engine.api.restapi.resource.BackendMacPoolsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static void GetVmSnapshotList ( 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void GetMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
private void readNetworkItem ( org.ovirt.engine.core.compat.backendcompat.XmlNode node ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = getNetwotkInterface ( node ) ; updateSingleNic ( node , iface ) ; _vm.getInterfaces ( ) . add ( iface ) ; readVmDevice ( node , _vm.getStaticData ( ) , iface.getId ( ) , java.lang.Boolean.TRUE ) ; }

Target:
protected void updateSingleNic ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { super . updateSingleNic ( node , iface ) ; iface.setName ( node.SelectSingleNode ( OvfProperties.VMD_NAME , _xmlNS ) . innerText ) ; iface.setMacAddress ( ( ( node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) ) != null ? node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) . innerText : "" ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getLunDao ( ) ; existingLUN = dao.get ( "1IET_00180001" ) ; newLUN = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; newLUN.setLUNId ( "oicu812" ) ; newLUN.setVolumeGroupId ( "" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getLunDao ( ) ; existingLUN = dao.get ( FixturesTool.LUN_ID1 ) ; newLUN = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; newLUN.setLUNId ( "oicu812" ) ; newLUN.setVolumeGroupId ( "" ) ; }
Source:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
private void validateRngRequiredSource ( ) { org.ovirt.engine.core.compat.Version clusterVersion = getVersion ( ) . getSelectedItem ( ) ; boolean rngSupportedForCluster = isRngSupportedForClusterVersion ( clusterVersion ) ; getRngRandomSourceRequired ( ) . setIsValid ( ( rngSupportedForCluster || ( ! ( getRngRandomSourceRequired ( ) . getEntity ( ) ) ) ) ) ; getRngHwrngSourceRequired ( ) . setIsValid ( ( rngSupportedForCluster || ( ! ( getRngHwrngSourceRequired ( ) . getEntity ( ) ) ) ) ) ; }

Target:
private void initSelectedMacPool ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.MacPool > allMacPools = getMacPoolListModel ( ) . getItems ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = getEntity ( ) ; if ( ( allMacPools != null ) && ( cluster != null ) ) { org.ovirt.engine.core.compat.Guid macPoolId = cluster.getMacPoolId ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : allMacPools ) { if ( macPool.getId ( ) . equals ( macPoolId ) ) { getMacPoolListModel ( ) . setSelectedItem ( macPool ) ; break ; } } } }
Source:
public void create ( ) { log.info ( "oVirt optimizer service starting" ) ; threads = new java.util.HashSet < > ( ) ; int refresh = java.lang.Integer.valueOf ( configProvider.load ( ) . getConfig ( ) . getProperty ( ConfigProvider.SOLVER_CLUSTER_REFRESH ) ) ; discoveryTimer = scheduler.createTimer ( refresh , org.ovirt.optimizer.service.DiscoveryTimeout.class ) ; }

Target:
public void create ( ) { log.info ( "oVirt optimizer service starting" ) ; threads = new java.util.HashSet < > ( ) ; int refresh = java.lang.Integer.parseInt ( configProvider.load ( ) . getConfig ( ) . getProperty ( ConfigProvider.SOLVER_CLUSTER_REFRESH ) ) ; discoveryTimer = scheduler.createTimer ( refresh , org.ovirt.optimizer.service.DiscoveryTimeout.class ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult notChangingManagementNetwork ( org.ovirt.engine.core.common.businessentities.network.Network newNetwork ) { java.lang.String managementNetwork = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ManagementNetwork ) ; return ( network.getName ( ) . equals ( managementNetwork ) ) && ( ! ( newNetwork.getName ( ) . equals ( managementNetwork ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult notRenamingManagementNetwork ( org.ovirt.engine.core.common.businessentities.network.Network newNetwork ) { java.lang.String managementNetwork = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ManagementNetwork ) ; return ( network.getName ( ) . equals ( managementNetwork ) ) && ( ! ( newNetwork.getName ( ) . equals ( managementNetwork ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private org.ovirt.engine.core.common.businessentities.HostJobInfo.HostJobStatus pollEntityIfSupported ( org.ovirt.engine.core.bll.CommandBase < ? > cmd ) { try { return ( ( org.ovirt.engine.core.bll.storage.EntityPollingCommand ) ( cmd ) ) . poll ( ) ; } catch ( java.lang.Exception e ) { log.error ( "Command id: '{}': failed to poll the command entity" , cmd.getActionType ( ) , cmd.getCommandId ( ) ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.HostJobInfo.HostJobStatus pollEntity ( org.ovirt.engine.core.bll.CommandBase < ? > cmd ) { try { return ( ( org.ovirt.engine.core.bll.storage.EntityPollingCommand ) ( cmd ) ) . poll ( ) ; } catch ( java.lang.Exception e ) { log.error ( "Command id: '{}': failed to poll the command entity" , cmd.getActionType ( ) , cmd.getCommandId ( ) ) ; } return null ; }