auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void GetCustomPropertiesList ( 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.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmCustomProperties , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void GetSANWipeAfterDelete ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SANWipeAfterDelete , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static 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.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void GetStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
protected boolean formatStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain dom , org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return runVdsCommand ( VDSCommandType.FormatStorageDomain , new org.ovirt.engine.core.common.vdscommands.FormatStorageDomainVDSCommandParameters ( vds.getId ( ) , dom.getId ( ) ) ) . getSucceeded ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { if ( ( e.getErrorCode ( ) ) != ( org.ovirt.engine.core.common.errors.VdcBllErrors.StorageDomainDoesNotExist ) ) { throw e ; } log.warn ( "Storage Domain '{}' which was about to be formatted does not exist in VDS '{}'" , dom.getName ( ) , vds.getName ( ) ) ; return true ; } }

Target:
protected boolean formatStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain dom , org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return runVdsCommand ( VDSCommandType.FormatStorageDomain , new org.ovirt.engine.core.common.vdscommands.FormatStorageDomainVDSCommandParameters ( vds.getId ( ) , dom.getId ( ) ) ) . getSucceeded ( ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { if ( ( e.getErrorCode ( ) ) != ( org.ovirt.engine.core.common.errors.EngineError.StorageDomainDoesNotExist ) ) { throw e ; } log.warn ( "Storage Domain '{}' which was about to be formatted does not exist in VDS '{}'" , dom.getName ( ) , vds.getName ( ) ) ; return true ; } }
Source:
private static void updateCdInVmDevice ( org.ovirt.engine.core.common.businessentities.VmBase oldVmBase , org.ovirt.engine.core.common.businessentities.VmBase newVmBase ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > cdList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDAO ( ) . getVmDeviceByVmIdTypeAndDevice ( oldVmBase.getId ( ) , VmDeviceType.DISK.getName ( ) , VmDeviceType.CDROM.getName ( ) ) ; if ( ( cdList.size ( ) ) > 0 ) { org.ovirt.engine.core.common.businessentities.VmDevice cd = cdList.get ( 0 ) ; cd.getSpecParams ( ) . put ( VdsProperties.Path , newVmBase.getiso_path ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.update ( cd ) ; } }

Target:
private static void updateCdInVmDevice ( org.ovirt.engine.core.common.businessentities.VmBase oldVmBase , org.ovirt.engine.core.common.businessentities.VmBase newVmBase ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > cdList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( oldVmBase.getId ( ) , VmDeviceType.DISK.getName ( ) , VmDeviceType.CDROM.getName ( ) ) ; if ( ( cdList.size ( ) ) > 0 ) { org.ovirt.engine.core.common.businessentities.VmDevice cd = cdList.get ( 0 ) ; cd.getSpecParams ( ) . put ( VdsProperties.Path , newVmBase.getiso_path ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.update ( cd ) ; } }
Source:
public void testAllDomainsExistAndActiveOneInactive ( ) { domain1.setStatus ( StorageDomainStatus.Active ) ; domain2.setStatus ( StorageDomainStatus.Inactive ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( "One domain should not be active" , result.isValid ( ) ) ; org.junit.Assert.assertEquals ( "Wrong validation error" , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 , result.getMessage ( ) ) ; }

Target:
public void testAllDomainsExistAndActiveOneInactive ( ) { domain1.setStatus ( StorageDomainStatus.Active ) ; domain2.setStatus ( StorageDomainStatus.Inactive ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsExistAndActive ( ) ; org.junit.Assert.assertThat ( "One domain should not be active" , result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImages ( org.ovirt.engine.core.compat.Guid vmId , java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.Disk > diskImageList ) { if ( diskImageList == null ) { return org.ovirt.engine.core.bll.ImagesHandler.filterEditableImageDisks ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( vmId ) ) ; } return org.ovirt.engine.core.bll.ImagesHandler.filterEditableImageDisks ( diskImageList ) ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImages ( org.ovirt.engine.core.compat.Guid vmId , java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.Disk > diskImageList ) { if ( diskImageList == null ) { return org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( vmId ) , true , false ) ; } return org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( diskImageList , true , false ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS createProxyCandidate ( ) { org.ovirt.engine.core.common.businessentities.VDS proxyCandidate = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; proxyCandidate.setVdsName ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.ANOTHER_HOST_NAME ) ; proxyCandidate.setId ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.OTHER_HOST_ID_1 ) ; proxyCandidate.setVdsGroupId ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_CLUSTER_ID ) ; proxyCandidate.setStoragePoolId ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_DATACENTER_ID ) ; proxyCandidate.setVdsGroupCompatibilityVersion ( Version.v3_0 ) ; return proxyCandidate ; }

Target:
private void mockVdsFenceOptions ( boolean agentsCompatibleWithProxy ) { vdsFenceOptions = org.mockito.Mockito.mock ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.class ) ; org.mockito.Mockito.doReturn ( agentsCompatibleWithProxy ) . when ( vdsFenceOptions ) . isAgentSupported ( org.mockito.Matchers.any ( java.lang.String.class ) ) ; }
Source:
private void readCpuItem ( org.ovirt.engine.core.compat.backendcompat.XmlNode node ) { _vm.getStaticData ( ) . setNumOfSockets ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:num_of_sockets" , _xmlNS ) . innerText ) ) ; _vm.getStaticData ( ) . setCpuPerSocket ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:cpu_per_socket" , _xmlNS ) . innerText ) ) ; }

Target:
protected void updateSingleNic ( org.ovirt.engine.core.compat.backendcompat.XmlNode node , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { super . updateSingleNic ( node , iface ) ; iface.setName ( node.SelectSingleNode ( OvfProperties.VMD_NAME , _xmlNS ) . innerText ) ; iface.setMacAddress ( ( ( node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) ) != null ? node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) . innerText : "" ) ) ; }
Source:
public void testValidateFieldValue ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; org.junit.Assert.assertTrue ( "Jar Jar" , comp.validateFieldValue ( "NAME" , "Jar Jar" ) ) ; org.junit.Assert.assertTrue ( "1234" , comp.validateFieldValue ( "NAME" , "1234" ) ) ; org.junit.Assert.assertFalse ( "<>" , comp.validateFieldValue ( "NAME" , "<>" ) ) ; org.junit.Assert.assertTrue ( "Invalid Field" , comp.validateFieldValue ( "NAME222" , "Jar Jar" ) ) ; org.junit.Assert.assertTrue ( "Lowercase Field" , comp.validateFieldValue ( "name" , "<>" ) ) ; }

Target:
public void testValidateFieldValue ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( comp.validateFieldValue ( "NAME" , "Jar Jar" ) , "Jar Jar" ) ; org.junit.jupiter.api.Assertions.assertTrue ( comp.validateFieldValue ( "NAME" , "1234" ) , "1234" ) ; org.junit.jupiter.api.Assertions.assertFalse ( comp.validateFieldValue ( "NAME" , "<>" ) , "<>" ) ; org.junit.jupiter.api.Assertions.assertTrue ( comp.validateFieldValue ( "NAME222" , "Jar Jar" ) , "Invalid Field" ) ; org.junit.jupiter.api.Assertions.assertTrue ( comp.validateFieldValue ( "name" , "<>" ) , "Lowercase Field" ) ; }
Source:
protected java.lang.String join ( java.util.List < java.lang.String > strings , java.lang.String separator ) { java.lang.StringBuffer result = new java.lang.StringBuffer ( ) ; if ( strings == null ) { return result.toString ( ) ; } for ( java.lang.String s : strings ) { if ( ( result.length ( ) ) != 0 ) { result.append ( separator ) ; } result.append ( s ) ; } return result.toString ( ) ; }

Target:
protected java.lang.String join ( java.util.List < java.lang.String > strings , java.lang.String separator ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; if ( strings == null ) { return result.toString ( ) ; } for ( java.lang.String s : strings ) { if ( ( result.length ( ) ) != 0 ) { result.append ( separator ) ; } result.append ( s ) ; } return result.toString ( ) ; }
Source:
private void retrieveDefaultSpmPriority ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDefaultSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spmDefaultPriorityValue = ( ( java.lang.Integer ) ( returnValue ) ) ; updateSpmPriorityValues ( ) ; updateSpmPriority ( ) ; } } ) ) ; }

Target:
private void retrieveDefaultSpmPriority ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spmDefaultPriorityValue = ( ( java.lang.Integer ) ( returnValue ) ) ; updateSpmPriorityValues ( ) ; updateSpmPriority ( ) ; } } ) ) ; }
Source:
protected void assertGetTreeForEntityResult ( org.ovirt.engine.core.compat.Guid entityID , java.util.List < org.ovirt.engine.core.common.businessentities.Permission > result , org.ovirt.engine.core.compat.Guid ... alternativeObjectIds ) { java.util.Set < org.ovirt.engine.core.compat.Guid > expectedObjectIds = new java.util.HashSet < > ( ) ; expectedObjectIds.add ( entityID ) ; expectedObjectIds.addAll ( java.util.Arrays.asList ( alternativeObjectIds ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : result ) { org.junit.Assert.assertTrue ( expectedObjectIds.contains ( permission.getObjectId ( ) ) ) ; } }

Target:
protected void assertGetTreeForEntityResult ( org.ovirt.engine.core.compat.Guid entityID , java.util.List < org.ovirt.engine.core.common.businessentities.Permission > result , org.ovirt.engine.core.compat.Guid ... alternativeObjectIds ) { java.util.Set < org.ovirt.engine.core.compat.Guid > expectedObjectIds = new java.util.HashSet < > ( ) ; expectedObjectIds.add ( entityID ) ; expectedObjectIds.addAll ( java.util.Arrays.asList ( alternativeObjectIds ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : result ) { org.junit.jupiter.api.Assertions.assertTrue ( expectedObjectIds.contains ( permission.getObjectId ( ) ) ) ; } }
Source:
public static void GetNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public org.ovirt.engine.api.model.Event lookupEvent ( java.lang.String id ) { try { java.lang.Long longId = java.lang.Long.valueOf ( id ) ; for ( org.ovirt.engine.core.common.businessentities.AuditLog auditLog : getBackendCollection ( ) ) { if ( ( auditLog.getaudit_log_id ( ) ) == longId ) return addLinks ( map ( auditLog ) ) ; } return notFound ( ) ; } catch ( java.lang.NumberFormatException e ) { return notFound ( ) ; } }

Target:
public org.ovirt.engine.api.model.Event lookupEvent ( java.lang.String id ) { try { java.lang.Long longId = java.lang.Long.valueOf ( id ) ; for ( org.ovirt.engine.core.common.businessentities.AuditLog auditLog : getBackendCollection ( ) ) { if ( ( auditLog.getAuditLogId ( ) ) == longId ) return addLinks ( map ( auditLog ) ) ; } return notFound ( ) ; } catch ( java.lang.NumberFormatException e ) { return notFound ( ) ; } }
Source:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.compat.Guid eval ( org.ovirt.engine.core.common.businessentities.VM vm ) { return vm.getId ( ) ; }

Target:
private org.ovirt.engine.core.common.scheduling.AffinityGroup createAffinityGroup ( org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup , java.lang.Boolean isPositive , final org.ovirt.engine.core.common.businessentities.VM ... vmList ) { org.ovirt.engine.core.common.scheduling.AffinityGroup ag = new org.ovirt.engine.core.common.scheduling.AffinityGroup ( ) ; ag.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; ag.setPositive ( isPositive ) ; ag.setClusterId ( vdsGroup.getId ( ) ) ; ag.setEnforcing ( true ) ; ag.setEntityIds ( java.util.Arrays.stream ( vmList ) . map ( VM :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; return ag ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = getImportChainConfirmationModel ( ( ( java.lang.String ) ( result ) ) ) ; sourceListModel.setConfirmWindow ( confirmationModel ) ; } else { stopProgress ( ) ; getTestResult ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . testFailedUnknownErrorMsg ( ) ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.StoragePool getPreviousDataCenter ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters ) { org.ovirt.engine.core.compat.Guid previousDataCenterId = getVmwarePropertiesModel ( ) . getLastStoragePoolId ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter : dataCenters ) { if ( dataCenter.getId ( ) . equals ( previousDataCenterId ) ) { return dataCenter ; } } return null ; }
Source:
public static void getGlusterHooks ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > getExistingIfaces ( ) { if ( ( existingIfaces ) == null ) { existingIfaces = org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( getDbFacade ( ) . getInterfaceDAO ( ) . getAllInterfacesForVds ( params.getVdsId ( ) ) ) ; } return existingIfaces ; }

Target:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > getExistingIfaces ( ) { if ( ( existingIfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = getDbFacade ( ) . getInterfaceDAO ( ) . getAllInterfacesForVds ( params.getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : ifaces ) { iface.setNetworkImplementationDetails ( org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( getExistingClusterNetworks ( ) , iface ) ) ; } existingIfaces = org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( ifaces ) ; } return existingIfaces ; }
Source:
protected boolean validateStorageDomains ( ) { org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator storageDomainsValidator = getStorageDomainsValidator ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getStoragePoolId ( ) , getStorageDomainsIds ( ) ) ; return ( ( validate ( storageDomainsValidator.allDomainsExistAndActive ( ) ) ) && ( validate ( storageDomainsValidator.allDomainsWithinThresholds ( ) ) ) ) && ( validate ( storageDomainsValidator.allDomainsHaveSpaceForClonedDisks ( getSourceImages ( ) ) ) ) ; }

Target:
protected boolean validateStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = getSnapshotsDummiesForStorageAllocations ( ) ; org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator storageDomainsValidator = getStorageDomainsValidator ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getStoragePoolId ( ) , getStorageDomainsIds ( ) ) ; return ( ( validate ( storageDomainsValidator.allDomainsExistAndActive ( ) ) ) && ( validate ( storageDomainsValidator.allDomainsWithinThresholds ( ) ) ) ) && ( validate ( storageDomainsValidator.allDomainsHaveSpaceForClonedDisks ( disksList ) ) ) ; }
Source:
public static void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
protected void failedToRunVm ( ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { processVmPoolOnStopVm ( ) ; } } ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; }

