auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setExternalId ( "0" ) ; newUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( "groups" ) ) ) ; newUser.setNamespace ( "*" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; newUser.setExternalId ( "0" ) ; newUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( "groups" ) ) ) ; newUser.setNamespace ( "*" ) ; }
Source:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.network.vm.ReorderVmNicsCommand.getVm ( ) ; if ( ( vm == null ) || ( ( vm.getStaticData ( ) ) == null ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST ) ; return false ; } if ( ! ( org.ovirt.engine.core.bll.network.vm.ReorderVmNicsCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.network.vm.ReorderVmNicsCommand.getVm ( ) ; if ( ( vm == null ) || ( ( vm.getStaticData ( ) ) == null ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; return false ; } if ( ! ( org.ovirt.engine.core.bll.network.vm.ReorderVmNicsCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } return true ; }
Source:
public static java.net.URL getTrustStoreUrl ( ) throws java.net.MalformedURLException { return new java.net.URL ( ( ( org.ovirt.engine.core.bll.provider.ExternalTrustStoreInitializer.FILE_URL_PREFIX ) + ( org.ovirt.engine.core.bll.provider.ExternalTrustStoreInitializer.getTrustStorePath ( ) ) ) ) ; }

Target:
public static java.security.KeyStore getTrustStore ( ) { try ( java.io.InputStream in = new java.io.FileInputStream ( org.ovirt.engine.core.bll.provider.ExternalTrustStoreInitializer.getTrustStorePath ( ) ) ) { java.lang.String password = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getPKITrustStorePassword ( ) ; java.security.KeyStore ks = java.security.KeyStore.getInstance ( "JKS" ) ; ks.load ( in , password.toCharArray ( ) ) ; return ks ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
private boolean isMoveCommandAvailable ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > Cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { if ( ( ! ( isImageDiskOK ( disk ) ) ) || ( ( ! ( isVmDown ( ) ) ) && ( disk.getPlugged ( ) ) ) ) { return false ; } } return true ; }

Target:
private boolean isMoveCommandAvailable ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { if ( ( ! ( isImageDiskOK ( disk ) ) ) || ( ( ! ( isVmDown ( ) ) ) && ( disk.getPlugged ( ) ) ) ) { return false ; } } return true ; }
Source:
public void successfulFenceWithSameProxyRetry ( ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult1 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult2 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS ) ; mockFenceVdsResult ( fenceVdsResult1 , fenceVdsResult2 ) ; mockProxyHost ( false ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.START , createAgent ( ) ) ; org.junit.Assert.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; verifyAttemptToFindDifferentProxy ( ) ; verifyAuditFenceExecutionStart ( 2 ) ; verifyAuditFenceExecutionFailure ( 1 ) ; }

Target:
public void successfulFenceWithSameProxyRetry ( ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult1 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult2 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS ) ; mockFenceVdsResult ( fenceVdsResult1 , fenceVdsResult2 ) ; mockProxyHost ( false ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.START , createAgent ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; verifyAttemptToFindDifferentProxy ( ) ; verifyAuditFenceExecutionStart ( 2 ) ; verifyAuditFenceExecutionFailure ( 1 ) ; }
Source:
public int hashCode ( ) { int result = ( ( icon ) != null ) ? icon.hashCode ( ) : 0 ; result = ( 31 * result ) + ( ( osDefaultIcon ) != null ? osDefaultIcon.hashCode ( ) : 0 ) ; result = ( 31 * result ) + ( ( smallIconId ) != null ? smallIconId.hashCode ( ) : 0 ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( icon , osDefaultIcon , smallIconId , validationResult ) ; }
Source:
protected final void init ( ) { super . init ( ) ; if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmId ( ) ) != null ) { setVmId ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmId ( ) ) ; } else { setVm ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVm ( ) ) ; } if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) ) != null ) { setVmNumaNodesForValidation ( getVmNumaNodeDao ( ) . getAllVmNumaNodeByVmId ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getId ( ) ) ) ; doInit ( ) ; } }

