auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gwt.resources.client.ImageResource getValue ( T value ) { setTitle ( value.getComment ( ) ) ; if ( ( ( value.getComment ( ) ) != null ) && ( ( value.getComment ( ) ) != "" ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.CommentColumn.getApplicationResources ( ) . commentImage ( ) ; } return null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( T value ) { setTitle ( value.getComment ( ) ) ; if ( ( ( value.getComment ( ) ) != null ) && ( ! ( value.getComment ( ) . isEmpty ( ) ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.CommentColumn.getApplicationResources ( ) . commentImage ( ) ; } return null ; }
Source:
public void setup ( ) throws java.lang.Exception { validator = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) ; org.ovirt.engine.core.common.config.IConfigUtilsInterface confUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( confUtils.getValue ( ConfigValues.DefaultManagementNetwork , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MANAGEMENT_NETWORK ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( confUtils ) ; }

Target:
public void setup ( ) throws java.lang.Exception { validator = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.provider.storage.LibvirtSecretValidator libvirtSecretValidator = new org.ovirt.engine.core.bll.provider.storage.LibvirtSecretValidator ( getParameters ( ) . getLibvirtSecret ( ) ) ; return ( ( validate ( libvirtSecretValidator.uuidExist ( ) ) ) && ( validate ( libvirtSecretValidator.valueNotEmpty ( ) ) ) ) && ( validate ( libvirtSecretValidator.providerExist ( ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.provider.storage.LibvirtSecretValidator libvirtSecretValidator = new org.ovirt.engine.core.bll.provider.storage.LibvirtSecretValidator ( getParameters ( ) . getLibvirtSecret ( ) ) ; return ( ( validate ( libvirtSecretValidator.uuidExist ( ) ) ) && ( validate ( libvirtSecretValidator.valueNotEmpty ( ) ) ) ) && ( validate ( libvirtSecretValidator.providerExist ( ) ) ) ; }
Source:
public java.lang.String getVmPoolName ( ) { if ( ( ( mVmPoolName ) == null ) && ( ( mVmPool ) == null ) ) { mVmPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . get ( getVmPoolId ( ) ) ; if ( ( mVmPool ) != null ) { mVmPoolName = mVmPool.getvm_pool_name ( ) ; } } return mVmPoolName ; }

Target:
public java.lang.String getVmPoolName ( ) { if ( ( ( mVmPoolName ) == null ) && ( ( mVmPool ) == null ) ) { mVmPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . get ( getVmPoolId ( ) ) ; if ( ( mVmPool ) != null ) { mVmPoolName = mVmPool.getVmPoolName ( ) ; } } return mVmPoolName ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( returnValue ) ) ; model.getPath ( ) . setEntity ( connection.getconnection ( ) ) ; model.getVfsType ( ) . setEntity ( connection.getVfsType ( ) ) ; model.getMountOptions ( ) . setEntity ( connection.getMountOptions ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( returnValue ) ) ; model.getPath ( ) . setEntity ( connection.getconnection ( ) ) ; model.getVfsType ( ) . setEntity ( connection.getVfsType ( ) ) ; model.getMountOptions ( ) . setEntity ( connection.getMountOptions ( ) ) ; }
Source:
public void testIsQcowV3SupportedForDcVersionV3 ( ) { disk1.setVolumeFormat ( VolumeFormat.COW ) ; disk1.setQcowCompat ( QcowCompat.QCOW2_V3 ) ; org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setStoragePoolFormatType ( StorageFormatType.V3 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( sp ) ; org.junit.Assert.assertThat ( validator.isQcowVersionSupportedForDcVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_QCOW_COMPAT_DOES_NOT_MATCH_DC_VERSION ) ) ; }

Target:
public void testIsQcowV3SupportedForDcVersionV3 ( ) { disk1.setVolumeFormat ( VolumeFormat.COW ) ; disk1.setQcowCompat ( QcowCompat.QCOW2_V3 ) ; org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setStoragePoolFormatType ( StorageFormatType.V3 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( sp ) ; org.junit.Assert.assertThat ( validator.isQcowVersionSupportedForDcVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_QCOW_COMPAT_DOES_NOT_MATCH_DC_VERSION ) ) ; }
Source:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
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.network.VnicProfileView > ( ) ; } return source ; }
Source:
public void onSuccess ( java.lang.Object parentModel , java.lang.Object returnValue ) { if ( returnValue == null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; updateNetworkInterfaces ( getNetworkProfileBehavior ( ) , nics ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { if ( returnValue == null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = returnValue.getReturnValue ( ) ; updateNetworkInterfaces ( getNetworkProfileBehavior ( ) , nics ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.Object > createClusterPolicyParameters ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Map < java.lang.String , java.lang.Object > parameters = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; if ( vm != null ) { parameters.put ( PolicyUnitImpl.VM , vm ) ; } if ( ( cluster.getClusterPolicyProperties ( ) ) != null ) { parameters.putAll ( cluster.getClusterPolicyProperties ( ) ) ; } return parameters ; }

Target:
protected java.util.Map < java.lang.String , java.lang.String > createClusterPolicyParameters ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { java.util.Map < java.lang.String , java.lang.String > parameters = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; if ( ( cluster.getClusterPolicyProperties ( ) ) != null ) { parameters.putAll ( cluster.getClusterPolicyProperties ( ) ) ; } return parameters ; }
Source:
private void removeNetwork ( ) { networkMap.remove ( ( ( java.lang.String ) ( getNetworkList ( ) . getSelectedItem ( ) ) ) ) ; getNetworkList ( ) . setItems ( new java.util.ArrayList < java.lang.String > ( networkMap.keySet ( ) ) ) ; getNetworkList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( networkMap.keySet ( ) ) ) ; }

Target:
private void removeNetwork ( ) { networkMap.remove ( getNetworkList ( ) . getSelectedItem ( ) ) ; getNetworkList ( ) . setItems ( new java.util.ArrayList < java.lang.String > ( networkMap.keySet ( ) ) ) ; getNetworkList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( networkMap.keySet ( ) ) ) ; }
Source:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > all = getTagDao ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap tagVm : all ) { getTagDao ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }

Target:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > all = org.ovirt.engine.core.bll.VmCommand.getTagDao ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap tagVm : all ) { org.ovirt.engine.core.bll.VmCommand.getTagDao ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }
Source:
public void testExecuteQueryWithDirectOnly ( ) { org.ovirt.engine.core.dao.PermissionDAO permissionDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.PermissionDAO.class ) ; org.mockito.Mockito.when ( permissionDAOMock.getAllForEntity ( objectID , getUser ( ) . getUserId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( mockedPermissions ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDAOMock ) ; assertQueryDAOCall ( true ) ; }

Target:
public void testExecuteQueryWithDirectOnly ( ) { org.ovirt.engine.core.dao.PermissionDAO permissionDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.PermissionDAO.class ) ; org.mockito.Mockito.when ( permissionDAOMock.getAllForEntity ( objectID , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) , false ) ) . thenReturn ( mockedPermissions ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDAOMock ) ; assertQueryDAOCall ( true ) ; }
Source:
public void createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ) ; mockIsoDomainListSyncronizer ( ) ; mockVmRunHandler ( ) ; mockSuccessfulRunVmValidator ( ) ; mockSuccessfulSnapshotValidator ( ) ; mockBackend ( ) ; }

Target:
public void createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ) ; mockIsoDomainListSyncronizer ( ) ; mockSuccessfulRunVmValidator ( ) ; mockSuccessfulSnapshotValidator ( ) ; mockBackend ( ) ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; getCommand ( ) . endAction ( ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) return false ; org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.MyValue other = ( ( org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.MyValue ) ( obj ) ) ; if ( ( length ) != ( other.length ) ) return false ; if ( ( width ) != ( other.width ) ) return false ; return true ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.MyValue ) ) { return false ; } org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.MyValue other = ( ( org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.MyValue ) ( obj ) ) ; return ( ( length ) == ( other.length ) ) && ( ( width ) == ( other.width ) ) ; }
Source:
public void validateSucceeds ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) , null ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( false ) ; mockHasVolumeOnServer ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateSucceeds ( ) throws java.lang.Exception { mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( false ) ; mockHasVolumeOnServer ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public boolean isDisplayNetworkAffected ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel network : ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel ) ( op1 ) ) . getNetworks ( ) ) { if ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.isDisplayNetworkAffected ( network , null ) ) { return true ; } } return false ; }

Target:
public boolean isDisplayNetworkAffected ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { if ( ( op1 != null ) && ( op1 instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel ) ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel network : ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel ) ( op1 ) ) . getNetworks ( ) ) { if ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.isDisplayNetworkAffected ( network , null ) ) { return true ; } } } return false ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForClonedDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > disksMap = getDomainsDisksMap ( diskImages ) ; return validOrFirstFailure ( new org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator.ValidatorPredicate ( ) { @ java.lang.Override public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForClonedDisks ( disksList ) ; } } ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForClonedDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > disksMap = getDomainsDisksMap ( diskImages ) ; return validOrFirstFailure ( ( entry ) -> { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForClonedDisks ( disksList ) ; } ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getSparsifyCommand ( ) ) ) { return sparsifyConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ) ( result ) ) ; if ( ( volumes.size ( ) ) > 0 ) { clusterModel.getEnableGlusterService ( ) . setIsChangeable ( false ) ; if ( ! isVirtGlusterAllowed ) { clusterModel.getEnableOvirtService ( ) . setIsChangeable ( false ) ; } } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes ) { if ( ( volumes.size ( ) ) > 0 ) { clusterModel.getEnableGlusterService ( ) . setIsChangeable ( false ) ; if ( ! isVirtGlusterAllowed ) { clusterModel.getEnableOvirtService ( ) . setIsChangeable ( false ) ; } } }
Source:
private void newPoolNameIsAlreadyTaken ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePoolList = new java.util.ArrayList < > ( ) ; storagePoolList.add ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createStoragePool ( ) ) ; org.mockito.Mockito.when ( spDao.getByName ( org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.anyBoolean ( ) ) ) . thenReturn ( new java.util.ArrayList ( storagePoolList ) ) ; }

Target:
private void newPoolNameIsAlreadyTaken ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePoolList = new java.util.ArrayList < > ( ) ; storagePoolList.add ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createStoragePool ( ) ) ; org.mockito.Mockito.when ( spDao.getByName ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( new java.util.ArrayList ( storagePoolList ) ) ; }
Source:
public static void addPermission ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.bll.PredefinedRoles role , org.ovirt.engine.core.common.VdcObjectType objectType ) { org.ovirt.engine.core.common.businessentities.Permission perms = new org.ovirt.engine.core.common.businessentities.Permission ( ) ; perms.setAdElementId ( userId ) ; perms.setObjectType ( objectType ) ; perms.setObjectId ( entityId ) ; perms.setRoleId ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
public void addPermission ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.bll.PredefinedRoles role , org.ovirt.engine.core.common.VdcObjectType objectType ) { org.ovirt.engine.core.common.businessentities.Permission perms = new org.ovirt.engine.core.common.businessentities.Permission ( ) ; perms.setAdElementId ( userId ) ; perms.setObjectType ( objectType ) ; perms.setObjectId ( entityId ) ; perms.setRoleId ( role.getId ( ) ) ; addPermission ( perms ) ; }
Source:
public boolean isValid ( java.lang.Integer value , javax.validation.ConstraintValidatorContext context ) { final java.util.List < java.lang.String > validValues = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.ValidNumOfMonitors ) ; if ( ( value == null ) || ( validValues == null ) ) { return false ; } return validValues.contains ( value.toString ( ) ) ; }

Target:
public boolean isValid ( java.lang.Integer value , javax.validation.ConstraintValidatorContext context ) { if ( value == null ) { return false ; } final java.util.List < java.lang.String > validValues = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.ValidNumOfMonitors ) ; return validValues.contains ( value.toString ( ) ) ; }
Source:
private boolean isSharingIommuGroup ( org.ovirt.engine.core.common.businessentities.HostDevice device ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > iommoGroupDevices = hostDeviceDao.getHostDevicesByHostIdAndIommuGroup ( device.getHostId ( ) , device.getIommuGroup ( ) ) ; return ( iommoGroupDevices.size ( ) ) > 1 ; }

Target:
private boolean isSharingIommuGroup ( org.ovirt.engine.core.common.businessentities.HostDevice device ) { if ( ( device.getIommuGroup ( ) ) == null ) { return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > iommoGroupDevices = hostDeviceDao.getHostDevicesByHostIdAndIommuGroup ( device.getHostId ( ) , device.getIommuGroup ( ) ) ; return ( iommoGroupDevices.size ( ) ) > 1 ; }
Source:
public void init ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid hostId : hostDynamicDao.getIdsOfHostsWithStatus ( VDSStatus.Up ) ) { parameters.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( hostId ) ) ; } backend.runInternalMultipleActions ( VdcActionType.RefreshHostDevices , parameters ) ; hostDeviceDao.cleanDownVms ( ) ; }

Target:
private void init ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid hostId : hostDynamicDao.getIdsOfHostsWithStatus ( VDSStatus.Up ) ) { parameters.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( hostId ) ) ; } backend.runInternalMultipleActions ( VdcActionType.RefreshHostDevices , parameters ) ; hostDeviceDao.cleanDownVms ( ) ; }
Source:
protected boolean allowedStorageDomain ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > sourceActiveStorageDomains , boolean shouldFilterBySourceType , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel templateDisk , org.ovirt.engine.core.common.businessentities.StorageDomain sd ) { boolean isTemplate = isTemplateDisk ( diskImage ) ; if ( isTemplate && ( sourceActiveStorageDomains.contains ( sd ) ) ) { return false ; } return super . allowedStorageDomain ( sourceActiveStorageDomains , shouldFilterBySourceType , diskImage , templateDisk , sd ) ; }

Target:
protected boolean allowedStorageDomain ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > sourceActiveStorageDomains , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel templateDisk , org.ovirt.engine.core.common.businessentities.StorageDomain sd ) { boolean isTemplate = isTemplateDisk ( diskImage ) ; if ( isTemplate && ( sourceActiveStorageDomains.contains ( sd ) ) ) { return false ; } return super . allowedStorageDomain ( sourceActiveStorageDomains , diskImage , templateDisk , sd ) ; }
Source:
private java.lang.StringBuilder runAndCheck ( java.lang.StringBuilder original , java.lang.String pattern , java.lang.String value , java.lang.String expected ) { java.lang.StringBuilder res = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.replace ( original , pattern , value ) ; org.junit.Assert.assertThat ( res.toString ( ) , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expected ) ) ) ; return res ; }

Target:
private java.lang.String runAndCheck ( java.lang.String original , java.lang.String pattern , java.lang.String value , java.lang.String expected ) { java.lang.String res = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.replace ( original , pattern , value ) ; org.junit.Assert.assertThat ( res , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expected ) ) ) ; return res ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceBondNameIsEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getBondName ( ) ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceBondNameIsEmpty ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getBondName ( ) ) ) { ret.add ( i ) ; } } return ret ; }
Source:
public static void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3MigrationOptions adapt ( org.ovirt.engine.api.model.MigrationOptions from ) { org.ovirt.engine.api.v3.types.V3MigrationOptions to = new org.ovirt.engine.api.v3.types.V3MigrationOptions ( ) ; if ( from.isSetAutoConverge ( ) ) { to.setAutoConverge ( from.getAutoConverge ( ) ) ; } if ( from.isSetCompressed ( ) ) { to.setCompressed ( from.getCompressed ( ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.v3.types.V3MigrationOptions adapt ( org.ovirt.engine.api.model.MigrationOptions from ) { org.ovirt.engine.api.v3.types.V3MigrationOptions to = new org.ovirt.engine.api.v3.types.V3MigrationOptions ( ) ; if ( from.isSetAutoConverge ( ) ) { to.setAutoConverge ( from.getAutoConverge ( ) . value ( ) ) ; } if ( from.isSetCompressed ( ) ) { to.setCompressed ( from.getCompressed ( ) . value ( ) ) ; } return to ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { true , false } , getUsers ( ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { false , false } , getUsers ( ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private void validateVnicProfileMapping ( org.ovirt.engine.api.model.VnicProfileMapping mapping ) { if ( ! ( mapping.isSetSourceNetworkName ( ) ) ) { badRequest ( "vNic profile mapping is missing source network name." ) ; } if ( ! ( mapping.isSetSourceNetworkProfileName ( ) ) ) { badRequest ( "vNic profile mapping is missing source network profile name." ) ; } if ( ! ( mapping.isSetTargetVnicProfile ( ) ) ) { badRequest ( "vNic profile mapping is missing target vNic profile." ) ; } if ( ! ( mapping.getTargetVnicProfile ( ) . isSetId ( ) ) ) { badRequest ( "vNic profile mapping is missing target vNic profile id." ) ; } asGuid ( mapping.getTargetVnicProfile ( ) . getId ( ) ) ; }

Target:
private void validateVnicProfileMapping ( org.ovirt.engine.api.model.VnicProfileMapping mapping ) { if ( ! ( mapping.isSetSourceNetworkName ( ) ) ) { badRequest ( "vNic profile mapping is missing source network name." ) ; } if ( ! ( mapping.isSetSourceNetworkProfileName ( ) ) ) { badRequest ( "vNic profile mapping is missing source network profile name." ) ; } if ( ( mapping.isSetTargetVnicProfile ( ) ) && ( mapping.getTargetVnicProfile ( ) . isSetId ( ) ) ) { asGuid ( mapping.getTargetVnicProfile ( ) . getId ( ) ) ; } }
Source:
protected java.lang.String getProgressText ( T object ) { java.lang.Integer progressValue = org.ovirt.engine.ui.webadmin.widget.table.column.QuotaPercentColumn.getProgressValue ( object ) ; if ( ( progressValue != null ) && ( progressValue >= 100 ) ) { return getaApplicationConstants ( ) . exceeded ( ) ; } if ( ( progressValue != null ) && ( progressValue < 0 ) ) { return getaApplicationConstants ( ) . unlimited ( ) ; } return progressValue != null ? progressValue + "%" : "0%" ; }

Target:
protected java.lang.String getProgressText ( T object ) { java.lang.Integer progressValue = org.ovirt.engine.ui.webadmin.widget.table.column.QuotaPercentColumn.getProgressValue ( object ) ; if ( ( progressValue != null ) && ( progressValue > 100 ) ) { return getaApplicationConstants ( ) . exceeded ( ) ; } if ( ( progressValue != null ) && ( progressValue < 0 ) ) { return getaApplicationConstants ( ) . unlimited ( ) ; } return progressValue != null ? progressValue + "%" : "0%" ; }
Source:
private void initListerners ( final org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaModel model ) { model.getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { addItems ( model ) ; } } ) ; }

Target:
private void initListerners ( final org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaModel model ) { model.getItemsChangedEvent ( ) . 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 ) { addItems ( model ) ; } } ) ; }
Source:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDAO ) ; returnedPermissions = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; org.ovirt.engine.core.common.businessentities.permissions permissions = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; returnedPermissions.add ( permissions ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getQuotaId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( permissionDAO.getConsumedPermissionsForQuotaId ( quotaId ) ) . thenReturn ( returnedPermissions ) ; }

Target:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDAO ) ; returnedPermissions = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; org.ovirt.engine.core.common.businessentities.permissions permissions = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; returnedPermissions.add ( permissions ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( permissionDAO.getConsumedPermissionsForQuotaId ( quotaId ) ) . thenReturn ( returnedPermissions ) ; }
Source:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VDS , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( getStatusChangeVDSCommand ( ) , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters ( upServer.getId ( ) , entity.getGlusterCommand ( ) , entity.getStage ( ) , entity.getName ( ) ) ) ; return new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VDS , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > ( upServer , returnValue ) ; }

Target:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VDS , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( getStatusChangeVDSCommand ( ) , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters ( upServer.getId ( ) , entity.getGlusterCommand ( ) , entity.getStage ( ) , entity.getName ( ) ) ) ; return new org.ovirt.engine.core.common.utils.Pair ( upServer , returnValue ) ; }
Source:
public void ResetIrs ( ) { nullifyInternalProxies ( ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( _storagePoolId ) ; if ( storagePool != null ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; } }

Target:
public void ResetIrs ( ) { nullifyInternalProxies ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( _storagePoolId ) ; if ( storagePool != null ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; } }
Source:
public void setSpeed ( java.lang.Integer value ) { if ( ( ( speed ) == null ) && ( value == null ) ) { return ; } if ( ( ( speed ) == null ) || ( ! ( speed.equals ( value ) ) ) ) { speed = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Speed" ) ) ; } }

Target:
public void setSpeed ( java.lang.Integer value ) { speed = value ; }
Source:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VDS , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue ; returnValue = runVdsCommand ( VDSCommandType.RemoveGlusterHook , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters ( server.getId ( ) , entity.getGlusterCommand ( ) , entity.getStage ( ) , entity.getName ( ) ) ) ; return new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VDS , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > ( server , returnValue ) ; }

Target:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VDS , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue ; returnValue = runVdsCommand ( VDSCommandType.RemoveGlusterHook , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters ( server.getId ( ) , entity.getGlusterCommand ( ) , entity.getStage ( ) , entity.getName ( ) ) ) ; return new org.ovirt.engine.core.common.utils.Pair ( server , returnValue ) ; }
Source:
public static java.lang.String toSingular ( java.lang.String candidate ) { if ( candidate.endsWith ( "s" ) ) { return candidate.substring ( 0 , ( ( candidate.length ( ) ) - 1 ) ) ; } return candidate ; }

Target:
public static java.lang.String toSingular ( java.lang.String candidate ) { if ( ( ( candidate.length ( ) ) >= 1 ) && ( candidate.endsWith ( "s" ) ) ) { return candidate.substring ( 0 , ( ( candidate.length ( ) ) - 1 ) ) ; } return candidate ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.Network getNetworkByVnicProfile ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile ) { if ( vnicProfile == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.Network retVal = null ; if ( ( vnicProfile.getNetworkId ( ) ) != null ) { retVal = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . get ( vnicProfile.getNetworkId ( ) ) ; } return retVal ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.Network getNetworkByVnicProfile ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile ) { if ( ( vnicProfile == null ) || ( ( vnicProfile.getNetworkId ( ) ) == null ) ) { return null ; } return org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . get ( vnicProfile.getNetworkId ( ) ) ; }
Source:
public void testGetBaseNicVerifyDelegation ( ) throws java.lang.Exception { org.ovirt.engine.core.vdsbroker.CalculateBaseNic spy = org.mockito.Mockito.spy ( calculateBaseNic ) ; spy.getBaseNic ( baseNic ) ; org.mockito.Mockito.verify ( spy ) . getBaseNic ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.class ) , org.mockito.ArgumentMatchers.isNull ( ) ) ; }

Target:
public void testGetBaseNicVerifyDelegation ( ) throws java.lang.Exception { org.ovirt.engine.core.vdsbroker.CalculateBaseNic spy = org.mockito.Mockito.spy ( calculateBaseNic ) ; spy.getBaseNic ( baseNic ) ; org.mockito.Mockito.verify ( spy ) . getBaseNic ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.isNull ( ) ) ; }
Source:
public void testIncompleteMove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { control.replay ( ) ; ( ( org.ovirt.engine.api.resource.VmDiskResource ) ( resource ) ) . move ( new org.ovirt.engine.api.model.Action ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "move" , "storageDomain.id|name" ) ; } }

Target:
public void testIncompleteMove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { control.replay ( ) ; resource.move ( new org.ovirt.engine.api.model.Action ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "move" , "storageDomain.id|name" ) ; } }
Source:
public static void addDiskToVm ( org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getBaseDiskDao ( ) . save ( disk ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , null , true , false , null ) ; }

Target:
public static void addDiskToVm ( org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getBaseDiskDao ( ) . save ( disk ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , null , true , false , null , false ) ; }
Source:
public void getClusterIdCluster ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.Cluster gr = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; gr.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setCluster ( gr ) ; final org.ovirt.engine.core.compat.Guid g = b.getClusterId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }

Target:
public void getClusterIdCluster ( ) { final org.ovirt.engine.core.common.businessentities.Cluster gr = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; gr.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setCluster ( gr ) ; final org.ovirt.engine.core.compat.Guid g = b.getClusterId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }
Source:
public static java.lang.String join ( java.util.ArrayList < java.lang.String > array , java.lang.String delimiter ) { if ( array == null ) { return "" ; } java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; java.util.Iterator < java.lang.String > iter = array.iterator ( ) ; while ( iter.hasNext ( ) ) { builder.append ( iter.next ( ) ) ; if ( ! ( iter.hasNext ( ) ) ) { break ; } builder.append ( delimiter ) ; } return builder.toString ( ) ; }

Target:
public static java.lang.String join ( java.util.List < java.lang.String > list , java.lang.String delimiter ) { if ( list == null ) { return "" ; } java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; java.util.Iterator < java.lang.String > iter = list.iterator ( ) ; while ( iter.hasNext ( ) ) { builder.append ( iter.next ( ) ) ; if ( ! ( iter.hasNext ( ) ) ) { break ; } builder.append ( delimiter ) ; } return builder.toString ( ) ; }
Source:
public void setEntity ( java.lang.Object value ) { super . setEntity ( value ) ; if ( getIsToSync ( ) . getIsChangable ( ) ) { setBootProtocolsAvailable ( ( ( java.lang.Boolean ) ( value ) ) ) ; if ( ! ( ( java.lang.Boolean ) ( value ) ) ) { revertChanges ( ) ; } else { saveOriginalNetworkParameters ( ) ; } } }

Target:
public void setEntity ( java.lang.Object value ) { super . setEntity ( value ) ; if ( getIsToSync ( ) . getIsChangable ( ) ) { if ( ! ( ( java.lang.Boolean ) ( value ) ) ) { revertChanges ( ) ; } setBootProtocolsAvailable ( ( ( java.lang.Boolean ) ( value ) ) ) ; } }