auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getid ( ) ; getStorageServerConnectionDao ( ) . remove ( connectionId ) ; log.info ( "Removing connection '{}' from database " , connectionId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) ) ) { log.info ( "No vdsId passed - hosts will not be disconnected." ) ; } else { org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; } org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getId ( ) ; getStorageServerConnectionDao ( ) . remove ( connectionId ) ; log.info ( "Removing connection '{}' from database " , connectionId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) ) ) { log.info ( "No vdsId passed - hosts will not be disconnected." ) ; } else { org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; } org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }
Source:
public void SetDefaultNames1 ( ) { org.ovirt.engine.core.common.businessentities.VDS host = context.host ; if ( ( host.getstorage_pool_id ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDataCenterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.hostDataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( returnValue ) ) ; SetDefaultNames2 ( ) ; } } , frontendHash ) , host.getstorage_pool_id ( ) ) ; } else { SetDefaultNames2 ( ) ; } }

Target:
public void SetDefaultNames1 ( ) { org.ovirt.engine.core.common.businessentities.VDS host = context.host ; if ( ( host.getStoragePoolId ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDataCenterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.hostDataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( returnValue ) ) ; SetDefaultNames2 ( ) ; } } , frontendHash ) , host.getStoragePoolId ( ) ) ; } else { SetDefaultNames2 ( ) ; } }
Source:
public void updateClusterAndMoveMacs ( org.ovirt.engine.core.common.businessentities.Cluster cluster , org.ovirt.engine.core.compat.Guid newMacPoolId , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { org.ovirt.engine.core.compat.Guid oldMacPoolId = cluster.getMacPoolId ( ) ; moveMacsOfUpdatedCluster ( oldMacPoolId , newMacPoolId , cluster.getId ( ) , commandContext ) ; if ( needToMigrateMacs ( oldMacPoolId , newMacPoolId ) ) { cluster.setMacPoolId ( newMacPoolId ) ; clusterDao.update ( cluster ) ; } }

Target:
public void updateClusterAndMoveMacs ( org.ovirt.engine.core.common.businessentities.Cluster cluster , org.ovirt.engine.core.compat.Guid newMacPoolId , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { org.ovirt.engine.core.compat.Guid oldMacPoolId = cluster.getMacPoolId ( ) ; moveMacsOfUpdatedCluster ( cluster , newMacPoolId , commandContext ) ; if ( needToMigrateMacs ( oldMacPoolId , newMacPoolId ) ) { cluster.setMacPoolId ( newMacPoolId ) ; clusterDao.update ( cluster ) ; } }
Source:
public static void endTaskStep ( org.ovirt.engine.core.compat.NGuid stepId , org.ovirt.engine.core.common.job.JobExecutionStatus exitStatus ) { try { if ( stepId != null ) { org.ovirt.engine.core.common.job.Step step = org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . getStep ( stepId.getValue ( ) ) ; if ( step != null ) { step.markStepEnded ( exitStatus ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateStep ( step ) ; } } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.errorFormat ( "Failed to terminate step {0} with status {1}" , stepId , exitStatus , e ) ; } }

Target:
public static void endTaskStep ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.common.job.JobExecutionStatus exitStatus ) { try { if ( stepId != null ) { org.ovirt.engine.core.common.job.Step step = org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . getStep ( stepId.getValue ( ) ) ; if ( step != null ) { step.markStepEnded ( exitStatus ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateStep ( step ) ; } } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.errorFormat ( "Failed to terminate step {0} with status {1}" , stepId , exitStatus , e ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = model.filterStorageDomains ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ) ; model.getStorageDomain ( ) . setItems ( storageDomains ) ; model.getStorageDomain ( ) . setIsEmpty ( storageDomains.isEmpty ( ) ) ; model.updateControlsAvailability ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = filterStorageDomains ( returnValue ) ; getStorageDomain ( ) . setItems ( storageDomains ) ; getStorageDomain ( ) . setIsEmpty ( storageDomains.isEmpty ( ) ) ; updateControlsAvailability ( ) ; stopProgress ( ) ; }
Source:
public void onSearchableModelActivation ( org.ovirt.engine.ui.userportal.section.main.presenter.SearchableModelActivationEvent event ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel currentModel = modelProvider.getModel ( ) ; if ( ( event.getListModel ( ) ) == currentModel ) { currentModel.getSearchCommand ( ) . Execute ( ) ; } else { currentModel.EnsureAsyncSearchStopped ( ) ; } }

Target:
public void onSearchableModelActivation ( org.ovirt.engine.ui.userportal.section.main.presenter.SearchableModelActivationEvent event ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel currentModel = modelProvider.getModel ( ) ; if ( ( event.getListModel ( ) ) == currentModel ) { currentModel.getSearchCommand ( ) . Execute ( ) ; } else { currentModel.setItems ( null ) ; currentModel.EnsureAsyncSearchStopped ( ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > getQuotaStorageByStorageGuid ( org.ovirt.engine.core.compat.Guid storageId , org.ovirt.engine.core.compat.Guid quotaId , boolean allowEmpty ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = createQuotaIdParameterMapper ( quotaId ) . addValue ( "storage_id" , storageId ) . addValue ( "allow_empty" , allowEmpty ) ; java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorageList = getCallsHandler ( ) . executeReadList ( "GetQuotaStorageByStorageGuid" , getQuotaStorageResultSet ( ) , parameterSource ) ; return quotaStorageList ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > getQuotaStorageByStorageGuid ( org.ovirt.engine.core.compat.Guid storageId , org.ovirt.engine.core.compat.Guid quotaId , boolean allowEmpty ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = createQuotaIdParameterMapper ( quotaId ) . addValue ( "storage_id" , storageId ) . addValue ( "allow_empty" , allowEmpty ) ; return getCallsHandler ( ) . executeReadList ( "GetQuotaStorageByStorageGuid" , getQuotaStorageResultSet ( ) , parameterSource ) ; }
Source:
public void shouldElectActiveSharedBeforeLocalDataDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Arrays.asList ( localDomain , sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.Assert.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }

Target:
public void shouldElectActiveSharedBeforeLocalDataDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Arrays.asList ( localDomain , sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.Assert.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }
Source:
public void removeFilter ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { unusedFilters.add ( policyUnit ) ; for ( int i = 0 ; i < ( usedFilters.size ( ) ) ; i ++ ) { if ( usedFilters.get ( i ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { usedFilters.remove ( i ) ; break ; } } refreshCustomProperties ( policyUnit ) ; getFiltersChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void removeFilter ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { unusedFilters.add ( policyUnit ) ; for ( int i = 0 ; i < ( usedFilters.size ( ) ) ; i ++ ) { if ( usedFilters.get ( i ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { usedFilters.remove ( i ) ; break ; } } refreshCustomProperties ( policyUnit , false ) ; getFiltersChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > findGroupsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.AuthzUtils.getIdsBatches ( extension , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryGroups ( extension , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , QueryEntity.GROUP ) ) ) ; } return results ; }

Target:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > findGroupsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryGroups ( extension , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , QueryEntity.GROUP ) ) ) ; } return results ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc create ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct createInfo ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.create ( createInfo.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc create ( java.util.Map createInfo ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.create ( createInfo ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > soundDevList = getVmDeviceDAO ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetSoundDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.SOUND ) ; java.util.List < java.lang.String > result = new java.util.ArrayList < java.lang.String > ( soundDevList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : soundDevList ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetSoundDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > soundDevList = getVmDeviceDAO ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetSoundDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.SOUND ) ; java.util.List < java.lang.String > result = new java.util.ArrayList ( soundDevList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : soundDevList ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetSoundDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
public void onPowerringUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = org.ovirt.engine.core.bll.RunVmCommand.getVmStaticDAO ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( org.ovirt.engine.core.bll.RunVmCommand.getCurrentVdsId ( ) , vmStatic.getNumOfCpus ( ) , vmStatic.getMinAllocatedMem ( ) , vmStatic.getName ( ) ) ; }

Target:
public void onPowerringUp ( ) { decreasePendingVms ( org.ovirt.engine.core.bll.RunVmCommand.getVmStaticDAO ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ) ; }
Source:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.datacenters.NewNetworkModel model ) { super . init ( model ) ; model.getDataCenters ( ) . getSelectedItemChangedEvent ( ) . 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 ) { ( ( org.ovirt.engine.ui.webadmin.section.main.presenter.popup.cluster.NewClusterNetworkPopupPresenterWidget.ViewDef ) ( getView ( ) ) ) . setDataCenterName ( model.getDataCenters ( ) . getSelectedItem ( ) . getName ( ) ) ; } } ) ; }

Target:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.datacenters.NewNetworkModel model ) { super . init ( model ) ; model.getDataCenters ( ) . getSelectedItemChangedEvent ( ) . 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 ) { ( ( org.ovirt.engine.ui.webadmin.section.main.presenter.popup.cluster.NewClusterNetworkPopupPresenterWidget.ViewDef ) ( getView ( ) ) ) . setDataCenterName ( model.getDataCenters ( ) . getSelectedItem ( ) . getName ( ) ) ; } } ) ; }
Source:
public static org.ovirt.engine.api.model.User map ( org.ovirt.engine.core.common.businessentities.DbUser entity , org.ovirt.engine.api.model.User template ) { org.ovirt.engine.api.model.User model = ( template != null ) ? template : new org.ovirt.engine.api.model.User ( ) ; model.setExternalId ( entity.getExternalId ( ) . toHex ( ) ) ; model.setName ( entity.getFirstName ( ) ) ; model.setUserName ( ( ( ( entity.getLoginName ( ) ) + "@" ) + ( entity.getDomain ( ) ) ) ) ; model.setId ( entity.getId ( ) . toString ( ) ) ; model.setLastName ( entity.getLastName ( ) ) ; model.setEmail ( entity.getEmail ( ) ) ; model.setDepartment ( entity.getDepartment ( ) ) ; if ( ( ( entity.getGroupNames ( ) ) != null ) && ( ( entity.getGroupNames ( ) . trim ( ) . length ( ) ) > 0 ) ) { model.setGroups ( new org.ovirt.engine.api.model.Groups ( ) ) ; for ( java.lang.String name : entity.getGroupNames ( ) . split ( "," ) ) { org.ovirt.engine.api.model.Group group = new org.ovirt.engine.api.model.Group ( ) ; group.setName ( name ) ; model.getGroups ( ) . getGroups ( ) . add ( group ) ; } } if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getDomain ( ) ) ) ) { org.ovirt.engine.api.model.Domain dom = new org.ovirt.engine.api.model.Domain ( ) ; dom.setId ( new org.ovirt.engine.core.compat.Guid ( entity.getDomain ( ) . getBytes ( ) , true ) . toString ( ) ) ; model.setDomain ( dom ) ; } return model ; }

Target:
public static org.ovirt.engine.api.model.User map ( org.ovirt.engine.core.common.businessentities.DbUser entity , org.ovirt.engine.api.model.User template ) { org.ovirt.engine.api.model.User model = ( template != null ) ? template : new org.ovirt.engine.api.model.User ( ) ; model.setName ( entity.getFirstName ( ) ) ; model.setUserName ( ( ( ( entity.getLoginName ( ) ) + "@" ) + ( entity.getDomain ( ) ) ) ) ; model.setId ( entity.getId ( ) . toString ( ) ) ; model.setLastName ( entity.getLastName ( ) ) ; model.setEmail ( entity.getEmail ( ) ) ; model.setDepartment ( entity.getDepartment ( ) ) ; if ( ( ( entity.getGroupNames ( ) ) != null ) && ( ( entity.getGroupNames ( ) . trim ( ) . length ( ) ) > 0 ) ) { model.setGroups ( new org.ovirt.engine.api.model.Groups ( ) ) ; for ( java.lang.String name : entity.getGroupNames ( ) . split ( "," ) ) { org.ovirt.engine.api.model.Group group = new org.ovirt.engine.api.model.Group ( ) ; group.setName ( name ) ; model.getGroups ( ) . getGroups ( ) . add ( group ) ; } } if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getDomain ( ) ) ) ) { org.ovirt.engine.api.model.Domain dom = new org.ovirt.engine.api.model.Domain ( ) ; dom.setId ( new org.ovirt.engine.core.compat.Guid ( entity.getDomain ( ) . getBytes ( ) , true ) . toString ( ) ) ; model.setDomain ( dom ) ; } return model ; }
Source:
public boolean Validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation valueValidation = new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) ; getSelectedKey ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { valueValidation } ) ; getValue ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { valueValidation } ) ; return ( getSelectedKey ( ) . getIsValid ( ) ) && ( getValue ( ) . getIsValid ( ) ) ; }

