auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static org.ovirt.engine.api.restapi.model.StorageFormat map ( org.ovirt.engine.core.common.businessentities.StorageFormatType model , org.ovirt.engine.api.restapi.model.StorageFormat template ) { if ( model == null ) { return null ; } switch ( model ) { case V1 : return org.ovirt.engine.api.restapi.model.StorageFormat.V1 ; case V2 : return org.ovirt.engine.api.restapi.model.StorageFormat.V2 ; case V3 : return org.ovirt.engine.api.restapi.model.StorageFormat.V3 ; default : assert false : "unknown storage-format value: " + ( model.toString ( ) ) ; return null ; } }

Target:
public static org.ovirt.engine.api.model.StorageFormat map ( org.ovirt.engine.core.common.businessentities.StorageFormatType model , org.ovirt.engine.api.model.StorageFormat template ) { if ( model == null ) { return null ; } switch ( model ) { case V1 : return org.ovirt.engine.api.model.StorageFormat.V1 ; case V2 : return org.ovirt.engine.api.model.StorageFormat.V2 ; case V3 : return org.ovirt.engine.api.model.StorageFormat.V3 ; default : assert false : "unknown storage-format value: " + ( model.toString ( ) ) ; return null ; } }
Source:
public void canRemoveLastBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 1 ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( volumeEntity.getBricks ( ) , volumeEntity , 1 , false ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_REMOVE_ALL_BRICKS_FROM_VOLUME ) ) ; }

Target:
public void canRemoveLastBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 1 ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( volumeEntity.getBricks ( ) , volumeEntity , 1 , false ) ; org.hamcrest.MatcherAssert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_REMOVE_ALL_BRICKS_FROM_VOLUME ) ) ; }
Source:
public void networkInUseByVms ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VM vm = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ; org.mockito.Mockito.when ( vm.getName ( ) ) . thenReturn ( NAMEABLE_NAME ) ; networkNotUsedByVmsTest ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE ) , java.util.Collections.singletonList ( vm ) ) ; }

Target:
public void networkInUseByVms ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VM vm = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ; org.mockito.Mockito.when ( vm.getName ( ) ) . thenReturn ( NAMEABLE_NAME ) ; networkNotUsedByVmsTest ( failsWithNetworkInUse ( ) , java.util.Collections.singletonList ( vm ) ) ; }
Source:
private void removeVmStatlessImages ( ) { runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.IdParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }

Target:
protected boolean hasMaximumNumberOfDisks ( ) { return org.ovirt.engine.core.utils.archstrategy.ArchStrategyFactory.getStrategy ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getClusterArch ( ) ) . run ( new org.ovirt.engine.core.bll.architecture.HasMaximumNumberOfDisks ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) ) ) . returnValue ( ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpManagementNetworkExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateCluster , org.ovirt.engine.core.common.action.ClusterOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; final org.ovirt.engine.core.common.businessentities.Cluster updatedCluster = resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; verifyModel ( updatedCluster , 0 ) ; verifyManagementNetwork ( updatedCluster ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpManagementNetworkExpectation ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateCluster , org.ovirt.engine.core.common.action.ClusterOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; final org.ovirt.engine.core.common.businessentities.Cluster updatedCluster = resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; verifyModel ( updatedCluster , 0 ) ; verifyManagementNetwork ( updatedCluster ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute logoff: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; callback.getDel ( ) . onSuccess ( null ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute logoff: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; callback.getAsyncCallback ( ) . onSuccess ( null ) ; }
Source:
public void canDoActionSucceedsWhenGlusterServerHasNoPeers ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , false ) ; org.junit.Assert.assertTrue ( commandMock.canDoAction ( ) ) ; }

Target:
public void validateSucceedsWhenGlusterServerHasPeersThatExistInDB ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( true ) ; org.junit.Assert.assertTrue ( commandMock.validate ( ) ) ; }
Source:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vm.getStaticData ( ) . setId ( new org.ovirt.engine.core.compat.Guid ( section.attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { int osId = osRepository.getOsIdByUniqueName ( node.innerText ) ; _vm.getStaticData ( ) . setOsId ( osId ) ; _vm.setClusterArch ( osRepository.getArchitectureFromOS ( osId ) ) ; } else { _vm.setClusterArch ( ArchitectureType.undefined ) ; } }

Target:
protected void readOsSection ( org.ovirt.engine.core.utils.ovf.xml.XmlNode section ) { _vm.getStaticData ( ) . setId ( new org.ovirt.engine.core.compat.Guid ( section.attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.utils.ovf.xml.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { int osId = osRepository.getOsIdByUniqueName ( node.innerText ) ; _vm.getStaticData ( ) . setOsId ( osId ) ; _vm.setClusterArch ( osRepository.getArchitectureFromOS ( osId ) ) ; } else { _vm.setClusterArch ( ArchitectureType.undefined ) ; } }
Source:
private void validateInterfacesExist ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : params.getInterfaces ( ) ) { updateBaseInterface ( iface ) ; java.lang.String nameWithoutVlanId = org.ovirt.engine.core.utils.NetworkUtils.stripVlan ( iface ) ; if ( ( ! ( getExistingIfaces ( ) . containsKey ( nameWithoutVlanId ) ) ) && ( ! ( bonds.containsKey ( nameWithoutVlanId ) ) ) ) { addViolation ( VdcBllMessages.NETWORK_INTERFACES_DONT_EXIST , nameWithoutVlanId ) ; } } }

Target:
private void validateInterfacesExist ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : params.getInterfaces ( ) ) { updateBaseInterface ( iface ) ; java.lang.String nameWithoutVlanId = org.ovirt.engine.core.utils.NetworkUtils.stripVlan ( iface ) ; if ( ( ! ( getExistingIfaces ( ) . containsKey ( nameWithoutVlanId ) ) ) && ( ! ( bonds.containsKey ( nameWithoutVlanId ) ) ) ) { addViolation ( EngineMessage.NETWORK_INTERFACES_DONT_EXIST , nameWithoutVlanId ) ; } } }
Source:
private int calculateValue ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { int res = 0 ; if ( networkCluster != null ) { if ( networkCluster.isDisplay ( ) ) { res += 2 ; } if ( networkCluster.isMigration ( ) ) { res += 1 ; } } return res ; }

Target:
private int calculateValue ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { int res = 0 ; if ( networkCluster != null ) { if ( networkCluster.isManagement ( ) ) { res += 10 ; } if ( networkCluster.isDisplay ( ) ) { res += 2 ; } if ( networkCluster.isMigration ( ) ) { res += 1 ; } } return res ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List disksForDomain = domainsDisksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForNewDisks ( disksForDomain ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > newDisksForDomain = domainsNewDisksMap.get ( sdId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > clonedDisksForDomain = domainsClonedDisksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForAllDisks ( newDisksForDomain , clonedDisksForDomain ) ; }
Source:
public void testReadAllText ( ) throws java.lang.Exception { java.io.File iFile = java.io.File.createTempFile ( "Test" , ".txt" ) ; java.io.FileWriter iFileWriter = new java.io.FileWriter ( iFile ) ; iFileWriter.write ( "This is a test" ) ; iFileWriter.close ( ) ; java.lang.String data = org.ovirt.engine.core.utils.FileUtil.readAllText ( iFile.getAbsolutePath ( ) ) ; assertEquals ( "Data should be equal" , "This is a test" , data ) ; }

Target:
public void testReadAllText ( ) throws java.lang.Exception { java.io.File iFile = java.io.File.createTempFile ( "Test" , ".txt" ) ; java.io.FileWriter iFileWriter = new java.io.FileWriter ( iFile ) ; iFileWriter.write ( "This is a test" ) ; iFileWriter.close ( ) ; java.lang.String data = org.ovirt.engine.core.utils.FileUtil.readAllText ( iFile.getAbsolutePath ( ) ) ; org.junit.Assert.assertEquals ( "Data should be equal" , "This is a test" , data ) ; }
Source:
public void getLabelList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ) ( source ) ) ; 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.Label > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllLabels , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getDataCenterById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
protected void initProfiles ( ) { java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > existingProfiles = getProfiles ( ) . getItems ( ) ; if ( existingProfiles == null ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > profiles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > ( ) ; profiles.add ( createDefaultProfile ( ) ) ; getProfiles ( ) . setItems ( profiles ) ; } else { for ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profile : existingProfiles ) { profile.updateDc ( getSelectedDc ( ) . getcompatibility_version ( ) , false , getSelectedDc ( ) . getId ( ) , null ) ; } } }