Target:
private void notifyHostsVmFailed ( ) { if ( ! ( getRunVdssList ( ) . isEmpty ( ) ) ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vdsId : getRunVdssList ( ) ) { if ( ! ( getCurrentVdsId ( ) . equals ( vdsId ) ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.FailedToRunVm , new org.ovirt.engine.core.common.vdscommands.FailedToRunVmVDSCommandParameters ( vdsId ) ) ; } } } } ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; cachedTimeZones.set ( index , ( ( java.util.HashMap < java.lang.String , java.lang.String > ) ( returnValue ) ) . entrySet ( ) ) ; behavior.PostUpdateTimeZone ( selectedTimeZone ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; java.util.HashMap < java.lang.String , java.lang.String > timeZones = ( ( java.util.HashMap < java.lang.String , java.lang.String > ) ( returnValue ) ) ; cachedTimeZones.put ( timezoneType , timeZones.entrySet ( ) ) ; behavior.PostUpdateTimeZone ( selectedTimeZone ) ; }
Source:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public void testStorageDomainVmLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; vm.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; vm.getStorageDomain ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; vm = org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , vm ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_VM_HREF , vm.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_HREF , vm.getStorageDomain ( ) . getHref ( ) ) ; }

Target:
public void testStorageDomainVmLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; vm.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; vm.getStorageDomain ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; vm = org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , vm ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_VM_HREF , vm.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_HREF , vm.getStorageDomain ( ) . getHref ( ) ) ; }
Source:
public void testFailInterfaceCanUpdateReadOnly ( ) { initializeCommand ( new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( diskImageGuid , vmId ) , createDiskImage ( ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . updateReadOnlyRequested ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ) . when ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( ) ; org.junit.Assert.assertFalse ( command.validateCanUpdateReadOnly ( diskValidator ) ) ; }

Target:
public void testFailInterfaceCanUpdateReadOnly ( ) { initializeCommand ( new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( diskImageGuid , vmId ) , createDiskImage ( ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . updateReadOnlyRequested ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ) . when ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.DiskVmElement.class ) ) ; org.junit.Assert.assertFalse ( command.validateCanUpdateReadOnly ( diskValidator ) ) ; }
Source:
private static void logNullParameters ( org.ovirt.engine.core.common.businessentities.async_tasks task ) { if ( ( task.getaction_parameters ( ) ) == null ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "Null action_parameters:\n" ) ; java.lang.StackTraceElement [ ] st = java.lang.Thread.currentThread ( ) . getStackTrace ( ) ; for ( int i = 0 ; i < ( st.length ) ; i ++ ) { sb.append ( java.lang.String.format ( "\tMethod: %1$s\n" , st [ i ] . getMethodName ( ) ) ) ; } org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.log.error ( sb.toString ( ) ) ; } }

Target:
private static void logNullParameters ( org.ovirt.engine.core.common.businessentities.async_tasks task ) { if ( ( task.getaction_parameters ( ) ) == null ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "Null action_parameters:\n" ) ; java.lang.StackTraceElement [ ] st = java.lang.Thread.currentThread ( ) . getStackTrace ( ) ; for ( java.lang.StackTraceElement element : st ) { sb.append ( java.lang.String.format ( "\tMethod: %1$s\n" , element.getMethodName ( ) ) ) ; } org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.log.error ( sb.toString ( ) ) ; } }
Source:
public void bondWithNetworkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( "net" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = createBondSlaves ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , ifaces ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; ifaces.add ( bond ) ; parameters.setInterfaces ( ifaces ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }

Target:
public void sameBondNameSentTwice ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; mockExistingIfaces ( bond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( bond , bond ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; }
Source:
private void connectStorageToHost ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.api.model.LogicalUnit unit ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx = org.ovirt.engine.api.restapi.util.StorageDomainHelper.getConnection ( storageType , unit.getAddress ( ) , unit.getTarget ( ) , unit.getUsername ( ) , unit.getPassword ( ) , unit.getPort ( ) ) ; performAction ( VdcActionType.ConnectStorageToVds , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( cnx , hostId , false ) ) ; }

Target:
private void connectStorageToHost ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.api.model.LogicalUnit unit ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx = org.ovirt.engine.api.restapi.util.StorageDomainHelper.getConnection ( storageType , unit.getAddress ( ) , unit.getTarget ( ) , unit.getUsername ( ) , unit.getPassword ( ) , unit.getPort ( ) ) ; performAction ( ActionType.ConnectStorageToVds , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( cnx , hostId , false ) ) ; }
Source:
public static java.net.URI buildSsoUrlKerberos ( java.lang.String url ) { try { org.apache.http.client.utils.URIBuilder uriBuilder = new org.apache.http.client.utils.URIBuilder ( java.lang.String.format ( "%1$s/sso/oauth/%2$s" , url.substring ( 0 , url.lastIndexOf ( "/" ) ) , org.ovirt.engine.sdk4.internal.SsoUtils.ENTRY_POINT_HTTP ) ) ; uriBuilder.addParameter ( "grant_type" , org.ovirt.engine.sdk4.internal.SsoUtils.GRANT_TYPE_HTTP ) ; uriBuilder.addParameter ( "scope" , org.ovirt.engine.sdk4.internal.SsoUtils.SCOPE ) ; return uriBuilder.build ( ) ; } catch ( java.net.URISyntaxException ex ) { throw new java.lang.Error ( "Failed to build SSO authentication URL" , ex ) ; } }

Target:
public static java.net.URI buildSsoUrlKerberos ( java.lang.String url ) { try { java.net.URI uri = new java.net.URI ( url ) ; org.apache.http.client.utils.URIBuilder uriBuilder = new org.apache.http.client.utils.URIBuilder ( java.lang.String.format ( "%1$s://%2$s/ovirt-engine/sso/oauth/%3$s" , uri.getScheme ( ) , uri.getAuthority ( ) , org.ovirt.engine.sdk4.internal.SsoUtils.ENTRY_POINT_HTTP ) ) ; uriBuilder.addParameter ( "grant_type" , org.ovirt.engine.sdk4.internal.SsoUtils.GRANT_TYPE_HTTP ) ; uriBuilder.addParameter ( "scope" , org.ovirt.engine.sdk4.internal.SsoUtils.SCOPE ) ; return uriBuilder.build ( ) ; } catch ( java.net.URISyntaxException ex ) { throw new java.lang.Error ( "Failed to build SSO authentication URL" , ex ) ; } }
Source:
public void validateVmMemoryCanStartOnVdsVmTooBigButLowOverhead ( ) { vm.setMinAllocatedMem ( 8865 ) ; vm.setVmMemSizeMb ( 8865 ) ; vds.setGuestOverhead ( 0 ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , true ) ; }

Target:
public void validateVmMemoryCantStartOnVdsBecauseOfGuestOverhead ( ) { org.mockito.Mockito.doReturn ( 256 ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; boolean vmPassedMemoryRequirement = slaValidator.hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertFalse ( vmPassedMemoryRequirement ) ; }
Source:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
private static void convertAAAProfilesResult ( 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 ) { java.util.List < java.lang.String > results = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } return results ; } } ; }
Source:
public void GetUserNameFromUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; u.setLoginName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , un ) ; }

Target:
public void GetUserNameFromUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; u.setLoginName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; u.setDomain ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( java.lang.String.format ( "%s[%s]" , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) , un ) ; }
Source:
private java.lang.String getInstalledVdsIdIfExists ( org.ovirt.engine.core.uutils.ssh.SSHClient client ) { try { java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.uutils.ssh.ConstraintByteArrayOutputStream ( 256 ) ; client.executeCommand ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.GetVdsmIdByVdsmToolCommand ) , null , out , null ) ; return new java.lang.String ( out.toByteArray ( ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } catch ( java.lang.Exception e ) { log.warn ( "Failed to initiate vdsm-id request on host: {}" , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; return null ; } }

Target:
private java.lang.String getInstalledVdsIdIfExists ( org.ovirt.engine.core.uutils.ssh.SSHClient client ) { try { java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.uutils.ssh.ConstraintByteArrayOutputStream ( 256 ) ; client.executeCommand ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.GetVdsmIdByVdsmToolCommand ) , null , out , null ) ; return new java.lang.String ( out.toByteArray ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; } catch ( java.lang.Exception e ) { log.warn ( "Failed to initiate vdsm-id request on host: {}" , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; return null ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.bll.storage.GetStorageDomainsByConnectionQuery.getParameters ( ) . getStoragePoolId ( ) ; java.lang.String connection = org.ovirt.engine.core.bll.storage.GetStorageDomainsByConnectionQuery.getParameters ( ) . getConnection ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > domainsList ; if ( storagePoolId != null ) { domainsList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDAO ( ) . getAllByStoragePoolAndConnection ( storagePoolId , connection ) ; } else { domainsList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDAO ( ) . getAllForConnection ( connection ) ; } org.ovirt.engine.core.bll.storage.GetStorageDomainsByConnectionQuery.getQueryReturnValue ( ) . setReturnValue ( domainsList ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.bll.storage.GetStorageDomainsByConnectionQuery.getParameters ( ) . getStoragePoolId ( ) ; java.lang.String connection = org.ovirt.engine.core.bll.storage.GetStorageDomainsByConnectionQuery.getParameters ( ) . getConnection ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > domainsList ; if ( storagePoolId != null ) { domainsList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllByStoragePoolAndConnection ( storagePoolId , connection ) ; } else { domainsList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForConnection ( connection ) ; } org.ovirt.engine.core.bll.storage.GetStorageDomainsByConnectionQuery.getQueryReturnValue ( ) . setReturnValue ( domainsList ) ; }
Source:
public void search ( ) { if ( ( getSearchPageSize ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.UnknownInteger ) ) { asyncCallback.requestSearch ( ) ; } else { stopRefresh ( ) ; if ( getIsQueryFirstTime ( ) ) { setSelectedItem ( null ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.setSelectedItems ( null ) ; } if ( ( getIsTimerDisabled ( ) ) == false ) { setIsQueryFirstTime ( true ) ; syncSearch ( ) ; setIsQueryFirstTime ( false ) ; getTimer ( ) . start ( ) ; } else { syncSearch ( ) ; } } }

Target:
public void execute ( ) { startRefresh ( ) ; }
Source:
public void Activate ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { pb.add ( new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( a.getId ( ) , getEntity ( ) . getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ActivateStorageDomain , pb ) ; }

Target:
public void activate ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { pb.add ( new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( a.getId ( ) , getEntity ( ) . getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ActivateStorageDomain , pb ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostResourceTest.ROOT_PASSWORD } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostResourceTest.ROOT_PASSWORD } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) , 0 ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setId ( diskImageGuid ) ; disk.setSize ( 100000L ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setId ( diskImageGuid ) ; disk.setSize ( 100000L ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singleton ( sdId ) ) ) ; disk.setStoragePoolId ( spId ) ; return disk ; }
Source:
public java.lang.StringBuilder getTagIdAndChildrenIds ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_id ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : _children ) { builder.append ( "," ) . append ( tag.getTagIdAndChildrenIds ( ) ) ; } return builder ; }

Target:
public java.lang.StringBuilder getTagIdAndChildrenIds ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( getTagId ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : _children ) { builder.append ( "," ) . append ( tag.getTagIdAndChildrenIds ( ) ) ; } return builder ; }