Target:
public boolean validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation valueValidation = new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) ; getSelectedKey ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { valueValidation } ) ; getValue ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { valueValidation } ) ; return ( getSelectedKey ( ) . getIsValid ( ) ) && ( getValue ( ) . getIsValid ( ) ) ; }
Source:
private boolean validateSourceStorageDomain ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageById ( imageId ) ; org.ovirt.engine.core.compat.Guid domainId = diskImage.getStorageIds ( ) . get ( 0 ) ; org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = getValidator ( domainId , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) . getValue ( ) ) ; return validate ( validator.isDomainExistAndActive ( ) ) ; }

Target:
private boolean validateSourceStorageDomain ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageById ( imageId ) ; org.ovirt.engine.core.compat.Guid domainId = diskImage.getStorageIds ( ) . get ( 0 ) ; org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = getValidator ( domainId , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) ) ; return validate ( validator.isDomainExistAndActive ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DisplayType getDefaultDisplayType ( int osId , org.ovirt.engine.core.compat.Version clusterVersion ) { org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > > pairs = osRepository.getGraphicsAndDisplays ( osId , clusterVersion ) ; if ( ! ( pairs.isEmpty ( ) ) ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > graphicsDisplayPair = pairs.get ( 0 ) ; return graphicsDisplayPair.getSecond ( ) ; } return org.ovirt.engine.core.common.businessentities.DisplayType.qxl ; }

Target:
private org.ovirt.engine.core.common.businessentities.DisplayType getDefaultDisplayType ( int osId , org.ovirt.engine.core.compat.Version clusterVersion ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > > pairs = osRepository.getGraphicsAndDisplays ( osId , clusterVersion ) ; if ( ! ( pairs.isEmpty ( ) ) ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > graphicsDisplayPair = pairs.get ( 0 ) ; return graphicsDisplayPair.getSecond ( ) ; } return org.ovirt.engine.core.common.businessentities.DisplayType.qxl ; }
Source:
private void commonTestFlow ( boolean withDummyLun ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVgId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VG_ID ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VDS_ID ) ; expectGetLunsForVg ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VG_ID , withDummyLun ) ; expectGetDeviceList ( ) ; expectGetLunsMap ( ) ; expectGetConnections ( ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.checkReturnValue ( getQuery ( ) ) ; }

Target:
private void commonTestFlow ( boolean withDummyLun ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVgId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VG_ID ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VDS_ID ) ; expectGetLunsForVg ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VG_ID , withDummyLun ) ; expectGetDeviceList ( ) ; expectGetLunsMap ( ) ; expectGetConnections ( ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; checkReturnValue ( ) ; }
Source:
public void executeCommandWhenFailed ( ) { setUpMocksForRemove ( ) ; mockBackend ( false , EngineError.GlusterHookRemoveFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . remove ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_REMOVE_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { setUpMocksForRemove ( ) ; mockBackend ( false , EngineError.GlusterHookRemoveFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . remove ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_REMOVE_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.action.MigrateVmParameters ) ) { return false ; } org.ovirt.engine.core.common.action.MigrateVmParameters other = ( ( org.ovirt.engine.core.common.action.MigrateVmParameters ) ( obj ) ) ; return ( ( ( forceMigrationForNonMigratableVm ) == ( other.forceMigrationForNonMigratableVm ) ) && ( java.util.Objects.equals ( getVmId ( ) , other.getVmId ( ) ) ) ) && ( java.util.Objects.equals ( targetVdsGroupId , other.targetVdsGroupId ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.action.MigrateVmParameters ) ) { return false ; } org.ovirt.engine.core.common.action.MigrateVmParameters other = ( ( org.ovirt.engine.core.common.action.MigrateVmParameters ) ( obj ) ) ; return ( ( java.util.Objects.equals ( getVmId ( ) , other.getVmId ( ) ) ) && ( ( forceMigrationForNonMigratableVm ) == ( other.forceMigrationForNonMigratableVm ) ) ) && ( java.util.Objects.equals ( targetVdsGroupId , other.targetVdsGroupId ) ) ; }
Source:
public static void initUniqueOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetUniqueOsNames ) , callback ) ; }

Target:
public static void initUniqueOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetUniqueOsNames ) , callback ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > model ) { driver.edit ( model ) ; model.getSelectedItemChangedEvent ( ) . 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 ) { com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.NicLabelEditor.this , model ) ; } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > model ) { driver.edit ( model ) ; model.getSelectedItemChangedEvent ( ) . 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 ) { com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.NicLabelEditor.this , model ) ; } } ) ; }
Source:
private static java.lang.String LoadFile ( java.lang.String fileName ) { java.lang.String content = "" ; fileName = org.ovirt.engine.core.common.config.ConfigUtil.resolvePath ( org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getSysprepDir ( ) , fileName ) ; if ( org.ovirt.engine.core.utils.FileUtil.fileExists ( fileName ) ) { try { content = org.ovirt.engine.core.utils.FileUtil.readAllText ( fileName ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.error ( ( "Failed to read sysprep template: " + fileName ) , e ) ; } } else { org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.error ( ( ( "Sysprep template: " + fileName ) + " not found" ) ) ; } return content ; }

Target:
private static java.lang.String LoadFile ( java.lang.String fileName ) { java.lang.String content = "" ; fileName = org.ovirt.engine.core.common.config.ConfigUtil.resolvePath ( org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getSysprepDir ( ) , fileName ) ; if ( org.ovirt.engine.core.utils.FileUtil.fileExists ( fileName ) ) { try { content = org.ovirt.engine.core.utils.FileUtil.readAllText ( fileName ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.error ( ( "Failed to read sysprep template: " + fileName ) , e ) ; } } else { org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.error ( ( ( "Sysprep template: " + fileName ) + " not found" ) ) ; } return content ; }
Source:
public boolean validateBrickCount ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType selectedVolumeType , boolean isCreateVolume ) { int brickCount = 0 ; if ( ( bricks.getItems ( ) ) != null ) { brickCount = ( ( java.util.List < ? > ) ( getBricks ( ) . getItems ( ) ) ) . size ( ) ; } int replicaCount = getReplicaCountValue ( ) ; int stripeCount = getStripeCountValue ( ) ; return org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickModel.validateBrickCount ( selectedVolumeType , brickCount , replicaCount , stripeCount , isCreateVolume ) ; }

Target:
public boolean validateBrickCount ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType selectedVolumeType , boolean isCreateVolume ) { int brickCount = 0 ; if ( ( bricks.getItems ( ) ) != null ) { brickCount = getBricks ( ) . getItems ( ) . size ( ) ; } int replicaCount = getReplicaCountValue ( ) ; int stripeCount = getStripeCountValue ( ) ; return org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickModel.validateBrickCount ( selectedVolumeType , brickCount , replicaCount , stripeCount , isCreateVolume ) ; }
Source:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( auditLogDao ) . when ( command ) . getAuditLogDao ( ) ; org.mockito.Mockito.doReturn ( getEventWithOvirtOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_2 ) ; org.mockito.Mockito.doReturn ( getEventWithExternalOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_3 ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getEventWithOvirtOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_2 ) ; org.mockito.Mockito.doReturn ( getEventWithExternalOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_3 ) ; }
Source:
protected org.ovirt.engine.api.model.Disk postPopulate ( org.ovirt.engine.api.model.Disk model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) . value ( ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskInterface.class ) . value ( ) ) ; model.setSgio ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ScsiGenericIO.class ) . value ( ) ) ; model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ) ; model.setLunStorage ( null ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Disk postPopulate ( org.ovirt.engine.api.model.Disk model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskInterface.class ) ) ; model.setSgio ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ScsiGenericIO.class ) ) ; model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ) ; model.setLunStorage ( null ) ; return model ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Provider > convert ( java.lang.Object returnValue ) { if ( returnValue == null ) { return new java.util.ArrayList < > ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.filterProvidersByProvidedType ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) , providedEntity ) ) ; java.util.Collections.sort ( providers , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return providers ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Provider > convert ( java.lang.Object returnValue ) { if ( returnValue == null ) { return new java.util.ArrayList < > ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = org.ovirt.engine.ui.uicommonweb.Linq.filterProvidersByProvidedType ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) , providedEntity ) ; java.util.Collections.sort ( providers , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return providers ; }
Source:
public void shouldNotMigrateVmOnClusterTwoWhileMigrating ( ) { final org.ovirt.engine.core.common.businessentities.VM migratingVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; migratingVM.setClusterId ( cluster2.getId ( ) ) ; org.mockito.Mockito.when ( clusterDao.getWithoutMigratingVms ( ) ) . thenReturn ( java.util.Collections.singletonList ( cluster1 ) ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void shouldNotMigrateVmOnClusterTwoWhileMigrating ( ) { final org.ovirt.engine.core.common.businessentities.VM migratingVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; migratingVM.setClusterId ( cluster2.getId ( ) ) ; org.mockito.Mockito.when ( clusterDao.getWithoutMigratingVms ( ) ) . thenReturn ( java.util.Collections.singletonList ( cluster1 ) ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = storageDomainDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertNotNull ( storageDomain ) ; java.lang.String name = storageDomain.getStorageName ( ) ; org.junit.Assert.assertTrue ( name.equals ( underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.STORAGE_DOMAIN_ID , VdcObjectType.Storage ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = storageDomainDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertNotNull ( storageDomain ) ; java.lang.String name = storageDomain.getStorageName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.STORAGE_DOMAIN_ID , VdcObjectType.Storage ) ) ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public boolean Validate ( boolean isOVirt ) { getOVirtISO ( ) . setIsValid ( true ) ; getRootPassword ( ) . setIsValid ( true ) ; if ( isOVirt ) { getOVirtISO ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } else { getRootPassword ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } return ( getRootPassword ( ) . getIsValid ( ) ) && ( getOVirtISO ( ) . getIsValid ( ) ) ; }

Target:
public boolean validate ( boolean isOVirt ) { getOVirtISO ( ) . setIsValid ( true ) ; getRootPassword ( ) . setIsValid ( true ) ; if ( isOVirt ) { getOVirtISO ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } else { getRootPassword ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } return ( getRootPassword ( ) . getIsValid ( ) ) && ( getOVirtISO ( ) . getIsValid ( ) ) ; }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . endAction ( VdcActionType.CopyImageGroup , p , org.ovirt.engine.core.bll.ImportVmCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . endAction ( VdcActionType.CopyImageGroup , p , org.ovirt.engine.core.bll.ImportVmCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }
Source:
private boolean networkExists ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network_cluster > networks = org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getNetworkClusterDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network_cluster network_cluster : networks ) { if ( network_cluster.getnetwork_id ( ) . equals ( org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetworkCluster ( ) . getnetwork_id ( ) ) ) { return true ; } } return false ; }

Target:
private org.ovirt.engine.core.common.businessentities.network_cluster getNetworkCluster ( ) { return org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetworkCluster ( ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getVnicCustomProperties ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile ) { java.util.Map < java.lang.String , java.lang.String > customProperties = null ; if ( vnicProfile != null ) { customProperties = vnicProfile.getCustomProperties ( ) ; } return customProperties == null ? new java.util.HashMap < > ( ) : customProperties ; }

Target:
private java.util.Map < java.lang.String , java.lang.String > getVnicCustomProperties ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile ) { java.util.Map < java.lang.String , java.lang.String > customProperties = null ; if ( vnicProfile != null ) { customProperties = vnicProfile.getCustomProperties ( ) ; } return customProperties == null ? new java.util.HashMap < > ( ) : customProperties ; }
Source:
public void rollback ( ) { log.errorFormat ( "Transaction rolled-back for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { if ( isQuotaDependant ( ) ) { rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.debug ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }

Target:
public void rollback ( ) { log.errorFormat ( "Transaction rolled-back for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { if ( isQuotaDependant ( ) ) { rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.error ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }
Source:
public boolean handlesEvent ( com.google.gwt.view.client.CellPreviewEvent < org.ovirt.engine.ui.uicommonweb.models.EntityModel > event ) { com.google.gwt.dom.client.NativeEvent nativeEvent = event.getNativeEvent ( ) ; if ( ! ( "click" . equals ( nativeEvent.getType ( ) . toLowerCase ( ) ) ) ) { return false ; } com.google.gwt.dom.client.Element target = nativeEvent.getEventTarget ( ) . cast ( ) ; return "input" . equals ( target.getTagName ( ) . toLowerCase ( ) ) ; }

Target:
private static boolean handlesEvent ( com.google.gwt.view.client.CellPreviewEvent < org.ovirt.engine.ui.uicommonweb.models.EntityModel > event ) { com.google.gwt.dom.client.NativeEvent nativeEvent = event.getNativeEvent ( ) ; if ( ! ( "click" . equals ( nativeEvent.getType ( ) . toLowerCase ( ) ) ) ) { return false ; } com.google.gwt.dom.client.Element target = nativeEvent.getEventTarget ( ) . cast ( ) ; return "input" . equals ( target.getTagName ( ) . toLowerCase ( ) ) ; }
Source:
public void setUp ( ) { super . setUp ( ) ; vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( getDiskImageId ( ) , java.lang.Boolean.FALSE ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( cmd ) . getVmDao ( ) ; org.mockito.Mockito.doReturn ( getProviderProxy ( ) ) . when ( cmd ) . getProviderProxy ( ) ; }

Target:
public void setUp ( ) { super . setUp ( ) ; vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( getDiskImageId ( ) , java.lang.Boolean.FALSE ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; }
Source:
public boolean Validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.LengthValidation tempVar = new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( ) ; tempVar.setMaxLength ( 40 ) ; getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , tempVar } ) ; org.ovirt.engine.ui.uicommonweb.validation.LengthValidation tempVar2 = new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( ) ; tempVar2.setMaxLength ( 300 ) ; getSearchString ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , tempVar2 } ) ; return ( getName ( ) . getIsValid ( ) ) && ( getSearchString ( ) . getIsValid ( ) ) ; }

Target:
public boolean validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.LengthValidation tempVar = new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( ) ; tempVar.setMaxLength ( 40 ) ; getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , tempVar } ) ; org.ovirt.engine.ui.uicommonweb.validation.LengthValidation tempVar2 = new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( ) ; tempVar2.setMaxLength ( 300 ) ; getSearchString ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , tempVar2 } ) ; return ( getName ( ) . getIsValid ( ) ) && ( getSearchString ( ) . getIsValid ( ) ) ; }