auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( 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.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ( obj ) ) ; return ( ( java.util.Objects.equals ( getId ( ) , entity.getId ( ) ) ) && ( java.util.Objects.equals ( getGlusterServerUuid ( ) , entity.getGlusterServerUuid ( ) ) ) ) && ( java.util.Objects.equals ( getKnownAddresses ( ) , entity.getKnownAddresses ( ) ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ( obj ) ) ; return ( ( java.util.Objects.equals ( serverId , entity.serverId ) ) && ( java.util.Objects.equals ( glusterServerUuid , entity.glusterServerUuid ) ) ) && ( java.util.Objects.equals ( knownAddresses , entity.knownAddresses ) ) ; }
Source:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public void getoVirtISOsList ( 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 ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public void testCommandExternalNetwork ( ) { setUpPhysicalNetwork ( org.ovirt.engine.core.bll.network.dc.AutodefineExternalNetworkCommandTest.HAS_SHORT_NAME , org.ovirt.engine.core.bll.network.dc.AutodefineExternalNetworkCommandTest.IS_VM_NETWORK ) ; physicalNetwork.setProvidedBy ( new org.ovirt.engine.core.common.businessentities.network.ProviderNetwork ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_FOR_EXTERNAL_NETWORK.name ( ) ) ) ; }

Target:
public void testCommandInvalidNetworkId ( ) { org.mockito.Mockito.when ( networkDao.get ( org.ovirt.engine.core.bll.network.dc.AutodefineExternalNetworkCommandTest.PHYSICAL_NETWORK_ID ) ) . thenReturn ( null ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.NETWORK_HAVING_ID_NOT_EXISTS ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( getVds ( ) . getStaticData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . update ( getParameters ( ) . getVdsStaticData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( getVds ( ) . getStaticData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . update ( getParameters ( ) . getVdsStaticData ( ) ) ; updateFenceAgents ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) { getGlusterHostAddress ( ) . setIsChangable ( true ) ; getGlusterHostPassword ( ) . setIsChangable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangable ( false ) ; getGlusterHostPassword ( ) . setIsChangable ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( getGlusterHostAddress ( ) . getEntity ( ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( getGlusterHostAddress ( ) . getEntity ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.InitializationType getInitializationType ( ) { if ( ( ( java.lang.Boolean ) ( getAttachFloppy ( ) . getEntity ( ) ) ) && ( "[sysprep]" . equals ( getFloppyImage ( ) . getSelectedItem ( ) ) ) ) { return org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ; } else if ( ( ( java.lang.Boolean ) ( getAttachIso ( ) . getEntity ( ) ) ) && ( "[cloud-init]" . equals ( getIsoImage ( ) . getSelectedItem ( ) ) ) ) { return org.ovirt.engine.core.common.businessentities.InitializationType.CloudInit ; } else { return org.ovirt.engine.core.common.businessentities.InitializationType.None ; } }

Target:
public java.lang.String getIsoImagePath ( ) { if ( ( ( java.lang.Boolean ) ( getAttachIso ( ) . getEntity ( ) ) ) ) { return ( ( java.lang.String ) ( getIsoImage ( ) . getSelectedItem ( ) ) ) ; } else { return "" ; } }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
private void localize ( final org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { startTimeEditor.setLabel ( constants.rebalanceStartTime ( ) ) ; volumeEditor.setLabel ( constants.rebalanceVolumeName ( ) ) ; clusterEditor.setLabel ( constants.rebalanceClusterVolume ( ) ) ; statusTimeEditor.setLabel ( constants.rebalanceStatusTime ( ) ) ; stopTimeEditor.setLabel ( constants.rebalanceStopTime ( ) ) ; }

Target:
private void localize ( final org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { status.setText ( constants.rebalanceComplete ( ) ) ; startTimeEditor.setLabel ( constants.rebalanceStartTime ( ) ) ; volumeEditor.setLabel ( constants.rebalanceVolumeName ( ) ) ; clusterEditor.setLabel ( constants.rebalanceClusterVolume ( ) ) ; statusTimeEditor.setLabel ( constants.rebalanceStatusTime ( ) ) ; stopTimeEditor.setLabel ( constants.rebalanceStopTime ( ) ) ; }
Source:
public static boolean isDiskImageRawBlock ( final org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { return ( ( diskImage.getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.RAW ) ) && ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDao ( ) . get ( diskImage.getStorageIds ( ) . get ( 0 ) ) . getStorageType ( ) . isBlockDomain ( ) ) ; }

Target:
public static boolean isDiskImageRawBlock ( final org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { return ( ( diskImage.getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.RAW ) ) && ( diskImage.getStorageTypes ( ) . get ( 0 ) . isBlockDomain ( ) ) ; }
Source:
private void addCreationDateColum ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > creationDateColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractRenderedTextColumn < org.ovirt.engine.core.common.businessentities.Permission , java.util.Date > ( new org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer ( ) ) { @ java.lang.Override public java.util.Date getRawValue ( org.ovirt.engine.core.common.businessentities.Permission object ) { return new java.util.Date ( ( ( object.getCreationDate ( ) ) * 1000 ) ) ; } } ; org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( creationDateColumn , constants.permissionsCreationDate ( ) , "300px" ) ; creationDateColumn.makeSortable ( ) ; }

Target:
private void addTypeColumn ( ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( new org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn ( ) , org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants.empty ( ) , "30px" ) ; }
Source:
private static int setCDBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isCD ( device ) ) && ( device.getIsPlugged ( ) ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } } return bootOrder ; }

Target:
private static int setCDBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isCD ( device ) ) && ( device.isPlugged ( ) ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } } return bootOrder ; }
Source:
private void dontSendTicket ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.SetVmTicketCommand.getVm ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.log.warnFormat ( "Can\'t give console of virtual machine \"{0}\" to user \"{1}\", it has probably been taken by another user." , vm.getId ( ) , user.getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( false ) ; }

Target:
private void dontSendTicket ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.SetVmTicketCommand.getVm ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.log.warn ( "Can't give console of virtual machine '{}' to user '{}', it has probably been taken by another user." , vm.getId ( ) , user.getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( false ) ; }
Source:
private org.ovirt.engine.core.bll.context.CommandContext createCommandContext ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity option ) { org.ovirt.engine.core.common.job.Step setOptionStep = addSubStep ( StepEnum.EXECUTING , StepEnum.SETTING_GLUSTER_OPTION , getOptionValues ( volume , option ) ) ; org.ovirt.engine.core.bll.job.ExecutionContext setOptionCtx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; setOptionCtx.setMonitored ( true ) ; setOptionCtx.setStep ( setOptionStep ) ; return new org.ovirt.engine.core.bll.context.CommandContext ( setOptionCtx , getCompensationContext ( ) ) ; }

Target:
private org.ovirt.engine.core.bll.context.CommandContext createCommandContext ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity option ) { org.ovirt.engine.core.common.job.Step setOptionStep = addSubStep ( StepEnum.EXECUTING , StepEnum.SETTING_GLUSTER_OPTION , getOptionValues ( volume , option ) ) ; org.ovirt.engine.core.bll.job.ExecutionContext setOptionCtx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; setOptionCtx.setMonitored ( true ) ; setOptionCtx.setStep ( setOptionStep ) ; return cloneContext ( ) . withExecutionContext ( setOptionCtx ) . withoutLock ( ) ; }
Source:
private void copyRoles ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel manageModel , org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { networkCluster.setRequired ( manageModel.isRequired ( ) ) ; networkCluster.setDisplay ( manageModel.isDisplayNetwork ( ) ) ; networkCluster.setMigration ( manageModel.isMigrationNetwork ( ) ) ; networkCluster.setManagement ( manageModel.isManagement ( ) ) ; networkCluster.setGluster ( manageModel.isGlusterNetwork ( ) ) ; }

Target:
private void copyRoles ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel manageModel , org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { networkCluster.setRequired ( manageModel.isRequired ( ) ) ; networkCluster.setDisplay ( manageModel.isDisplayNetwork ( ) ) ; networkCluster.setMigration ( manageModel.isMigrationNetwork ( ) ) ; networkCluster.setManagement ( manageModel.isManagement ( ) ) ; networkCluster.setDefaultRoute ( manageModel.isDefaultRouteNetwork ( ) ) ; networkCluster.setGluster ( manageModel.isGlusterNetwork ( ) ) ; }
Source:
protected void EntityPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . EntityPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { UpdateActionAvailability ( ) ; } }

Target:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ) ; } }
Source:
private void updateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangeble = ( ( getIsStaticAddress ( ) ) && ( network != null ) ) && ( ! ( network.getId ( ) . equals ( NGuid.Empty ) ) ) ; getAddress ( ) . setIsChangable ( isChangeble ) ; getSubnet ( ) . setIsChangable ( isChangeble ) ; getGateway ( ) . setIsChangable ( isChangeble ) ; }

Target:
private void updateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangeble = ( ( getIsStaticAddress ( ) ) && ( network != null ) ) && ( ! ( network.getId ( ) . equals ( Guid.Empty ) ) ) ; getAddress ( ) . setIsChangable ( isChangeble ) ; getSubnet ( ) . setIsChangable ( isChangeble ) ; getGateway ( ) . setIsChangable ( isChangeble ) ; }
Source:
public boolean poll ( org.ovirt.engine.core.compat.Guid hostId ) { long timeBeforePoll = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.core.common.interfaces.FutureVDSCall < org.ovirt.engine.core.common.vdscommands.VDSReturnValue > task = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runFutureVdsCommand ( FutureVDSCommandType.Poll , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( hostId ) ) ; try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = task.get ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SetupNetworksPollingTimeout ) , java.util.concurrent.TimeUnit.SECONDS ) ; if ( returnValue.getSucceeded ( ) ) { return true ; } waitBeforeNextPoll ( timeBeforePoll ) ; } catch ( java.util.concurrent.TimeoutException e ) { } return false ; }

Target:
public boolean poll ( org.ovirt.engine.core.compat.Guid hostId ) { waitBetweenPolls ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.LOGGER.trace ( "Request to do poll for host {}." , hostId ) ; org.ovirt.engine.core.common.interfaces.FutureVDSCall < org.ovirt.engine.core.common.vdscommands.VDSReturnValue > task = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runFutureVdsCommand ( FutureVDSCommandType.Poll , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( hostId ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.LOGGER.trace ( "FutureVDSCommandType.Poll executed for host{}." , hostId ) ; boolean succeeded = getValue ( task ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.LOGGER.trace ( "Result of FutureVDSCommandType.Poll for host {}: {}" , hostId , succeeded ) ; timestampOfEndOfPreviousInvocation = currentTimestamp ( ) ; return succeeded ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.storage_pool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }
Source:
private void onNumaSupport ( ) { if ( ( getWindow ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VmNumaSupportModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VmNumaSupportModel ) ( getWindow ( ) ) ) ; setVmNumaNodes ( model.getVm ( ) . getvNumaNodeList ( ) ) ; }

Target:
private void onNumaSupport ( ) { if ( ( getWindow ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VmNumaSupportModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VmNumaSupportModel ) ( getWindow ( ) ) ) ; setVmNumaNodes ( model.getNumaNodes ( model.getVm ( ) . getId ( ) ) ) ; model.getVm ( ) . setvNumaNodeList ( getVmNumaNodes ( ) ) ; }
Source:
public void validateFailsWhenGlusterServerHasPeers ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.SERVER_ALREADY_PART_OF_ANOTHER_CLUSTER.toString ( ) ) ) ; }

Target:
public void validateFailsWhenGlusterServerHasPeers ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( false ) ; org.junit.jupiter.api.Assertions.assertFalse ( command.validate ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.SERVER_ALREADY_PART_OF_ANOTHER_CLUSTER.toString ( ) ) ) ; }
Source:
public boolean handle ( java.util.List < org.ovirt.engine.api.extensions.ExtMap > queryResults ) { boolean result = true ; for ( org.ovirt.engine.api.extensions.ExtMap queryResult : queryResults ) { if ( ( groups.size ( ) ) < ( org.ovirt.engine.core.aaa.AuthzUtils.QUERIES_RESULTS_LIMIT ) ) { groups.add ( queryResult ) ; } else { result = false ; } } return result ; }

Target:
public boolean handle ( java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > queryResults ) { boolean result = true ; for ( org.ovirt.engine.api.extensions.ExtMap queryResult : queryResults ) { if ( ( groups.size ( ) ) < ( org.ovirt.engine.core.aaa.AuthzUtils.QUERIES_RESULTS_LIMIT ) ) { groups.add ( queryResult ) ; } else { result = false ; } } return result ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomainList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; if ( ( storageDomainList.size ( ) ) != 0 ) { model.getStorageTypeList ( ) . setChangeProhibitionReason ( constants.cannotChangeRepositoryTypeWithSDAttached ( ) ) ; model.getStorageTypeList ( ) . setIsChangable ( false ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomainList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; if ( ( storageDomainList.size ( ) ) != 0 ) { model.getStoragePoolType ( ) . setChangeProhibitionReason ( constants.cannotChangeRepositoryTypeWithSDAttached ( ) ) ; model.getStoragePoolType ( ) . setIsChangable ( false ) ; } }
Source:
private void optimizationForDesktopFormatter ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel object ) { if ( ( ( object.getOptimizationForDesktop ( ) ) != null ) && ( ( object.getOptimizationForDesktop ( ) . getEntity ( ) ) != null ) ) { optimizationForDesktopEditor.setLabel ( messages.clusterPopupMemoryOptimizationForDesktopLabel ( object.getOptimizationForDesktop ( ) . getEntity ( ) . toString ( ) ) ) ; } }

Target:
private void optimizationForDesktopFormatter ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel object ) { if ( ( ( object.getOptimizationForDesktop ( ) ) != null ) && ( ( object.getOptimizationForDesktop ( ) . getEntity ( ) ) != null ) ) { optimizationForDesktopEditor.asRadioButton ( ) . setHTML ( templates.radioButtonLabel ( messages.clusterPopupMemoryOptimizationForDesktopLabel ( object.getOptimizationForDesktop ( ) . getEntity ( ) . toString ( ) ) ) ) ; } }
Source:
public void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.BooleanReturnForXmlRpc glusterVolumeEmptyCheck ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.volumeEmptyCheck" ) . withParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.BooleanReturnForXmlRpc ( response , "volumeEmptyCheck" ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.BooleanReturn glusterVolumeEmptyCheck ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.volumeEmptyCheck" ) . withParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.BooleanReturn ( response , "volumeEmptyCheck" ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( VmOsType.RHEL6 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; mockVMDAO ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; mockVMDAO ( vm ) ; return vm ; }
Source:
public void testGetIncludeStatistics ( ) { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpEntityQueryExpectations ( ) ; org.ovirt.engine.api.model.HostNic nic = resource.get ( ) ; org.junit.Assert.assertTrue ( nic.isSetStatistics ( ) ) ; hostNicsResource.verifyModelSpecific ( nic , org.ovirt.engine.api.restapi.resource.BackendHostNicResourceTest.NIC_IDX ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpEntityQueryExpectations ( ) ; org.ovirt.engine.api.model.HostNic nic = resource.get ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( nic.isSetStatistics ( ) ) ; hostNicsResource.verifyModelSpecific ( nic , org.ovirt.engine.api.restapi.resource.BackendHostNicResourceTest.NIC_IDX ) ; } finally { accepts.clear ( ) ; } }
Source:
public void setUp ( ) { disk = org.ovirt.engine.core.bll.validator.DiskValidatorTest.createDisk ( ) ; disk.setDiskAlias ( "disk1" ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.DiskValidator ( disk ) ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( validator ) . getVmDAO ( ) ; }

Target:
public void setUp ( ) { initializeOsRepository ( 1 , DiskInterface.VirtIO ) ; disk = org.ovirt.engine.core.bll.validator.DiskValidatorTest.createDisk ( ) ; disk.setDiskAlias ( "disk1" ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.DiskValidator ( disk ) ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( validator ) . getVmDAO ( ) ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
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 ) ; }
Source:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setActive ( true ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( true ) ; }

Target:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = getDiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setActive ( true ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( true ) ; }
Source:
protected void setupForStorageTests ( ) { org.mockito.Mockito.doReturn ( multipleSdValidator ) . when ( command ) . getStorageDomainsValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anySet ( ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyList ( ) ) ; }

Target:
protected void setupForStorageTests ( ) { org.mockito.Mockito.doReturn ( multipleSdValidator ) . when ( command ) . getStorageDomainsValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anySetOf ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.DiskImage.class ) ) ; }
Source:
private boolean storageDomainStatusIsValid ( ) { boolean returnValue ; if ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.isInternalExecution ( ) ) { returnValue = checkStorageDomainStatus ( StorageDomainStatus.InActive , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , StorageDomainStatus.Maintenance ) ; } else { returnValue = checkStorageDomainStatus ( StorageDomainStatus.InActive , StorageDomainStatus.Unknown , StorageDomainStatus.Maintenance ) ; } return returnValue ; }

