auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity entity = new org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity ( ) ; entity.setEntityId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "entity_id" ) ) ) ; entity.setEntityType ( org.ovirt.engine.core.common.VdcObjectType.valueOf ( rs.getString ( "entity_type" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity entity = new org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity ( ) ; entity.setEntityId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "entity_id" ) ) ) ; entity.setEntityType ( org.ovirt.engine.core.common.VdcObjectType.valueOf ( rs.getString ( "entity_type" ) ) ) ; return entity ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc getStorageConnectionsList ( java.lang.String spUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getStorageConnectionsList ( spUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc ( 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.StatusOnlyReturnForXmlRpc freeze ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.freeze ( vmId ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkLabel > convertToNetworkLabels ( java.util.Set < java.lang.String > labels ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkLabel > result = new java.util.ArrayList < > ( labels.size ( ) ) ; for ( java.lang.String label : labels ) { result.add ( new org.ovirt.engine.core.common.businessentities.network.NetworkLabel ( label ) ) ; } return result ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel > convertToNetworkLabels ( java.util.Set < java.lang.String > labels ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel > result = new java.util.ArrayList < > ( labels.size ( ) ) ; for ( java.lang.String label : labels ) { result.add ( new org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel ( label ) ) ; } return result ; }
Source:
private void DataCenter_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.DataCenter_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ; if ( dataCenter != null ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; } }

Target:
private void memSize_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.updateMinAllocatedMemory ( ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( getParameters ( ) . getVm ( ) . getVmName ( ) ) ) ) { return java.util.Collections.singletonMap ( getParameters ( ) . getVm ( ) . getVmName ( ) , LockingGroup.VM_NAME.name ( ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( getParameters ( ) . getVm ( ) . getName ( ) ) ) ) { return java.util.Collections.singletonMap ( getParameters ( ) . getVm ( ) . getName ( ) , LockMessagesMatchUtil.VM_NAME ) ; } return null ; }
Source:
protected void setUpCommand ( ) { command = createCommand ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areTemplateImagesInStorageReady ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . verifyAddVM ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; }

Target:
protected void setUpCommand ( ) { command = createCommand ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areTemplateImagesInStorageReady ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . verifyAddVm ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; }
Source:
private static void assertNotEmptyCanDoActionMessage ( java.util.List < ? > list ) { org.junit.Assert.assertTrue ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.EXPECTED_CAN_DO_MESSAGE , ( ( list != null ) && ( ( list.size ( ) ) > 0 ) ) ) ; }

Target:
public void testValidateAndSetStorageQuotaGlobalInGrace ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > parameters = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; parameters.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.STORAGE_QUOTA_GLOBAL_IN_GRACE , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1 ) ) ; org.junit.Assert.assertTrue ( quotaManager.validateAndSetStorageQuota ( storage_pool , parameters , canDoActionMessages ) ) ; assertEmptyCanDoActionMessage ( ) ; assertAuditLogWritten ( ) ; }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , 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:
public static void GetStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void GetCustomPropertiesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmCustomProperties , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > templateDiskImages = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getImagesToCheckDestinationStorageDomains ( ) , true , false , false ) ; validDisksDomains = org.ovirt.engine.core.bll.ImagesHandler.findDomainsInApplicableStatusForDisks ( templateDiskImages , poolDomainsMap , validDomainStatuses ) ; return validate ( new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( templateDiskImages ) . diskImagesOnAnyApplicableDomains ( validDisksDomains , poolDomainsMap , VdcBllMessages.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , validDomainStatuses ) ) ; }

Target:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > templateDiskImages = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getImagesToCheckDestinationStorageDomains ( ) , true , false , false ) ; validDisksDomains = org.ovirt.engine.core.bll.ImagesHandler.findDomainsInApplicableStatusForDisks ( templateDiskImages , poolDomainsMap , validDomainStatuses ) ; return validate ( new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( templateDiskImages ) . diskImagesOnAnyApplicableDomains ( validDisksDomains , poolDomainsMap , EngineMessage.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , validDomainStatuses ) ) ; }
Source:
private void testManagementNetworkChange ( boolean managementAfter , boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { org.mockito.Mockito.when ( networkCluster.isManagement ( ) ) . thenReturn ( managementAfter ) ; org.mockito.Mockito.when ( vdsDao.getAllForVdsGroup ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ) . thenReturn ( ( emptyCluster ? java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > emptyList ( ) : java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > singletonList ( null ) ) ) ; org.junit.Assert.assertThat ( validator.managementNetworkChange ( ) , expectedResult ) ; }

Target:
private void testManagementNetworkChange ( boolean managementAfter , boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { org.mockito.Mockito.when ( networkCluster.isManagement ( ) ) . thenReturn ( managementAfter ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ) . thenReturn ( ( emptyCluster ? java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > emptyList ( ) : java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > singletonList ( null ) ) ) ; org.junit.Assert.assertThat ( validator.managementNetworkChange ( ) , expectedResult ) ; }
Source:
public void RemoveTag ( org.ovirt.engine.core.compat.Guid tagId ) { if ( tagsMapByID.containsKey ( tagId ) ) { org.ovirt.engine.core.common.businessentities.Tags tag = tagsMapByID.get ( tagId ) ; RemoveTagAndChildren ( tag ) ; org.ovirt.engine.core.common.businessentities.Tags parent = tagsMapByID.get ( tag.getparent_id ( ) ) ; parent.getChildren ( ) . remove ( tag ) ; AddTagToHash ( parent ) ; } else { org.ovirt.engine.core.bll.TagsDirector.log.warnFormat ( "Trying to remove tag, not exists in Data Structure - {0}" , tagId ) ; } }

Target:
public void RemoveTag ( org.ovirt.engine.core.compat.Guid tagId ) { if ( tagsMapByID.containsKey ( tagId ) ) { org.ovirt.engine.core.common.businessentities.Tags tag = tagsMapByID.get ( tagId ) ; RemoveTagAndChildren ( tag ) ; org.ovirt.engine.core.common.businessentities.Tags parent = tagsMapByID.get ( tag.getparent_id ( ) ) ; parent.getChildren ( ) . remove ( tag ) ; addTagToHash ( parent ) ; } else { org.ovirt.engine.core.bll.TagsDirector.log.warnFormat ( "Trying to remove tag, not exists in Data Structure - {0}" , tagId ) ; } }
Source:
private java.lang.String formatSpiceMenuItem ( int parentId , int itemId , java.lang.String itemText , int itemCode ) { return new java.lang.StringBuilder ( parentId ) . append ( "\r" ) . append ( itemId ) . append ( "\r" ) . append ( itemText ) . append ( "\r" ) . append ( itemCode ) . append ( "\n" ) . toString ( ) ; }

Target:
private java.lang.String formatSpiceMenuItem ( int parentId , int itemId , java.lang.String itemText , int itemCode ) { return new java.lang.StringBuilder ( java.lang.Integer.toString ( parentId ) ) . append ( "\r" ) . append ( itemId ) . append ( "\r" ) . append ( itemText ) . append ( "\r" ) . append ( itemCode ) . append ( "\r\n" ) . toString ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( ! ( java.lang.Boolean.TRUE.equals ( iface.getBonded ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } int slavesCount = getSlaveCount ( nics ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , ( "$NETWORK_BONDS_INVALID_SLAVE_COUNT_LIST " + slavesCount ) ) . when ( ( slavesCount < 2 ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( ! ( java.lang.Boolean.TRUE.equals ( iface.getBonded ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } int slavesCount = getSlaveCount ( nics ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , ( "$NETWORK_BONDS_INVALID_SLAVE_COUNT_LIST " + slavesCount ) ) . when ( ( slavesCount < 2 ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; this . allNics = allNics ; initNicModels ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ) ( returnValue ) ) ; allNetworks = networks ; initNetworkModels ( ) ; initDcNetworkParams ( ) ; queryInterfaces ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.setDataCenter ( model , list ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , null ) ; initTemplate ( ) ; initCdImage ( ) ; }
Source:
private void updateDefaultNetworkFilterIfRequired ( ) { if ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getParameters ( ) . isUseDefaultNetworkFiterId ( ) ) { final org.ovirt.engine.core.common.businessentities.network.NetworkFilter networkFilter = org.ovirt.engine.core.bll.network.cluster.NetworkHelper.resolveVnicProfileDefaultNetworkFilter ( networkFilterDao ) ; if ( networkFilter != null ) { final org.ovirt.engine.core.compat.Guid networkFilterId = networkFilter.getId ( ) ; setNetworkFilterId ( networkFilterId ) ; } } }

Target:
private void updateDefaultNetworkFilterIfRequired ( ) { if ( ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getParameters ( ) . isUseDefaultNetworkFiterId ( ) ) && ( ! ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . isPassthrough ( ) ) ) ) { final org.ovirt.engine.core.common.businessentities.network.NetworkFilter networkFilter = org.ovirt.engine.core.bll.network.cluster.NetworkHelper.resolveVnicProfileDefaultNetworkFilter ( networkFilterDao ) ; if ( networkFilter != null ) { final org.ovirt.engine.core.compat.Guid networkFilterId = networkFilter.getId ( ) ; setNetworkFilterId ( networkFilterId ) ; } } }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { getView ( ) . rdpSelected ( event.getValue ( ) ) ; getView ( ) . spiceSelected ( ( ! ( event.getValue ( ) ) ) ) ; getView ( ) . setWanOptionsVisible ( ( ( wanOptionsAvailable ) && ( ! ( event.getValue ( ) ) ) ) ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { getView ( ) . showRdpPanel ( event.getValue ( ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( ( source != null ) && ( ( ( ( java.util.List ) ( source ) ) . size ( ) ) > 0 ) ) { return true ; } return false ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkLabelsByNetworkId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.NETWORK_ID } , getEntityList ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkLabelsByNetworkId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.NETWORK_ID } , getEntityList ( ) , failure ) ; }
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.VDSGroup > list = getClusterByServiceList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( 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.VDSGroup > ( ) ; }

Target:
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 > ( ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.UserSession > searchSessions ( ) { return genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getEngineSessionDao ( ) , false ) . stream ( ) . peek ( this :: injectSessionInfo ) . map ( UserSession :: new ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.UserSession > searchSessions ( ) { return genericSearch ( engineSessionDao , false ) . stream ( ) . peek ( this :: injectSessionInfo ) . map ( UserSession :: new ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public void testPreferWithValue ( ) { org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=false" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=true" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=junk" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_NEW_AUTH , getPrefer ( "new-auth=false" ) ) ; org.junit.Assert.assertEquals ( ( ( FiltersHelper.PREFER_PERSISTENCE_AUTH ) | ( FiltersHelper.PREFER_NEW_AUTH ) ) , getPrefer ( "persistent-auth=false, new-auth=false" ) ) ; }

Target:
public void testPreferWithValue ( ) { org.junit.jupiter.api.Assertions.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=false" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=true" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=junk" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FiltersHelper.PREFER_NEW_AUTH , getPrefer ( "new-auth=false" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( ( ( FiltersHelper.PREFER_PERSISTENCE_AUTH ) | ( FiltersHelper.PREFER_NEW_AUTH ) ) , getPrefer ( "persistent-auth=false, new-auth=false" ) ) ; }
Source:
protected void writeBuffer ( java.nio.ByteBuffer buff ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ! ( isOpen ( ) ) ) { connect ( ) ; } write ( buff ) ; }

Target:
protected void processOutgoing ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final java.nio.ByteBuffer buff = outbox.peekLast ( ) ; if ( buff == null ) { return ; } write ( buff ) ; if ( ! ( buff.hasRemaining ( ) ) ) { outbox.removeLast ( ) ; } updateInterestedOps ( ) ; }
Source:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
private java.lang.String parseFilterResult ( java.lang.Object result ) { if ( ( result == null ) || ( ! ( result instanceof java.lang.Object [ ] ) ) ) { java.lang.System.out.println ( "Filter error" ) ; } java.lang.String retValue = "Got filtered hosts:\n" ; for ( java.lang.Object hostID : ( ( java.lang.Object [ ] ) ( result ) ) ) { retValue += ( hostID.toString ( ) ) + "\n" ; } return retValue ; }

Target:
private java.util.List < java.lang.String > parseFilterResult ( java.lang.Object result ) { if ( ( result == null ) || ( ! ( result instanceof java.lang.Object [ ] ) ) ) { java.lang.System.out.println ( "Filter error" ) ; return null ; } java.util.List < java.lang.String > retValue = new java.util.LinkedList < java.lang.String > ( ) ; for ( java.lang.Object hostID : ( ( java.lang.Object [ ] ) ( result ) ) ) { retValue.add ( hostID.toString ( ) ) ; } return retValue ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( super . hashCode ( ) ) ; result = ( prime * result ) + ( ( volumeId ) == null ? 0 : volumeId.hashCode ( ) ) ; result = ( prime * result ) + ( ( files ) == null ? 0 : files.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( super . hashCode ( ) , volumeId , files ) ; }
Source:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.PARAMETER_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.PARAMETER_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( ! ( isVisible ( value ) ) ) { return ; } sb.appendHtmlConstant ( "<table style=\"margin:0 auto\"><tr>" ) ; java.util.Iterator < com.google.gwt.cell.client.HasCell < T , ? > > iterator = hasCells.iterator ( ) ; while ( iterator.hasNext ( ) ) { render ( context , value , sb , iterator.next ( ) ) ; } sb.appendHtmlConstant ( "</tr></table>" ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( ! ( isVisible ( value ) ) ) { return ; } sb.appendHtmlConstant ( "<table style=\"margin:0 auto\"><tr>" ) ; java.util.Iterator < com.google.gwt.cell.client.HasCell < T , ? > > iterator = hasCells.iterator ( ) ; while ( iterator.hasNext ( ) ) { render ( context , value , sb , iterator.next ( ) ) ; } sb.appendHtmlConstant ( "</tr></table>" ) ; }
Source:
public void testRefreshStatusNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( false ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepStatusDetail ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }

Target:
public void testRefreshStatusNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( false ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }
Source:
private org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm createVdsmVm ( org.ovirt.engine.core.common.businessentities.VmDynamic dbVmDynamic , java.util.Map < java.lang.String , java.lang.Object > struct , java.lang.Double notifyTime ) { org.ovirt.engine.core.common.businessentities.VmDynamic clonedVmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( dbVmDynamic ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( clonedVmDynamic , struct , vdsManager.getCopyVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm ( notifyTime ) . setVmDynamic ( clonedVmDynamic ) . setDevicesHash ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVmDevicesHash ( struct ) ) ; }

Target:
private org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm createVdsmVm ( org.ovirt.engine.core.common.businessentities.VmDynamic dbVmDynamic , java.util.Map < java.lang.String , java.lang.Object > struct , java.lang.Double notifyTime ) { org.ovirt.engine.core.common.businessentities.VmDynamic clonedVmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( dbVmDynamic ) ; vdsBrokerObjectsBuilder.updateVMDynamicData ( clonedVmDynamic , struct , vdsManager.getCopyVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm ( notifyTime ) . setVmDynamic ( clonedVmDynamic ) . setDevicesHash ( vdsBrokerObjectsBuilder.getVmDevicesHash ( struct ) ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase restoreCinderDisk ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk , org.ovirt.engine.core.common.action.ImagesContainterParametersBase params ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RestoreFromCinderSnapshot , params , org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.cloneContextAndDetachFromParent ( ) ) ; try { return future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { log.error ( "Error restoring snapshot" , e ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase restoreCinderDisk ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk , org.ovirt.engine.core.common.action.ImagesContainterParametersBase params ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( ActionType.RestoreFromCinderSnapshot , params , org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.cloneContextAndDetachFromParent ( ) ) ; try { return future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { log.error ( "Error restoring snapshot" , e ) ; } return null ; }
Source:
private void assertNumOfVfsInValidRange ( int numOfVfs ) { org.junit.Assert.assertThat ( validator.numOfVfsInValidRange ( numOfVfs ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NUM_OF_VFS_REPLACEMENT , numOfVfs ) , java.lang.String.format ( VfsConfigValidator.MAX_NUM_OF_VFS_REPLACEMENT , oldVfsConfig.getMaxNumOfVfs ( ) ) ) ) ; }

Target:
private void assertNumOfVfsInValidRange ( int numOfVfs ) { org.junit.Assert.assertThat ( validator.numOfVfsInValidRange ( numOfVfs ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NUM_OF_VFS_REPLACEMENT , numOfVfs ) , java.lang.String.format ( VfsConfigValidator.MAX_NUM_OF_VFS_REPLACEMENT , oldVfsConfig.getMaxNumOfVfs ( ) ) ) ) ; }
Source:
protected void verifyModelOnNewCluster ( org.ovirt.engine.api.model.VM model , int index ) { assertNotNull ( model.getCluster ( ) . getId ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyModel ( model , index ) ; }

Target:
protected void verifyModelOnNewCluster ( org.ovirt.engine.api.model.Vm model , int index ) { assertNotNull ( model.getCluster ( ) . getId ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyModel ( model , index ) ; }
Source:
public void testNetworkNotAttachedToHost ( ) throws java.lang.Exception { org.mockito.Mockito.when ( vdsDaoMock.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > emptyList ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) , null ) . networkNotAttachedToHost ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkNotChangedWhenOldAttachmentIsNull ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( null ) . networkNotChanged ( null ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
< T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < ? extends org.ovirt.engine.core.compat.NGuid > > void updateActionButtonCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command , org.ovirt.engine.ui.webadmin.plugin.api.ActionButtonInterface actionButtonInterface , java.util.List < T > selectedItems ) { boolean isEnabled = true ; isEnabled = org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.invokeAndGetResultAsBoolean ( actionButtonInterface.isEnabled ( ) , org.ovirt.engine.ui.webadmin.plugin.entity.BaseEntity.arrayFrom ( selectedItems ) , null , isEnabled ) ; command.setIsExecutionAllowed ( isEnabled ) ; boolean isAccessible = true ; isAccessible = org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.invokeAndGetResultAsBoolean ( actionButtonInterface.isAccessible ( ) , org.ovirt.engine.ui.webadmin.plugin.entity.BaseEntity.arrayFrom ( selectedItems ) , null , isAccessible ) ; command.setIsAvailable ( isAccessible ) ; }

Target:
< T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < ? extends org.ovirt.engine.core.compat.NGuid > > void updateActionButtonCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command , org.ovirt.engine.ui.webadmin.plugin.api.ActionButtonInterface actionButtonInterface , java.util.List < T > selectedItems ) { boolean isEnabled = true ; isEnabled = org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.invokeAndGetResultAsBoolean ( actionButtonInterface.isEnabled ( ) , org.ovirt.engine.ui.webadmin.plugin.entity.EntityObject.arrayFrom ( selectedItems ) , null , isEnabled ) ; command.setIsExecutionAllowed ( isEnabled ) ; boolean isAccessible = true ; isAccessible = org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.invokeAndGetResultAsBoolean ( actionButtonInterface.isAccessible ( ) , org.ovirt.engine.ui.webadmin.plugin.entity.EntityObject.arrayFrom ( selectedItems ) , null , isAccessible ) ; command.setIsAvailable ( isAccessible ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus getRawValue ( org.ovirt.engine.core.common.businessentities.storage_domains object ) { return object.getstorage_domain_shared_status ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage_domains object ) { if ( ( object.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getstorage_domain_shared_status ( ) ) ; } else { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getstatus ( ) ) ; } }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.VmInternalData createVmInternalData ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendedVmDynamic ( org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( xmlRpcStruct ) ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendedVmDynamic ( org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) ) ; }