Target:
protected final void init ( ) { super . init ( ) ; if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmId ( ) ) != null ) { setVmId ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmId ( ) ) ; } else { setVm ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVm ( ) ) ; } if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) ) != null ) { setVmNumaNodesForValidation ( vmNumaNodeDao.getAllVmNumaNodeByVmId ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getId ( ) ) ) ; doInit ( ) ; } }
Source:
public void getIpv6AddressOfNetwork ( ) { java.lang.String networkName = "networkName" ; testResolveHostNetworkAddress ( ( e ) -> e.getIpv6AddressOfNetwork ( networkName ) , networkName ) ; }

Target:
public void setUp ( ) { injectorRule.bind ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class , managementNetworkUtil ) ; nic.setNetworkName ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.NETWORK_NAME1 ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.getInterfaces ( ) . add ( nic ) ; underTest = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( vds , org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.COMMAND_CONTEXT ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , null ) ; initCdImage ( ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getModel ( ) . getSpiceProxy ( ) . setIsChangable ( getModel ( ) . getSpiceProxyEnabled ( ) . getEntity ( ) ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getBroker ( ) . glusterVolumeRebalanceStart ( org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . isFixLayoutOnly ( ) , org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . isForceAction ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getBroker ( ) . glusterVolumeRebalanceStart ( org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . isFixLayoutOnly ( ) , org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . isForceAction ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public org.ovirt.engine.sdk.entities.Response delete ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . delete ( url , org.ovirt.engine.sdk.entities.Response.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.entities.Response delete ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . delete ( url , org.ovirt.engine.sdk.entities.Response.class , headers ) ; }
Source:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; handleQxlClusterLevel ( ) ; updateWatchdogModels ( ) ; }

Target:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMigrationOptions ( ) ; handleQxlClusterLevel ( ) ; updateWatchdogModels ( ) ; updateBootMenu ( ) ; }
Source:
public void testGetBrandingRootPath ( ) { java.lang.String rootPath = ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/utils/" ) . getFile ( ) ) + "/branding" ; org.junit.Assert.assertEquals ( "Root paths don't match" , new java.io.File ( rootPath ) , testManager.getBrandingRootPath ( ) ) ; }

Target:
public void testGetBrandingRootPath ( ) throws java.net.URISyntaxException { java.lang.String rootPath = ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/utils/" ) . toURI ( ) . getPath ( ) ) + "/branding" ; org.junit.Assert.assertEquals ( "Root paths don't match" , new java.io.File ( rootPath ) , testManager.getBrandingRootPath ( ) ) ; }
Source:
public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( java.util.Map.Entry < java.lang.String , java.lang.String > ) ( object ) ) . getValue ( ) ; }

Target:
public java.lang.String renderNullSafe ( java.lang.Object object ) { org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel timeZone = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel ) ( object ) ) ; if ( timeZone.isDefault ( ) ) { return messages.defaultTimeZoneCaption ( timeZone.getDisplayValue ( ) ) ; } else { return timeZone.getDisplayValue ( ) ; } }
Source:
private boolean isEveyoneUserPortalBasedVmPermission ( org.ovirt.engine.core.common.businessentities.permissions permission ) { return ( permission.getad_element_id ( ) . getValue ( ) . equals ( ApplicationGuids.everyone.asGuid ( ) ) ) && ( permission.getrole_id ( ) . getValue ( ) . equals ( ApplicationGuids.userTemplateBasedVM.asGuid ( ) ) ) ; }