Target:
protected void initProfiles ( ) { java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > existingProfiles = getProfiles ( ) . getItems ( ) ; if ( existingProfiles == null ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > profiles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > ( ) ; profiles.add ( getDefaultProfile ( ) ) ; getProfiles ( ) . setItems ( profiles ) ; } else { for ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profile : existingProfiles ) { profile.updateDc ( getSelectedDc ( ) . getcompatibility_version ( ) , getSelectedDc ( ) . getId ( ) ) ; } } }
Source:
private void ResetData ( ) { storageDomain = null ; storageModel = null ; storageId = null ; nfsConnection = null ; connection = null ; removeConnection = false ; path = null ; hostId = new org.ovirt.engine.core.compat.Guid ( ) ; domainType = org.ovirt.engine.core.common.businessentities.StorageDomainType.values ( ) [ 0 ] ; clusters = null ; allStorageDomains = null ; attachedStorageDomains = null ; isoStorageDomains = null ; allHosts = null ; localStorageHost = null ; noLocalStorageHost = false ; }

Target:
private void resetData ( ) { storageDomain = null ; storageModel = null ; storageId = null ; nfsConnection = null ; connection = null ; removeConnection = false ; path = null ; hostId = new org.ovirt.engine.core.compat.Guid ( ) ; domainType = org.ovirt.engine.core.common.businessentities.StorageDomainType.values ( ) [ 0 ] ; clusters = null ; allStorageDomains = null ; attachedStorageDomains = null ; isoStorageDomains = null ; allHosts = null ; localStorageHost = null ; noLocalStorageHost = false ; }
Source:
public static org.ovirt.engine.core.bll.adbroker.RootDSE get ( org.ovirt.engine.core.bll.adbroker.LdapProviderType ldapProviderType , javax.naming.directory.Attributes rootDseRecords ) throws java.lang.NumberFormatException , javax.naming.NamingException { switch ( ldapProviderType ) { case activeDirectory : return new org.ovirt.engine.core.bll.adbroker.ADRootDSE ( rootDseRecords ) ; case ipa : return new org.ovirt.engine.core.bll.adbroker.IPARootDSE ( rootDseRecords ) ; case rhds : return new org.ovirt.engine.core.bll.adbroker.RHDSRootDSE ( rootDseRecords ) ; case general : default : return new org.ovirt.engine.core.bll.adbroker.GeneralRootDSE ( rootDseRecords ) ; } }

Target:
public static org.ovirt.engine.core.bll.adbroker.RootDSE get ( org.ovirt.engine.core.ldap.LdapProviderType ldapProviderType , javax.naming.directory.Attributes rootDseRecords ) throws java.lang.NumberFormatException , javax.naming.NamingException { switch ( ldapProviderType ) { case activeDirectory : return new org.ovirt.engine.core.bll.adbroker.ADRootDSE ( rootDseRecords ) ; case ipa : return new org.ovirt.engine.core.bll.adbroker.IPARootDSE ( rootDseRecords ) ; case rhds : return new org.ovirt.engine.core.bll.adbroker.RHDSRootDSE ( rootDseRecords ) ; case itds : return new org.ovirt.engine.core.bll.adbroker.ITDSRootDSE ( rootDseRecords ) ; case general : default : return new org.ovirt.engine.core.bll.adbroker.GeneralRootDSE ( rootDseRecords ) ; } }
Source:
protected boolean canDoAction ( ) { return ( ( ( ( validate ( networkExists ( geRemovedtNetwork ( ) ) ) ) && ( validate ( notManagementNetwork ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.networkNotUsedByRunningVm ( ) ) ) ) && ( validate ( networkNotUsedByTemplates ( geRemovedtNetwork ( ) ) ) ) ) && ( validate ( networkNotUsedByHost ( geRemovedtNetwork ( ) ) ) ) ; }

Target:
protected boolean canDoAction ( ) { return ( ( ( ( validate ( networkExists ( getRemovedNetwork ( ) ) ) ) && ( validate ( notManagementNetwork ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.networkNotUsedByVms ( ) ) ) ) && ( validate ( networkNotUsedByTemplates ( getRemovedNetwork ( ) ) ) ) ) && ( validate ( networkNotUsedByHosts ( getRemovedNetwork ( ) ) ) ) ; }
Source:
public void validateFailsWhenGlusterMultipleHostHasVolumesWithForce ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , true ) , null ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockHasMultipleClusters ( true ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void validateSucceedsWithForceOption ( ) throws java.lang.Exception { command.getParameters ( ) . setForceAction ( true ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( org.ovirt.engine.core.compat.Guid guid , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.Integer size ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( guid ) ; storageDomain.setStorageDomainType ( StorageDomainType.Data ) ; storageDomain.setStorageType ( storageType ) ; storageDomain.setStatus ( StorageDomainStatus.Active ) ; storageDomain.setAvailableDiskSize ( size ) ; return storageDomain ; }

Target:
private void verifyNoDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = memoryStorageHandler.findStorageDomainForMemory ( storageDomains , disksList ) ; org.junit.Assert.assertNull ( storageDomain ) ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlanNic ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , java.lang.String nicName , java.lang.Integer vlanId ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingNic = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; existingNic.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; existingNic.setName ( nicName ) ; existingNic.setVlanId ( vlanId ) ; existingNic.setBaseInterface ( baseNic.getName ( ) ) ; return existingNic ; }
Source:
private boolean labelAdded ( ) { return ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( getOldNetwork ( ) ) ) ) && ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ) ; }

Target:
private boolean allowedNetworkLabelManipulation ( ) { boolean labelNotChanged = ! ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.labelChanged ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ) ; return ( ! ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) . isExternal ( ) ) ) && ( labelNotChanged || ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.labelAdded ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ) ) ; }
Source:
public void testGetAllForSubscriber ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > result = dao.getAllForSubscriber ( existingSubscriber ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.event_subscriber subscription : result ) { assertEquals ( existingSubscriber , subscription.getsubscriber_id ( ) ) ; } }

Target:
public void testGetAllForSubscriber ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > result = dao.getAllForSubscriber ( existingSubscriber ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.event_subscriber subscription : result ) { org.junit.Assert.assertEquals ( existingSubscriber , subscription.getsubscriber_id ( ) ) ; } }
Source:
protected void executeVdsBrokerCommand ( ) { java.util.List < java.lang.String > vmIds = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.getParameters ( ) . getVmIds ( ) ; java.lang.String [ ] vmIdsArray = vmIds.toArray ( new java.lang.String [ vmIds.size ( ) ] ) ; fullVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.getBroker ( ) . list ( java.lang.Boolean.TRUE.toString ( ) , vmIdsArray ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > [ ] struct = fullVmListReturn.mVmList ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.setReturnValue ( struct ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { java.util.List < java.lang.String > vmIds = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getParameters ( ) . getVmIds ( ) ; java.lang.String [ ] vmIdsArray = vmIds.toArray ( new java.lang.String [ vmIds.size ( ) ] ) ; fullVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getBroker ( ) . list ( java.lang.Boolean.TRUE.toString ( ) , vmIdsArray ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > [ ] struct = fullVmListReturn.mVmList ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.setReturnValue ( struct ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.Snapshot x , org.ovirt.engine.core.common.businessentities.Snapshot y ) { if ( ( x.getType ( ) ) == ( Snapshot.SnapshotType.ACTIVE ) ) { return 1 ; } if ( ( y.getType ( ) ) == ( Snapshot.SnapshotType.ACTIVE ) ) { return - 1 ; } return super . compare ( x , y ) ; }

Target:
private void sortSnapshots ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { java.util.Collections.sort ( snapshots , java.util.Comparator.comparing ( ( org.ovirt.engine.core.common.businessentities.Snapshot s ) -> ( s.getType ( ) ) == Snapshot.SnapshotType.ACTIVE ) . reversed ( ) . thenComparing ( Linq.SnapshotByCreationDateCommparer ) ) ; }
Source:
private void mockVdsDynamic ( ) { org.mockito.Mockito.when ( vdsDynamicDAO.get ( command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ) ; }

Target:
private void mockVdsDynamic ( ) { org.mockito.Mockito.when ( vdsDynamicDAO.get ( command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ) ; org.mockito.Mockito.when ( vdsDynamicDAO.getFromCache ( command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesExcludedFromPreview ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.compat.Guid previousActiveSnapshotId , org.ovirt.engine.core.compat.Guid newActiveSnapshotId ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > excludedImages = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { if ( image.getVmSnapshotId ( ) . equals ( previousActiveSnapshotId ) ) { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( image.getImageId ( ) , newActiveSnapshotId ) ; excludedImages.add ( image ) ; } } return excludedImages ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getImagesExcludedFromPreview ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , org.ovirt.engine.core.compat.Guid previousActiveSnapshotId , org.ovirt.engine.core.compat.Guid newActiveSnapshotId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > excludedImages = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { if ( image.getVmSnapshotId ( ) . equals ( previousActiveSnapshotId ) ) { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( image.getImageId ( ) , newActiveSnapshotId ) ; excludedImages.add ( image ) ; } } return excludedImages ; }
Source:
public static void getAllQuotasByClusterId ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ( ) ; } return ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRelevantQuotasForVdsGroup , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
private void refreshCachedPendingValues ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList ) { for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdsList ) { int pendingMemory = org.ovirt.engine.core.bll.scheduling.pending.PendingMemory.collectForHost ( getPendingResourceManager ( ) , vds.getId ( ) ) ; int pendingCpuCount = org.ovirt.engine.core.bll.scheduling.pending.PendingCpuCores.collectForHost ( getPendingResourceManager ( ) , vds.getId ( ) ) ; vds.setPendingVcpusCount ( pendingCpuCount ) ; vds.setPendingVmemSize ( pendingMemory ) ; } }

Target:
private void refreshCachedPendingValues ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList ) { for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdsList ) { int pendingMemory = org.ovirt.engine.core.bll.scheduling.pending.PendingOvercommitMemory.collectForHost ( getPendingResourceManager ( ) , vds.getId ( ) ) ; int pendingCpuCount = org.ovirt.engine.core.bll.scheduling.pending.PendingCpuCores.collectForHost ( getPendingResourceManager ( ) , vds.getId ( ) ) ; vds.setPendingVcpusCount ( pendingCpuCount ) ; vds.setPendingVmemSize ( pendingMemory ) ; } }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { return ( ( ( ( object.getMemSizeMBUsage ( ) ) == null ? "0" : object.getMemSizeMBUsage ( ) . toString ( ) ) + ( constants.outOfQuota ( ) ) ) + ( ( object.getMemSizeMB ( ) ) == ( - 1 ) ? constants.unlimitedQuota ( ) : object.getMemSizeMB ( ) . toString ( ) ) ) + " MB" ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( object.getMemSizeMB ( ) ) == null ) { return "" ; } else if ( object.getMemSizeMB ( ) . equals ( QuotaVdsGroup.UNLIMITED_MEM ) ) { return messages.unlimitedMemConsumption ( object.getMemSizeMBUsage ( ) ) ; } else { return messages.limitedMemConsumption ( object.getMemSizeMBUsage ( ) , object.getMemSizeMB ( ) ) ; } }
Source:
public void testGetById ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_1 ) ; org.junit.Assert.assertNotNull ( "Failed to retrive storage device" , storageDevice ) ; org.junit.Assert.assertEquals ( "Failed to retrive corrective storage device" , org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_1 , storageDevice.getId ( ) ) ; storageDevice = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.NON_EXISTING_STORAGE_DEVICE_ID ) ; org.junit.Assert.assertNull ( storageDevice ) ; }

Target:
public void testGetById ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_1 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( storageDevice , "Failed to retrive storage device" ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_1 , storageDevice.getId ( ) , "Failed to retrive corrective storage device" ) ; storageDevice = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.NON_EXISTING_STORAGE_DEVICE_ID ) ; org.junit.jupiter.api.Assertions.assertNull ( storageDevice ) ; }
Source:
public static void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters initCreateVmParams ( ) { org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters createVmParams = super . initCreateVmParams ( ) ; createVmParams.getVm ( ) . setRunOnce ( true ) ; org.ovirt.engine.core.common.action.RunVmOnceParams runOnceParams = org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) ; org.ovirt.engine.core.common.action.SysPrepParams sysPrepParams = new org.ovirt.engine.core.common.action.SysPrepParams ( ) ; sysPrepParams.setSysPrepDomainName ( runOnceParams.getSysPrepDomainName ( ) ) ; sysPrepParams.setSysPrepUserName ( runOnceParams.getSysPrepUserName ( ) ) ; sysPrepParams.setSysPrepPassword ( runOnceParams.getSysPrepPassword ( ) ) ; createVmParams.setSysPrepParams ( sysPrepParams ) ; createVmParams.setVmInit ( runOnceParams.getVmInit ( ) ) ; return createVmParams ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters buildCreateVmParameters ( ) { org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters createVmParams = super . buildCreateVmParameters ( ) ; org.ovirt.engine.core.common.action.RunVmOnceParams runOnceParams = org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) ; org.ovirt.engine.core.common.action.SysPrepParams sysPrepParams = new org.ovirt.engine.core.common.action.SysPrepParams ( ) ; sysPrepParams.setSysPrepDomainName ( runOnceParams.getSysPrepDomainName ( ) ) ; sysPrepParams.setSysPrepUserName ( runOnceParams.getSysPrepUserName ( ) ) ; sysPrepParams.setSysPrepPassword ( runOnceParams.getSysPrepPassword ( ) ) ; createVmParams.setSysPrepParams ( sysPrepParams ) ; createVmParams.getVm ( ) . setVmInit ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getVmInit ( ) ) ; return createVmParams ; }
Source:
public void testDirectDescetor ( ) { org.ovirt.engine.core.common.businessentities.Tags tag1 = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tag2 = createTag ( "tag2" , "desc2" ) ; tagsDirector.addTag ( tag1 ) ; tagsDirector.addTag ( tag2 ) ; tagsDirector.moveTag ( tag2.gettag_id ( ) , tag1.gettag_id ( ) ) ; org.junit.Assert.assertTrue ( tagsDirector.isTagDescestorOfTag ( tag1.gettag_id ( ) , tag2.gettag_id ( ) ) ) ; }

Target:
public void testDirectDescetor ( ) { org.ovirt.engine.core.common.businessentities.Tags tag1 = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tag2 = createTag ( "tag2" , "desc2" ) ; tagsDirector.addTag ( tag1 ) ; tagsDirector.addTag ( tag2 ) ; tagsDirector.moveTag ( tag2.getTagId ( ) , tag1.getTagId ( ) ) ; org.junit.Assert.assertTrue ( tagsDirector.isTagDescestorOfTag ( tag1.getTagId ( ) , tag2.getTagId ( ) ) ) ; }
Source:
public static void GetPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }

Target:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public void execute ( ) { if ( enclosingCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; enclosingCommand.getReturnValue ( ) . getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalTaskIdList ( ) ) ; } enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
public void execute ( ) { if ( enclosingCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; enclosingCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; } enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public void doParse_customFieldId ( ) throws com.google.gwt.core.ext.UnableToCompleteException { stubFieldIdAnnotation ( ownerTypeParentField , "ownerTypeParentFieldCustomId" , true ) ; tested.doParse ( ownerType , new java.util.ArrayList < com.google.gwt.core.ext.typeinfo.JClassType > ( ) , "." , "IdPrefix" ) ; org.junit.Assert.assertThat ( tested.statements.contains ( getExpectedStatement ( "ownerTypeParentField" , "IdPrefix_ownerTypeParentFieldCustomId" ) ) , org.hamcrest.CoreMatchers.is ( org.hamcrest.CoreMatchers.equalTo ( true ) ) ) ; }

Target:
public void doParse_customFieldId ( ) throws com.google.gwt.core.ext.UnableToCompleteException { stubFieldIdAnnotation ( ownerTypeParentField , "ownerTypeParentFieldCustomId" , true ) ; tested.doParse ( ownerType , new java.util.ArrayList < com.google.gwt.core.ext.typeinfo.JClassType > ( ) , "." , "IdPrefix" ) ; org.hamcrest.MatcherAssert.assertThat ( tested.statements.contains ( getExpectedStatement ( "ownerTypeParentField" , "IdPrefix_ownerTypeParentFieldCustomId" ) ) , org.hamcrest.CoreMatchers.is ( org.hamcrest.CoreMatchers.equalTo ( true ) ) ) ; }
Source:
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 ; }

Target:
private org.ovirt.schedulerproxy.FilteringResult parseFilterResult ( java.lang.Object xmlRpcStruct ) { org.ovirt.schedulerproxy.FilteringResult retValue = new org.ovirt.schedulerproxy.FilteringResult ( ) ; java.lang.Object rawResult = parseRawResult ( xmlRpcStruct , retValue ) ; if ( rawResult == null ) { java.lang.System.out.println ( "filter error" ) ; return null ; } for ( java.lang.Object hostID : ( ( java.lang.Object [ ] ) ( rawResult ) ) ) { retValue.addHost ( hostID.toString ( ) ) ; } return retValue ; }
Source:
public void testGetAvailableValues ( ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; java.util.Set < java.lang.String > properties = new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( "somevalue" ) ) ; org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( this , properties , values ) ; assertFalse ( properties.isEmpty ( ) ) ; assertEquals ( "Standard" , "Anakin" , values.get ( "somevalue" ) ) ; }

Target:
public void testGetAvailableValues ( ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; java.util.Set < java.lang.String > properties = new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( "somevalue" ) ) ; org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( this , properties , values ) ; org.junit.Assert.assertFalse ( properties.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( "Standard" , "Anakin" , values.get ( "somevalue" ) ) ; }
Source:
protected void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) ) != null ) { baseDiskDao.remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getId ( ) ) ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . get ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ; } } super . endWithFailure ( ) ; }

Target:
protected void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) ) != null ) { baseDiskDao.remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getId ( ) ) ; if ( ( diskImageDynamicDao.get ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ) != null ) { diskImageDynamicDao.remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ; } } super . endWithFailure ( ) ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addBonds ( bond ) ) . build ( ) ; _doTestValidateModifiedBondSlaves ( org.mockito.Mockito.spy ( validator ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
public static void updateVdsDomainsData ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainData ) { if ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { proxy.updateVdsDomainsData ( vds.getId ( ) , vds.getName ( ) , vdsDomainData ) ; } } }

Target:
public static void updateVdsDomainsData ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainData ) { if ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.reportingVdsStatus ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { proxy.updateVdsDomainsData ( vds.getId ( ) , vds.getName ( ) , vdsDomainData ) ; } } }
Source:
public void rollback ( ) { super . rollback ( ) ; if ( macAddressChanged ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . AddMac ( oldIface.getMacAddress ( ) ) ; if ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.AllowDuplicateMacAddresses ) ) ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMac ( getMacAddress ( ) ) ; } } }

Target:
public void rollback ( ) { super . rollback ( ) ; if ( macAddressChanged ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . AddMac ( oldIface.getMacAddress ( ) ) ; if ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.AllowDuplicateMacAddresses ) ) ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMac ( getMacAddress ( ) ) ; } } }