auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.Set < java.lang.String > getRemovedBonds ( ) { if ( ( removedBonds ) == null ) { removedBonds = new java.util.HashSet ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) ) { removedBonds.add ( bond.getName ( ) ) ; } } return removedBonds ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getNicsToConfigureWithoutLabelsUpdates ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsToConfigure = new java.util.ArrayList < > ( ) ; nicsToConfigure.addAll ( interfaceDao.getAllInterfacesForVds ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getVdsId ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) ) { if ( ( bond.getId ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.network.Bond newBond = new org.ovirt.engine.core.common.businessentities.network.Bond ( bond.getName ( ) ) ; nicsToConfigure.add ( newBond ) ; } } return nicsToConfigure ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ! ( areRequiredNetworksAvailable ( vds ) ) ) { sb.append ( "is missing networks required by VM nics " ) . append ( org.ovirt.engine.core.common.businessentities.Entities.interfacesByNetworkName ( getVmNICs ( ) ) . keySet ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_NETWORKS ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { org.ovirt.engine.core.dal.VdcBllMessages returnValue = validateRequiredNetworksAvailable ( vds ) ; if ( ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_NETWORKS ) == returnValue ) { sb.append ( "is missing networks required by VM nics " ) . append ( org.ovirt.engine.core.common.businessentities.Entities.interfacesByNetworkName ( getVmNICs ( ) ) . keySet ( ) ) ; } else if ( ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MISSING_DISPLAY_NETWORK ) == returnValue ) { sb.append ( "is missing the cluster's display network" ) ; } return returnValue ; }
Source:
public void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }

Target:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage getDiskImageById ( org.ovirt.engine.core.compat.Guid imageId ) { if ( diskImagesMap.containsKey ( imageId ) ) { return diskImagesMap.get ( imageId ) ; } org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageDao ( ) . get ( imageId ) ; diskImagesMap.put ( imageId , diskImage ) ; return diskImage ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage getDiskImageByImageId ( org.ovirt.engine.core.compat.Guid imageId ) { if ( diskImagesMap.containsKey ( imageId ) ) { return diskImagesMap.get ( imageId ) ; } org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageDao ( ) . get ( imageId ) ; diskImagesMap.put ( imageId , diskImage ) ; return diskImage ; }
Source:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) . getAgent ( ) ) == null ) ) || ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) . getAgent ( ) . getId ( ) ) == null ) ) { return failCanDoAction ( VdcBllMessages.VDS_REMOVE_FENCE_AGENT_ID_REQUIRED ) ; } return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) . getAgent ( ) ) == null ) ) || ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) . getAgent ( ) . getId ( ) ) == null ) ) { return failCanDoAction ( EngineMessage.VDS_REMOVE_FENCE_AGENT_ID_REQUIRED ) ; } return super . canDoAction ( ) ; }
Source:
private void onSaveHosts ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel hostsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel ) ( getWindow ( ) ) ) ; if ( hostsModel == null ) { return ; } if ( ! ( hostsModel.validate ( ) ) ) { return ; } if ( ( hostsModel.getClusterModel ( ) . getClusterId ( ) ) != null ) { addHosts ( hostsModel ) ; } else { onSaveInternalWithModel ( hostsModel.getClusterModel ( ) ) ; } }

Target:
private void onSaveHosts ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel hostsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel ) ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel.getWindow ( ) ) ) ; if ( hostsModel == null ) { return ; } if ( ! ( hostsModel.validate ( ) ) ) { return ; } if ( ( hostsModel.getClusterModel ( ) . getClusterId ( ) ) != null ) { addHosts ( hostsModel ) ; } else { onSaveInternalWithModel ( hostsModel.getClusterModel ( ) ) ; } }
Source:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ContentHost > runContentHostListMethod ( java.lang.String relativeUrl ) { try { org.ovirt.engine.core.bll.host.provider.foreman.ContentHostsWrapper wrapper = objectMapper.readValue ( runHttpGetMethod ( relativeUrl ) , org.ovirt.engine.core.bll.host.provider.foreman.ContentHostsWrapper.class ) ; return java.util.Arrays.asList ( wrapper.getResults ( ) ) ; } catch ( java.io.IOException e ) { return java.util.Collections.emptyList ( ) ; } }

Target:
private org.ovirt.engine.core.compat.Version getForemanVersion ( ) { try { org.ovirt.engine.core.bll.host.provider.foreman.ReportedForemanStatus status = objectMapper.readValue ( runHttpGetMethod ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.API_VERSION_ENTRY_POINT ) , org.ovirt.engine.core.bll.host.provider.foreman.ReportedForemanStatus.class ) ; return new org.ovirt.engine.core.compat.Version ( status.getVersion ( ) ) ; } catch ( java.io.IOException e ) { log.warn ( "Unable to detect Foreman version for provider {}. Using older version to connect to the provider" , getProvider ( ) . getName ( ) ) ; return null ; } }
Source:
private static void removeNetworkFromHosts ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.bll.context.CommandContext context , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder builder = new org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder ( network , context ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.NetworkParametersBuilder.updateParametersSequencing ( parameters ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters , context ) ; } }

Target:
private static void removeNetworkFromHosts ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.bll.context.CommandContext context , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { final org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil managementNetworkUtil = org.ovirt.engine.core.bll.utils.Injector.get ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class ) ; org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder builder = new org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder ( network , context , managementNetworkUtil ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.NetworkParametersBuilder.updateParametersSequencing ( parameters ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters , context ) ; } }
Source:
private void updateStepProgress ( org.ovirt.engine.core.compat.Guid stepId , java.lang.Integer progress ) { org.ovirt.engine.core.common.job.Step s = dao.get ( stepId ) ; s.setProgress ( progress ) ; dao.update ( s ) ; }

Target:
public void updateStepProgress ( ) { java.lang.Integer newProgress = 74 ; org.ovirt.engine.core.common.job.Step s = dao.get ( FixturesTool.STEP_ID ) ; org.junit.Assert.assertNotEquals ( "New progress should be different than the current" , s.getProgress ( ) , newProgress ) ; updateStepProgress ( FixturesTool.STEP_ID , newProgress ) ; s = dao.get ( FixturesTool.STEP_ID ) ; org.junit.Assert.assertEquals ( "New progress should be the same as the current" , s.getProgress ( ) , newProgress ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; javax.ws.rs.core.Response performAction = null ; try { performAction = performAction ( VdcActionType.RemoveClusterPolicy , new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( asGuid ( id ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetClusterPolicyById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) . lookupEntity ( asGuid ( id ) ) ) ) ; } catch ( org.ovirt.engine.api.restapi.resource.BackendFailureException e ) { org.ovirt.engine.api.restapi.resource.BackendSchedulingPolicyResource.log.error ( "Failed performing action" , e ) ; } return performAction ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; javax.ws.rs.core.Response performAction = null ; try { performAction = performAction ( ActionType.RemoveClusterPolicy , new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( asGuid ( id ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetClusterPolicyById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) . lookupEntity ( asGuid ( id ) ) ) ) ; } catch ( org.ovirt.engine.api.restapi.resource.BackendFailureException e ) { org.ovirt.engine.api.restapi.resource.BackendSchedulingPolicyResource.log.error ( "Failed performing action" , e ) ; } return performAction ; }
Source:
private void handleTaskOfCommandWithEmptyVdsmId ( final boolean isPartiallySubmittedCommand , final org.ovirt.engine.core.common.businessentities.AsyncTasks task ) { if ( isPartiallySubmittedCommand ) { if ( org.ovirt.engine.core.bll.tasks.AsyncTaskManager.hasEmptyVdsmId ( task ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; return ; } partiallyCompletedCommandTasks.put ( task.getVdsmTaskId ( ) , task ) ; return ; } org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { logAndFailTaskOfCommandWithEmptyVdsmId ( task , "Engine was restarted before all tasks of the command could be submitted to vdsm." ) ; return null ; } } ) ; }

Target:
private void handleTaskOfCommandWithEmptyVdsmId ( final boolean isPartiallySubmittedCommand , final org.ovirt.engine.core.common.businessentities.AsyncTask task ) { if ( isPartiallySubmittedCommand ) { if ( org.ovirt.engine.core.bll.tasks.AsyncTaskManager.hasEmptyVdsmId ( task ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; return ; } partiallyCompletedCommandTasks.put ( task.getVdsmTaskId ( ) , task ) ; return ; } org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { logAndFailTaskOfCommandWithEmptyVdsmId ( task , "Engine was restarted before all tasks of the command could be submitted to vdsm." ) ; return null ; } } ) ; }
Source:
public void testChangeCdUsingMatrixParameter ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( ) ) ; setUpActionExpectations ( VdcActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO } , true , true ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO ) ; cdrom = resource.update ( cdrom ) ; assertTrue ( cdrom.isSetFile ( ) ) ; }

Target:
public void testChangeCdUsingMatrixParameter ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( ) ) ; setUpActionExpectations ( ActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO } , true , true ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO ) ; cdrom = resource.update ( cdrom ) ; assertTrue ( cdrom.isSetFile ( ) ) ; }
Source:
public void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
protected void SyncSearch ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetVmTemplatesWithPermittedAction ( 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 returnValue ) { ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalTemplateListModel ) ( model ) ) . setItems ( ( ( java.lang.Iterable ) ( returnValue ) ) ) ; } } ) , ActionGroup.EDIT_TEMPLATE_PROPERTIES ) ; }

Target:
protected void SyncSearch ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetAllVmTemplates ( 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 returnValue ) { ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalTemplateListModel ) ( model ) ) . setItems ( ( ( java.lang.Iterable ) ( returnValue ) ) ) ; } } ) ) ; }
Source:
private boolean validateNics ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : interfaces ) { org.ovirt.engine.core.bll.validator.VmNicValidator nicValidator = new org.ovirt.engine.core.bll.validator.VmNicValidator ( iface , clusterCompatibilityVersion ) ; if ( ( ! ( validate ( nicValidator.networkNameValid ( ) ) ) ) || ( ! ( validate ( nicValidator.linkedCorrectly ( ) ) ) ) ) { return false ; } } return true ; }

Target:
private boolean validateNics ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { org.ovirt.engine.core.bll.validator.VmNicValidator nicValidator = new org.ovirt.engine.core.bll.validator.VmNicValidator ( iface , clusterCompatibilityVersion ) ; if ( ( ! ( validate ( nicValidator.emptyNetworkValid ( ) ) ) ) || ( ! ( validate ( nicValidator.linkedCorrectly ( ) ) ) ) ) { return false ; } } return true ; }
Source:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) , null ) ) ; setupMocks ( ) ; org.mockito.Mockito.doReturn ( getServer ( ) ) . when ( cmd ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateFailsOnNullCluster ( ) { cmd.setClusterId ( null ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID.toString ( ) ) ) ; }
Source:
protected boolean verifyAddVM ( ) { return org.ovirt.engine.core.bll.VmHandler.VerifyAddVm ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , ( ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ) , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ) ; }

Target:
protected boolean verifyAddVM ( ) { return org.ovirt.engine.core.bll.VmHandler.VerifyAddVm ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , ( ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ) , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ) ; }
Source:
private void AddVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( getVmId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStatisticsDAO ( ) . save ( stats ) ; getCompensationContext ( ) . snapshotNewEntity ( stats ) ; getCompensationContext ( ) . stateChanged ( ) ; }

Target:
private void AddVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setstatus ( VMStatus.ImageLocked ) ; tempVar.setvm_host ( "" ) ; tempVar.setvm_ip ( "" ) ; tempVar.setapp_list ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getapp_list ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . save ( tempVar ) ; getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Disk disk ) { validateEnums ( org.ovirt.engine.api.model.Disk.class , disk ) ; if ( disk.isSetId ( ) ) { return javax.ws.rs.core.Response.fromResponse ( attachDiskToVm ( disk ) ) . entity ( map ( lookupEntity ( asGuid ( disk.getId ( ) ) ) ) ) . build ( ) ; } else { validateDiskForCreation ( disk ) ; return performCreation ( addAction , getAddParameters ( map ( disk ) , disk ) , getEntityIdResolver ( disk.getName ( ) ) ) ; } }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Disk disk ) { validateEnums ( org.ovirt.engine.api.model.Disk.class , disk ) ; if ( disk.isSetId ( ) ) { return javax.ws.rs.core.Response.fromResponse ( attachDiskToVm ( disk ) ) . entity ( map ( lookupEntity ( asGuid ( disk.getId ( ) ) ) ) ) . build ( ) ; } else { validateDiskForCreation ( disk ) ; return performCreate ( addAction , getAddParameters ( map ( disk ) , disk ) , getEntityIdResolver ( disk.getName ( ) ) ) ; } }
Source:
private void initTimeZones ( ) { java.util.Map < java.lang.String , java.lang.String > timeZones = TimeZoneType.GENERAL_TIMEZONE.getTimeZoneList ( ) ; getTimeZones ( ) . setItems ( timeZones.entrySet ( ) ) ; getTimeZones ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( timeZones.entrySet ( ) , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < java.util.Map.Entry < java.lang.String , java.lang.String > > ( ) { @ java.lang.Override public boolean match ( java.util.Map.Entry < java.lang.String , java.lang.String > item ) { return item.getValue ( ) . startsWith ( "(GMT) Greenwich" ) ; } } ) ) ; }

Target:
private void initTimeZones ( ) { java.util.Map < java.lang.String , java.lang.String > timeZones = TimeZoneType.GENERAL_TIMEZONE.getTimeZoneList ( ) ; getTimeZones ( ) . setItems ( timeZones.entrySet ( ) ) ; getTimeZones ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( timeZones.entrySet ( ) , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < java.util.Map.Entry < java.lang.String , java.lang.String > > ( ) { @ java.lang.Override public boolean match ( java.util.Map.Entry < java.lang.String , java.lang.String > item ) { return item.getValue ( ) . startsWith ( "(GMT) Greenwich" ) ; } } ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { org.ovirt.engine.api.resource.HostNicResource subresource = collection.getHostNicSubResource ( GUIDS [ org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SINGLE_NIC_IDX ] . toString ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpQueryExpectations ( "" ) ; verifyModel ( subresource.get ( ) , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SINGLE_NIC_IDX ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { org.ovirt.engine.api.resource.HostNicResource subresource = collection.getHostNicResource ( GUIDS [ org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SINGLE_NIC_IDX ] . toString ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpQueryExpectations ( "" ) ; verifyModel ( subresource.get ( ) , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SINGLE_NIC_IDX ) ; }
Source:
public void testGetAvailableValues ( ) { setSomeValue ( "Anakin" ) ; java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < > ( ) ; java.util.Set < java.lang.String > properties = new java.util.HashSet < > ( java.util.Arrays.asList ( "somevalue" ) ) ; org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( this , properties , values ) ; org.junit.Assert.assertFalse ( properties.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( "Standard" , "Anakin" , values.get ( "somevalue" ) ) ; }

Target:
public void testGetAvailableValues ( ) { setSomeValue ( "Anakin" ) ; java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < > ( ) ; java.util.Set < java.lang.String > properties = java.util.Collections.singleton ( "somevalue" ) ; org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( this , properties , values ) ; org.junit.Assert.assertFalse ( properties.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( "Standard" , "Anakin" , values.get ( "somevalue" ) ) ; }
Source:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public static void GetMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public static void GetNetworkConnectivityCheckTimeoutInSeconds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 120 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.NetworkConnectivityCheckTimeoutInSeconds , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
protected boolean validate ( ) { if ( ! ( checkRemoveEditValidations ( ) ) ) { return false ; } if ( ( getClusterDao ( ) . getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) . size ( ) ) > 0 ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_POLICY_INUSE , java.lang.String.format ( "$clusters %1$s" , clustersListIntoTokenizedString ( ) ) ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( checkRemoveEditValidations ( ) ) ) { return false ; } if ( ( clusterDao.getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) . size ( ) ) > 0 ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_POLICY_INUSE , java.lang.String.format ( "$clusters %1$s" , clustersListIntoTokenizedString ( ) ) ) ; } return true ; }
Source:
public void initOvfDataUpdater ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil scheduler = org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) ; scheduler.scheduleAFixedDelayJob ( this , "ovfUpdate_timer" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.OvfDataUpdater.log.info ( "Initialization of OvfDataUpdater completed successfully." ) ; }

Target:
public void initOvfDataUpdater ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil scheduler = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) ; scheduler.scheduleAFixedDelayJob ( this , "ovfUpdate_timer" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.OvfDataUpdater.log.info ( "Initialization of OvfDataUpdater completed successfully." ) ; }
Source:
private void RunOnce ( ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel selectedItem = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( getSelectedItem ( ) ) ) ; if ( ( selectedItem == null ) || ( ( selectedItem.getEntity ( ) ) == null ) ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( selectedItem.getEntity ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.UserPortalRunOnceModel ( vm , getCustomPropertiesKeysList ( ) . get ( vm.getVdsGroupCompatibilityVersion ( ) ) , this ) ; setWindow ( model ) ; model.init ( ) ; }

Target:
private void runOnce ( ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel selectedItem = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( getSelectedItem ( ) ) ) ; if ( ( selectedItem == null ) || ( ( selectedItem.getEntity ( ) ) == null ) ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( selectedItem.getEntity ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.UserPortalRunOnceModel ( vm , getCustomPropertiesKeysList ( ) . get ( vm.getVdsGroupCompatibilityVersion ( ) ) , this ) ; setWindow ( model ) ; model.init ( ) ; }
Source:
private java.lang.String GetRealKey ( java.lang.String agent , java.lang.String displayedKey ) { java.lang.String result = "" ; if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( displayedKey ) ) ) { if ( fenceOptionMapping.containsKey ( agent ) ) { java.util.HashMap < java.lang.String , java.lang.String > agentOptions = fenceOptionMapping.get ( agent ) ; result = ( agentOptions.containsKey ( displayedKey ) ) ? agentOptions.get ( displayedKey ) : displayedKey ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.error ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } } return result ; }

Target:
private java.lang.String getRealKey ( java.lang.String agent , java.lang.String displayedKey ) { java.lang.String result = "" ; if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( displayedKey ) ) ) { if ( fenceOptionMapping.containsKey ( agent ) ) { java.util.HashMap < java.lang.String , java.lang.String > agentOptions = fenceOptionMapping.get ( agent ) ; result = ( agentOptions.containsKey ( displayedKey ) ) ? agentOptions.get ( displayedKey ) : displayedKey ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.error ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } } return result ; }
Source:
public void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { runQueryByIdParameter ( VdcQueryType.IsClusterEmpty , aQuery , clusterId ) ; }
Source:
public org.ovirt.engine.api.model.VmPool populate ( org.ovirt.engine.api.model.VmPool pool , org.ovirt.engine.core.common.businessentities.vm_pools entity ) { if ( ( pool.isSetSize ( ) ) && ( ( pool.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( pool.getName ( ) ) ) ) ; pool.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; pool.getTemplate ( ) . setId ( vm.getvmt_guid ( ) . toString ( ) ) ; } return pool ; }

Target:
public org.ovirt.engine.api.model.VmPool populate ( org.ovirt.engine.api.model.VmPool pool , org.ovirt.engine.core.common.businessentities.vm_pools entity ) { if ( ( pool.isSetSize ( ) ) && ( ( pool.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getVM ( pool ) ; pool.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; pool.getTemplate ( ) . setId ( vm.getvmt_guid ( ) . toString ( ) ) ; } return pool ; }
Source:
public boolean isDisplayNetworkAffected ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { final org.ovirt.engine.ui.uicommonweb.models.hosts.network.BondNetworkInterfaceModel bond = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ) ( op1 ) ) . getBond ( ) ; if ( ( bond.getBonded ( ) . size ( ) ) == 2 ) { return org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.isDisplayNetworkAttached ( bond ) ; } return false ; }

Target:
public boolean isDisplayNetworkAffected ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { final org.ovirt.engine.ui.uicommonweb.models.hosts.network.BondNetworkInterfaceModel bond = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ) ( op1 ) ) . getBond ( ) ; if ( ( bond.getSlaves ( ) . size ( ) ) == 2 ) { return org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.isDisplayNetworkAttached ( bond ) ; } return false ; }
Source:
private void New ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void newEntity ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
public java.lang.String getSessionIdBySsoAccessToken ( java.lang.String ssoToken ) { java.lang.String sessionId = null ; for ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo : sessionInfoMap.values ( ) ) { if ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SSO_ACCESS_TOKEN_PARAMETER_NAME ) . equals ( ssoToken ) ) { sessionId = ( ( java.lang.String ) ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID ) ) ) ; break ; } } return sessionId ; }

Target:
public java.lang.String getSessionIdBySsoAccessToken ( java.lang.String ssoToken ) { java.lang.String sessionId = null ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( ssoToken ) ) { for ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo : sessionInfoMap.values ( ) ) { if ( ssoToken.equals ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SSO_ACCESS_TOKEN_PARAMETER_NAME ) ) ) { sessionId = ( ( java.lang.String ) ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID ) ) ) ; break ; } } } return sessionId ; }
Source:
protected void addStoragePermissionByQuotaMode ( java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permsList , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid StorageDomainId ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = null ; if ( storagePoolId != null ) { storagePool = org.ovirt.engine.core.bll.CommandBase.getStoragePoolDAO ( ) . get ( storagePoolId ) ; if ( storagePool != null ) { if ( ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) || ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT ) ) ) { permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( StorageDomainId , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; } } } }

Target:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { return createTaskImpl ( taskId , asyncTaskCreationInfo , parentCommand , description , entityType , entityIds ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during CreateTask for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
private void initTimeZones ( ) { java.util.Set < java.lang.String > timeZoneTypes = TimeZoneType.GENERAL_TIMEZONE.getTimeZoneList ( ) . keySet ( ) ; getTimeZones ( ) . setItems ( timeZoneTypes ) ; }

Target:
private void initTimeZones ( ) { java.util.Map < java.lang.String , java.lang.String > timeZones = TimeZoneType.GENERAL_TIMEZONE.getTimeZoneList ( ) ; getTimeZones ( ) . setItems ( timeZones.entrySet ( ) ) ; getTimeZones ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( timeZones.entrySet ( ) , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < java.util.Map.Entry < java.lang.String , java.lang.String > > ( ) { @ java.lang.Override public boolean match ( java.util.Map.Entry < java.lang.String , java.lang.String > item ) { return item.getValue ( ) . startsWith ( "(GMT) Greenwich" ) ; } } ) ) ; }
Source:
private void addStatistics ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity , javax.ws.rs.core.UriInfo ui ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.utils.LinkHelper.addLinks ( ui , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }

Target:
private void addStatistics ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }
Source:
public void nameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }

Target:
public void nameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }