auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testImport ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster ) ; }

Target:
public void testImport ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , false ) ; }
Source:
public static void getVmById ( 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.GetVmByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVmById ( 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.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected com.google.gwt.resources.client.ImageResource getStatusImage ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkStatus netStatus = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) . getStatus ( ) ; if ( netStatus == ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.OPERATIONAL ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel.resources.upImage ( ) ; } else if ( netStatus == ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel.resources.downImage ( ) ; } else { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel.resources.questionMarkImage ( ) ; } }

Target:
protected com.google.gwt.resources.client.ImageResource getStatusImage ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkStatus netStatus = item.getStatus ( ) ; if ( netStatus == ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.OPERATIONAL ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel.resources.upImage ( ) ; } else if ( netStatus == ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel.resources.downImage ( ) ; } else { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.InternalNetworkPanel.resources.questionMarkImage ( ) ; } }
Source:
void mockGetVdsCertificateSubjectByVmId ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery query ) { org.mockito.Mockito.doReturn ( hostSubjectReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetVdsCertificateSubjectByVmId ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.HOST_SUBJECT ) . when ( hostSubjectReturnValue ) . getReturnValue ( ) ; }

Target:
void mockGetVdsCertificateSubjectByVmId ( ) { org.mockito.Mockito.doReturn ( hostSubjectReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetVdsCertificateSubjectByVmId ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.HOST_SUBJECT ) . when ( hostSubjectReturnValue ) . getReturnValue ( ) ; }
Source:
public void validateFailsOnCompatVersion ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CommitRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , getBricks ( volumeWithRemoveBricksTask ) ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.UNSUPPORTED_VERSION ) . when ( vdsGroup ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }

Target:
public void validateFailsOnCompatVersion ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CommitRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , getBricks ( volumeWithRemoveBricksTask ) ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.UNSUPPORTED_VERSION ) . when ( cluster ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }
Source:
public boolean validate ( boolean validateDiskModel ) { boolean uploadImageIsValid ; if ( getImageSourceLocalEnabled ( ) . getEntity ( ) ) { getImagePath ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; uploadImageIsValid = getImagePath ( ) . getIsValid ( ) ; } else { uploadImageIsValid = false ; } boolean diskIsValid = ( ! validateDiskModel ) || ( diskModel.validate ( ) ) ; return uploadImageIsValid && diskIsValid ; }

Target:
public boolean validate ( ) { boolean uploadImageIsValid ; if ( getImageSourceLocalEnabled ( ) . getEntity ( ) ) { getImagePath ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; uploadImageIsValid = getImagePath ( ) . getIsValid ( ) ; } else { uploadImageIsValid = false ; } return uploadImageIsValid && ( diskModel.validate ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validOrFirstFailure ( org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator.ValidatorPredicate predicate ) { for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry : domainValidators.entrySet ( ) ) { org.ovirt.engine.core.bll.ValidationResult currResult = predicate.evaluate ( getStorageDomainValidator ( entry ) ) ; if ( ! ( currResult.isValid ( ) ) ) { return currResult ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validOrFirstFailure ( org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator.ValidatorPredicate predicate ) { for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry : domainValidators.entrySet ( ) ) { org.ovirt.engine.core.bll.ValidationResult currResult = predicate.evaluate ( entry ) ; if ( ! ( currResult.isValid ( ) ) ) { return currResult ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public boolean Validate ( ) { getPath ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getVfsType ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation ( ) } ) ; return ( getPath ( ) . getIsValid ( ) ) && ( getVfsType ( ) . getIsValid ( ) ) ; }

Target:
public boolean validate ( ) { getPath ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getVfsType ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation ( ) } ) ; return ( getPath ( ) . getIsValid ( ) ) && ( getVfsType ( ) . getIsValid ( ) ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel getImportModel ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel ( ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importVirtualMachinesTitle ( ) ) ; model.setHashName ( "import_virtual_machine" ) ; return model ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel getImportModel ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel ( ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importVirtualMachinesTitle ( ) ) ; model.setHashName ( "import_virtual_machine" ) ; model.setEntity ( getEntity ( ) ) ; return model ; }
Source:
public void testListCrash ( ) throws java.lang.Exception { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpNetworkAttachmentsQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; control.replay ( ) ; try { getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpNetworkAttachmentsQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.VdsNetworkInterface FindInterfaceByIsBond ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > items ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface i : items ) { if ( ( ( i.getBonded ( ) ) != null ) && ( i.getBonded ( ) ) ) { return i ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface FindInterfaceByIsBond ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ( ( i.getBonded ( ) ) != null ) && ( i.getBonded ( ) ) ) { return i ; } } return null ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceNetworkNameNotEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceNetworkNameNotEmpty ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { ret.add ( i ) ; } } return ret ; }
Source:
public boolean addMac ( java.lang.String mac ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.writeLock ( ) ) ) { checkIfInitialized ( ) ; boolean added = macsStorage.useMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; logWhenMacPoolIsEmpty ( ) ; return added ; } }

Target:
public boolean addMac ( java.lang.String mac ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.writeLock ( ) ) ) { boolean added = macsStorage.useMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; logWhenMacPoolIsEmpty ( ) ; return added ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Event model , int index ) { assertNotNull ( model ) ; assertEquals ( model.getId ( ) , java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; assertEquals ( model.getSeverity ( ) , LogSeverity.ALERT.value ( ) ) ; assertEquals ( model.getDescription ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; assertEquals ( model.getOrigin ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; assertEquals ( model.getCustomId ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Event model , int index ) { assertNotNull ( model ) ; assertEquals ( model.getId ( ) , java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; assertEquals ( model.getSeverity ( ) , LogSeverity.ALERT ) ; assertEquals ( model.getDescription ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; assertEquals ( model.getOrigin ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; assertEquals ( model.getCustomId ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; }
Source:
public void testCheckVmOnlyOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void testCheckVmOnlyOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public org.ovirt.engine.api.model.Disks list ( ) { if ( org.ovirt.engine.api.common.util.QueryHelper.hasMatrixParam ( getUriInfo ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDisksResource.UNREGISTERED_CONSTRAINT_PARAMETER ) ) { return mapCollection ( getBackendCollection ( VdcQueryType.GetUnregisteredDisks , new org.ovirt.engine.core.common.queries.GetUnregisteredDisksQueryParameters ( storageDomainId , getStoragePoolIdForDomain ( storageDomainId ) ) ) ) ; } else { return mapCollection ( getBackendCollection ( VdcQueryType.GetAllDisksByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( this . storageDomainId ) ) ) ; } }

Target:
public org.ovirt.engine.api.model.Disks list ( ) { if ( org.ovirt.engine.api.common.util.QueryHelper.hasMatrixParam ( getUriInfo ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDisksResource.UNREGISTERED_CONSTRAINT_PARAMETER ) ) { return mapCollection ( getBackendCollection ( VdcQueryType.GetUnregisteredDisks , new org.ovirt.engine.core.common.queries.GetUnregisteredDisksQueryParameters ( storageDomainId , getStoragePoolIdForDomain ( storageDomainId ) ) ) ) ; } else { return mapCollection ( getBackendCollection ( VdcQueryType.GetAllDisksByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( this . storageDomainId ) ) ) ; } }
Source:
public boolean isStartupTimeoutPassed ( ) { java.util.Date waitTo = getBackend ( ) . getStartedAt ( ) . addSeconds ( ( ( java.lang.Integer ) ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DisableFenceAtStartupInSec ) ) ) ) ; java.util.Date now = new java.util.Date ( ) ; if ( ! ( ( waitTo.before ( now ) ) || ( waitTo.equals ( now ) ) ) ) { return false ; } else { return true ; } }

Target:
public boolean isStartupTimeoutPassed ( ) { java.util.Date waitTo = getBackend ( ) . getStartedAt ( ) . addSeconds ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DisableFenceAtStartupInSec ) ) ; java.util.Date now = new java.util.Date ( ) ; return ( waitTo.before ( now ) ) || ( waitTo.equals ( now ) ) ; }
Source:
private org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > createCommand ( org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters params ) { org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > ( params , null ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; return command ; }

Target:
private org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > createCommand ( org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters params ) { org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand ( params , null ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; return command ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { org.ovirt.engine.core.common.businessentities.VM vm = queryReturnValue.getReturnValue ( ) ; updateVms ( java.util.Collections.singletonList ( vm ) ) ; } else { setError ( messages.failedToLoadOva ( getOvaPath ( ) . getEntity ( ) ) ) ; } stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateVms ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; }
Source:
public void setUpBefore ( ) throws java.lang.Exception { super . setUpBefore ( ) ; mcr.mockConfigValue ( ConfigValues.DefaultMTU , 1500 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseIface = createBaseInterface ( qosA , networkName ) ; baseIface.setMtu ( 100 ) ; setTestIface ( baseIface ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( baseIface ) ) . thenReturn ( baseIface ) ; }

Target:
public void setUpBefore ( ) throws java.lang.Exception { super . setUpBefore ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseIface = createBaseInterface ( qosA , networkName ) ; baseIface.setMtu ( 100 ) ; setTestIface ( baseIface ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( baseIface ) ) . thenReturn ( baseIface ) ; }
Source:
public boolean Validate ( ) { boolean isValid = ( ( getAddedLuns ( ) . size ( ) ) > 0 ) || ( ( includedLUNs.size ( ) ) > 0 ) ; if ( ! isValid ) { getInvalidityReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . noLUNsSelectedInvalidReason ( ) ) ; } setIsValid ( isValid ) ; return ( super . Validate ( ) ) && ( getIsValid ( ) ) ; }

Target:
public boolean validate ( ) { boolean isValid = ( ( getAddedLuns ( ) . size ( ) ) > 0 ) || ( ( includedLUNs.size ( ) ) > 0 ) ; if ( ! isValid ) { getInvalidityReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . noLUNsSelectedInvalidReason ( ) ) ; } setIsValid ( isValid ) ; return ( super . validate ( ) ) && ( getIsValid ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > cpuProfiles = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( 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.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 ; } } } }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.quota.QuotaVmListModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.quota.QuotaVmListModel ) ( model ) ) ; vmModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; vmModel.setIsEmpty ( ( ( ( ( java.util.List ) ( vmModel.getItems ( ) ) ) . size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.quota.QuotaVmListModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.quota.QuotaVmListModel ) ( model ) ) ; vmModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; vmModel.setIsEmpty ( ( ( ( ( java.util.List ) ( vmModel.getItems ( ) ) ) . size ( ) ) == 0 ) ) ; }
Source:
public void addExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . initializeVds ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS ) ; }

Target:
public void addExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Boolean interfaceHasSiblingVlanInterfaces = ( ( java.lang.Boolean ) ( returnValue ) ) ; if ( ! interfaceHasSiblingVlanInterfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaceList ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( i.getBondName ( ) , vlanParent.getName ( ) ) ) { ifacesOptions.add ( i ) ; } } } defaultInterfaceName.append ( vlanParent.getName ( ) ) ; asyncQuery.asyncCallback.OnSuccess ( asyncQuery.Model , ifacesOptions ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Boolean interfaceHasSiblingVlanInterfaces = ( ( java.lang.Boolean ) ( returnValue ) ) ; if ( ! interfaceHasSiblingVlanInterfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaceList ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( i.getBondName ( ) , vlanParent.getName ( ) ) ) { ifacesOptions.add ( i ) ; } } } defaultInterfaceName.append ( vlanParent.getName ( ) ) ; asyncQuery.asyncCallback.onSuccess ( asyncQuery.Model , ifacesOptions ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ; if ( vm != null ) { updateAppListFromVm ( vm ) ; } } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = result.getReturnValue ( ) ; if ( vm != null ) { updateAppListFromVm ( vm ) ; } } }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; control.replay ( ) ; try { resource.update ( getUpdate ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.update ( getUpdate ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public java.io.File writeConf ( java.lang.String ... lines ) throws java.io.IOException { java.io.File file = tmp.newFile ( "tmp.conf" ) ; java.io.PrintWriter writer = null ; try { writer = new java.io.PrintWriter ( file , "UTF-8" ) ; for ( java.lang.String line : lines ) { writer.println ( line ) ; } } finally { if ( writer != null ) { writer.close ( ) ; } } return file ; }

Target:
public java.io.File writeConf ( java.lang.String ... lines ) throws java.io.IOException { java.io.File file = tmp.newFile ( "tmp.conf" ) ; try ( java.io.PrintWriter writer = new java.io.PrintWriter ( file , "UTF-8" ) ) { for ( java.lang.String line : lines ) { writer.println ( line ) ; } } return file ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createHibernationMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.bll.utils.VmOverheadCalculator vmOverheadCalculator ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryDisk ( vm , storageType , vmOverheadCalculator ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.generateHibernationMemoryDiskAlias ( vm.getName ( ) ) ) ; image.setDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_HIBERNATION_MEMORY_DISK_DESCRIPTION ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createHibernationMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.bll.utils.VmOverheadCalculator vmOverheadCalculator ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryDisk ( vm , storageType , vmOverheadCalculator , null ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.generateHibernationMemoryDiskAlias ( vm.getName ( ) ) ) ; image.setDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_HIBERNATION_MEMORY_DISK_DESCRIPTION ) ; return image ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > buildFromOVFs ( java.util.List < java.lang.String > ovfList ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = new java.util.ArrayList < > ( ) ; for ( java.lang.String ovf : ovfList ) { try { if ( ! ( ovfHelper.isOvfTemplate ( ovf ) ) ) { vms.add ( ovfHelper.readVmFromOvf ( ovf ) ) ; } } catch ( org.ovirt.engine.core.utils.ovf.OvfReaderException ex ) { auditLogOvfLoadError ( ex.getName ( ) , ex.getMessage ( ) ) ; } } return vms ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > buildFromOVFs ( java.util.List < java.lang.String > ovfList ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = new java.util.ArrayList < > ( ) ; for ( java.lang.String ovf : ovfList ) { try { if ( ! ( ovfHelper.isOvfTemplate ( ovf ) ) ) { vms.add ( ovfHelper.readVmFromOvf ( ovf ) . getVm ( ) ) ; } } catch ( org.ovirt.engine.core.utils.ovf.OvfReaderException ex ) { auditLogOvfLoadError ( ex.getName ( ) , ex.getMessage ( ) ) ; } } return vms ; }
Source:
public void testGetAllStaticByStoragePool ( ) { org.ovirt.engine.core.compat.Guid spID = dbFacade.getVdsGroupDao ( ) . get ( newVmStatic.getVdsGroupId ( ) ) . getStoragePoolId ( ) ; org.junit.Assert.assertNotNull ( spID.getValue ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByStoragePoolId ( spID.getValue ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllStaticByStoragePool ( ) { org.ovirt.engine.core.compat.Guid spID = dbFacade.getVdsGroupDao ( ) . get ( newVmStatic.getVdsGroupId ( ) ) . getStoragePoolId ( ) ; org.junit.Assert.assertNotNull ( spID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByStoragePoolId ( spID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , T model , com.google.gwt.safehtml.shared.SafeHtml tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < T > valueUpdater ) { super . onBrowserEvent ( context , parent , model , tooltipContent , event , valueUpdater ) ; if ( ! ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) ) { return ; } onClickEvent ( model ) ; }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , T model , java.lang.String tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < T > valueUpdater ) { super . onBrowserEvent ( context , parent , model , tooltipContent , event , valueUpdater ) ; if ( ! ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) ) { return ; } onClickEvent ( model ) ; }
Source:
protected boolean canDoAction ( ) { performDbLoads ( ) ; return ( ( ( ( ( ( ( ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommand.canRunActionOnNonManagedVm ( ) ) ) && ( isDiskExist ( getDisk ( ) ) ) ) && ( interfaceDiskValidation ( ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ) && ( imageStorageValidation ( ) ) ) && ( virtIoScsiDiskValidation ( ) ) ; }

Target:
protected boolean validate ( ) { performDbLoads ( ) ; return ( ( ( ( ( ( ( ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommand.canRunActionOnNonManagedVm ( ) ) ) && ( isDiskExist ( getDisk ( ) ) ) ) && ( interfaceDiskValidation ( ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ) && ( imageStorageValidation ( ) ) ) && ( virtIoScsiDiskValidation ( ) ) ; }
Source:
public void updateAuditLogEventProcessed ( long auditLogId ) throws java.sql.SQLException { java.sql.Connection connection = null ; java.sql.PreparedStatement ps = null ; try { connection = ds.getConnection ( ) ; ps = connection.prepareStatement ( ( "UPDATE audit_log " + ( "SET processed = 'true' " + "WHERE audit_log_id = ? ;" ) ) ) ; ps.setLong ( 1 , auditLogId ) ; int updated = ps.executeUpdate ( ) ; if ( updated != 1 ) { org.ovirt.engine.core.notifier.dao.EventsManager.log.error ( "Failed to mark audit_log entry as processed for audit_log_id: {}" , auditLogId ) ; } } finally { org.ovirt.engine.core.utils.db.DbUtils.closeQuietly ( ps , connection ) ; } }

Target:
public void updateAuditLogEventProcessed ( long auditLogId ) throws java.sql.SQLException { try ( java.sql.Connection connection = ds.getConnection ( ) ; java.sql.PreparedStatement ps = connection.prepareStatement ( ( "UPDATE audit_log " + ( "SET processed = 'true' " + "WHERE audit_log_id = ? ;" ) ) ) ) { ps.setLong ( 1 , auditLogId ) ; int updated = ps.executeUpdate ( ) ; if ( updated != 1 ) { org.ovirt.engine.core.notifier.dao.EventsManager.log.error ( "Failed to mark audit_log entry as processed for audit_log_id: {}" , auditLogId ) ; } } }
Source:
public void onSuccess ( java.lang.Object result1 ) { getProfile ( ) . setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ) ( result1 ) ) ) ; profileBehavior.initSelectedProfile ( getProfile ( ) , getNic ( ) ) ; updateProfileChangability ( ) ; okCommand.setIsExecutionAllowed ( true ) ; initSelectedType ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > result ) { getProfile ( ) . setItems ( result ) ; profileBehavior.initSelectedProfile ( getProfile ( ) , getNic ( ) ) ; updateProfileChangability ( ) ; okCommand.setIsExecutionAllowed ( true ) ; initSelectedType ( ) ; }
Source:
public void freeMac ( java.lang.String mac ) { org.ovirt.engine.core.bll.network.MacPoolManager.log.infoFormat ( "MacPoolManager::freeMac(mac = '{0}') - entered" , mac ) ; lockObj.writeLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( ( ( "Failed to free mac address " + mac ) + " ." ) ) ; } else { internalFreeMac ( mac ) ; } } finally { lockObj.writeLock ( ) . unlock ( ) ; } }

Target:
public void freeMac ( java.lang.String mac ) { lockObj.writeLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( ( ( "Failed to free mac address " + mac ) + " ." ) ) ; } else { internalFreeMac ( mac ) ; } } finally { lockObj.writeLock ( ) . unlock ( ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.Linq.Sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = org.ovirt.engine.ui.uicommonweb.Linq.DisksToDiskModelList ( disks ) ; model.getExternalAttachableDisks ( ) . setItems ( org.ovirt.engine.ui.uicommonweb.Linq.ToEntityModelList ( org.ovirt.engine.ui.uicommonweb.Linq.FilterDisksByType ( diskModels , DiskStorageType.LUN ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.Linq.Sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = org.ovirt.engine.ui.uicommonweb.Linq.DisksToDiskModelList ( disks ) ; model.getExternalAttachableDisks ( ) . setItems ( org.ovirt.engine.ui.uicommonweb.Linq.ToEntityModelList ( org.ovirt.engine.ui.uicommonweb.Linq.FilterDisksByType ( diskModels , DiskStorageType.LUN ) ) ) ; }
Source:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.VdsIdParametersBase parameters = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
protected org.ovirt.engine.api.model.StorageDomain map ( org.ovirt.engine.core.common.businessentities.storage_domains entity , org.ovirt.engine.api.model.StorageDomain template ) { org.ovirt.engine.api.model.StorageDomain model = super . map ( entity , template ) ; if ( ! ( isFiltered ( ) ) ) { switch ( entity.getstorage_type ( ) ) { case ISCSI : mapVolumeGroupIscsi ( model , entity ) ; break ; case FCP : mapVolumeGroupFcp ( model , entity ) ; break ; case NFS : case LOCALFS : case POSIXFS : mapNfsOrLocalOrPosix ( model , entity ) ; break ; } } return model ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain map ( org.ovirt.engine.api.model.StorageDomain entity , org.ovirt.engine.api.model.StorageDomain template ) { org.ovirt.engine.api.model.StorageDomain model = super . map ( entity , template ) ; if ( ! ( isFiltered ( ) ) ) { switch ( entity.getstorage_type ( ) ) { case ISCSI : mapVolumeGroupIscsi ( model , entity ) ; break ; case FCP : mapVolumeGroupFcp ( model , entity ) ; break ; case NFS : case LOCALFS : case POSIXFS : mapNfsOrLocalOrPosix ( model , entity ) ; break ; } } return model ; }
Source:
private void schedulJobs ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil sched = org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) ; duringFailureJobId = sched.scheduleAFixedDelayJob ( this , "OnVdsDuringFailureTimer" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_DURING_FAILURE_TIMEOUT_IN_MINUTES , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_DURING_FAILURE_TIMEOUT_IN_MINUTES , java.util.concurrent.TimeUnit.MINUTES ) ; sched.pauseJob ( duringFailureJobId ) ; _refreshIteration = ( _numberRefreshesBeforeSave ) - 1 ; onTimerJobId = sched.scheduleAFixedDelayJob ( this , "OnTimer" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_REFRESH_RATE , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_REFRESH_RATE , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void schedulJobs ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil sched = org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) ; duringFailureJobId = sched.scheduleAFixedDelayJob ( this , "OnVdsDuringFailureTimer" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_DURING_FAILURE_TIMEOUT_IN_MINUTES , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_DURING_FAILURE_TIMEOUT_IN_MINUTES , java.util.concurrent.TimeUnit.MINUTES ) ; sched.pauseJob ( duringFailureJobId ) ; _refreshIteration = ( _numberRefreshesBeforeSave ) - 1 ; onTimerJobId = sched.scheduleAFixedDelayJob ( this , "OnTimer" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_REFRESH_RATE , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_REFRESH_RATE , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }
Source:
public boolean IsBetter ( org.ovirt.engine.core.bll.VDS x , org.ovirt.engine.core.bll.VDS y , org.ovirt.engine.core.bll.VM vm ) { return ( ( x.getPhysicalMemMb ( ) ) - ( x.getMemCommited ( ) ) ) < ( ( y.getPhysicalMemMb ( ) ) - ( y.getMemCommited ( ) ) ) ; }

Target:
public boolean IsBetter ( org.ovirt.engine.core.common.businessentities.VDS x , org.ovirt.engine.core.common.businessentities.VDS y , org.ovirt.engine.core.common.businessentities.VM vm ) { return ( ( x.getPhysicalMemMb ( ) ) - ( x.getMemCommited ( ) ) ) < ( ( y.getPhysicalMemMb ( ) ) - ( y.getMemCommited ( ) ) ) ; }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
protected void initContainerDetails ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase parameters ) { super . setVmId ( parameters.getContainerId ( ) ) ; if ( ( ( getDiskImage ( ) ) != null ) && ( ( getDiskImage ( ) . getStoragePoolId ( ) ) != null ) ) { setStoragePoolId ( getDiskImage ( ) . getStoragePoolId ( ) . getValue ( ) ) ; } }

Target:
protected void initContainerDetails ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase parameters ) { super . setVmId ( parameters.getContainerId ( ) ) ; if ( ( ( getDiskImage ( ) ) != null ) && ( ( getDiskImage ( ) . getStoragePoolId ( ) ) != null ) ) { setStoragePoolId ( getDiskImage ( ) . getStoragePoolId ( ) ) ; } }