Target:
private boolean isEveryoneUserPortalBasedVmPermission ( org.ovirt.engine.core.common.businessentities.permissions permission ) { return ( permission.getad_element_id ( ) . equals ( ApplicationGuids.everyone.asGuid ( ) ) ) && ( permission.getrole_id ( ) . equals ( ApplicationGuids.userTemplateBasedVM.asGuid ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ( model.dataCenter.getstorage_pool_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) { model.updateOptionsNonLocalFSData ( ) ; } else { model.updateOptionsLocalFSData ( ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ( model.dataCenter.getStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) { model.updateOptionsNonLocalFSData ( ) ; } else { model.updateOptionsLocalFSData ( ) ; } }
Source:
protected org.ovirt.engine.core.compat.Guid getTemplateId ( org.ovirt.engine.api.model.VM vm ) { return vm.getTemplate ( ) . isSetId ( ) ? asGuid ( vm.getTemplate ( ) . getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , SearchType.VmTemplate , ( "Template: name=" + ( vm.getTemplate ( ) . getName ( ) ) ) ) . getId ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getTemplateId ( org.ovirt.engine.api.model.VM vm ) { return vm.getTemplate ( ) . isSetId ( ) ? asGuid ( vm.getTemplate ( ) . getId ( ) ) : getTemplateByName ( vm ) . getId ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean isEnabled = bootSequenceModel.getCdromOption ( ) . getIsChangable ( ) ; java.lang.String itemName = bootSequenceModel.getCdromOption ( ) . getTitle ( ) ; updateItemAvailability ( itemName , isEnabled ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { boolean isEnabled = bootSequenceModel.getCdromOption ( ) . getIsChangable ( ) ; java.lang.String itemName = bootSequenceModel.getCdromOption ( ) . getTitle ( ) ; updateItemAvailability ( itemName , isEnabled ) ; }
Source:
protected void ItemsChanging ( java.lang.Iterable newValue , java.lang.Iterable oldValue ) { org.ovirt.engine.ui.uicompat.IProvideCollectionChangedEvent notifier = ( ( org.ovirt.engine.ui.uicompat.IProvideCollectionChangedEvent ) ( ( oldValue instanceof org.ovirt.engine.ui.uicompat.IProvideCollectionChangedEvent ) ? oldValue : null ) ) ; if ( notifier != null ) { notifier.getCollectionChangedEvent ( ) . removeListener ( this ) ; } notifier = ( ( org.ovirt.engine.ui.uicompat.IProvideCollectionChangedEvent ) ( ( newValue instanceof org.ovirt.engine.ui.uicompat.IProvideCollectionChangedEvent ) ? newValue : null ) ) ; if ( notifier != null ) { notifier.getCollectionChangedEvent ( ) . addListener ( this ) ; } UnsubscribeList ( oldValue ) ; SubscribeList ( newValue ) ; }

Target:
protected void itemsChanging ( java.lang.Iterable newValue , java.lang.Iterable oldValue ) { org.ovirt.engine.ui.uicompat.IProvideCollectionChangedEvent notifier = ( ( org.ovirt.engine.ui.uicompat.IProvideCollectionChangedEvent ) ( ( oldValue instanceof org.ovirt.engine.ui.uicompat.IProvideCollectionChangedEvent ) ? oldValue : null ) ) ; if ( notifier != null ) { notifier.getCollectionChangedEvent ( ) . removeListener ( this ) ; } notifier = ( ( org.ovirt.engine.ui.uicompat.IProvideCollectionChangedEvent ) ( ( newValue instanceof org.ovirt.engine.ui.uicompat.IProvideCollectionChangedEvent ) ? newValue : null ) ) ; if ( notifier != null ) { notifier.getCollectionChangedEvent ( ) . addListener ( this ) ; } unsubscribeList ( oldValue ) ; subscribeList ( newValue ) ; }
Source:
protected boolean validateCreateAllSnapshotsFromVmCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.validate ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) . clone ( ) ) ; if ( ! ( returnValue.isValid ( ) ) ) { org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return false ; } return true ; }

Target:
protected boolean validateCreateAllSnapshotsFromVmCommand ( ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.validate ( ActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) . clone ( ) ) ; if ( ! ( returnValue.isValid ( ) ) ) { org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return false ; } return true ; }
Source:
private void setConsoleHelpers ( ) { this . consoleUtils = ( ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils.class ) ) ) ; this . consoleManager = ( ( org.ovirt.engine.ui.uicommonweb.ConsoleManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ConsoleManager.class ) ) ) ; this . errorPopupManager = ( ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager.class ) ) ) ; }

Target:
public void setRebootCommand ( org.ovirt.engine.ui.uicommonweb.UICommand value ) { privateRebootCommand = value ; }
Source:
public void testHotsetUpdateableWhenHotsetRequested ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; oic.addHotsetField ( "name" , java.util.EnumSet.of ( VMStatus.Up ) ) ; org.junit.Assert.assertTrue ( "hot set requested for hot set fields should be true in state Up" , oic.isFieldUpdatable ( VMStatus.Up , "name" , null , true ) ) ; }

Target:
public void testHotsetUpdateableWhenHotsetRequested ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; oic.addHotsetField ( "name" , java.util.EnumSet.of ( VMStatus.Up ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( oic.isFieldUpdatable ( VMStatus.Up , "name" , null , true ) , "hot set requested for hot set fields should be true in state Up" ) ; }
Source:
private static void initHasSpiceSupport ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.spiceSupportMatrix = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetSpiceSupportMatrix ) , callback ) ; }

Target:
public static void initOsArchitecture ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osArchitectures = ( ( java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsArchitectures ) , callback ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , boolean notFound , org.ovirt.engine.api.model.VM entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound , org.ovirt.engine.api.model.VM entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }
Source:
public void testProxyCompatibilityWithFencingPolicy ( ) { org.ovirt.engine.core.common.businessentities.VDS host = createHost ( ) ; host.setSupportedClusterLevels ( "3.4,3.5" ) ; org.ovirt.engine.core.bll.pm.FenceProxyLocator locator = setupLocator ( ) ; org.junit.Assert.assertTrue ( locator.isFencingPolicySupported ( host , Version.v3_5 ) ) ; org.junit.Assert.assertFalse ( locator.isFencingPolicySupported ( host , Version.v3_6 ) ) ; }

Target:
public void testProxyCompatibilityWithFencingPolicy ( ) { org.ovirt.engine.core.common.businessentities.VDS host = createHost ( ) ; host.setSupportedClusterLevels ( "3.6" ) ; org.ovirt.engine.core.bll.pm.FenceProxyLocator locator = setupLocator ( ) ; org.junit.Assert.assertTrue ( locator.isFencingPolicySupported ( host , Version.v3_6 ) ) ; org.junit.Assert.assertFalse ( locator.isFencingPolicySupported ( host , Version.v4_0 ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getCpuProfileDao ( ) ; cpuProfile = new org.ovirt.engine.core.common.businessentities.profiles.CpuProfile ( ) ; cpuProfile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cpuProfile.setName ( "new_profile" ) ; cpuProfile.setClusterId ( FixturesTool.VDS_GROUP_RHEL6_ISCSI ) ; cpuProfile.setQosId ( FixturesTool.QOS_ID_4 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getCpuProfileDao ( ) ; cpuProfile = new org.ovirt.engine.core.common.businessentities.profiles.CpuProfile ( ) ; cpuProfile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cpuProfile.setName ( "new_profile" ) ; cpuProfile.setClusterId ( FixturesTool.CLUSTER_RHEL6_ISCSI ) ; cpuProfile.setQosId ( FixturesTool.QOS_ID_4 ) ; }
Source:
public void completeExternalNetworkProviderConfigurationsNoNameTest ( ) { org.ovirt.engine.api.model.ExternalNetworkProviderConfigurations configurations = getExternalNetworkProviderConfigurations ( 1 ) ; configurations.getExternalNetworkProviderConfigurations ( ) . get ( 0 ) . getExternalNetworkProvider ( ) . setName ( null ) ; try { org.ovirt.engine.api.restapi.resource.BackendExternalProviderHelper.completeExternalNetworkProviderConfigurations ( resource , configurations ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , Response.Status.BAD_REQUEST.getStatusCode ( ) ) ; } }

Target:
public void completeExternalNetworkProviderConfigurationsNoNameTest ( ) { org.ovirt.engine.api.model.ExternalNetworkProviderConfigurations configurations = getExternalNetworkProviderConfigurations ( 1 ) ; configurations.getExternalNetworkProviderConfigurations ( ) . get ( 0 ) . getExternalNetworkProvider ( ) . setName ( null ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.BackendExternalProviderHelper.completeExternalNetworkProviderConfigurations ( resource , configurations ) ) , Response.Status.BAD_REQUEST.getStatusCode ( ) ) ; }
Source:
public java.lang.String getCpuNameByCpuId ( java.lang.String name , org.ovirt.engine.core.compat.Version ver ) { final org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager cpuFlagsManager = org.ovirt.engine.core.bll.CpuFlagsManagerHandler.managersDictionary.get ( ver ) ; return cpuFlagsManager != null ? cpuFlagsManager.getCpuNameByCpuId ( name ) : null ; }

Target:
public java.lang.String getCpuNameByCpuId ( java.lang.String name , org.ovirt.engine.core.compat.Version ver ) { final org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager cpuFlagsManager = org.ovirt.engine.core.bll.CpuFlagsManagerHandler.managersDictionary.get ( ver ) ; java.lang.String cpuName = ( cpuFlagsManager != null ) ? cpuFlagsManager.getCpuNameByCpuId ( name ) : null ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( cpuName ) ) { return cpuName ; } if ( name.endsWith ( "-IBRS" ) ) { return cpuFlagsManager != null ? cpuFlagsManager.getCpuNameByCpuId ( name.replace ( "-IBRS" , ",+spec-ctrl" ) ) : null ; } return null ; }
Source:
private void SubscribeList ( java.lang.Iterable list ) { if ( list == null ) { return ; } for ( java.lang.Object a : list ) { org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent notifier = ( ( org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ( ( a instanceof org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ? a : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . addListener ( this ) ; } } }

Target:
private void subscribeList ( java.lang.Iterable list ) { if ( list == null ) { return ; } for ( java.lang.Object a : list ) { org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent notifier = ( ( org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ( ( a instanceof org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ? a : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . addListener ( this ) ; } } }
Source:
public void testOffsetMissingParameter ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setDescription ( "incomplete" ) ; try { offsetValidateParameters ( vm ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "VM" , "status" ) ; } }

Target:
public void testOffsetMissingParameter ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { offsetValidateParameters ( vm ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "status" ) ; } }
Source:
protected boolean canDoAction ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) ; if ( vm == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.RebootVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return org.ovirt.engine.core.bll.RebootVmCommand.failVmStatusIllegal ( ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.RebootVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) && ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringUp ) ) ) { return org.ovirt.engine.core.bll.RebootVmCommand.failVmStatusIllegal ( ) ; } return true ; }
Source:
public static java.lang.String changeStorageDomainAndPoolInMemoryVolume ( java.lang.String originalMemoryVolume , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId ) { java.util.List < org.ovirt.engine.core.compat.Guid > guids = org.ovirt.engine.core.utils.GuidUtils.getGuidListFromString ( originalMemoryVolume ) ; return java.lang.String.format ( "%1$s,%2$s,%3$s,%4$s,%5$s,%6$s" , storageDomainId.toString ( ) , storagePoolId.toString ( ) , guids.get ( 2 ) , guids.get ( 3 ) , guids.get ( 4 ) , guids.get ( 5 ) ) ; }

Target:
public static java.lang.String changeStorageDomainAndPoolInMemoryState ( java.lang.String originalMemoryVolume , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId ) { java.util.List < org.ovirt.engine.core.compat.Guid > guids = org.ovirt.engine.core.utils.GuidUtils.getGuidListFromString ( originalMemoryVolume ) ; return org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryStateString ( storageDomainId , storagePoolId , guids.get ( 2 ) , guids.get ( 3 ) , guids.get ( 4 ) , guids.get ( 5 ) ) ; }
Source:
protected org.ovirt.engine.api.model.VM deprecatedPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < org.ovirt.engine.api.common.util.DetailHelper.Detail > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( getHttpHeaders ( ) ) ; model = addInlineDetails ( details , model ) ; if ( details.contains ( Detail.STATISTICS ) ) { addInlineStatistics ( model ) ; } return model ; }

Target:
public org.ovirt.engine.core.common.businessentities.InstanceType lookupInstanceType ( org.ovirt.engine.core.compat.Guid id ) { return getEntity ( org.ovirt.engine.core.common.businessentities.InstanceType.class , VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( id ) , "GetVmTemplate" ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) , true , true , true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ) ; allDisks.addAll ( cinderDisks ) ; return allDisks ; }

