auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration getHostedEngineDeployConfiguration ( org.ovirt.engine.api.restapi.resource.BaseBackendResource resource ) { if ( org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( resource.getHttpHeaders ( ) , resource.getUriInfo ( ) , org.ovirt.engine.api.restapi.resource.HostResourceParametersUtil.QUERY_PARAM_DEPLOY_HOSTED_ENGINE , true , false ) ) { return new org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration ( HostedEngineDeployConfiguration.Action.DEPLOY ) ; } if ( org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( resource.getHttpHeaders ( ) , resource.getUriInfo ( ) , org.ovirt.engine.api.restapi.resource.HostResourceParametersUtil.QUERY_PARAM_UNDEPLOY_HOSTED_ENGINE , true , false ) ) { return new org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration ( HostedEngineDeployConfiguration.Action.UNDEPLOY ) ; } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration getHostedEngineDeployConfiguration ( org.ovirt.engine.api.restapi.resource.BaseBackendResource resource ) { if ( org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( resource.getHttpHeaders ( ) , resource.getUriInfo ( ) , org.ovirt.engine.api.restapi.resource.HostResourceParametersUtil.QUERY_PARAM_DEPLOY_HOSTED_ENGINE , true , false ) ) { return new org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration ( HostedEngineDeployConfiguration.Action.DEPLOY ) ; } if ( org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( resource.getHttpHeaders ( ) , resource.getUriInfo ( ) , org.ovirt.engine.api.restapi.resource.HostResourceParametersUtil.QUERY_PARAM_UNDEPLOY_HOSTED_ENGINE , true , false ) ) { return new org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration ( HostedEngineDeployConfiguration.Action.UNDEPLOY ) ; } return null ; }
Source:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmBase.class ) , org.mockito.Matchers.any ( java.util.ArrayList.class ) ) ; vmStatic.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; }

Target:
public void testLongName ( ) { vmStatic.setName ( "this_should_be_very_long_vm_name_so_it will_fail_can_do_action_validation" ) ; org.junit.Assert.assertFalse ( "validate should fail for too long vm name." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ; }
Source:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.isInternalExecution ( ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return super . getExclusiveLocks ( ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.isInternalExecution ( ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER , VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_OPERATION_INPROGRESS ) ) ; } return super . getExclusiveLocks ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn createVolumeContainer ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > createVolumeInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.create_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , createVolumeInfo ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterWebhookAdd ( java.lang.String url , java.lang.String bearerToken ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterEvent.webhookAdd" ) . withParameter ( "url" , url ) . withParameter ( "bearerToken" , bearerToken ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
void localize ( ) { message1.setHTML ( listItem ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.messages.nextRunConfigurationExists ( ) ) ) ; message2.setHTML ( listItem ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.messages.nextRunConfigurationCanBeAppliedImmediately ( ) ) ) ; applyCpuLaterEditor.setLabel ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.constants.applyLater ( ) ) ; changedFieldsExpander.setTitleWhenExpended ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.constants.changedFieldsList ( ) ) ; changedFieldsExpander.setTitleWhenCollapsed ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.constants.changedFieldsList ( ) ) ; }

Target:
void localize ( ) { message1.setHTML ( listItem ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.messages.nextRunConfigurationExists ( ) ) ) ; message2.setHTML ( listItem ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.messages.nextRunConfigurationCanBeAppliedImmediately ( ) ) ) ; applyCpuLaterEditor.setLabel ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.constants.applyLater ( ) ) ; changedFieldsExpander.setTitleWhenExpanded ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.constants.changedFieldsList ( ) ) ; changedFieldsExpander.setTitleWhenCollapsed ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.constants.changedFieldsList ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkAttachmentDao ( ) ; networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNicId ( FixturesTool.VDS_NETWORK_INTERFACE ) ; networkAttachment.setProperties ( new java.util.HashMap < > ( ) ) ; networkAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; networkAttachment.setNetworkId ( FixturesTool.NETWORK_ENGINE ) ; networkAttachment.setIpConfiguration ( createIpConfiguration ( NetworkBootProtocol.DHCP , NetworkBootProtocol.NONE ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkAttachmentDao ( ) ; networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNicId ( FixturesTool.VDS_NETWORK_INTERFACE ) ; networkAttachment.setProperties ( new java.util.HashMap < > ( ) ) ; networkAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; networkAttachment.setNetworkId ( FixturesTool.NETWORK_ENGINE ) ; networkAttachment.setIpConfiguration ( createIpConfiguration ( Ipv4BootProtocol.DHCP , Ipv4BootProtocol.NONE ) ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Class < ? > > addExceptions ( java.util.Map < java.lang.String , java.lang.Class < ? > > map ) { map.put ( "brick" , org.ovirt.engine.sdk.entities.GlusterBrick.class ) ; map.put ( "bricks" , org.ovirt.engine.sdk.entities.GlusterBricks.class ) ; map.put ( "hostnic" , org.ovirt.engine.sdk.entities.HostNIC.class ) ; map.put ( "hostnics" , org.ovirt.engine.sdk.entities.HostNics.class ) ; return map ; }

Target:
private java.util.Map < java.lang.String , java.lang.String > addExceptions ( java.util.Map < java.lang.String , java.lang.String > map ) { map.put ( "brick" , "GlusterBrick" ) ; map.put ( "bricks" , "GlusterBricks" ) ; map.put ( "hostnic" , "HostNIC" ) ; map.put ( "hostnics" , "HostNics" ) ; return map ; }
Source:
protected void initFrontend ( ) { frontend.setEventsHandler ( frontendEventsHandler ) ; frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { user.logout ( ) ; } } ) ; frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String engineAuthToken = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; restApiSessionManager.acquireSession ( engineAuthToken ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void render ( com.google.gwt.cell.client.Cell.Context context , T object , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( showMask.showMask ( object ) ) { sb.appendHtmlConstant ( "<div style=\"position: absolute; left: 19px\" >" ) ; sb.append ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( mask ) . getHTML ( ) ) ) ; sb.appendHtmlConstant ( "</div>" ) ; } super . render ( context , object , sb ) ; }

Target:
public static void renderMask ( com.google.gwt.resources.client.ImageResource mask , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.appendHtmlConstant ( "<div style=\"position: absolute; left: 19px\" >" ) ; sb.append ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( mask ) . getHTML ( ) ) ) ; sb.appendHtmlConstant ( "</div>" ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) . mput ( Schema.UserKeys.UNLOCK_TIME , java.lang.System.currentTimeMillis ( ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( ContextKeys.POSITIONAL ) ) . mput ( Schema.UserKeys.UNLOCK_TIME , java.lang.System.currentTimeMillis ( ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
Source:
private void initializeCommand ( org.ovirt.engine.core.compat.Guid storageId , org.ovirt.engine.core.common.businessentities.VolumeType volumeType ) { org.ovirt.engine.core.common.action.AddDiskParameters parameters = createParameters ( ) ; parameters.setStorageDomainId ( storageId ) ; if ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Preallocated ) ) { parameters.setDiskInfo ( createPreallocDiskImageBase ( ) ) ; } else if ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) { parameters.setDiskInfo ( createSparseDiskImageBase ( ) ) ; } initializeCommand ( storageId , parameters ) ; }

Target:
private void initializeCommand ( org.ovirt.engine.core.compat.Guid storageId , org.ovirt.engine.core.common.businessentities.VolumeType volumeType ) { org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setStorageDomainId ( storageId ) ; if ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Preallocated ) ) { parameters.setDiskInfo ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createPreallocDiskImage ( ) ) ; } else if ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) { parameters.setDiskInfo ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createSparseDiskImage ( ) ) ; } initializeCommand ( storageId , parameters ) ; }
Source:
private boolean isAgentSupported ( org.ovirt.engine.core.common.businessentities.VDS vds ) { boolean ret = false ; org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( vds.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( _vds.getManagementIp ( ) ) ) { ret = options.isAgentSupported ( _vds.getPmType ( ) ) ; } if ( org.apache.commons.lang.StringUtils.isNotEmpty ( _vds.getPmSecondaryIp ( ) ) ) { ret = options.isAgentSupported ( _vds.getPmSecondaryType ( ) ) ; } return ret ; }

Target:
private static boolean isStatusEqualTo ( org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue returnValue , java.lang.String targetStatus ) { boolean result = false ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue value = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) ; result = value.getStatus ( ) . equalsIgnoreCase ( targetStatus ) ; } return result ; }
Source:
private void removeMemoryVolumes ( java.lang.String memoryVolume , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryVolume , vmId ) , org.ovirt.engine.core.bll.ImportVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.log.errorFormat ( "Failed to remove memory volumes: {0}" , memoryVolume ) ; } }

Target:
private void removeMemoryVolumes ( java.lang.String memoryVolume , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryVolume , vmId ) , org.ovirt.engine.core.bll.ImportVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.log.error ( "Failed to remove memory volumes '{}'" , memoryVolume ) ; } }
Source:
public void AttachTask ( org.ovirt.engine.core.bll.tasks.CommandAsyncTask asyncTask ) { synchronized ( _listTasks ) { if ( ! ( _listTasks.containsKey ( asyncTask.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.CommandMultiAsyncTasks.log.infoFormat ( "CommandMultiAsyncTasks::AttachTask: Attaching task '{0}' to command '{1}'." , asyncTask.getVdsmTaskId ( ) , getCommandId ( ) ) ; _listTasks.put ( asyncTask.getVdsmTaskId ( ) , asyncTask ) ; } } }

Target:
public void AttachTask ( org.ovirt.engine.core.bll.tasks.CommandAsyncTask asyncTask ) { synchronized ( _listTasks ) { if ( ! ( _listTasks.containsKey ( asyncTask.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.CommandMultiAsyncTasks.log.info ( "CommandMultiAsyncTasks::AttachTask: Attaching task '{}' to command '{}'." , asyncTask.getVdsmTaskId ( ) , getCommandId ( ) ) ; _listTasks.put ( asyncTask.getVdsmTaskId ( ) , asyncTask ) ; } } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( ! ( bondDialogModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.PfNicLabelModel labelsModel = bondDialogModel.getLabelsModel ( ) ; if ( computeAndCommitLabelChanges ( entity , labelsModel ) ) { setBondOptions ( entity , bondDialogModel ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( ! ( bondDialogModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.NicLabelModel labelsModel = bondDialogModel.getLabelsModel ( ) ; if ( computeAndCommitLabelChanges ( entity , labelsModel ) ) { setBondOptions ( entity , bondDialogModel ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > validateProperties ( org.ovirt.engine.core.compat.Version version , java.lang.String properties ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( properties ) ) { return java.util.Collections.emptyList ( ) ; } if ( syntaxErrorInProperties ( properties ) ) { return invalidSyntaxValidationError ; } java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > result = populateVMProperties ( version , properties , map ) ; return result ; }

Target:
private java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > validateProperties ( org.ovirt.engine.core.compat.Version version , java.lang.String properties ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( properties ) ) { return java.util.Collections.emptyList ( ) ; } if ( syntaxErrorInProperties ( properties ) ) { return invalidSyntaxValidationError ; } java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > result = populateVMProperties ( version , properties , map ) ; return result ; }
Source:
public void testRemoveAllBeforeDate ( ) throws java.lang.Exception { java.util.Date cutoff = org.ovirt.engine.core.dao.AuditLogDAOTest.EXPECTED_DATE_FORMAT.parse ( "2010-12-20 13:11:00" ) ; dao.removeAllBeforeDate ( cutoff ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( ) ; org.junit.Assert.assertEquals ( 3 , result.size ( ) ) ; }

Target:
public void testGetAllFiltered ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.AuditLogDAOTest.FILTERED_COUNT , result.size ( ) ) ; }
Source:
public void updateVmDynamic ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vmDynamic ) ; }

Target:
public void vmsMonitoring ( ) { if ( isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( this ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( this ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( this , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) ) . perform ( ) ; } }
Source:
public void updateMinAllocatedMemory ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; if ( cluster == null ) { return ; } double overCommitFactor = 100.0 / ( cluster.getmax_vds_memory_over_commit ( ) ) ; getModel ( ) . getMinAllocatedMemory ( ) . setEntity ( ( ( int ) ( ( getModel ( ) . getMemSize ( ) . getEntity ( ) ) * overCommitFactor ) ) ) ; }

Target:
public void updateMinAllocatedMemory ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; if ( cluster == null ) { return ; } double overCommitFactor = 100.0 / ( cluster.getMaxVdsMemoryOverCommit ( ) ) ; getModel ( ) . getMinAllocatedMemory ( ) . setEntity ( ( ( int ) ( ( getModel ( ) . getMemSize ( ) . getEntity ( ) ) * overCommitFactor ) ) ) ; }
Source:
public static boolean hasMemoryBalloon ( org.ovirt.engine.core.compat.Guid vmId ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.isMemBalloonEnabled ( vmId ) ; }

Target:
private static void updateSpiceUsb ( org.ovirt.engine.core.compat.Guid vmId , int oldNumberOfSlots , int newNumberOfUsbSlots ) { if ( oldNumberOfSlots > newNumberOfUsbSlots ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.removeUsbSlots ( vmId , ( oldNumberOfSlots - newNumberOfUsbSlots ) ) ; if ( newNumberOfUsbSlots == 0 ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.removeUsbControllers ( vmId ) ; } return ; } if ( oldNumberOfSlots < newNumberOfUsbSlots ) { if ( oldNumberOfSlots == 0 ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSpiceUsbControllers ( vmId , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getNeededNumberOfUsbControllers ( newNumberOfUsbSlots ) ) ; } org.ovirt.engine.core.bll.utils.VmDeviceUtils.addUsbSlots ( vmId , ( newNumberOfUsbSlots - oldNumberOfSlots ) ) ; return ; } }
Source:
private void DataCenter_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.DataCenter_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ; if ( dataCenter != null ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; } }

Target:
private void memSize_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.updateMinAllocatedMemory ( ) ; }
Source:
public static void getRpmVersion ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( ( source != null ) && ( ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ) ) { return true ; } return false ; } } ; getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }
Source:
private static void setGatewayIfManagementNetwork ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { if ( ( org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) . equals ( iface.getNetworkName ( ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }

Target:
private static void setGatewayIfNecessary ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { if ( ( ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( host.getVdsGroupCompatibilityVersion ( ) ) ) || ( org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) . equals ( iface.getNetworkName ( ) ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }
Source:
public void testValidateNoVM ( ) { command.getParameters ( ) . setId ( new org.ovirt.engine.core.compat.Guid ( "a09f57b1-5739-4352-bf88-a6f834ed46db" ) ) ; command.getParameters ( ) . setAction ( VmWatchdogAction.PAUSE ) ; command.getParameters ( ) . setModel ( vmWatchdogType ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void testValidateNoVM ( ) { command.getParameters ( ) . setId ( new org.ovirt.engine.core.compat.Guid ( "a09f57b1-5739-4352-bf88-a6f834ed46db" ) ) ; command.getParameters ( ) . setAction ( VmWatchdogAction.PAUSE ) ; command.getParameters ( ) . setModel ( vmWatchdogType ) ; org.junit.jupiter.api.Assertions.assertFalse ( command.validate ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getRepoListForStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.FileTypeExtension fileType ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_domain_id" , storageDomainId ) ; parameterSource.addValue ( "file_type" , fileType.getValue ( ) ) ; return getCallsHandler ( ) . executeReadList ( "GetRepo_files_by_storage_domain" , org.ovirt.engine.core.dao.RepoFileMetaDataDAODbFacadeImpl.RepoFileMetaDataMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getRepoListForStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageType fileType ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_domain_id" , storageDomainId ) ; parameterSource.addValue ( "file_type" , fileType.getValue ( ) ) ; return getCallsHandler ( ) . executeReadList ( "GetRepo_files_by_storage_domain" , org.ovirt.engine.core.dao.RepoFileMetaDataDAODbFacadeImpl.RepoFileMetaDataMapper.instance , parameterSource ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpVDSGroups ( ) , null ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpVDSGroups ( ) , null ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
private void readUsbItem ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node ) { vmBase.setUsbPolicy ( org.ovirt.engine.core.common.businessentities.UsbPolicy.forStringValue ( node.SelectSingleNode ( "rasd:UsbPolicy" , _xmlNS ) . innerText ) ) ; }

Target:
private void readCpuItem ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node ) { vmBase.setNumOfSockets ( java.lang.Integer.parseInt ( selectSingleNode ( node , "rasd:num_of_sockets" , _xmlNS ) . innerText ) ) ; vmBase.setCpuPerSocket ( java.lang.Integer.parseInt ( selectSingleNode ( node , "rasd:cpu_per_socket" , _xmlNS ) . innerText ) ) ; }
Source:
public void testExecuteQueryCommand ( ) { dcNetworks.addAll ( java.util.Arrays.asList ( mockExternalNetwork , mockNonExternalNetwork ) ) ; underTest.executeQueryCommand ( ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > actual = underTest.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNotNull ( actual ) ; org.junit.Assert.assertEquals ( 1 , actual.size ( ) ) ; org.junit.Assert.assertTrue ( actual.contains ( mockNonExternalNetwork ) ) ; }

Target:
public void testExecuteQueryCommand ( ) { dcNetworks.addAll ( java.util.Arrays.asList ( mockExternalNetwork , mockNonExternalNetwork ) ) ; underTest.executeQueryCommand ( ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > actual = underTest.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNotNull ( actual ) ; org.junit.Assert.assertThat ( actual , org.hamcrest.Matchers.hasSize ( 1 ) ) ; org.junit.Assert.assertTrue ( actual.contains ( mockNonExternalNetwork ) ) ; }
Source:
public static org.ovirt.engine.api.model.Storage map ( org.ovirt.engine.core.common.businessentities.storage_domains entity , org.ovirt.engine.api.model.Storage template ) { org.ovirt.engine.api.model.Storage model = ( template != null ) ? template : new org.ovirt.engine.api.model.Storage ( ) ; model.setId ( entity.getstorage ( ) ) ; model.setType ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( entity.getstorage_type ( ) , null ) ) ; model.setVolumeGroup ( new org.ovirt.engine.api.model.VolumeGroup ( ) ) ; model.getVolumeGroup ( ) . setId ( entity.getstorage ( ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.Storage map ( org.ovirt.engine.api.restapi.types.StorageDomain entity , org.ovirt.engine.api.model.Storage template ) { org.ovirt.engine.api.model.Storage model = ( template != null ) ? template : new org.ovirt.engine.api.model.Storage ( ) ; model.setId ( entity.getstorage ( ) ) ; model.setType ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( entity.getstorage_type ( ) , null ) ) ; model.setVolumeGroup ( new org.ovirt.engine.api.model.VolumeGroup ( ) ) ; model.getVolumeGroup ( ) . setId ( entity.getstorage ( ) ) ; return model ; }
Source:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > > aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
private void removeVmStatelessImages ( ) { if ( ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getSnapshotDao ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) && ( ( getVmPoolType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmPoolType.Manual ) ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.info ( "Deleting snapshot for stateless vm '{}'" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }

Target:
private void removeVmStatelessImages ( ) { if ( ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getSnapshotDao ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) && ( ( getVmPoolType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmPoolType.MANUAL ) ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.info ( "Deleting snapshot for stateless vm '{}'" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }
Source:
void testIsManagementNetworkNameInGivenClusterCommon ( java.lang.String managementNetworkName , boolean expected ) { if ( managementNetworkName != null ) { org.mockito.Mockito.when ( mockNetwork.getName ( ) ) . thenReturn ( managementNetworkName ) ; org.mockito.Mockito.when ( mockNetworkDao.getManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID ) ) . thenReturn ( mockNetwork ) ; } final boolean actual = underTest.isManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_NAME , org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID ) ; org.mockito.Mockito.verify ( mockNetworkDao ) . getManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID ) ; org.junit.Assert.assertEquals ( expected , actual ) ; }

Target:
public void testIsManagementNetworkNameInGivenClusterNegative ( ) throws java.lang.Exception { testIsManagementNetworkNameInGivenClusterCommon ( ( "not" + ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_NAME ) ) , org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID , false ) ; }
Source:
protected void setObjectName ( java.lang.Object object , java.lang.String name ) { ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( object ) ) . getTemplate ( ) . setName ( name ) ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] getClonedNameValidators ( java.lang.Object object ) { final int maxClonedNameLength = getMaxClonedNameLength ( object ) ; return new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( maxClonedNameLength ) , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) { @ java.lang.Override protected java.lang.String composeMessage ( ) { return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . nameMustConataionOnlyAlphanumericChars ( maxClonedNameLength ) ; } } , new org.ovirt.engine.ui.uicommonweb.models.storage.TemplateBackupModel.UniqueClonedNameValidator ( assignedVmNames ) } ; }
Source:
public static void handleCustomPropertiesError ( java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > validationErrors , java.util.List < java.lang.String > message ) { java.lang.String invalidSyntaxMsg = VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CUSTOM_VM_PROPERTIES_INVALID_SYNTAX.name ( ) ; java.util.List < java.lang.String > errorMessages = org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.getInstance ( ) . generateErrorMessages ( validationErrors , invalidSyntaxMsg , org.ovirt.engine.core.bll.VmHandler.failureReasonsToVdcBllMessagesMap , org.ovirt.engine.core.bll.VmHandler.failureReasonsToFormatMessages ) ; message.addAll ( errorMessages ) ; }

Target:
public static void handleCustomPropertiesError ( java.util.List < org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils.ValidationError > validationErrors , java.util.List < java.lang.String > message ) { java.lang.String invalidSyntaxMsg = VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CUSTOM_VM_PROPERTIES_INVALID_SYNTAX.name ( ) ; java.util.List < java.lang.String > errorMessages = org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.getInstance ( ) . generateErrorMessages ( validationErrors , invalidSyntaxMsg , org.ovirt.engine.core.bll.VmHandler.failureReasonsToVdcBllMessagesMap , org.ovirt.engine.core.bll.VmHandler.failureReasonsToFormatMessages ) ; message.addAll ( errorMessages ) ; }
Source:
private void persistTopology ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( interfaceDao , host.getInterfaces ( ) , dbNics , userConfiguredData ) ; networkInterfacesPersister.persistTopology ( ) ; final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister networkAttachmentPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister ( networkAttachmentDao , host.getId ( ) , host.getInterfaces ( ) , userConfiguredData.getCustomProperties ( ) , userConfiguredData.getNetworkAttachments ( ) , clusterNetworks ) ; networkAttachmentPersister.persistNetworkAttachments ( ) ; }

Target:
private org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister createHostNetworkAttachmentsPersister ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { if ( userConfiguredData.isLegacyMode ( ) ) { return new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister ( networkAttachmentDao , host.getId ( ) , host.getInterfaces ( ) , userConfiguredData.getCustomPropertiesForVdsNetworkInterface ( ) , userConfiguredData.getNetworkAttachments ( ) , clusterNetworks ) ; } else { return new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister ( networkAttachmentDao , host.getId ( ) , host.getInterfaces ( ) , userConfiguredData.getNetworkAttachments ( ) , clusterNetworks ) ; } }
Source:
public org.ovirt.engine.api.resource.ActionResource getActionSubresource ( java.lang.String action , java.lang.String oid ) { return new org.ovirt.engine.api.resource.ActionResource ( ) { @ java.lang.Override public javax.ws.rs.core.Response get ( ) { java.net.URI uri = java.net.URI.create ( org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , newModel ( id ) ) . getHref ( ) ) ; javax.ws.rs.core.Response.Status status = Response.Status.MOVED_PERMANENTLY ; return javax.ws.rs.core.Response.status ( status ) . location ( uri ) . build ( ) ; } @ java.lang.Override public org.ovirt.engine.api.model.Action getAction ( ) { return null ; } } ; }

Target:
public org.ovirt.engine.api.resource.ActionResource getActionResource ( java.lang.String action , java.lang.String oid ) { return new org.ovirt.engine.api.resource.ActionResource ( ) { @ java.lang.Override public javax.ws.rs.core.Response get ( ) { java.net.URI uri = java.net.URI.create ( org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , newModel ( id ) ) . getHref ( ) ) ; javax.ws.rs.core.Response.Status status = Response.Status.MOVED_PERMANENTLY ; return javax.ws.rs.core.Response.status ( status ) . location ( uri ) . build ( ) ; } @ java.lang.Override public org.ovirt.engine.api.model.Action getAction ( ) { return null ; } } ; }
Source:
public void testCheckIfRoleIsReadOnlyFalse ( ) { getRole ( ) . setReadonly ( false ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; org.junit.Assert.assertFalse ( "Role should be read only" , getCommand ( ) . checkIfRoleIsReadOnly ( messages ) ) ; org.junit.Assert.assertTrue ( "Shouldn't be any validate messages" , messages.isEmpty ( ) ) ; }

Target:
public void testCheckIfRoleIsReadOnlyFalse ( ) { getRole ( ) . setReadonly ( false ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( getCommand ( ) . checkIfRoleIsReadOnly ( messages ) , "Role should be read only" ) ; org.junit.jupiter.api.Assertions.assertTrue ( messages.isEmpty ( ) , "Shouldn't be any validate messages" ) ; }