auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void save ( org.ovirt.engine.core.common.businessentities.bookmarks bookmark ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = new org.ovirt.engine.core.dao.BookmarkDAODbFacadeImpl.BookmarkSqlParameterSource ( bookmark ) ; getCallsHandler ( ) . executeModification ( "InsertBookmark" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.bookmarks bookmark ) { org.ovirt.engine.core.compat.Guid id = bookmark.getbookmark_id ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; bookmark.setbookmark_id ( id ) ; } org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = new org.ovirt.engine.core.dao.BookmarkDAODbFacadeImpl.BookmarkSqlParameterSource ( bookmark ) ; getCallsHandler ( ) . executeModification ( "InsertBookmark" , parameterSource ) ; }
Source:
public void successfulFence ( ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS ) ; mockFenceVdsResult ( fenceVdsResult , null ) ; mockProxyHost ( ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.START , createAgent ( ) ) ; org.junit.Assert.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; verifyAuditFenceExecutionStart ( 1 ) ; }

Target:
public void successfulFence ( ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS ) ; mockFenceVdsResult ( fenceVdsResult , null ) ; mockProxyHost ( ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.START , createAgent ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; verifyAuditFenceExecutionStart ( 1 ) ; }
Source:
protected void configure ( ) { super . configure ( ) ; bind ( org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemMessagesTranslator.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.section.login.presenter.ConnectAutomaticallyProvider.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.utils.ConnectAutomaticallyManager.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
protected void configure ( ) { super . configure ( ) ; bind ( org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemMessagesTranslator.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.section.login.presenter.ConnectAutomaticallyProvider.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.utils.ConnectAutomaticallyManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.common.view.popup.VmPopupResources.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > getDiskInterfaceList ( org.ovirt.engine.core.compat.Version clusterVersion ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > diskInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.DiskInterface [ ] { org.ovirt.engine.core.common.businessentities.DiskInterface.IDE , org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO } ) ) ; boolean isVirtIOScsiEnabled = ( clusterVersion != null ) ? ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.VirtIoScsiEnabled , clusterVersion.getValue ( ) ) ) ) : true ; if ( isVirtIOScsiEnabled ) { diskInterfaces.add ( DiskInterface.VirtIO_SCSI ) ; } return diskInterfaces ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > getDiskInterfaceList ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > diskInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.DiskInterface [ ] { org.ovirt.engine.core.common.businessentities.DiskInterface.IDE , org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO , org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI } ) ) ; return diskInterfaces ; }
Source:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void setBackgroundImageByClassName ( java.lang.String className , java.lang.String imageUrl ) { com.google.gwt.dom.client.NodeList < com.google.gwt.dom.client.Element > elements = getElement ( ) . getElementsByTagName ( "td" ) ; for ( int i = 0 ; i < ( elements.getLength ( ) ) ; i ++ ) { com.google.gwt.dom.client.Element element = elements.getItem ( i ) ; if ( element.getClassName ( ) . contains ( className ) ) { element.getStyle ( ) . setBackgroundImage ( ( ( "url(" + imageUrl ) + ")" ) ) ; } } }

Target:
private com.google.gwt.dom.client.Element getElementByTagAndClassName ( java.lang.String tagName , java.lang.String className ) { com.google.gwt.dom.client.NodeList < com.google.gwt.dom.client.Element > elements = getElement ( ) . getElementsByTagName ( tagName ) ; for ( int i = 0 ; i < ( elements.getLength ( ) ) ; i ++ ) { com.google.gwt.dom.client.Element element = elements.getItem ( i ) ; if ( element.getClassName ( ) . contains ( className ) ) { return element ; } } return null ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { boolean returnValue = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( returnValue ) { command.Execute ( ) ; } else { displayConsoleConnectConfirmPopup ( command ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { boolean returnValue = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( returnValue ) { command.execute ( ) ; } else { displayConsoleConnectConfirmPopup ( command ) ; } }
Source:
public void setUp ( ) { clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( clusterDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( clusterId ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }

Target:
public void setUp ( ) { clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( clusterDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterUtils ) . when ( command ) . getClusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( clusterId ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }
Source:
public void testAddValueVersion ( ) { org.ovirt.engine.core.compat.Version verision = new org.ovirt.engine.core.compat.Version ( this . random.nextInt ( ) , this . random.nextInt ( ) ) ; paramSource.addValue ( paramName , verision ) ; org.junit.Assert.assertEquals ( "wrong value returned from parameter source" , verision.toString ( ) , paramSource.getValue ( paramName ) ) ; }

Target:
public void testAddValueVersion ( ) { org.ovirt.engine.core.compat.Version verision = new org.ovirt.engine.core.compat.Version ( this . random.nextInt ( ) , this . random.nextInt ( ) ) ; paramSource.addValue ( paramName , verision ) ; org.junit.jupiter.api.Assertions.assertEquals ( verision.toString ( ) , paramSource.getValue ( paramName ) , "wrong value returned from parameter source" ) ; }
Source:
public void hasMultipleClustersForLocalDC ( ) { org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) , new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) ; org.mockito.Mockito.when ( clusterDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( clusters ) ; cmd.getStoragePool ( ) . setIsLocal ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.CLUSTER_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE ) ; }

Target:
public void hasNoStorageDomains ( ) { org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult validateModelCompatibleWithOs ( ) { org.ovirt.engine.core.bll.validator.VmWatchdogValidator validator = getVmWatchdogValidator ( ) ; if ( validator != null ) { return validator.isModelCompatibleWithOs ( ) ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY ) ; } }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateWatchdog ( ) { if ( ! ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . isClusterIndependent ( ) ) ) { org.ovirt.engine.core.bll.validator.VmWatchdogValidator validator = getVmWatchdogValidator ( ) ; if ( validator != null ) { return validator.isValid ( ) ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY ) ; } } else { return new org.ovirt.engine.core.bll.validator.VmWatchdogValidator.VmWatchdogClusterIndependentValidator ( createWatchdogFromParams ( ) ) . isValid ( ) ; } }
Source:
protected void onBind ( ) { super . onBind ( ) ; registerHandler ( org.ovirt.engine.ui.userportal.section.main.presenter.AbstractSideTabWithDetailsPresenter.getView ( ) . getTableSelectionModel ( ) . addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { modelProvider.setSelectedItems ( getSelectedItems ( ) ) ; fireTableSelectionChangeEvent ( ) ; updateLayout ( ) ; if ( hasSelection ( ) ) { placeManager.revealPlace ( getSubTabRequest ( ) ) ; } else { placeManager.revealPlace ( getSideTabRequest ( ) ) ; } } } ) ) ; }

Target:
protected void onBind ( ) { super . onBind ( ) ; registerHandler ( org.ovirt.engine.ui.userportal.section.main.presenter.AbstractSideTabWithDetailsPresenter.getView ( ) . getTable ( ) . getSelectionModel ( ) . addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { modelProvider.setSelectedItems ( getSelectedItems ( ) ) ; fireTableSelectionChangeEvent ( ) ; updateLayout ( ) ; if ( hasSelection ( ) ) { placeManager.revealPlace ( getSubTabRequest ( ) ) ; } else { placeManager.revealPlace ( getSideTabRequest ( ) ) ; } } } ) ) ; }
Source:
public boolean isVolumeSnapshotHardLimitReached ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getGlusterVolumeDao ( ) . getById ( volumeId ) ; if ( volume != null ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig config = getGlusterVolumeSnapshotConfigDao ( ) . getConfigByVolumeIdAndName ( volume.getClusterId ( ) , volumeId , "snap-max-hard-limit" ) ; if ( config != null ) { int snapMaxHardLimit = java.lang.Integer.parseInt ( config.getParamValue ( ) ) ; int snapshotCount = volume.getSnapshotsCount ( ) ; return snapshotCount >= snapMaxHardLimit ; } } return false ; }

Target:
public boolean isVolumeSnapshotHardLimitReached ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = glusterVolumeDao.getById ( volumeId ) ; if ( volume != null ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig config = glusterVolumeSnapshotConfigDao.getConfigByVolumeIdAndName ( volume.getClusterId ( ) , volumeId , "snap-max-hard-limit" ) ; if ( config != null ) { int snapMaxHardLimit = java.lang.Integer.parseInt ( config.getParamValue ( ) ) ; int snapshotCount = volume.getSnapshotsCount ( ) ; return snapshotCount >= snapMaxHardLimit ; } } return false ; }
Source:
protected boolean isFiltered ( ) { java.util.List < java.lang.String > filterVar = getHttpHeaders ( ) . getRequestHeader ( org.ovirt.engine.api.restapi.resource.BaseBackendResource.USER_FILTER_HEADER ) ; if ( ( filterVar != null ) && ( ( filterVar.size ( ) ) > 0 ) ) { return java.lang.Boolean.valueOf ( filterVar.iterator ( ) . next ( ) ) ; } else { return false ; } }

Target:
protected boolean isFiltered ( ) { return org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BaseBackendResource.FILTER , true , false ) ; }
Source:
public void testValidRemovedBondsWhenNotRemovingAnyBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Bond > emptyList ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , params , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) , null , null , managementNetworkUtil ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void modifiedAttachmentNotRemovedAttachmentModifiedButNotRemovedValid ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( params ) . setHost ( host ) . build ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment modifiedAttachment = createNetworkAttachment ( new org.ovirt.engine.core.common.businessentities.network.Network ( ) ) ; org.junit.Assert.assertThat ( validator.modifiedAttachmentNotRemoved ( modifiedAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void updateMaxNumOfVmCpus ( ) { java.lang.String version = getClusterCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfVmCpus ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxCpus = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.postUpdateNumOfSockets2 ( ) ; } } ) , version ) ; }

Target:
protected void updateCustomPropertySheet ( ) { if ( ( getModel ( ) . getCompatibilityVersion ( ) ) != null ) { updateCustomPropertySheet ( getModel ( ) . getCompatibilityVersion ( ) ) ; } }
Source:
public static void GetDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void GetRedirectServletReportsPage ( 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.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void getAAAProfilesList ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void canDoActionFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeDiskWrongPlug ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.HOT_PLUG_DISK_IS_NOT_UNPLUGGED.toString ( ) ) ) ; }

Target:
public void validateFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeDiskWrongPlug ( true ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.HOT_PLUG_DISK_IS_NOT_UNPLUGGED.toString ( ) ) ) ; }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void initVmInitEnabled ( org.ovirt.engine.core.common.businessentities.VmInit vmInit ) { if ( vmInit == null ) { getIsCloudInitEnabled ( ) . setEntity ( false ) ; getIsSysprepEnabled ( ) . setEntity ( false ) ; getAttachFloppy ( ) . setEntity ( false ) ; } else { if ( getIsWindowsOS ( ) ) { getIsSysprepEnabled ( ) . setEntity ( true ) ; getAttachFloppy ( ) . setEntity ( true ) ; } else { getIsCloudInitEnabled ( ) . setEntity ( true ) ; } } }

Target:
private void initVmInitEnabled ( org.ovirt.engine.core.common.businessentities.VmInit vmInit , boolean isInitialized ) { if ( vmInit == null ) { getIsCloudInitEnabled ( ) . setEntity ( false ) ; getIsSysprepEnabled ( ) . setEntity ( false ) ; getAttachFloppy ( ) . setEntity ( false ) ; } else if ( ! isInitialized ) { if ( getIsWindowsOS ( ) ) { getIsSysprepEnabled ( ) . setEntity ( true ) ; getAttachFloppy ( ) . setEntity ( true ) ; } else { getIsCloudInitEnabled ( ) . setEntity ( true ) ; } } }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static 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.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , iface.getMtu ( ) , iface.getVlanId ( ) , null ) ; }

Target:
public void calculateNetworkImplementationDetailsInterfaceQosMissing ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setQos ( null ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , createQos ( ) ) ; }
Source:
public org.ovirt.engine.sdk.decorators.User add ( org.ovirt.engine.sdk.decorators.User user ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , user , org.ovirt.engine.sdk.entities.User.class , org.ovirt.engine.sdk.decorators.User.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.User add ( org.ovirt.engine.sdk.decorators.User user ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , user , org.ovirt.engine.sdk.entities.User.class , org.ovirt.engine.sdk.decorators.User.class , headers ) ; }
Source:
public org.ovirt.engine.sdk.decorators.Template add ( org.ovirt.engine.sdk.decorators.Template template ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , template , org.ovirt.engine.sdk.entities.Template.class , org.ovirt.engine.sdk.decorators.Template.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Template add ( org.ovirt.engine.sdk.decorators.Template template ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , template , org.ovirt.engine.sdk.entities.Template.class , org.ovirt.engine.sdk.decorators.Template.class , headers ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Permissions getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.Permissions permission = new org.ovirt.engine.core.common.businessentities.Permissions ( ) ; permission.setId ( GUIDS [ ( ( index + 1 ) % 3 ) ] ) ; permission.setAdElementId ( GUIDS [ 0 ] ) ; permission.setRoleId ( GUIDS [ index ] ) ; permission.setObjectType ( VdcObjectType.System ) ; return permission ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Permission getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.Permission permission = new org.ovirt.engine.core.common.businessentities.Permission ( ) ; permission.setId ( GUIDS [ ( ( index + 1 ) % 3 ) ] ) ; permission.setAdElementId ( GUIDS [ 0 ] ) ; permission.setRoleId ( GUIDS [ index ] ) ; permission.setObjectType ( VdcObjectType.System ) ; return permission ; }
Source:
public void testRemove ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = setUpVDSGroupExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachNetworkToVdsGroup , org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter.class , new java.lang.String [ ] { "VdsGroup" } , new java.lang.Object [ ] { vdsGroup } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpVDSGroupExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachNetworkToVdsGroup , org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult notRenamingManagementNetwork ( org.ovirt.engine.core.common.businessentities.network.Network newNetwork ) { java.lang.String managementNetwork = org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) ; return ( network.getName ( ) . equals ( managementNetwork ) ) && ( ! ( newNetwork.getName ( ) . equals ( managementNetwork ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult notChangingDataCenterId ( org.ovirt.engine.core.compat.Guid dataCenterId ) { final org.ovirt.engine.core.compat.Guid oldDataCenterId = network.getDataCenterId ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_DATA_CENTER_ID_CANNOT_BE_CHANGED ) . when ( ( ! ( oldDataCenterId.equals ( dataCenterId ) ) ) ) ; }
Source:
private java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActionsImpl ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isInternal ) { return runMultipleActionsImpl ( actionType , parameters , isInternal , null ) ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isRunOnlyIfAllCanDoPass , boolean waitForResult ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllCanDoPass , waitForResult ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult interfaceIsValidSlave ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_NIC_NAME , iface.getName ( ) ) ) . when ( ( ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) || ( iface.isBond ( ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult interfaceIsValidSlave ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_NIC_NAME , iface.getName ( ) ) ) . when ( ( ( org.ovirt.engine.core.common.utils.NetworkCommonUtils.isVlan ( iface ) ) || ( iface.isBond ( ) ) ) ) ; }
Source:
protected void executeCommand ( ) { for ( org.ovirt.engine.core.common.businessentities.permissions permission : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getAllDirectPermissionsForAdElement ( org.ovirt.engine.core.bll.RemoveUserCommand.getAdUserId ( ) ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParametes tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParametes ( permission ) ; tempVar.setShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RemovePermission , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RemoveUserCommand.getExecutionContext ( ) ) ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . remove ( org.ovirt.engine.core.bll.RemoveUserCommand.getAdUserId ( ) ) ; org.ovirt.engine.core.bll.RemoveUserCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { for ( org.ovirt.engine.core.common.businessentities.Permissions permission : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getAllDirectPermissionsForAdElement ( org.ovirt.engine.core.bll.RemoveUserCommand.getAdUserId ( ) ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParameters ( permission ) ; tempVar.setShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RemovePermission , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RemoveUserCommand.getExecutionContext ( ) ) ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . remove ( org.ovirt.engine.core.bll.RemoveUserCommand.getAdUserId ( ) ) ; org.ovirt.engine.core.bll.RemoveUserCommand.setSucceeded ( true ) ; }
Source:
public void parseInvalidString ( ) { java.lang.String [ ] invalidValues = new java.lang.String [ ] { "clust" , "clust,dc" , "cluster,d" , "cluster, dc" } ; for ( java.lang.String invalidValue : invalidValues ) { try { org.ovirt.engine.core.common.utils.pm.FenceProxySourceTypeHelper.parseFromString ( invalidValue ) ; org.junit.Assert.fail ( java.lang.String.format ( "Value '%s' is not valid argument of FenceProxySourceTypeHelper.parseFromString." , invalidValue ) ) ; } catch ( java.lang.IllegalArgumentException ex ) { } } }

Target:
public void parseInvalidString ( ) { java.lang.String [ ] invalidValues = new java.lang.String [ ] { "clust" , "clust,dc" , "cluster,d" , "cluster, dc" } ; for ( java.lang.String invalidValue : invalidValues ) { try { org.ovirt.engine.core.common.utils.pm.FenceProxySourceTypeHelper.parseFromString ( invalidValue ) ; org.junit.Assert.fail ( java.lang.String.format ( "Value '%s' is not valid argument of FenceProxySourceTypeHelper.parseFromString." , invalidValue ) ) ; } catch ( java.lang.IllegalArgumentException ignore ) { } } }
Source:
public void Rollback ( ) { log.errorFormat ( "Transaction rolled-back for command: {0}." , this . getClass ( ) . getName ( ) ) ; if ( ( this ) instanceof org.ovirt.engine.core.common.Quotable ) { ( ( org.ovirt.engine.core.common.Quotable ) ( this ) ) . rollbackQuota ( ) ; } cancelTasks ( ) ; }

Target:
public void Rollback ( ) { log.errorFormat ( "Transaction rolled-back for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { if ( ( this ) instanceof org.ovirt.engine.core.common.Quotable ) { ( ( org.ovirt.engine.core.common.Quotable ) ( this ) ) . rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.debug ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }
Source:
private void initCommand ( ) { final org.ovirt.engine.core.compat.Guid sourceSnapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; command = setupCanAddVmFromSnapshotTests ( 0 , 0 , sourceSnapshotId ) ; generateStorageToDisksMap ( command ) ; initDestSDs ( command ) ; storageDomainValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.StorageDomainValidator.class ) ; }

Target:
private void initCommand ( ) { final org.ovirt.engine.core.compat.Guid sourceSnapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; command = setupCanAddVmFromSnapshotTests ( 0 , 0 , sourceSnapshotId ) ; generateStorageToDisksMap ( command ) ; initDestSDs ( command ) ; storageDomainValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.StorageDomainValidator.class ) ; snapshotsValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsValidator.class ) ; }
Source:
public final void removeSessionOnLogout ( java.lang.String sessionId ) { removeSessionImpl ( sessionId , Acct.ReportReason.PRINCIPAL_LOGOUT , "Prinicial %1$s has performed logout" , getPrincipalName ( sessionId ) ) ; }

Target:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { java.lang.String authzName = null ; if ( ( getProfile ( sessionId ) ) != null ) { authzName = getProfile ( sessionId ) . getAuthz ( ) . getContext ( ) . < java.lang.String > get ( Base.ContextKeys.INSTANCE_NAME ) ; } org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , authzName , getPrincipalName ( sessionId ) , message , msgArgs ) ; engineSessionDao.remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }
Source:
protected void executeCommand ( ) { updateParameters ( ) ; if ( ! ( moveDiskParametersList.isEmpty ( ) ) ) { vdcReturnValues.addAll ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . RunMultipleActions ( VdcActionType.MoveOrCopyDisk , getParametersArrayList ( moveDiskParametersList ) , false ) ) ; } if ( ! ( liveMigrateVmDisksParametersList.isEmpty ( ) ) ) { vdcReturnValues.addAll ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . RunMultipleActions ( VdcActionType.LiveMigrateVmDisks , getParametersArrayList ( liveMigrateVmDisksParametersList ) , false ) ) ; } handleChildReturnValue ( ) ; org.ovirt.engine.core.bll.MoveDisksCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { updateParameters ( ) ; if ( ! ( moveDiskParametersList.isEmpty ( ) ) ) { vdcReturnValues.addAll ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . runMultipleActions ( VdcActionType.MoveOrCopyDisk , getParametersArrayList ( moveDiskParametersList ) , false ) ) ; } if ( ! ( liveMigrateVmDisksParametersList.isEmpty ( ) ) ) { vdcReturnValues.addAll ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . runMultipleActions ( VdcActionType.LiveMigrateVmDisks , getParametersArrayList ( liveMigrateVmDisksParametersList ) , false ) ) ; } handleChildReturnValue ( ) ; org.ovirt.engine.core.bll.MoveDisksCommand.setSucceeded ( true ) ; }
Source:
private void incrementVdsPendingVmsCount ( ) { synchronized ( _vds_pending_vm_count ) { if ( ! ( _vds_pending_vm_count.containsKey ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) ) ) ) { _vds_pending_vm_count.put ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , 1 ) ; } else { int i = _vds_pending_vm_count.get ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) ) ; _vds_pending_vm_count.put ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , ( i + 1 ) ) ; } } }

Target:
protected boolean acquireLockInternal ( ) { final boolean acquireLock = super . acquireLockInternal ( ) ; if ( ( ( ! acquireLock ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isAutoStartup ( ) ) ) { org.ovirt.engine.core.bll.AutoStartVmsRunner.getInstance ( ) . addVmToRun ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getVmId ( ) ) ; } return acquireLock ; }
Source:
public void validateVmShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED.toString ( ) ) ) ; }

Target:
public void validateVmShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; }
Source:
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 ) ; }

Target:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkQosValidator validator = new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( getNetworkQoS ( ) ) ; return ( ( ( ( ( validateParameters ( ) ) && ( validate ( validator.qosExists ( ) ) ) ) && ( validate ( validator.consistentDataCenter ( ) ) ) ) && ( validate ( validator.allValuesPresent ( ) ) ) ) && ( validate ( validator.peakConsistentWithAverage ( ) ) ) ) && ( validate ( validator.nameNotChangedOrNotTaken ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.dao.qos.QosDao < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > getQosDao ( ) { return getDbFacade ( ) . getNetworkQosDao ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : getParameters ( ) . getParametersList ( ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( parameters.getImageId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.CONFIGURE_DISK_STORAGE ) ) ; setStoragePoolId ( getVm ( ) . getStoragePoolId ( ) ) ; addStoragePermissionByQuotaMode ( permissionList , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) . getValue ( ) , parameters.getStorageDomainId ( ) ) ; } return permissionList ; }

Target:
public void preventRollback ( ) { getParameters ( ) . setExecutionIndex ( 0 ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.disk.GetVmTemplatesDisksQuery.getQueryReturnValue ( ) . setReturnValue ( getTemplateDisks ( ) ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = getTemplateDisks ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { disk.setDiskVmElements ( java.util.Collections.singletonList ( getDiskVmElement ( disk ) ) ) ; } org.ovirt.engine.core.bll.storage.disk.GetVmTemplatesDisksQuery.getQueryReturnValue ( ) . setReturnValue ( disks ) ; }
Source:
public java.lang.String toString ( int i ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; switch ( i ) { case 4 : sb.append ( "." ) . append ( revision ) ; case 3 : sb.insert ( 0 , build ) . insert ( 0 , "." ) ; case 2 : sb.insert ( 0 , minor ) . insert ( 0 , "." ) ; case 1 : sb.insert ( 0 , major ) ; } return sb.toString ( ) ; }

Target:
public java.lang.String toString ( int i ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; switch ( i ) { case 4 : sb.append ( '.' ) . append ( revision ) ; case 3 : sb.insert ( 0 , build ) . insert ( 0 , '.' ) ; case 2 : sb.insert ( 0 , minor ) . insert ( 0 , '.' ) ; case 1 : sb.insert ( 0 , major ) ; } return sb.toString ( ) ; }