auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void parseVolumeChainMoreItems ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument devices = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( org.ovirt.engine.core.vdsbroker.libvirt.VmDevicesConverterTest.DEVICES_XML ) ; java.util.List < java.util.Map < java.lang.String , java.lang.Object > > res = converter.parseVolumeChain ( devices.selectSingleNode ( "//*/disk[2]" ) ) ; org.junit.Assert.assertEquals ( 3 , res.size ( ) ) ; org.junit.Assert.assertEquals ( "cc5beaf2-3265-4b36-b7be-4f23dc3b07af" , res.get ( 0 ) . get ( VdsProperties.VolumeId ) ) ; org.junit.Assert.assertEquals ( "fff3c995-e7c3-4a2c-96a3-f0ce569a57c2" , res.get ( 1 ) . get ( VdsProperties.VolumeId ) ) ; org.junit.Assert.assertEquals ( "011046ce-312a-42e6-bcb7-764fd332da02" , res.get ( 2 ) . get ( VdsProperties.VolumeId ) ) ; }

Target:
public void parseVolumeChainMoreItems ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument devices = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( org.ovirt.engine.core.vdsbroker.libvirt.VmDevicesConverterTest.DEVICES_XML ) ; java.util.List < java.util.Map < java.lang.String , java.lang.Object > > res = converter.parseVolumeChain ( devices.selectSingleNode ( "//*/disk[2]" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 3 , res.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "cc5beaf2-3265-4b36-b7be-4f23dc3b07af" , res.get ( 0 ) . get ( VdsProperties.VolumeId ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "fff3c995-e7c3-4a2c-96a3-f0ce569a57c2" , res.get ( 1 ) . get ( VdsProperties.VolumeId ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "011046ce-312a-42e6-bcb7-764fd332da02" , res.get ( 2 ) . get ( VdsProperties.VolumeId ) ) ; }
Source:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { 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.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.utils.VdsCommandsHelper.runVdsCommandWithFailover ( VDSCommandType.CopyVolumeData , new org.ovirt.engine.core.common.vdscommands.CopyVolumeDataVDSCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getStorageJobId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getSrcInfo ( ) , org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getDstInfo ( ) , org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . isCollapse ( ) ) , org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getStoragePoolId ( ) , this ) ; org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { completeGenerationInfo ( ) ; org.ovirt.engine.core.bll.storage.utils.VdsCommandsHelper.runVdsCommandWithFailover ( VDSCommandType.CopyVolumeData , new org.ovirt.engine.core.common.vdscommands.CopyVolumeDataVDSCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getStorageJobId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getSrcInfo ( ) , org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getDstInfo ( ) , org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . isCollapse ( ) ) , org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getStoragePoolId ( ) , this ) ; org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSet ( java.lang.String volumeName , java.lang.String key , java.lang.String value ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.set" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "option" , key ) . withParameter ( "value" , value ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterVolumeSet ( java.lang.String volumeName , java.lang.String key , java.lang.String value ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.set" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "option" , key ) . withParameter ( "value" , value ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
private boolean bondIsBeingRemoved ( java.lang.String bondName ) { for ( org.ovirt.engine.core.common.businessentities.network.Bond removedBond : params.getRemovedBonds ( ) ) { if ( bondName.equals ( removedBond.getName ( ) ) ) { return true ; } } return false ; }

Target:
private boolean bondIsUpdatedAndDoesNotContainCertainSlave ( java.lang.String slaveName , java.lang.String bondName ) { for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : params.getBonds ( ) ) { boolean isRequiredBond = bond.getName ( ) . equals ( bondName ) ; if ( isRequiredBond ) { boolean updatedBondDoesNotContainGivenSlave = ! ( bond.getSlaves ( ) . contains ( slaveName ) ) ; return updatedBondDoesNotContainGivenSlave ; } } return false ; }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
protected java.util.function.Predicate < org.ovirt.engine.core.common.businessentities.StorageDomain > getPredicate ( final java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks ) { return ( storageDomain ) -> { updateDisksStorage ( storageDomain , memoryDisks ) ; org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = getStorageDomainValidator ( storageDomain ) ; return ( storageDomainValidator.isDomainWithinThresholds ( ) . isValid ( ) ) && ( storageDomainValidator.hasSpaceForClonedDisks ( memoryDisks ) . isValid ( ) ) ; } ; }

Target:
public boolean test ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { updateDisksStorage ( storageDomain , memoryDisks ) ; org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = getStorageDomainValidator ( storageDomain ) ; return ( storageDomainValidator.isDomainWithinThresholds ( ) . isValid ( ) ) && ( storageDomainValidator.hasSpaceForClonedDisks ( memoryDisks ) . isValid ( ) ) ; }
Source:
public void setScope ( java.lang.String scope ) { if ( ( ( scopeAsList ) == null ) && ( ! ( org.ovirt.engine.core.sso.utils.SsoUtils.strippedScopeAsList ( org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( scope ) ) . isEmpty ( ) ) ) ) { this . scope = scope ; this . scopeAsList = org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( scope ) ; } }

Target:
public void setScope ( java.lang.String scope ) { if ( ( ( scopeAsList ) == null ) && ( ! ( org.ovirt.engine.core.sso.utils.SsoUtils.strippedScopeAsList ( org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( scope ) ) . isEmpty ( ) ) ) ) { this . scope = scope ; this . scopeAsList = org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( scope ) ; restApiScope = org.ovirt.engine.core.sso.utils.SsoUtils.isRestApiScope ( scopeAsList ) ; } }
Source:
public static boolean isOsSupportedForVirtIoScsi ( int osId , org.ovirt.engine.core.compat.Version clusterVersion ) { java.util.ArrayList < java.lang.String > diskInterfaces = org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getDiskInterfaces ( osId , clusterVersion ) ; return diskInterfaces.contains ( DiskInterface.VirtIO_SCSI.toString ( ) ) ; }

Target:
public static boolean isOsSupportedForVirtIoScsi ( int osId , org.ovirt.engine.core.compat.Version clusterVersion ) { java.util.List < java.lang.String > diskInterfaces = org.ovirt.engine.core.bll.validator.VmValidationUtils.getOsRepository ( ) . getDiskInterfaces ( osId , clusterVersion ) ; return diskInterfaces.contains ( DiskInterface.VirtIO_SCSI.toString ( ) ) ; }
Source:
public void testAlerts ( ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 100 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( "Events: severity=error" , true ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; junit.framework.Assert.assertEquals ( "SELECT * FROM (SELECT audit_log.* FROM audit_log WHERE audit_log.severity = '2' and (not deleted) ORDER BY audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 0" , query ) ; }

Target:
public void testEvent ( ) { testValidSql ( "Event: " , "SELECT * FROM ((SELECT audit_log.* FROM audit_log WHERE not deleted) ORDER BY audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 0" ) ; testValidSql ( "Event: severity=error " , "SELECT * FROM ((SELECT audit_log.* FROM audit_log WHERE audit_log.severity = '2' AND not deleted) ORDER BY audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 0" ) ; testValidSql ( "Event: severity=alert " , "SELECT * FROM ((SELECT audit_log.* FROM audit_log WHERE audit_log.severity = '10' AND not deleted) ORDER BY audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 0" ) ; testValidSql ( "Event: host.name = \"host1\" " , "SELECT * FROM ((SELECT audit_log.* FROM audit_log LEFT OUTER JOIN vds_with_tags ON audit_log.vds_id=vds_with_tags.vds_id WHERE vds_with_tags.vds_name LIKE host1 AND not deleted) ORDER BY audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 0" ) ; }
Source:
private static void addSoundCard ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Version vdsGroupCompatibilityVersion ) { java.lang.String soundDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository.getSoundDevice ( vmBase.getOsId ( ) , vdsGroupCompatibilityVersion ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) , VmDeviceGeneralType.SOUND , org.ovirt.engine.core.common.utils.VmDeviceType.getSoundDeviceType ( soundDevice ) , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , true , null , false ) ; }

Target:
public static void addVideoDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , int numberOfVideoDevices ) { for ( int i = 0 ; i < numberOfVideoDevices ; i ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) , VmDeviceGeneralType.VIDEO , vmBase.getDefaultDisplayType ( ) . getDefaultVmDeviceType ( ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getVideoDeviceSpecParams ( vmBase ) , true , false ) ; } }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > parseLUNList ( java.util.Map < java.lang.String , java.lang.Object > [ ] lunList ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > result = new java.util.ArrayList < > ( lunList.length ) ; for ( java.util.Map < java.lang.String , java.lang.Object > xlun : lunList ) { result.add ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLunFromXmlRpc ( xlun ) ) ; } return result ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > parseLUNList ( java.util.Map < java.lang.String , java.lang.Object > [ ] lunList , org.ovirt.engine.core.compat.Version compatibilityVersion ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > result = new java.util.ArrayList < > ( lunList.length ) ; for ( java.util.Map < java.lang.String , java.lang.Object > xlun : lunList ) { result.add ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLunFromXmlRpc ( xlun , compatibilityVersion ) ) ; } return result ; }
Source:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyCanDoActionMessagesContainMessage ( EngineMessage.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }

Target:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyValidationMessagesContainMessage ( EngineMessage.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidateModifiedBondSlaves ( bond , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) , new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( 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.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , false , VdcBllMessages.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.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 ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain mockGetExistingDomain ( boolean answerWithDomain ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = java.util.Collections.emptyList ( ) ; if ( answerWithDomain ) { sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domains = java.util.Arrays.asList ( sd ) ; } org.mockito.Mockito.doReturn ( createQueryReturnValueWith ( domains ) ) . when ( backend ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; return sd ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain mockGetExistingDomain ( boolean answerWithDomain ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = java.util.Collections.emptyList ( ) ; if ( answerWithDomain ) { sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.getStorageStaticData ( ) . setConnection ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ) ; domains = java.util.Arrays.asList ( sd ) ; } org.mockito.Mockito.doReturn ( createQueryReturnValueWith ( domains ) ) . when ( backend ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; return sd ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( e.propertyName.equalsIgnoreCase ( "selectedSessionSummaryRow" ) ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails selectedSessionDetail = model.getGeoRepSessionSummary ( ) . getSelectedItem ( ) . getEntity ( ) ; getView ( ) . setCheckPointCompletedAtVisibility ( selectedSessionDetail.isCheckpointCompleted ( ) ) ; getView ( ) . updateSessionDetailProperties ( selectedSessionDetail ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( args.propertyName.equalsIgnoreCase ( "selectedSessionSummaryRow" ) ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails selectedSessionDetail = model.getGeoRepSessionSummary ( ) . getSelectedItem ( ) . getEntity ( ) ; getView ( ) . setCheckPointCompletedAtVisibility ( selectedSessionDetail.isCheckpointCompleted ( ) ) ; getView ( ) . updateSessionDetailProperties ( selectedSessionDetail ) ; } }
Source:
public void onRefreshActiveModel ( org.ovirt.engine.ui.frontend.communication.RefreshActiveModelEvent event ) { if ( getTimer ( ) . isActive ( ) ) { syncSearch ( ) ; if ( event.isDoFastForward ( ) ) { getTimer ( ) . fastForward ( ) ; } } }

Target:
public void onRefreshActiveModel ( org.ovirt.engine.ui.frontend.communication.RefreshActiveModelEvent event ) { if ( getTimer ( ) . isActive ( ) ) { if ( handleRefreshActiveModel ( event ) ) { syncSearch ( ) ; } if ( event.isDoFastForward ( ) ) { getTimer ( ) . fastForward ( ) ; } } }
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getEngineSshPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetEngineSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkQoSListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand.equals ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
private void postDoUpdateManagedFieldsFrom ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { if ( isNextRunConfigurationExists ( ) ) { deactivate ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( isVmDeviceExists ( vmBase.getManagedDeviceMap ( ) , VmDeviceType.CONSOLE.getName ( ) ) ) ; activate ( ) ; } updateWatchdog ( vmBase ) ; }

Target:
private void postDoUpdateManagedFieldsFrom ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { if ( isNextRunConfigurationExists ( ) ) { deactivate ( ) ; getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( isVmDeviceExists ( vmBase.getManagedDeviceMap ( ) , VmDeviceType.SOUND.getName ( ) ) ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( isVmDeviceExists ( vmBase.getManagedDeviceMap ( ) , VmDeviceType.CONSOLE.getName ( ) ) ) ; activate ( ) ; } updateWatchdog ( vmBase ) ; }
Source:
public void testDevicePassthroughMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setHostDevicePassthroughEnabled ( true ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; org.junit.Assert.assertNotNull ( host ) ; org.junit.Assert.assertNotNull ( host.getDevicePassthrough ( ) ) ; org.junit.Assert.assertTrue ( host.getDevicePassthrough ( ) . isEnabled ( ) ) ; }

Target:
public void testDevicePassthroughMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setHostDevicePassthroughEnabled ( true ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( host ) ; org.junit.jupiter.api.Assertions.assertNotNull ( host.getDevicePassthrough ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( host.getDevicePassthrough ( ) . isEnabled ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturnForXmlRpc glusterSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturnForXmlRpc ( vdsServer.glusterSnapshotCreate ( volumeName , snapshotName , description , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterVolumeSnapshotList ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotList ( ( volumeName == null ? "" : volumeName ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testAllByConnectionId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = dao.getAllByConnectionId ( new org.ovirt.engine.core.compat.Guid ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ) ; org.junit.Assert.assertEquals ( "Unexpected number of storage domains by connection id" , 1 , domains.size ( ) ) ; org.junit.Assert.assertEquals ( "Wrong storage domain id for search by connection id" , FixturesTool.STORAGE_DOMAIN_NFS_MASTER , domains.get ( 0 ) . getId ( ) ) ; }

Target:
public void testAllByConnectionId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = dao.getAllByConnectionId ( new org.ovirt.engine.core.compat.Guid ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , domains.size ( ) , "Unexpected number of storage domains by connection id" ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.STORAGE_DOMAIN_NFS_MASTER , domains.get ( 0 ) . getId ( ) , "Wrong storage domain id for search by connection id" ) ; }
Source:
private void writeParameter ( org.ovirt.api.metamodel.concepts.Parameter parameter ) { writeStartElement ( "parameter" ) ; writeCommon ( parameter ) ; writeStartElement ( "in" ) ; writeCharacters ( java.lang.Boolean.toString ( parameter.isIn ( ) ) ) ; writeEndElement ( ) ; writeStartElement ( "out" ) ; writeCharacters ( java.lang.Boolean.toString ( parameter.isIn ( ) ) ) ; writeEndElement ( ) ; writeTypeRef ( parameter.getType ( ) ) ; writeEndElement ( ) ; }

Target:
private void writeParameter ( org.ovirt.api.metamodel.concepts.Parameter parameter ) { writer.writeStartElement ( "parameter" ) ; writeCommon ( parameter ) ; writer.writeElement ( "in" , java.lang.Boolean.toString ( parameter.isIn ( ) ) ) ; writer.writeElement ( "out" , java.lang.Boolean.toString ( parameter.isIn ( ) ) ) ; writeTypeRef ( parameter.getType ( ) ) ; writer.writeEndElement ( ) ; }
Source:
public void testPrefixViewCache ( ) throws java.lang.Exception { java.io.File file = writeConf ( ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.Configuration view1 = config.getView ( "a" ) ; org.junit.Assert.assertNotNull ( view1 ) ; org.ovirt.engine.core.extensions.mgr.Configuration view2 = config.getView ( "a" ) ; org.junit.Assert.assertNotNull ( view2 ) ; org.junit.Assert.assertTrue ( ( view1 == view2 ) ) ; }

Target:
public void testPrefixViewCache ( ) throws java.lang.Exception { java.io.File file = writeConf ( ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.Configuration view1 = config.getView ( "a" ) ; org.junit.Assert.assertNotNull ( view1 ) ; org.ovirt.engine.core.extensions.mgr.Configuration view2 = config.getView ( "a" ) ; org.junit.Assert.assertNotNull ( view2 ) ; org.junit.Assert.assertSame ( view1 , view2 ) ; }
Source:
public void testStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.translateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_WITH_REPLACEMENT , "$action SOMEACTION" , "$type SOME Type" ) ) ; java.lang.String result = "Cannot SOMEACTION SOME Type. VM's Image doesn't exist." ; org.junit.Assert.assertEquals ( "Size" , 1 , error.size ( ) ) ; org.junit.Assert.assertEquals ( "String should equal" , result , error.get ( 0 ) ) ; }

Target:
public void testStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.translateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_WITH_REPLACEMENT , "$action SOMEACTION" , "$type SOME Type" ) ) ; java.lang.String result = "Cannot SOMEACTION SOME Type. VM's Image doesn't exist." ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , error.size ( ) , "Size" ) ; org.junit.jupiter.api.Assertions.assertEquals ( result , error.get ( 0 ) , "String should equal" ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkView entity = super . mapRow ( rs , rowNum ) ; entity.setStoragePoolName ( rs.getString ( "storage_pool_name" ) ) ; entity.setCompatabilityVersion ( new org.ovirt.engine.core.compat.Version ( rs.getString ( "compatibility_version" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkView entity = super . mapRow ( rs , rowNum ) ; entity.setStoragePoolName ( rs.getString ( "storage_pool_name" ) ) ; entity.setCompatabilityVersion ( new org.ovirt.engine.core.compat.Version ( rs.getString ( "compatibility_version" ) ) ) ; entity.setProviderName ( rs.getString ( "provider_name" ) ) ; return entity ; }
Source:
private boolean hotPlugNic ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic ) { if ( ! ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.canPerformHotPlug ( ) ) ) { return false ; } else { return runVdsCommand ( VDSCommandType.HotPlugNic , new org.ovirt.engine.core.common.vdscommands.HotPlugUnplgNicVDSParameters ( vmDynamic.getrun_on_vds ( ) . getValue ( ) , vmDynamic.getId ( ) , org.ovirt.engine.core.bll.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) , vmDevice ) ) . getSucceeded ( ) ; } }

Target:
private org.ovirt.engine.core.common.action.PlugUnplugVmNicParameters createPlugUnPlugParameters ( ) { org.ovirt.engine.core.common.action.PlugUnplugVmNicParameters plugUnplugVmNicParameters = new org.ovirt.engine.core.common.action.PlugUnplugVmNicParameters ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) . getId ( ) , org.ovirt.engine.core.common.action.PlugAction.PLUG ) ; plugUnplugVmNicParameters.setVmId ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; return plugUnplugVmNicParameters ; }
Source:
private boolean canRemoveTemplateDisk ( ) { if ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplate ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImage ( ) ; if ( ( diskImage.getStorageIds ( ) . size ( ) ) == 1 ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_LAST_DOMAIN ) ; } if ( ( ! ( checkDerivedVmFromTemplateExists ( diskImage ) ) ) || ( ! ( checkDerivedDisksFromDiskNotExist ( diskImage ) ) ) ) { return false ; } return true ; }

Target:
private boolean checkDerivedDisksFromDiskNotExist ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { return validate ( createDiskImagesValidator ( diskImage ) . diskImagesHaveNoDerivedDisks ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.VolumeFormat > getVolumeFormats ( ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.VolumeFormat > ( java.util.Arrays.asList ( VolumeFormat.COW , VolumeFormat.RAW ) ) ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterVolumeSnapshotsForVolume ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snapshots = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ) ( returnValue ) ) ; java.util.Collections.sort ( snapshots , new org.ovirt.engine.ui.uicommonweb.Linq.GlusterVolumeSnapshotComparer ( ) ) ; setItems ( snapshots ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
protected void selectedItemsChanged ( ) { super . selectedItemsChanged ( ) ; updateActionAvailability ( ) ; }
Source:
protected void setUpEntityQueryExpectations ( java.lang.String failure ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 3 ] , org.ovirt.engine.core.common.businessentities.ImageFileType.All } , entities , failure ) ; }

Target:
protected void setUpEntityQueryExpectations ( java.lang.String failure ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 3 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , entities , failure ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters getMigrateVDSCommandParameters ( ) { java.lang.String srcVdsHost = org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getHostName ( ) ; java.lang.String dstVdsHost = java.lang.String.format ( "%1$s:%2$s" , getDestinationVds ( ) . getHostName ( ) , getDestinationVds ( ) . getPort ( ) ) ; return new org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) , srcVdsHost , vdsDestinationId , dstVdsHost , org.ovirt.engine.core.common.businessentities.MigrationMethod.ONLINE , isTunnelMigrationUsed ( ) , getMigrationNetworkIp ( ) ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters createMigrateVDSCommandParameters ( ) { java.lang.String srcVdsHost = org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getHostName ( ) ; java.lang.String dstVdsHost = java.lang.String.format ( "%1$s:%2$s" , getDestinationVds ( ) . getHostName ( ) , getDestinationVds ( ) . getPort ( ) ) ; return new org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) , srcVdsHost , vdsDestinationId , dstVdsHost , org.ovirt.engine.core.common.businessentities.MigrationMethod.ONLINE , isTunnelMigrationUsed ( ) , getMigrationNetworkIp ( ) ) ; }
Source:
public void testAllocateVm ( ) throws java.lang.Exception { setUpGetVmExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AttachUserToVmFromPoolAndRun , org.ovirt.engine.core.common.action.VmPoolUserParameters.class , new java.lang.String [ ] { "VmPoolId" , "IsInternal" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , GUIDS [ 0 ] ) ) ; verifyTestAllocateVmActionResponse ( resource.allocatevm ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testAllocateVm ( ) throws java.lang.Exception { setUpGetVmExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AttachUserToVmFromPoolAndRun , org.ovirt.engine.core.common.action.VmPoolUserParameters.class , new java.lang.String [ ] { "VmPoolId" , "IsInternal" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , GUIDS [ 0 ] ) ) ; verifyTestAllocateVmActionResponse ( resource.allocateVm ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
private void buidSharedLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms ) { if ( ( listVms != null ) && ( ! ( listVms.isEmpty ( ) ) ) ) { sharedLockMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { sharedLockMap.put ( vm.getId ( ) . toString ( ) , LockingGroup.VM.name ( ) ) ; } } }

Target:
private void buildSharedLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsDiskPluggedTo ) { sharedLockMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsDiskPluggedTo ) { sharedLockMap.put ( vm.getId ( ) . toString ( ) , LockingGroup.VM.name ( ) ) ; } }
Source:
protected boolean performImageChecksForRunningVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > message , org.ovirt.engine.core.common.action.RunVmParams runParams , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmDisks ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( message , vm.getStoragePoolId ( ) , true , false , false , ( ( ! ( vm.isAutoStartup ( ) ) ) || ( ! ( runParams.getIsInternal ( ) ) ) ) , vmDisks ) ; }

Target:
protected boolean performImageChecksForRunningVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > message , org.ovirt.engine.core.common.action.RunVmParams runParams , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmDisks ) { org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( vmDisks ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) , message ) ) && ( org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( message , vm.getStoragePoolId ( ) , false , false , ( ( ! ( vm.isAutoStartup ( ) ) ) || ( ! ( runParams.getIsInternal ( ) ) ) ) , vmDisks ) ) ; }
Source:
private void initExternalProvidersList ( ) { org.ovirt.engine.ui.frontend.AsyncQuery getProvidersQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getProvidersQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.filterNetworkProviders ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ) ) ; providers.add ( 0 , null ) ; getExternalProviders ( ) . setItems ( providers ) ; getExternalProviders ( ) . setSelectedItem ( null ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetAllProviders ( getProvidersQuery ) ; }

Target:
private void initExternalProvidersList ( ) { org.ovirt.engine.ui.frontend.AsyncQuery getProvidersQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getProvidersQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; providers.add ( 0 , null ) ; getExternalProviders ( ) . setItems ( providers ) ; getExternalProviders ( ) . setSelectedItem ( null ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetAllNetworkProviders ( getProvidersQuery ) ; }
Source:
private void updateOverCommitPercent ( ) { setStorageDomainOverCommitPercent ( ( ( ( getAvailableDiskSize ( ) ) != null ) && ( ( getAvailableDiskSize ( ) ) > 0 ) ? ( ( getCommittedDiskSize ( ) ) * 100 ) / ( getAvailableDiskSize ( ) ) : 0 ) ) ; }

Target:
private void updateOverCommitPercent ( ) { if ( ( ( getAvailableDiskSize ( ) ) == null ) || ( ( getAvailableDiskSize ( ) ) == 0 ) ) { setStorageDomainOverCommitPercent ( 0 ) ; } else { setStorageDomainOverCommitPercent ( ( ( ( ( getCommittedDiskSize ( ) ) - ( getActualImagesSize ( ) ) ) * 100 ) / ( getAvailableDiskSize ( ) ) ) ) ; } }
Source:
public static void GetDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void GetNextAvailableDiskAliasNameByVMId ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }