auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSaveOrUpdateExisting ( ) { int sizeBeforeSave = dao.getAll ( ) . size ( ) ; existingUser.setFirstName ( "changedname" ) ; existingUser.setLastName ( "changedsurname" ) ; dao.saveOrUpdate ( existingUser ) ; int sizeAfterSave = dao.getAll ( ) . size ( ) ; org.ovirt.engine.core.common.businessentities.DbUser result = dao.get ( existingUser.getId ( ) ) ; org.junit.Assert.assertEquals ( existingUser , result ) ; org.junit.Assert.assertEquals ( 0 , ( sizeAfterSave - sizeBeforeSave ) ) ; }

Target:
public void testSaveOrUpdateExisting ( ) { int sizeBeforeSave = dao.getAll ( ) . size ( ) ; existingUser.setFirstName ( "changedname" ) ; existingUser.setLastName ( "changedsurname" ) ; dao.saveOrUpdate ( existingUser ) ; int sizeAfterSave = dao.getAll ( ) . size ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser result = dao.get ( existingUser.getId ( ) ) ; org.junit.Assert.assertEquals ( existingUser , result ) ; org.junit.Assert.assertEquals ( 0 , ( sizeAfterSave - sizeBeforeSave ) ) ; }
Source:
public void syncWith ( org.ovirt.engine.ui.uicommonweb.models.hosts.InterfacePropertiesAccessor interfacePropertiesAccessor ) { setBootProtocol ( interfacePropertiesAccessor.getBootProtocol ( ) ) ; getAddress ( ) . setEntity ( interfacePropertiesAccessor.getAddress ( ) ) ; getSubnet ( ) . setEntity ( interfacePropertiesAccessor.getNetmask ( ) ) ; getGateway ( ) . setEntity ( interfacePropertiesAccessor.getGateway ( ) ) ; getQosModel ( ) . init ( interfacePropertiesAccessor.getHostNetworkQos ( ) ) ; getCustomPropertiesModel ( ) . deserialize ( org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueModel.convertProperties ( interfacePropertiesAccessor.getCustomProperties ( ) ) ) ; }

Target:
public void syncWith ( org.ovirt.engine.ui.uicommonweb.models.hosts.InterfacePropertiesAccessor interfacePropertiesAccessor ) { setIpv4BootProtocol ( interfacePropertiesAccessor.getBootProtocol ( ) ) ; getIpv4Address ( ) . setEntity ( interfacePropertiesAccessor.getAddress ( ) ) ; getIpv4Subnet ( ) . setEntity ( interfacePropertiesAccessor.getNetmask ( ) ) ; getIpv4Gateway ( ) . setEntity ( interfacePropertiesAccessor.getGateway ( ) ) ; getQosModel ( ) . init ( interfacePropertiesAccessor.getHostNetworkQos ( ) ) ; getCustomPropertiesModel ( ) . deserialize ( org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueModel.convertProperties ( interfacePropertiesAccessor.getCustomProperties ( ) ) ) ; }
Source:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) ; params.setRefresh ( false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , params , aQuery ) ; }
Source:
private void doTestBadAddNic ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmTemplateInterface , org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateNicsResourceTest.VM_ID } , canDo , success ) ) ; org.ovirt.engine.api.model.Nic model = org.ovirt.engine.api.restapi.resource.BackendTemplateNicsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddNic ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmTemplateInterface , org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateNicsResourceTest.VM_ID } , valid , success ) ) ; org.ovirt.engine.api.model.Nic model = org.ovirt.engine.api.restapi.resource.BackendTemplateNicsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void setSearchStringImpl ( java.lang.String value , boolean checkIfNewValue ) { if ( ( ! checkIfNewValue ) || ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( searchString , value ) ) ) ) { searchString = value ; searchStringChanged ( ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SearchString" ) ) ; } }

Target:
private void setSearchStringImpl ( java.lang.String value , boolean checkIfNewValue ) { if ( ( ! checkIfNewValue ) || ( ! ( java.util.Objects.equals ( searchString , value ) ) ) ) { searchString = value ; searchStringChanged ( ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SearchString" ) ) ; } }
Source:
public void setRowData ( int start , java.util.List < ? extends T > values ) { super . setRowData ( start , values ) ; selectionModel.resolveChanges ( ) ; updateTableControls ( ) ; }

Target:
public void setRowData ( int start , java.util.List < ? extends T > values ) { super . setRowData ( start , values ) ; selectionModel.resolveChanges ( ) ; if ( ( ( ( values.size ( ) ) == 1 ) && ( selectionModel.getSelectedList ( ) . isEmpty ( ) ) ) && ( doAutoSelect ) ) { selectionModel.setSelected ( values.get ( 0 ) , true ) ; doAutoSelect = false ; } updateTableControls ( ) ; }
Source:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }

Target:
public void getIsGlusterVolumeSnapshotCliScheduleEnabled ( 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.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected void updateOldImageActive ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , boolean active ) { org.ovirt.engine.core.compat.Guid oldImageId = findImageForSameDrive ( snapshotType ) ; if ( oldImageId == null ) { log.error ( "Can't find image to update to active '{}', snapshot type '{}', original image id '{}'" , active , snapshotType , org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageId ( ) ) ; return ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage oldImage = org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( oldImageId ) ; oldImage.setActive ( active ) ; org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageDao ( ) . update ( oldImage.getImage ( ) ) ; }

Target:
protected void endWithFailure ( ) { updateOldImageAsActive ( SnapshotType.ACTIVE , true ) ; org.ovirt.engine.core.bll.TryBackToSnapshotCommand.undoActionOnSourceAndDestination ( ) ; org.ovirt.engine.core.bll.TryBackToSnapshotCommand.setSucceeded ( true ) ; }
Source:
private void override_EntityChanged ( org.ovirt.engine.ui.uicompat.EventArgs e ) { boolean isChangeable = ( ( java.lang.Boolean ) ( getOverride ( ) . getEntity ( ) ) ) ; getVersion ( ) . setIsChangable ( isChangeable ) ; getRetransmissions ( ) . setIsChangable ( isChangeable ) ; getTimeout ( ) . setIsChangable ( isChangeable ) ; getMountOptions ( ) . setIsChangable ( isChangeable ) ; }

Target:
private void override_EntityChanged ( org.ovirt.engine.ui.uicompat.EventArgs e ) { boolean isChangeable = ( ( java.lang.Boolean ) ( getOverride ( ) . getEntity ( ) ) ) ; getVersion ( ) . setIsChangable ( isChangeable ) ; getRetransmissions ( ) . setIsChangable ( isChangeable ) ; getTimeout ( ) . setIsChangable ( isChangeable ) ; getMountOptions ( ) . setIsChangable ( isChangeable ) ; getMountOptions ( ) . setTitle ( ( isChangeable ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . mountOptionsHint ( ) : null ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.LUNs lun : getParameters ( ) . getLunsList ( ) ) { proceedLUNInDb ( lun , getStorageDomain ( ) . getstorage_type ( ) , getStorageDomain ( ) . getstorage ( ) ) ; } setStorageDomainStatus ( StorageDomainStatus.Active , null ) ; getCompensationContext ( ) . resetCompensation ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.LUNs lun : getParameters ( ) . getLunsList ( ) ) { proceedLUNInDb ( lun , getStorageDomain ( ) . getStorageType ( ) , getStorageDomain ( ) . getStorage ( ) ) ; } setStorageDomainStatus ( StorageDomainStatus.Active , null ) ; getCompensationContext ( ) . resetCompensation ( ) ; return null ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel ) ( sender ) ) ; if ( ! ( keepStatusText ) ) { initStatusPanel ( ) ; } keepStatusText = false ; updateNetworks ( model.getNetworks ( ) ) ; updateLabels ( model.getNewNetworkLabelModel ( ) , model.getLabels ( ) ) ; updateNics ( model.getNics ( ) ) ; rendered = true ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel ) ( sender ) ) ; if ( ! ( keepStatusText ) ) { initStatusPanel ( ) ; } keepStatusText = false ; updateNetworks ( model.getNetworkModels ( ) ) ; updateLabels ( model.getNewNetworkLabelModel ( ) , model.getLabelModels ( ) ) ; updateNics ( model.getNicModels ( ) ) ; rendered = true ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.DbUser object ) { return object.getGroupNames ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.DbUser object ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( java.lang.String name : object.getGroupNames ( ) ) { if ( ( builder.length ( ) ) > 0 ) { builder.append ( "," ) ; } builder.append ( name ) ; } return builder.toString ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > externalVms = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm ( vm ) ) ; } this . externalVms.setItems ( externalVms ) ; stopProgress ( ) ; }

Target:
private void updateVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { clearVms ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > ( vm ) ) ; } externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }
Source:
private java.lang.String GetLocalStoragesFormattedString ( ) { java.lang.String localStorages = "" ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getSelectedItems ( ) ) ) { if ( ( a.getstorage_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { localStorages += ( a.getstorage_name ( ) ) + ", " ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }

Target:
private java.lang.String GetLocalStoragesFormattedString ( ) { java.lang.String localStorages = "" ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { localStorages += ( a.getStorageName ( ) ) + ", " ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }
Source:
protected org.ovirt.engine.api.model.NIC deprecatedPopulate ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; addReportedDevices ( model , entity ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.Nic deprecatedPopulate ( org.ovirt.engine.api.model.Nic model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; addReportedDevices ( model , entity ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } return model ; }
Source:
public void testNotEnoughForMultipleDiskAndDomainsSecondDomainFails ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; imagesDisks.addAll ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; mockStorageDomainDAOGetForStoragePool ( 10 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 ) ; org.junit.Assert.assertFalse ( "Validation should fail. Second domain should not have enough free space for request." , cmd.isEnoughSpaceToMergeSnapshots ( ) ) ; }

Target:
public void testNotEnoughForMultipleDiskAndDomainsSecondDomainFails ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; imagesDisks.addAll ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; mockStorageDomainDAOGetForStoragePool ( 10 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 ) ; org.junit.Assert.assertFalse ( "Validation should fail. Second domain should not have enough free space for request." , cmd.validateStorageDomains ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( getParameters ( ) . getStoragePoolId ( ) , memoryDisksList ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( getParameters ( ) . getStoragePoolId ( ) , memoryDisksList , getVmDisksDummies ( ) ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }
Source:
private void updateVmIconDefaultsTable ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmIconsDefaultDao ( ) . removeAll ( ) ; for ( java.util.Map.Entry < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > entry : osIdToIconIdMap.entrySet ( ) ) { final org.ovirt.engine.core.common.businessentities.VmIconDefault osDefautlIconIds = new org.ovirt.engine.core.common.businessentities.VmIconDefault ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , entry.getKey ( ) , entry.getValue ( ) . getSmall ( ) , entry.getValue ( ) . getLarge ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmIconsDefaultDao ( ) . save ( osDefautlIconIds ) ; } }

Target:
private void updateVmIconDefaultsTable ( ) { vmIconDefaultDao.removeAll ( ) ; for ( java.util.Map.Entry < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > entry : osIdToIconIdMap.entrySet ( ) ) { final org.ovirt.engine.core.common.businessentities.VmIconDefault osDefautlIconIds = new org.ovirt.engine.core.common.businessentities.VmIconDefault ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , entry.getKey ( ) , entry.getValue ( ) . getSmall ( ) , entry.getValue ( ) . getLarge ( ) ) ; vmIconDefaultDao.save ( osDefautlIconIds ) ; } }
Source:
public void setupMocks ( ) { mockGlobalParameters ( ) ; setUpCommand ( ) ; mockVds ( ) ; mockDbDao ( ) ; command.init ( ) ; }

Target:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; command.ensureDestinationImageMap ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }
Source:
public static void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ( vds.getcpu_cores ( ) ) != null ) && ( ( getVm ( ) . getnum_of_cpus ( ) ) > ( vds.getcpu_cores ( ) ) ) ) { sb.append ( "has less cores(" ) . append ( vds.getcpu_cores ( ) ) . append ( ") than " ) . append ( getVm ( ) . getnum_of_cpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { java.lang.Integer cores = org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( vds ) ; if ( ( cores != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > cores ) ) { sb.append ( "has less cores(" ) . append ( cores ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult ipConfiguredForStaticBootProtocol ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( ( ( ipConfiguration != null ) && ( ipConfiguration.hasPrimaryAddressSet ( ) ) ) && ( ( ipConfiguration.getPrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) && ( unsetAddress ( ipConfiguration ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) . when ( failWhen ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForRoleNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( isRoleNetwork ( ) ) && ( ( ( ipConfiguration == null ) || ( ! ( ipConfiguration.hasPrimaryAddressSet ( ) ) ) ) || ( ( ipConfiguration.getPrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , getNetwork ( ) . getName ( ) ) ) . when ( failWhen ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo option = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( option.getKey ( ) , key ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( option.getDefaultValue ( ) , defaultValue ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo option = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ) ( obj ) ) ; return ( java.util.Objects.equals ( option.getKey ( ) , key ) ) && ( java.util.Objects.equals ( option.getDefaultValue ( ) , defaultValue ) ) ; }
Source:
public void testMissingParameterAlteratives ( ) { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "status|host|name" ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "status|host|name" ) ; } }

Target:
public void testMissingParameterAlteratives ( ) { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "status|host|name" ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "status|host|name" ) ; } }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
protected void verify ( org.ovirt.engine.api.model.Application model , org.ovirt.engine.api.model.Application transform ) { assertNotNull ( transform ) ; assertNotNull ( transform.getId ( ) ) ; assertNotNull ( transform.getName ( ) ) ; assertEquals ( model.getName ( ) , transform.getName ( ) ) ; assertEquals ( model.getId ( ) , transform.getId ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.Application model , org.ovirt.engine.api.model.Application transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertNotNull ( transform.getId ( ) ) ; org.junit.Assert.assertNotNull ( transform.getName ( ) ) ; org.junit.Assert.assertEquals ( model.getName ( ) , transform.getName ( ) ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; }
Source:
public boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }

Target:
public boolean isMemoryHotUnplugSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } return isMemoryHotUnplugSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getCompatibilityVersion ( ) ) ; }
Source:
public boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > messages ) { java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > validationErrors = getVmPropertiesUtils ( ) . validateVMProperties ( vm.getVdsGroupCompatibilityVersion ( ) , vm.getStaticData ( ) ) ; if ( ! ( validationErrors.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.VmHandler.handleCustomPropertiesError ( validationErrors , messages ) ; return false ; } return true ; }

Target:
public boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > messages ) { java.util.List < org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.ValidationError > validationErrors = getVmPropertiesUtils ( ) . validateVMProperties ( vm.getVdsGroupCompatibilityVersion ( ) , vm.getStaticData ( ) ) ; if ( ! ( validationErrors.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.VmHandler.handleCustomPropertiesError ( validationErrors , messages ) ; return false ; } return true ; }
Source:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetAllIsoImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetAllIsoImagesListParameters ( asGuid ( storageDomainId ) ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData.class , VdcQueryType.GetAllIsoImagesList , queryParams ) ; files.addAll ( getBackendCollection ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData.class , VdcQueryType.GetAllFloppyImagesList , queryParams ) ) ; java.util.List < java.lang.String > fileNames = new java.util.LinkedList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData file : files ) { fileNames.add ( file.getRepoFileName ( ) ) ; } return fileNames ; }

Target:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetAllIsoImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetAllIsoImagesListParameters ( asGuid ( storageDomainId ) ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData.class , VdcQueryType.GetAllImagesList , queryParams ) ; java.util.List < java.lang.String > fileNames = new java.util.LinkedList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData file : files ) { fileNames.add ( file.getRepoFileName ( ) ) ; } return fileNames ; }
Source:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks = mapCollection ( getNetworks ( ) ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }

Target:
private org.ovirt.engine.api.model.Networks mapCollection ( java.util.List < org.ovirt.engine.api.model.Network > entities ) { org.ovirt.engine.api.model.Networks collection = new org.ovirt.engine.api.model.Networks ( ) ; for ( org.ovirt.engine.api.model.Network entity : entities ) { collection.getNetworks ( ) . add ( addLinks ( map ( entity ) ) ) ; } return collection ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setTitle ( ( object.isShareable ( ) ? getDefaultTitle ( ) : null ) ) ; return object.isShareable ( ) ? getDefaultImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setEnumTitle ( object.getVmEntityType ( ) ) ; if ( ( object.getVmEntityType ( ) ) == null ) { return null ; } return object.getVmEntityType ( ) . isVmType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.vmsImage ( ) : object.getVmEntityType ( ) . isTemplateType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.templatesImage ( ) : null ; }
Source:
public void testGetPeers ( ) throws javax.naming.AuthenticationException { java.util.Set < java.lang.String > peers = glusterUtil.getPeers ( org.ovirt.engine.core.utils.gluster.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.utils.gluster.GlusterUtilTest.PASSWORD ) ; org.junit.Assert.assertNotNull ( peers ) ; org.junit.Assert.assertTrue ( peers.contains ( org.ovirt.engine.core.utils.gluster.GlusterUtilTest.SERVER_NAME1 ) ) ; org.junit.Assert.assertTrue ( peers.contains ( org.ovirt.engine.core.utils.gluster.GlusterUtilTest.SERVER_NAME2 ) ) ; }

Target:
public void testGetPeers ( ) throws javax.naming.AuthenticationException { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME2 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT2 ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.any ( java.util.Set.class ) ) ; java.util.Set < java.lang.String > peers = glusterUtil.getPeers ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.USER , org.ovirt.engine.core.bll.utils.GlusterUtilTest.PASSWORD ) ; org.junit.Assert.assertNotNull ( peers ) ; org.junit.Assert.assertTrue ( peers.contains ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 ) ) ; org.junit.Assert.assertTrue ( peers.contains ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME2 ) ) ; }
Source:
public void testFindMappingEntry ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setNetworkName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.NETWORK_NAME ) ; vnic.setVnicProfileName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.VNIC_PROFILE1_NAME ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( externalVnicProfileMappings ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.Assert.assertThat ( ctx.getMatched ( ) . get ( vnic ) , org.hamcrest.Matchers.sameInstance ( externalVnicProfileMapping1 ) ) ; }

Target:
public void testFindMappingEntry ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setNetworkName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.NETWORK_NAME ) ; vnic.setVnicProfileName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.VNIC_PROFILE1_NAME ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( externalVnicProfileMappings ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.hamcrest.MatcherAssert.assertThat ( ctx.getMatched ( ) . get ( vnic ) , org.hamcrest.Matchers.sameInstance ( externalVnicProfileMapping1 ) ) ; }
Source:
private void assertCorrectSlaveCountInValidBondsWhenInsufficientBonds ( int numberOfSlaves ) { java.lang.String bondName = "bondName" ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_BONDS_INVALID_SLAVE_COUNT_LIST , bondName ) ) ; assertCorrectSlaveCountInValidBonds ( numberOfSlaves , java.lang.String.format ( "bonded interface with only %1$d slaves is not valid bond" , numberOfSlaves ) , matcher , bondName ) ; }

Target:
private void assertCorrectSlaveCountInValidBondsWhenInsufficientBonds ( int numberOfSlaves ) { java.lang.String bondName = "bondName" ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , bondName ) ) ; assertCorrectSlaveCountInValidBonds ( numberOfSlaves , java.lang.String.format ( "bonded interface with only %1$d slaves is not valid bond" , numberOfSlaves ) , matcher , bondName ) ; }
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 = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterByServiceList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) , supportsVirtService , supportsGlusterService ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; 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.VDSGroup > list = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.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 > ( ) ; }
Source:
protected org.ovirt.engine.api.model.GlusterBrick addParents ( org.ovirt.engine.api.model.GlusterBrick model ) { org.ovirt.engine.api.model.GlusterVolume volume = new org.ovirt.engine.api.model.GlusterVolume ( ) ; volume.setId ( getVolumeId ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( getClusterId ( ) ) ; volume.setCluster ( cluster ) ; model.setGlusterVolume ( volume ) ; return model ; }

Target:
private org.ovirt.engine.api.model.GlusterBrick populateAdvancedDetails ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class , VdcQueryType.GetGlusterVolumeById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( entity.getVolumeId ( ) ) , null , true ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails detailsEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , VdcQueryType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( volumeEntity.getClusterId ( ) , volumeEntity.getName ( ) , entity.getQualifiedName ( ) , true ) , null , true ) ; model = getMapper ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , org.ovirt.engine.api.model.GlusterBrick.class ) . map ( detailsEntity , model ) ; return model ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean isAttach = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ; createDiskPanel.setVisible ( ( ! isAttach ) ) ; attachDiskPanel.setVisible ( isAttach ) ; if ( ( ! isAttach ) && ( ! ( isNewLunDiskEnabled ) ) ) { disk.getIsInternal ( ) . setEntity ( true ) ; } revealDiskPanel ( disk ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean isAttach = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ; createDiskPanel.setVisible ( ( ! isAttach ) ) ; attachDiskPanel.setVisible ( isAttach ) ; if ( ( ! isAttach ) && ( ! ( isNewLunDiskEnabled ) ) ) { disk.getDiskStorageType ( ) . setEntity ( DiskStorageType.IMAGE ) ; } revealDiskPanel ( disk ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { java.lang.String targetNicName = attachment.getNicName ( ) ; boolean attachmentReferencesExistingNic = ( existingInterfacesMap.get ( attachment.getNicId ( ) , targetNicName ) ) != null ; if ( attachmentReferencesExistingNic ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentReferencesNewlyCreatedBond = ( targetNicName != null ) && ( ( bondsMap.get ( targetNicName ) ) != null ) ; if ( attachmentReferencesNewlyCreatedBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }

Target:
private boolean isNicActuallyExistsOrReferencesNewBond ( java.lang.String nicName , org.ovirt.engine.core.compat.Guid nicId ) { return hostSetupNetworksValidatorHelper.isNicActuallyExistsOrReferencesNewBond ( existingInterfacesMap , bondsMap , nicName , nicId ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsForDiskId ( ) { if ( ( listVms ) == null ) { listVms = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmDAO ( ) . getVmsListForDisk ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getDiskId ( ) ) ) , true ) ; } return listVms ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsForDiskId ( ) { if ( ( listVms ) == null ) { listVms = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmDao ( ) . getVmsListForDisk ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getDiskId ( ) ) ) , true ) ; } return listVms ; }
Source:
protected boolean validateUsbPolicy ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.updateImportedVmUsbPolicy ( vm.getStaticData ( ) ) ; return org.ovirt.engine.core.bll.VmHandler.isUsbPolicyLegal ( vm.getUsbPolicy ( ) , vm.getOs ( ) , getEffectiveCompatibilityVersion ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean validateUsbPolicy ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.updateImportedVmUsbPolicy ( vm.getStaticData ( ) ) ; return org.ovirt.engine.core.bll.VmHandler.isUsbPolicyLegal ( vm.getUsbPolicy ( ) , vm.getOs ( ) , getEffectiveCompatibilityVersion ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getReturnValue ( ) . getValidationMessages ( ) ) ; }
Source:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > result = dao.getAll ( ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.StorageDomainDAOTest.NUMBER_OF_STORAGE_DOMAINS_FOR_PRIVELEGED_USER , result.size ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) , existingDomain ) ; }