auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] getClonedNameValidators ( ) { final int maxClonedNameLength = getMaxClonedNameLength ( ) ; return new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( maxClonedNameLength ) , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) { @ java.lang.Override protected java.lang.String composeMessage ( ) { return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . nameMustConataionOnlyAlphanumericChars ( maxClonedNameLength ) ; } } , new org.ovirt.engine.ui.uicommonweb.models.storage.TemplateBackupModel.UniqueClonedNameValidator ( assignedVmNames ) } ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] getClonedNameValidators ( ) { final int maxClonedNameLength = getMaxClonedNameLength ( ) ; return new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( maxClonedNameLength ) , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . nameMustConataionOnlyAlphanumericChars ( maxClonedNameLength ) ) , new org.ovirt.engine.ui.uicommonweb.models.storage.TemplateBackupModel.UniqueClonedNameValidator ( assignedVmNames ) } ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; if ( returnValue != null ) { org.ovirt.engine.core.common.businessentities.VDS localStorageHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; dataCenterGuideModel.localStorageHost = localStorageHost ; } else { noLocalStorageHost = true ; } dataCenterGuideModel.updateOptionsLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; if ( returnValue != null ) { dataCenterGuideModel.localStorageHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; } else { noLocalStorageHost = true ; } dataCenterGuideModel.updateOptionsLocalFS ( ) ; }
Source:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }

Target:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.VM ) ( null ) ) ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }
Source:
private void UpdateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.network network = ( ( org.ovirt.engine.core.common.businessentities.network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangable = ( ( getIsStaticAddress ( ) ) && ( network != null ) ) && ( ! ( network.getId ( ) . equals ( NGuid.Empty ) ) ) ; getAddress ( ) . setIsChangable ( isChangable ) ; getSubnet ( ) . setIsChangable ( isChangable ) ; }

Target:
private void UpdateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.Network network = ( ( org.ovirt.engine.core.common.businessentities.Network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangable = getIsStaticAddress ( ) ; getAddress ( ) . setIsChangable ( isChangable ) ; getSubnet ( ) . setIsChangable ( isChangable ) ; }
Source:
public void canDoActionInvalidSourceDomain ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = initStorageDomain ( srcStorageId ) ; storageDomain.setstatus ( StorageDomainStatus.Locked ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL.toString ( ) ) ) ; }

Target:
public void canDoActionInvalidSourceDomain ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = initStorageDomain ( srcStorageId ) ; storageDomain.setstatus ( StorageDomainStatus.Locked ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL.toString ( ) ) ) ; }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; control.replay ( ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mapToVM ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.core.common.businessentities.VmTemplate template ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = getMapper ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , org.ovirt.engine.core.common.businessentities.VmStatic.class ) . map ( template , null ) ; org.ovirt.engine.core.common.businessentities.VM vm = getMapper ( org.ovirt.engine.api.model.VmPool.class , org.ovirt.engine.core.common.businessentities.VM.class ) . map ( model , new org.ovirt.engine.core.common.businessentities.VM ( vmStatic , new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) , new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ) ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mapToVM ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.core.common.businessentities.VmTemplate template ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = getMapper ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , org.ovirt.engine.core.common.businessentities.VmStatic.class ) . map ( template , null ) ; org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( getMapper ( org.ovirt.engine.api.model.VmPool.class , org.ovirt.engine.core.common.businessentities.VmStatic.class ) . map ( model , vmStatic ) , new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) , new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ) ; return vm ; }
Source:
protected void updateSpiceVersion ( ) { if ( ( clientOsType ( ) . equalsIgnoreCase ( "Windows" ) ) && ( clientBrowserType ( ) . equalsIgnoreCase ( "Explorer" ) ) ) { if ( clientPlatformType ( ) . equalsIgnoreCase ( "win32" ) ) { updateSpice32Version ( ) ; } else if ( clientPlatformType ( ) . equalsIgnoreCase ( "win64" ) ) { updateSpice64Version ( ) ; } } }

Target:
protected void updateSpiceVersion ( ) { if ( clientPlatformType ( ) . equalsIgnoreCase ( "win32" ) ) { updateSpice32Version ( ) ; } else if ( clientPlatformType ( ) . equalsIgnoreCase ( "win64" ) ) { updateSpice64Version ( ) ; } }
Source:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from logoff." ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , result ) ; if ( ( getLoginHandler ( ) ) != null ) { getLoginHandler ( ) . onLogout ( ) ; } }

Target:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from logoff." ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , result ) ; }
Source:
private java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaConsumptionParameters ( ) { if ( ( consumptionParameters ) == null ) { switch ( getActionType ( ) . getQuotaDependency ( ) ) { case NONE : return null ; case STORAGE : consumptionParameters = getThisQuotaStorageDependent ( ) . getQuotaStorageConsumptionParameters ( ) ; break ; case VDS_GROUP : consumptionParameters = getThisQuotaVdsDependent ( ) . getQuotaVdsConsumptionParameters ( ) ; break ; default : consumptionParameters = getThisQuotaStorageDependent ( ) . getQuotaStorageConsumptionParameters ( ) ; consumptionParameters.addAll ( getThisQuotaVdsDependent ( ) . getQuotaVdsConsumptionParameters ( ) ) ; break ; } } return consumptionParameters ; }

Target:
protected java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaConsumptionParameters ( ) { if ( ( consumptionParameters ) == null ) { switch ( getActionType ( ) . getQuotaDependency ( ) ) { case NONE : return null ; case STORAGE : consumptionParameters = getThisQuotaStorageDependent ( ) . getQuotaStorageConsumptionParameters ( ) ; break ; case VDS_GROUP : consumptionParameters = getThisQuotaVdsDependent ( ) . getQuotaVdsConsumptionParameters ( ) ; break ; default : consumptionParameters = getThisQuotaStorageDependent ( ) . getQuotaStorageConsumptionParameters ( ) ; consumptionParameters.addAll ( getThisQuotaVdsDependent ( ) . getQuotaVdsConsumptionParameters ( ) ) ; break ; } } return consumptionParameters ; }
Source:
public void testActivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicResource ) ( resource ) ) ; setUpGetEntityExpectations ( 4 ) ; setGetVmQueryExpectations ( 4 ) ; setGetNetworksQueryExpectations ( 4 ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } ) ) ; verifyActionResponse ( backendVmNicResource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testActivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicResource ) ( resource ) ) ; setUpGetEntityExpectations ( 3 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } ) ) ; verifyActionResponse ( backendVmNicResource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_id" , map.getstorage_id ( ) ) . addValue ( "storage_pool_id" , map.getstorage_pool_id ( ) ) . addValue ( "status" , map.getstatus ( ) ) . addValue ( "owner" , map.getowner ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertstorage_pool_iso_map" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_id" , map.getstorage_id ( ) ) . addValue ( "storage_pool_id" , map.getstorage_pool_id ( ) ) . addValue ( "status" , map.getstatus ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertstorage_pool_iso_map" , parameterSource ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; control.replay ( ) ; org.ovirt.engine.api.model.MacPool model = org.ovirt.engine.api.restapi.resource.BackendMacPoolResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; org.ovirt.engine.api.model.MacPool model = org.ovirt.engine.api.restapi.resource.BackendMacPoolResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
protected java.lang.Object [ ] getEncodedParameters ( java.lang.Object [ ] parameters , org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapIdEncoder idEncoder ) { if ( parameters == null ) { return null ; } java.lang.Object [ ] retVal = parameters.clone ( ) ; int index = 0 ; for ( java.lang.Object parameter : parameters ) { if ( parameter instanceof org.ovirt.engine.core.common.utils.ExternalId ) { retVal [ index ] = idEncoder.encodedId ( ( ( org.ovirt.engine.core.common.utils.ExternalId ) ( parameter ) ) ) ; } index ++ ; } return retVal ; }

Target:
protected java.lang.Object [ ] getEncodedParameters ( java.lang.Object [ ] parameters , org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapIdEncoder idEncoder ) { if ( parameters == null ) { return null ; } java.lang.Object [ ] retVal = parameters.clone ( ) ; int index = 0 ; for ( java.lang.Object parameter : parameters ) { if ( parameter instanceof org.ovirt.engine.core.compat.Guid ) { retVal [ index ] = idEncoder.encodedId ( ( ( org.ovirt.engine.core.compat.Guid ) ( parameter ) ) ) ; } index ++ ; } return retVal ; }
Source:
protected boolean isStorageDomainTypeCorrect ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( ( ( storageDomain.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( storageDomain.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getstorage_pool_type ( ) ) != ( storageDomain.getStorageType ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH ) ; return false ; } return true ; }

Target:
protected boolean isStorageDomainTypeCorrect ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( ( ( storageDomain.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( storageDomain.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getStorageType ( ) ) != ( storageDomain.getStorageType ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH ) ; return false ; } return true ; }
Source:
public boolean isSnapshotExist ( final org.ovirt.engine.core.compat.Guid id ) { return execute ( new java.util.concurrent.Callable < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean call ( ) { try { com.woorea.openstack.cinder.model.Snapshot snapshot = proxy.getSnapshotById ( id.toString ( ) ) ; return snapshot != null ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { org.ovirt.engine.core.bll.storage.disk.cinder.CinderBroker.log.info ( "Snapshot does not exists" ) ; return false ; } else { org.ovirt.engine.core.bll.storage.disk.cinder.CinderBroker.log.error ( "An error has occurred while looking for snapshot." ) ; throw ex ; } } } } ) ; }

Target:
public boolean isSnapshotExist ( final org.ovirt.engine.core.compat.Guid id ) { return execute ( ( ) -> { try { com.woorea.openstack.cinder.model.Snapshot snapshot = proxy.getSnapshotById ( id.toString ( ) ) ; return snapshot != null ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { org.ovirt.engine.core.bll.storage.disk.cinder.CinderBroker.log.info ( "Snapshot does not exists" ) ; return false ; } else { org.ovirt.engine.core.bll.storage.disk.cinder.CinderBroker.log.error ( "An error has occurred while looking for snapshot." ) ; throw ex ; } } } ) ; }
Source:
protected void onBind ( ) { super . onBind ( ) ; registerHandler ( org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getView ( ) . getTable ( ) . getSelectionModel ( ) . addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { modelProvider.setSelectedItems ( getSelectedItems ( ) ) ; fireTableSelectionChangeEvent ( ) ; handlePlaceTransition ( ) ; } } ) ) ; }

Target:
protected void onBind ( ) { super . onBind ( ) ; registerHandler ( getTable ( ) . getSelectionModel ( ) . addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { modelProvider.setSelectedItems ( getSelectedItems ( ) ) ; fireTableSelectionChangeEvent ( ) ; handlePlaceTransition ( ) ; } } ) ) ; }
Source:
private boolean checkDomain ( ) { if ( ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getParameters ( ) . getVmTemplateData ( ) . getVmInit ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getParameters ( ) . getVmTemplateData ( ) . getVmInit ( ) . getDomain ( ) ) != null ) ) { return isDomainLegal ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getParameters ( ) . getVmTemplateData ( ) . getVmInit ( ) . getDomain ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getReturnValue ( ) . getValidationMessages ( ) ) ; } return true ; }

Target:
private boolean checkDomain ( ) { if ( ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getParameters ( ) . getVmTemplateData ( ) . getVmInit ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getParameters ( ) . getVmTemplateData ( ) . getVmInit ( ) . getDomain ( ) ) != null ) ) { return org.ovirt.engine.core.bll.UpdateVmTemplateCommand.isDomainLegal ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getParameters ( ) . getVmTemplateData ( ) . getVmInit ( ) . getDomain ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getReturnValue ( ) . getValidationMessages ( ) ) ; } return true ; }
Source:
private void createStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStatus ( status ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; }

Target:
private void createStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStatus ( status ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( domain ) ; }
Source:
public void testGuestOs3 ( ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.VM map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.VM ) ( null ) ) ) ; assertNull ( map.getGuestInfo ( ) ) ; }

Target:
public void testGuestOs3 ( ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.VM map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.VM ) ( null ) ) ) ; }
Source:
public void testNetworkNotAttachedToHost ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.mockito.Mockito.when ( networkDaoMock.get ( network.getId ( ) ) ) . thenReturn ( network ) ; org.mockito.Mockito.when ( vdsDaoMock.getAllForNetwork ( org.mockito.ArgumentMatchers.eq ( network.getId ( ) ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( network.getId ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotAttachedToHost ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkNotAttachedToHost ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.mockito.Mockito.when ( networkDaoMock.get ( network.getId ( ) ) ) . thenReturn ( network ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( network.getId ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotAttachedToHost ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute logoff: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute logoff: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; callback.getDel ( ) . onSuccess ( null ) ; }
Source:
private void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full EndAction" ) ; } }

Target:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full EndAction" ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc getStorageDomainsList ( java.lang.String spUUID , int domainType , int poolType , java.lang.String path ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getStorageDomains" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "domainClass" , domainType ) . withParameter ( "storageType" , poolType ) . withParameter ( "remotePath" , path ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "domlist" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc getStorageDomainsList ( java.lang.String spUUID , int domainType , java.lang.String poolType , java.lang.String path ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getStorageDomains" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "domainClass" , domainType ) . withParameter ( "storageType" , poolType ) . withParameter ( "remotePath" , path ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "domlist" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc ( response ) ; }
Source:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vds.getId ( ) , reason , customLogValues ) ; tempVar.setSaveToDb ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vds.getId ( ) , reason , customLogValues ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
public static boolean IsDataActiveStorageDomain ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { boolean isData = ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ; boolean isActive = org.ovirt.engine.ui.uicommonweb.Linq.IsActiveStorageDomain ( storageDomain ) ; return isData && isActive ; }

Target:
public static boolean IsDataActiveStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isData = ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ; boolean isActive = org.ovirt.engine.ui.uicommonweb.Linq.IsActiveStorageDomain ( storageDomain ) ; return isData && isActive ; }
Source:
public void test ( ) { getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( "Wrong filtered domains" , org.apache.commons.collections.CollectionUtils.isEqualCollection ( ( ( java.util.Collection < java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) , java.util.Arrays.asList ( "aaa" , "internal" , "zzz" ) ) ) ; }

Target:
public void test ( ) { getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( "Wrong filtered domains" , org.apache.commons.collections.CollectionUtils.isEqualCollection ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) , java.util.Arrays.asList ( "aaa" , "internal" , "zzz" ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageServerConnectionLunMapDao ( ) ; org.ovirt.engine.core.dao.StorageServerConnectionDao storageServerConnectionDao = dbFacade.getStorageServerConnectionDao ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections existingConnection = storageServerConnectionDao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections newServerConnection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; newServerConnection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c2980" ) ; newServerConnection.setconnection ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDaoTest.EXISTING_DOMAIN_STORAGE_NAME ) ; existingLUNStorageMap = dao.get ( new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMapId ( "1IET_00180001" , existingConnection.getid ( ) ) ) ; newLUNStorageMap = new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDaoTest.FREE_LUN_ID , existingConnection.getid ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageServerConnectionLunMapDao ( ) ; org.ovirt.engine.core.dao.StorageServerConnectionDao storageServerConnectionDao = dbFacade.getStorageServerConnectionDao ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections existingConnection = storageServerConnectionDao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; existingLUNStorageMap = dao.get ( new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMapId ( "1IET_00180001" , existingConnection.getid ( ) ) ) ; newLUNStorageMap = new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDaoTest.FREE_LUN_ID , existingConnection.getid ( ) ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
protected void loadPayloadDevice ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getVmPayload ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = getVmPayloadByDeviceType ( VmDeviceType.CDROM ) ; if ( payload != null ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setVmPayload ( payload ) ; } else { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setVmPayload ( getVmPayloadByDeviceType ( VmDeviceType.FLOPPY ) ) ; } } }

Target:
protected void loadPayloadDevice ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = getVmPayloadByDeviceType ( VmDeviceType.CDROM ) ; if ( payload != null ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setVmPayload ( payload ) ; } else { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setVmPayload ( getVmPayloadByDeviceType ( VmDeviceType.FLOPPY ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.gluster.ReplaceBrickModel brickModel = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.ReplaceBrickModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hostList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; brickModel.getServers ( ) . setItems ( hostList ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostList ) { brickModel.getServers ( ) . setItems ( hostList ) ; }
Source:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToVmsThatAreNotDown ( org.mockito.Matchers.anyBoolean ( ) , org.mockito.Matchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }

Target:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToVmsThatAreNotDown ( org.mockito.Matchers.anyBoolean ( ) , org.mockito.Matchers.any ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }
Source:
public java.lang.Object call ( ) throws java.lang.Exception { if ( ( _resultError ) || ( ! ( _installIncomplete ) ) ) { _parser.cliNoop ( ) ; } else { java.lang.String [ ] msgs = ( ( java.lang.String [ ] ) ( _parser.cliEnvironmentGet ( org.ovirt.ovirt_host_deploy.constants.CoreEnv.INSTALL_INCOMPLETE_REASONS ) ) ) ; _messages.post ( InstallerMessages.Severity.WARNING , "Installation is incomplete, manual intervention is required" ) ; for ( java.lang.String m : msgs ) { _messages.post ( InstallerMessages.Severity.WARNING , m ) ; } } return null ; }

Target:
public java.lang.Boolean call ( ) throws java.lang.Exception { if ( ( _resultError ) || ( ! ( _installIncomplete ) ) ) { _parser.cliNoop ( ) ; } else { java.lang.String [ ] msgs = ( ( java.lang.String [ ] ) ( _parser.cliEnvironmentGet ( org.ovirt.ovirt_host_deploy.constants.CoreEnv.INSTALL_INCOMPLETE_REASONS ) ) ) ; _messages.post ( InstallerMessages.Severity.WARNING , "Installation is incomplete, manual intervention is required" ) ; for ( java.lang.String m : msgs ) { _messages.post ( InstallerMessages.Severity.WARNING , m ) ; } } return true ; }
Source:
protected boolean validate ( ) { if ( ( hostedEngineHelper.getStorageDomain ( ) ) != null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST ) ; } if ( ! ( fetchStorageDomainInfo ( ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ! ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES ) . contains ( heStorageDomain.getStorageType ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( hostedEngineHelper.getStorageDomain ( ) ) != null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST ) ; } if ( ( heStorageDomain ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ! ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES ) . contains ( heStorageDomain.getStorageType ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; } return true ; }
Source:
public void clusterWithNoServiceEnabled ( ) { createCommandWithNoService ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_AT_LEAST_ONE_SERVICE_MUST_BE_ENABLED ) ; }

Target:
public void clusterWithNoServiceEnabled ( ) { createCommandWithNoService ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_AT_LEAST_ONE_SERVICE_MUST_BE_ENABLED ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = getClusterByServiceList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) , supportsVirtService , supportsGlusterService ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > convert ( java.lang.Object source ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = getClusterByServiceList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) , supportsVirtService , supportsGlusterService ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < > ( ) ; }
Source:
private void mockWithChanges ( ) { mockStatusForAllServicesOfServer ( org.ovirt.engine.core.bll.gluster.GlusterServiceSyncJobTest.SERVER1_ID , GlusterServiceStatus.RUNNING ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > server2Services = createServerServicesWithMixedStatus ( org.ovirt.engine.core.bll.gluster.GlusterServiceSyncJobTest.SERVER2_ID ) ; org.mockito.Mockito.doReturn ( createVDSReturnValue ( org.ovirt.engine.core.bll.gluster.GlusterServiceSyncJobTest.SERVER2_ID , server2Services ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GlusterServicesList ) , org.mockito.Matchers.argThat ( isServer ( org.ovirt.engine.core.bll.gluster.GlusterServiceSyncJobTest.SERVER2_ID ) ) ) ; mockStatusForAllServicesOfServer ( org.ovirt.engine.core.bll.gluster.GlusterServiceSyncJobTest.SERVER3_ID , GlusterServiceStatus.STOPPED ) ; }

Target:
private void mockWithChanges ( ) { mockStatusForAllServicesOfServer ( org.ovirt.engine.core.bll.gluster.GlusterServiceSyncJobTest.SERVER1_ID , GlusterServiceStatus.RUNNING ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > server2Services = createServerServicesWithMixedStatus ( org.ovirt.engine.core.bll.gluster.GlusterServiceSyncJobTest.SERVER2_ID ) ; org.mockito.Mockito.doReturn ( createVDSReturnValue ( server2Services ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GlusterServicesList ) , org.mockito.Matchers.argThat ( isServer ( org.ovirt.engine.core.bll.gluster.GlusterServiceSyncJobTest.SERVER2_ID ) ) ) ; mockStatusForAllServicesOfServer ( org.ovirt.engine.core.bll.gluster.GlusterServiceSyncJobTest.SERVER3_ID , GlusterServiceStatus.STOPPED ) ; }
Source:
private java.lang.String getTimeZoneForVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) ) { return vm.getTimeZone ( ) ; } if ( osRepository.isWindows ( vm.getOs ( ) ) ) { return org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.DefaultWindowsTimeZone ) ; } else { return "Etc/GMT" ; } }

Target:
private java.lang.String getTimeZoneForVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) ) { return vm.getTimeZone ( ) ; } if ( osRepository.isWindows ( vm.getOs ( ) ) ) { return org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultWindowsTimeZone ) ; } else { return "Etc/GMT" ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.HostValidator hostValidator = new org.ovirt.engine.core.bll.validator.HostValidator ( getVds ( ) ) ; return ( ( validate ( hostValidator.hostExists ( ) ) ) && ( validate ( hostValidator.isUp ( ) ) ) ) && ( validate ( validateMinimumVersionSupport ( ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.HostValidator hostValidator = new org.ovirt.engine.core.bll.validator.HostValidator ( getVds ( ) ) ; return ( ( validate ( hostValidator.hostExists ( ) ) ) && ( validate ( hostValidator.isUp ( ) ) ) ) && ( validate ( validateMinimumVersionSupport ( ) ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( windowPropertyNames.contains ( propName ) ) { handleWindowModelChange ( source , windowPopup , false , propName ) ; } else if ( confirmWindowPropertyNames.contains ( propName ) ) { handleWindowModelChange ( source , confirmWindowPopup , true , propName ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( windowPropertyNames.contains ( propName ) ) { handleWindowModelChange ( source , windowPopup , false , propName ) ; } else if ( confirmWindowPropertyNames.contains ( propName ) ) { handleWindowModelChange ( source , confirmWindowPopup , true , propName ) ; } }
Source:
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.firstOrNull ( networkMap.keySet ( ) ) ) ; }

Target:
private void removeNetwork ( ) { networkMap.remove ( getNetworkList ( ) . getSelectedItem ( ) ) ; getNetworkList ( ) . setItems ( new java.util.ArrayList ( networkMap.keySet ( ) ) ) ; getNetworkList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( networkMap.keySet ( ) ) ) ; }