Target:
private boolean storageDomainStatusIsValid ( ) { boolean returnValue ; if ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.isInternalExecution ( ) ) { returnValue = checkStorageDomainStatus ( StorageDomainStatus.Inactive , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , StorageDomainStatus.Maintenance , StorageDomainStatus.PreparingForMaintenance ) ; } else { returnValue = checkStorageDomainStatus ( StorageDomainStatus.Inactive , StorageDomainStatus.Unknown , StorageDomainStatus.Maintenance , StorageDomainStatus.PreparingForMaintenance ) ; } return returnValue ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmDevice watchdogDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; watchdogDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( new org.ovirt.engine.core.compat.Guid ( ) , getParameters ( ) . getId ( ) ) ) ; watchdogDevice.setDevice ( VmDeviceType.WATCHDOG.getName ( ) ) ; watchdogDevice.setType ( VmDeviceType.WATCHDOG.getName ( ) ) ; watchdogDevice.setAddress ( StringUtils.EMPTY ) ; watchdogDevice.setSpecParams ( getSpecParams ( ) ) ; getVmDeviceDao ( ) . save ( watchdogDevice ) ; setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmDevice watchdogDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; watchdogDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( new org.ovirt.engine.core.compat.Guid ( ) , getParameters ( ) . getId ( ) ) ) ; watchdogDevice.setDevice ( VmDeviceType.WATCHDOG.getName ( ) ) ; watchdogDevice.setType ( VmDeviceGeneralType.WATCHDOG ) ; watchdogDevice.setAddress ( StringUtils.EMPTY ) ; watchdogDevice.setSpecParams ( getSpecParams ( ) ) ; getVmDeviceDao ( ) . save ( watchdogDevice ) ; setSucceeded ( true ) ; }
Source:
protected boolean isOSSupportingHotPlug ( ) { java.lang.String vmOs = org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getos ( ) . name ( ) ; java.lang.String [ ] unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.HotPlugUnsupportedOsList ) . split ( "," ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( vmOs ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; return false ; } } return true ; }

Target:
protected boolean isOsSupportingHotPlug ( ) { java.lang.String vmOs = org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getos ( ) . name ( ) ; java.lang.String [ ] unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.HotPlugUnsupportedOsList ) . split ( "," ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( vmOs ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; return false ; } } return true ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > searchVDSsByDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data = genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVdsDao ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( cpuFlagsManagerHandler.findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getClusterCompatibilityVersion ( ) ) ) ; } return data ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > searchVmsFromDb ( ) { org.ovirt.engine.core.aaa.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAllUsingQuery ( data.getQuery ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmLock ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateOperationProgress ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmStatistics ( vm ) ; } return vms ; }
Source:
public void testUpdateIfNeeded ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic before = dao.get ( existingVds.getId ( ) ) ; before.setStatus ( VDSStatus.Down ) ; dao.updateIfNeeded ( before ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic after = dao.get ( existingVds.getId ( ) ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testGet ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic result = dao.get ( existingVds.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingVds.getId ( ) , result.getId ( ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { jobDao.save ( job ) ; java.util.Set < java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > > entrySet = job.getJobSubjectEntities ( ) . entrySet ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entry : entrySet ) { jobSubjectEntityDao.save ( job.getId ( ) , entry.getKey ( ) , entry.getValue ( ) ) ; } return null ; }

Target:
public org.ovirt.engine.core.common.job.Job runInTransaction ( ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { job.getJobSubjectEntities ( ) ; } return job ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > presets = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > ) ( returnValue ) ) ; diskModel1.getPreset ( ) . setItems ( presets ) ; diskModel1.getPreset ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( presets ) ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > presets = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > ) ( returnValue ) ) ; diskModel1.getPreset ( ) . setItems ( presets ) ; diskModel1.getPreset ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( presets ) ) ; diskModel1.StopProgress ( ) ; }
Source:
public void execute ( java.util.Map < java.lang.String , java.lang.Object > argMap ) throws java.io.IOException , java.security.GeneralSecurityException { if ( ! ( org.ovirt.engine.core.uutils.crypto.EnvelopePBE.check ( new java.lang.String ( org.ovirt.engine.core.cryptotool.Main.readStream ( java.lang.System.in ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) , org.ovirt.engine.core.cryptotool.Main.getPassword ( "Password: " , ( ( java.lang.String ) ( argMap.get ( "password" ) ) ) ) ) ) ) { java.lang.System.err.println ( "FAILED" ) ; throw new org.ovirt.engine.core.cryptotool.Main.ExitException ( "Check failed" , 1 ) ; } }

Target:
public void execute ( java.util.Map < java.lang.String , java.lang.Object > argMap ) throws java.io.IOException , java.security.GeneralSecurityException { if ( ! ( org.ovirt.engine.core.uutils.crypto.EnvelopePBE.check ( new java.lang.String ( org.ovirt.engine.core.cryptotool.Main.readStream ( java.lang.System.in ) , java.nio.charset.StandardCharsets.UTF_8 ) , org.ovirt.engine.core.cryptotool.Main.getPassword ( "Password: " , ( ( java.lang.String ) ( argMap.get ( "password" ) ) ) ) ) ) ) { java.lang.System.err.println ( "FAILED" ) ; throw new org.ovirt.engine.core.cryptotool.Main.ExitException ( "Check failed" , 1 ) ; } }
Source:
protected void ExecuteVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.getParameters ( ) . setEntityId ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getId ( ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . gethibernation_vol_handle ( ) ) ) ) ) { setSuspendedVm ( true ) ; setSucceeded ( StopSuspendedVm ( ) ) ; } else { super . ExecuteVmCommand ( ) ; } removeStatelessVmUnmanagedDevices ( ) ; }

Target:
protected void executeVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.getParameters ( ) . setEntityId ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getId ( ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . gethibernation_vol_handle ( ) ) ) ) ) { setSuspendedVm ( true ) ; setSucceeded ( StopSuspendedVm ( ) ) ; } else { super . executeVmCommand ( ) ; } removeStatelessVmUnmanagedDevices ( ) ; }
Source:
public void checkValidIpConfigurationNoneBootProtocol ( ) { initIpConfigurationDetails ( Ipv4BootProtocol.NONE , false , false ) ; org.ovirt.engine.core.bll.ValidationResult actual = underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) ; org.junit.Assert.assertEquals ( ValidationResult.VALID , actual ) ; }

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 void initExternalProviderList ( ) { org.ovirt.engine.ui.frontend.AsyncQuery getProvidersQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = getNonReadOnlyExternalNetworkProviders ( result ) ; getExternalProviders ( ) . setItems ( providers ) ; selectExternalProvider ( ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllNetworkProviders ( getProvidersQuery ) ; }

Target:
private void initExternalProviderList ( ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.AsyncQuery getProvidersQuery = new org.ovirt.engine.ui.uicommonweb.models.datacenters.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = getNonReadOnlyExternalNetworkProviders ( result ) ; getExternalProviders ( ) . setItems ( providers ) ; selectExternalProvider ( ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllNetworkProviders ( getProvidersQuery ) ; }