Target:
public boolean validateCinder ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ) ; if ( ! ( cinderDisks.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.validator.storage.CinderDisksValidator cinderDisksValidator = getCinderDisksValidator ( cinderDisks ) ; return validate ( cinderDisksValidator.validateCinderDiskSnapshotsLimits ( ) ) ; } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmWatchdog getWatchdog ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmWatchdog > entities = getBackendCollection ( org.ovirt.engine.core.common.businessentities.VmWatchdog.class , VdcQueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmWatchdog current : entities ) { if ( java.util.Objects.equals ( current.getId ( ) , guid ) ) { return current ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmWatchdog getWatchdog ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmWatchdog > entities = getBackendCollection ( org.ovirt.engine.core.common.businessentities.VmWatchdog.class , QueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmWatchdog current : entities ) { if ( java.util.Objects.equals ( current.getId ( ) , guid ) ) { return current ; } } return null ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult updateHostAddressAllowed ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_HOSTNAME_CANNOT_CHANGE ) . when ( ( ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallFailed ) ) && ( ! ( oldHost.getHostName ( ) . equals ( getHost ( ) . getHostName ( ) ) ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult updateHostAddressAllowed ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_HOSTNAME_CANNOT_CHANGE ) . when ( ( ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallFailed ) ) && ( ! ( oldHost.getHostName ( ) . equals ( getHost ( ) . getHostName ( ) ) ) ) ) ) ; }
Source:
protected javax.ws.rs.core.Response performNonBlockingAction ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.api.model.Action action ) { try { doNonBlockingAction ( task , params ) ; if ( action != null ) { action.setStatus ( CreationStatus.IN_PROGRESS.value ( ) ) ; return javax.ws.rs.core.Response.status ( Response.Status.ACCEPTED ) . entity ( action ) . build ( ) ; } else { return javax.ws.rs.core.Response.status ( Response.Status.ACCEPTED ) . build ( ) ; } } catch ( java.lang.Exception e ) { return handleError ( javax.ws.rs.core.Response.class , e , false ) ; } }

Target:
protected javax.ws.rs.core.Response performNonBlockingAction ( org.ovirt.engine.core.common.action.ActionType task , org.ovirt.engine.core.common.action.ActionParametersBase params , org.ovirt.engine.api.model.Action action ) { try { doNonBlockingAction ( task , params ) ; if ( action != null ) { action.setStatus ( CreationStatus.IN_PROGRESS.value ( ) ) ; return javax.ws.rs.core.Response.status ( Response.Status.ACCEPTED ) . entity ( action ) . build ( ) ; } else { return javax.ws.rs.core.Response.status ( Response.Status.ACCEPTED ) . build ( ) ; } } catch ( java.lang.Exception e ) { return handleError ( javax.ws.rs.core.Response.class , e , false ) ; } }
Source:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsNone ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsNone ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( false , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
public static java.util.Map < java.lang.Integer , java.lang.Integer > getHugePages ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { if ( ! ( org.ovirt.engine.core.common.utils.HugePageUtils.isBackedByHugepages ( vm ) ) ) { return java.util.Collections.emptyMap ( ) ; } int hugePageSize = java.lang.Integer.parseInt ( org.ovirt.engine.core.common.utils.HugePageUtils.getHugePageSize ( vm ) ) ; int fullPages = ( ( int ) ( ( ( ( ( org.ovirt.engine.core.common.utils.HugePageUtils.KIB_IN_MIB ) * ( vm.getMemSizeMb ( ) ) ) + hugePageSize ) - 1 ) / hugePageSize ) ) ; return java.util.Collections.singletonMap ( hugePageSize , fullPages ) ; }

Target:
public static boolean isBackedByHugepages ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { return ( org.ovirt.engine.core.common.utils.HugePageUtils.getHugePageSize ( vm ) . orElse ( 0 ) ) > 0 ; }
Source:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }
Source:
private void handleResuming ( ) { org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.lockImage ( ) ; boolean resumeSessionSuccess = startImageTransferSession ( ) ; if ( resumeSessionSuccess ) { log.info ( "Resuming session for {}" , getTransferDescription ( ) ) ; } else { log.error ( "Failed to resume session for {}" , getTransferDescription ( ) ) ; } updateEntityPhase ( ( resumeSessionSuccess ? org.ovirt.engine.core.common.businessentities.storage.ImageTransferPhase.TRANSFERRING : org.ovirt.engine.core.common.businessentities.storage.ImageTransferPhase.PAUSED_SYSTEM ) ) ; resetPeriodicPauseLogTime ( 0 ) ; }

Target:
private void handleResuming ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.lockImage ( ) ; log.info ( "Resuming transfer for {}" , getTransferDescription ( ) ) ; extendTicketIfNecessary ( context ) ; updateEntityPhase ( ImageTransferPhase.TRANSFERRING ) ; resetPeriodicPauseLogTime ( 0 ) ; }
Source:
protected void setRngDevice ( org.ovirt.engine.api.model.VM model ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > rngDevices = getEntity ( java.util.List.class , VdcQueryType.GetRngDevice , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( model.getId ( ) ) ) , "GetRngDevice" , true ) ; if ( ( rngDevices != null ) && ( ! ( rngDevices.isEmpty ( ) ) ) ) { model.setRngDevice ( org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( rngDevices.get ( 0 ) , null ) ) ; } }

Target:
protected void setRngDevice ( org.ovirt.engine.api.model.Vm model ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > rngDevices = getEntity ( java.util.List.class , VdcQueryType.GetRngDevice , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( model.getId ( ) ) ) , "GetRngDevice" , true ) ; if ( ( rngDevices != null ) && ( ! ( rngDevices.isEmpty ( ) ) ) ) { model.setRngDevice ( org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( rngDevices.get ( 0 ) , null ) ) ; } }
Source:
public void onSuccess ( java.util.List < java.lang.Integer > numOfMonitors ) { java.lang.Integer oldNumOfMonitors = null ; if ( ( getNumOfMonitors ( ) . getSelectedItem ( ) ) != null ) { oldNumOfMonitors = getNumOfMonitors ( ) . getSelectedItem ( ) ; } getNumOfMonitors ( ) . setItems ( numOfMonitors ) ; if ( oldNumOfMonitors != null ) { getNumOfMonitors ( ) . setSelectedItem ( oldNumOfMonitors ) ; } }

Target:
public void onCreated ( org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault instance ) { getIcon ( ) . setEntity ( instance ) ; }
Source:
public void setZeroValue ( ) { percentageBarA.setVisible ( true ) ; percentageBarA.setTitle ( title ) ; percentageBarA.setStyleName ( style.empty ( ) ) ; percentageBarA.setWidth ( "99%" ) ; percentageLabelA.setText ( org.ovirt.engine.ui.userportal.widget.DoublePercentageProgressBar.ZERO ) ; percentageLabelA.setStyleName ( style.percentageLabelBlack ( ) ) ; }

Target:
public void setZeroValue ( ) { percentageBarA.setVisible ( true ) ; percentageBarA.setTitle ( title ) ; percentageBarA.setStyleName ( style.empty ( ) ) ; percentageBarA.setWidth ( ( ( org.ovirt.engine.ui.userportal.widget.DoublePercentageProgressBar.FULL_WIDTH ) + "%" ) ) ; percentageLabelA.setText ( org.ovirt.engine.ui.userportal.widget.DoublePercentageProgressBar.ZERO ) ; percentageLabelA.setStyleName ( style.percentageLabelBlack ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { network_SelectedItemChanged ( null ) ; } else if ( sender == ( getQosOverridden ( ) ) ) { getQosModel ( ) . setIsChangable ( getQosOverridden ( ) . getEntity ( ) ) ; } }

Target:
private void updateQosChangeability ( ) { getQosModel ( ) . setIsChangable ( ( ( ( getQosOverridden ( ) . getIsAvailable ( ) ) && ( getQosOverridden ( ) . getIsChangable ( ) ) ) && ( getQosOverridden ( ) . getEntity ( ) ) ) ) ; }