auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { boolean hasNics = ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) . size ( ) ) > 0 ; if ( ! hasNics ) { org.ovirt.engine.ui.uicommonweb.models.vms.BootSequenceModel bootSequenceModel = getBootSequence ( ) ; bootSequenceModel.getNetworkOption ( ) . setIsChangable ( false ) ; bootSequenceModel.getNetworkOption ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . interfaceIsRequiredToBootFromNetwork ( ) ) ; } }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic ) { return vnic.isPlugged ( ) ; }
Source:
protected void setStorageDomainStatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , org.ovirt.engine.core.bll.context.CompensationContext context ) { if ( ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStoragePoolId ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStoragePoolIsoMapData ( ) ; if ( context != null ) { context.snapshotEntityStatus ( map ) ; } org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . setStatus ( status ) ; org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , status ) ; } }

Target:
protected void setStorageDomainStatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , org.ovirt.engine.core.bll.context.CompensationContext context ) { if ( ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStoragePoolId ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStoragePoolIsoMapData ( ) ; if ( context != null ) { context.snapshotEntityStatus ( map ) ; } org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . setStatus ( status ) ; org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , status ) ; } }
Source:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; 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 ) ; }

Target:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; 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.ovirt.engine.core.common.businessentities.StorageDomain domain = result.get ( 0 ) ; org.junit.Assert.assertEquals ( existingDomain , domain ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 8 , domain.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 4 , domain.getActualImagesSize ( ) ) ; }
Source:
public void getVdsGroupName ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDSGroup g = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; g.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVdsGroup ( g ) ; final java.lang.String n = b.getVdsGroupName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }

Target:
public void getClusterName ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.Cluster g = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; g.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setCluster ( g ) ; final java.lang.String n = b.getClusterName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }
Source:
private void removeRequestFromTracking ( org.codehaus.jackson.JsonNode id ) { this . queue.remove ( id ) ; this . map.remove ( id ) ; }

Target:
private void removeRequestFromTracking ( org.codehaus.jackson.JsonNode id ) { try ( org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper wrapper = new org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper ( this . lock ) ) { this . queue.remove ( id ) ; org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking = this . map.remove ( id ) ; java.util.List < org.codehaus.jackson.JsonNode > nodes = this . hostToId.get ( tracking.getClient ( ) . getHostname ( ) ) ; nodes.remove ( id ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.Provider > providersListModel = getProviders ( ) ; providersListModel.setItems ( providers , org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( providers ) ) ; providersListModel.setIsChangable ( true ) ; getIsDiscoveredHosts ( ) . setEntity ( null ) ; getIsDiscoveredHosts ( ) . setEntity ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > computeResources = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalComputeResourceListModel = getExternalComputeResource ( ) ; externalComputeResourceListModel.setItems ( computeResources ) ; externalComputeResourceListModel.setIsChangable ( true ) ; }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( parentMock ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
public static org.ovirt.engine.core.bll.ValidationResult canRunActionOnNonManagedVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.bll.ValidationResult validationResult = ValidationResult.VALID ; if ( ( ( vm.isHostedEngine ( ) ) && ( ! ( org.ovirt.engine.core.bll.VmHandler.COMMANDS_ALLOWED_ON_HOSTED_ENGINE.contains ( actionType ) ) ) ) || ( ( vm.isExternalVm ( ) ) && ( ! ( org.ovirt.engine.core.bll.VmHandler.COMMANDS_ALLOWED_ON_EXTERNAL_VMS.contains ( actionType ) ) ) ) ) { validationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_RUN_ACTION_ON_NON_MANAGED_VM ) ; } return validationResult ; }

Target:
public static org.ovirt.engine.core.bll.ValidationResult canRunActionOnNonManagedVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.bll.ValidationResult validationResult = ValidationResult.VALID ; if ( ( ( vm.isHostedEngine ( ) ) && ( ! ( org.ovirt.engine.core.bll.VmHandler.COMMANDS_ALLOWED_ON_HOSTED_ENGINE.contains ( actionType ) ) ) ) || ( ( vm.isExternalVm ( ) ) && ( ! ( org.ovirt.engine.core.bll.VmHandler.COMMANDS_ALLOWED_ON_EXTERNAL_VMS.contains ( actionType ) ) ) ) ) { validationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_CANNOT_RUN_ACTION_ON_NON_MANAGED_VM ) ; } return validationResult ; }
Source:
public void logServerMessage ( final org.ovirt.engine.core.common.businessentities.VDS server , final org.ovirt.engine.core.common.AuditLogType logType ) { logAuditMessage ( ( server == null ? org.ovirt.engine.core.compat.Guid.Empty : server.getVdsGroupId ( ) ) , null , server , logType , java.util.Collections.< java.lang.String , java.lang.String > emptyMap ( ) ) ; }

Target:
public void logServerMessage ( final org.ovirt.engine.core.common.businessentities.VDS server , final org.ovirt.engine.core.common.AuditLogType logType ) { logAuditMessage ( ( server == null ? org.ovirt.engine.core.compat.Guid.Empty : server.getClusterId ( ) ) , null , server , logType , java.util.Collections.< java.lang.String , java.lang.String > emptyMap ( ) ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 ) ) ; prepareMocks ( cmd ) ; mockBackend ( false , EngineError.GlusterVolumeRemoveBricksStartFailed ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { setVolumeId ( volumeId2 ) ; mockBackend ( false , EngineError.GlusterVolumeRemoveBricksStartFailed ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
protected void setUpGetSystemStatisticsExpectations ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryResult = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) ; org.mockito.Mockito.when ( backend.runQuery ( org.mockito.Mockito.eq ( VdcQueryType.GetSystemStatistics ) , queryParams ( ) ) ) . thenReturn ( queryResult ) ; org.mockito.Mockito.when ( queryResult.getSucceeded ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( queryResult.getReturnValue ( ) ) . thenReturn ( setUpStats ( ) ) ; }

Target:
protected void setUpGetSystemStatisticsExpectations ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryResult = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; org.mockito.Mockito.when ( backend.runQuery ( org.mockito.Mockito.eq ( VdcQueryType.GetSystemStatistics ) , queryParams ( ) ) ) . thenReturn ( queryResult ) ; queryResult.setSucceeded ( true ) ; queryResult.setReturnValue ( setUpStats ( ) ) ; }
Source:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public void testOneSecondLatency ( ) { java.lang.String doubleValue = "1000000000" ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setMockForTesting ( diskData ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > disks = vdsBrokerObjectsBuilder.buildVmDiskStatistics ( xml ) ; org.junit.Assert.assertEquals ( new java.lang.Double ( "1" ) , disks.get ( 0 ) . getWriteLatency ( ) ) ; }

Target:
public void testOneSecondLatency ( ) { java.lang.String doubleValue = "1000000000" ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setMockForTesting ( diskData ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > disks = vdsBrokerObjectsBuilder.buildVmDiskStatistics ( xml ) ; org.junit.jupiter.api.Assertions.assertEquals ( new java.lang.Double ( "1" ) , disks.get ( 0 ) . getWriteLatency ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( getNic ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; } if ( ( ( getNic ( ) . getLabels ( ) ) == null ) || ( ! ( getNic ( ) . getLabels ( ) . contains ( getLabel ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.INTERFACE_NOT_LABELED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( getNic ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; } if ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( getNic ( ) ) ) ) || ( ! ( getNic ( ) . getLabels ( ) . contains ( getLabel ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.INTERFACE_NOT_LABELED ) ; } return true ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > cpuProfiles = returnValue.getReturnValue ( ) ; getModel ( ) . getCpuProfiles ( ) . setItems ( cpuProfiles ) ; if ( cpuProfiles != null ) { for ( org.ovirt.engine.core.common.businessentities.profiles.CpuProfile cpuProfile : cpuProfiles ) { if ( cpuProfile.getId ( ) . equals ( cpuProfileId ) ) { getModel ( ) . getCpuProfiles ( ) . setSelectedItem ( cpuProfile ) ; break ; } } } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > devs = returnValue.getReturnValue ( ) ; getModel ( ) . getIsRngEnabled ( ) . setEntity ( ( ! ( devs.isEmpty ( ) ) ) ) ; final org.ovirt.engine.core.common.businessentities.VmRngDevice rngDevice = ( devs.isEmpty ( ) ) ? new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) : devs.get ( 0 ) ; rngDevice.updateSourceByVersion ( getModel ( ) . getCompatibilityVersion ( ) ) ; getModel ( ) . setRngDevice ( rngDevice ) ; }
Source:
private void setupVmNetworkInterfaceDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > expectedVmNetworkInterface = java.util.Collections.singletonList ( vmNetworkInterface ) ; org.ovirt.engine.core.dao.VmNetworkInterfaceDAO vmNetworkInterfaceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAO.class ) ; org.mockito.Mockito.when ( vmNetworkInterfaceDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVmNetworkInterface ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmNetworkInterfaceDao ( ) ) . thenReturn ( vmNetworkInterfaceDaoMock ) ; }

Target:
private void setupVmNetworkInterfaceDao ( java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > expectedVmNetworkInterfaces ) { org.ovirt.engine.core.dao.VmNetworkInterfaceDAO vmNetworkInterfaceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAO.class ) ; org.mockito.Mockito.when ( vmNetworkInterfaceDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVmNetworkInterfaces ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmNetworkInterfaceDao ( ) ) . thenReturn ( vmNetworkInterfaceDaoMock ) ; }
Source:
public static void getMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getClusterById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getTemplateDisks ( ) { if ( ( ( templateDisks ) == null ) && ( ( org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) ) { org.ovirt.engine.core.bll.VmTemplateHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; templateDisks = org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getVmTemplate ( ) . getDiskList ( ) ; } return templateDisks ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getTemplateDisks ( ) { if ( ( ( templateDisks ) == null ) && ( ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) ) { org.ovirt.engine.core.bll.VmTemplateHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; templateDisks = org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) . getDiskList ( ) ; } return templateDisks ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getSelectedDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.ListModel diskListModel : diskSnapshotsMap.values ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage selectedImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( diskListModel.getSelectedItem ( ) ) ) ; if ( selectedImage != null ) { disks.add ( selectedImage ) ; } } return disks ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getSelectedDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.ListModel diskListModel : diskSnapshotsMap.values ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage selectedImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( diskListModel.getSelectedItem ( ) ) ) ; if ( selectedImage != null ) { disks.add ( selectedImage ) ; } } return disks ; }
Source:
public java.util.Iterator getPrefixes ( java.lang.String namespaceURI ) { java.util.List < java.lang.String > prefixes = new java.util.LinkedList < java.lang.String > ( ) ; for ( java.lang.String prefix : prefixToUri.keySet ( ) ) { if ( prefixToUri.get ( prefix ) . equals ( namespaceURI ) ) prefixes.add ( prefix ) ; } return prefixes.iterator ( ) ; }

Target:
public java.util.Iterator getPrefixes ( java.lang.String namespaceURI ) { java.util.List < java.lang.String > prefixes = new java.util.LinkedList < java.lang.String > ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > prefixToUriEntry : prefixToUri.entrySet ( ) ) { if ( prefixToUriEntry.getValue ( ) . equals ( namespaceURI ) ) { prefixes.add ( prefixToUriEntry.getKey ( ) ) ; } } return prefixes.iterator ( ) ; }
Source:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( disk , containerID ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( vdcRetValue.getFault ( ) . getError ( ) , "ImportVmCommand::MoveOrCopyAllImageGroups: Failed to copy disk!" ) ; } org.ovirt.engine.core.bll.ImportVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }

Target:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( disk , containerID ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( vdcRetValue.getFault ( ) . getError ( ) , "Failed to copy disk!" ) ; } org.ovirt.engine.core.bll.ImportVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }
Source:
protected void ExecuteVdsBrokerCommand ( ) { glusterServices = org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getBroker ( ) . glusterServicesList ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getParameters ( ) . getServiceNames ( ) . toArray ( new java.lang.String [ 0 ] ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.ProceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( glusterServices.getServices ( ) ) ; } }

Target:
protected void ExecuteVdsBrokerCommand ( ) { glusterServices = org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getBroker ( ) . glusterServicesList ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getParameters ( ) . getServiceNames ( ) . toArray ( new java.lang.String [ 0 ] ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.proceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( glusterServices.getServices ( ) ) ; } }
Source:
public void initTable ( final org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { super . initTable ( constants ) ; org.ovirt.engine.ui.common.widget.table.column.BooleanColumn < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > portMirroringColumn = new org.ovirt.engine.ui.common.widget.table.column.BooleanColumn < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( constants.portMirroringEnabled ( ) ) { @ java.lang.Override public java.lang.Boolean getRawValue ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface object ) { return object.isPortMirroring ( ) ; } } ; getTable ( ) . addColumnWithHtmlHeader ( portMirroringColumn , constants.portMirroring ( ) , "60px" ) ; }

Target:
public void initTable ( final org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { super . initTable ( constants ) ; org.ovirt.engine.ui.common.widget.table.column.BooleanColumn < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > portMirroringColumn = new org.ovirt.engine.ui.common.widget.table.column.BooleanColumn < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( constants.portMirroringEnabled ( ) ) { @ java.lang.Override public java.lang.Boolean getRawValue ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface object ) { return object.isPortMirroring ( ) ; } } ; getTable ( ) . addColumnWithHtmlHeader ( portMirroringColumn , constants.portMirroring ( ) , "85px" ) ; }
Source:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ; org.ovirt.engine.core.bll.ValidationResult slavesValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , "slaveA" ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_NAME , "networkName" ) ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , slavesValidationResult , slavesValidationResult ) ; }

Target:
public void testValidModifiedBondsFailsWhenBondNotHaveNameAndId ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.CreateOrUpdateBond createOrUpdateBond = new org.ovirt.engine.core.common.action.CreateOrUpdateBond ( ) ; doTestValidModifiedBonds ( createOrUpdateBond , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.BOND_DOES_NOT_HAVE_NEITHER_ID_NOR_NAME_SPECIFIED ) , ValidationResult.VALID ) ; }
Source:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private org.ovirt.engine.api.model.DetailedLink findUsage ( org.ovirt.engine.api.model.RSDL rsdl , javax.ws.rs.core.UriInfo uriInfo , java.lang.String httpMethod ) { org.ovirt.engine.api.model.DetailedLink link = null ; for ( org.ovirt.engine.api.model.DetailedLink currentLink : rsdl.getLinks ( ) . getLinks ( ) ) { if ( isMatch ( currentLink , uriInfo , httpMethod ) ) { link = currentLink ; break ; } } assert link != null : "Corresponding link not found (this should not happen)" ; return link ; }

Target:
private org.ovirt.engine.api.model.DetailedLink findUsage ( org.ovirt.engine.api.model.Rsdl rsdl , javax.ws.rs.core.UriInfo uriInfo , java.lang.String httpMethod ) { org.ovirt.engine.api.model.DetailedLink link = null ; for ( org.ovirt.engine.api.model.DetailedLink currentLink : rsdl.getLinks ( ) . getLinks ( ) ) { if ( isMatch ( currentLink , uriInfo , httpMethod ) ) { link = currentLink ; break ; } } assert link != null : "Corresponding link not found (this should not happen)" ; return link ; }
Source:
public boolean IsTemplate ( ) { java.lang.String id1 = "1" ; java.lang.String id2 = "2" ; org.ovirt.engine.core.utils.ovf.xml.XmlNode node = _document.SelectSingleNode ( "//*/Content/TemplateId" ) ; if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( node.innerText ) ) ) { id1 = node.innerText ; } org.ovirt.engine.core.utils.ovf.xml.XmlNodeList list = _document.SelectNodes ( "//*/Content/Section" ) ; for ( org.ovirt.engine.core.utils.ovf.xml.XmlNode section : list ) { java.lang.String value = section.attributes.get ( "xsi:type" ) . getValue ( ) ; if ( org.apache.commons.lang.StringUtils.equals ( value , "ovf:OperatingSystemSection_Type" ) ) { id2 = section.attributes.get ( "ovf:id" ) . getValue ( ) ; } } return org.apache.commons.lang.StringUtils.equals ( id1 , id2 ) ; }

Target:
public boolean isTemplate ( ) { java.lang.String id1 = "1" ; java.lang.String id2 = "2" ; org.ovirt.engine.core.utils.ovf.xml.XmlNode node = _document.SelectSingleNode ( "//*/Content/TemplateId" ) ; if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( node.innerText ) ) ) { id1 = node.innerText ; } org.ovirt.engine.core.utils.ovf.xml.XmlNodeList list = _document.SelectNodes ( "//*/Content/Section" ) ; for ( org.ovirt.engine.core.utils.ovf.xml.XmlNode section : list ) { java.lang.String value = section.attributes.get ( "xsi:type" ) . getValue ( ) ; if ( org.apache.commons.lang.StringUtils.equals ( value , "ovf:OperatingSystemSection_Type" ) ) { id2 = section.attributes.get ( "ovf:id" ) . getValue ( ) ; } } return org.apache.commons.lang.StringUtils.equals ( id1 , id2 ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusters ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > list = new java.util.ArrayList < > ( ) ; list.add ( createCluster ( Version.v3_4 ) ) ; list.add ( createCluster ( Version.v3_5 ) ) ; return list ; }

Target:
public void testRefreshStatusNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( false ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepStatusDetail ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }
Source:
public void shouldElectActiveSharedBeforeLocalDataDomain2 ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Arrays.asList ( sharedDomain , localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.Assert.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }

Target:
public void shouldElectActiveSharedBeforeLocalDataDomain2 ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Arrays.asList ( sharedDomain , localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.Assert.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }
Source:
public void testRemoveStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics before = dao.get ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertNotNull ( before ) ; dao.remove ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.EXISTING_VM_ID ) ; org.ovirt.engine.core.common.businessentities.VmStatistics after = dao.get ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertNull ( after ) ; }

Target:
public void testUpdateAll ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmStatistics existingVm = dao.get ( FixturesTool.VM_RHEL5_POOL_57 ) ; org.ovirt.engine.core.common.businessentities.VmStatistics existingVm2 = dao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ) ; existingVm.setCpuSys ( 50.0 ) ; existingVm2.setCpuUser ( 50.0 ) ; dao.updateAll ( java.util.Arrays.asList ( existingVm , existingVm2 ) ) ; org.junit.Assert.assertEquals ( existingVm , dao.get ( existingVm.getId ( ) ) ) ; org.junit.Assert.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }
Source:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { setSdDiscardSupport ( true , false ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedNoDiskRequiresPassDiscardFunctionality ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
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 ) ; }

Target:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map > result = dao.getAll ( existingLUNStorageMap.getId ( ) . lunId ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map mapping : result ) { org.junit.Assert.assertEquals ( existingLUNStorageMap.getId ( ) . lunId , mapping.getId ( ) . lunId ) ; } }

Target:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUN_storage_server_connection_map > result = dao.getAll ( existingLUNStorageMap.getId ( ) . lunId ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUN_storage_server_connection_map mapping : result ) { org.junit.Assert.assertEquals ( existingLUNStorageMap.getId ( ) . lunId , mapping.getId ( ) . lunId ) ; } }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getDiskSnapshotIDColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk disk ) { return ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getImageId ( ) . toString ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Disk > getDiskSnapshotIDColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk disk ) { return ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getImageId ( ) . toString ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
private boolean networkAttachmentIsBeingRemoved ( java.lang.String interfaceName ) { for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : params.getRemovedNetworkAttachments ( ) ) { if ( java.util.Objects.equals ( interfaceName , attachment.getNicName ( ) ) ) { return true ; } } return false ; }

Target:
private boolean slaveUsedMultipleTimesInDifferentBonds ( java.lang.String potentiallyDuplicateSlaveName ) { int count = 0 ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : params.getBonds ( ) ) { for ( java.lang.String slaveName : bond.getSlaves ( ) ) { if ( slaveName.equals ( potentiallyDuplicateSlaveName ) ) { count ++ ; } } } return count >= 2 ; }
Source:
public static java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > GetImagesLeaf ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > retVal = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { org.ovirt.engine.core.utils.MultiValueMapUtils.addToMap ( image.getId ( ) , image , retVal ) ; } for ( org.ovirt.engine.core.compat.Guid key : retVal.keySet ( ) ) { org.ovirt.engine.core.bll.ImportVmCommand.SortImageList ( retVal.get ( key ) ) ; } return retVal ; }

Target:
public static java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > getImagesLeaf ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > retVal = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { org.ovirt.engine.core.utils.MultiValueMapUtils.addToMap ( image.getId ( ) , image , retVal ) ; } for ( org.ovirt.engine.core.compat.Guid key : retVal.keySet ( ) ) { org.ovirt.engine.core.bll.ImportVmCommand.sortImageList ( retVal.get ( key ) ) ; } return retVal ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ( ( glusterVolume.getAsyncTask ( ) ) == null ) || ( ( glusterVolume.getAsyncTask ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType.REBALANCE_VOLUME ) ) ) || ( ( glusterVolume.getAsyncTask ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ( ( glusterVolume.getAsyncTask ( ) ) == null ) || ( ( glusterVolume.getAsyncTask ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType.REBALANCE ) ) ) || ( ( glusterVolume.getAsyncTask ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED ) ; } return true ; }
Source:
public 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 void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }