auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkResourceTest.NETWORK_ID } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.Network model = org.ovirt.engine.api.restapi.resource.BackendNetworkResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Network model = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( true , false ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; initAndAssertValidation ( true ) ; }

Target:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFS ( ) ) ; initAndAssertValidation ( true ) ; }
Source:
public static void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
public boolean checkQuotaNameExisting ( org.ovirt.engine.core.common.businessentities.Quota quota , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.common.businessentities.Quota quotaByName = getQuotaDAO ( ) . getQuotaByQuotaName ( quota.getQuotaName ( ) ) ; if ( ( quotaByName != null ) && ( ! ( quotaByName.getId ( ) . equals ( quota.getId ( ) ) ) ) ) { messages.add ( VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NAME_ALREADY_EXISTS.toString ( ) ) ; return false ; } return true ; }

Target:
public boolean checkQuotaNameExisting ( org.ovirt.engine.core.common.businessentities.Quota quota , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.common.businessentities.Quota quotaByName = getQuotaDAO ( ) . getQuotaByQuotaName ( quota.getQuotaName ( ) ) ; if ( ( quotaByName != null ) && ( ! ( quotaByName.getId ( ) . equals ( quota.getId ( ) ) ) ) ) { messages.add ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED.toString ( ) ) ; return false ; } return true ; }
Source:
public static boolean setDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.common.businessentities.VM vm ) { if ( disk != null ) { java.lang.String vmName = "" ; int count = 1 ; if ( vm != null ) { vmName = vm.getvm_name ( ) ; count = ( vm.getDiskMapCount ( ) ) + 1 ; } disk.setDiskAlias ( org.ovirt.engine.core.bll.ImagesHandler.getSuggestedDiskAlias ( disk , vmName , count ) ) ; return true ; } else { org.ovirt.engine.core.bll.ImagesHandler.log.errorFormat ( "Disk object is null" ) ; return false ; } }

Target:
public static boolean setDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.common.businessentities.VM vm , int count ) { if ( disk == null ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Disk object is null" ) ; return false ; } java.lang.String vmName = org.ovirt.engine.core.bll.ImagesHandler.nullSafeGetVmName ( vm ) ; disk.setDiskAlias ( org.ovirt.engine.core.bll.ImagesHandler.getSuggestedDiskAlias ( disk , vmName , count ) ) ; return true ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc migrateStatus ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.migrateStatus ( vmId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionResume ( java.lang.String volumeName , java.lang.String slaveHostName , java.lang.String slaveVolumeName , java.lang.String userName , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepSessionResume ( volumeName , slaveHostName , slaveVolumeName , userName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void appendTo ( java.lang.StringBuffer buffer ) { buffer.append ( "eqQueryParams(" ) ; for ( int i = 0 ; i < ( names.length ) ; i ++ ) { if ( i > 0 ) { buffer.append ( ", " ) ; } buffer.append ( names [ i ] ) ; buffer.append ( "=" ) ; buffer.append ( values [ i ] ) ; } buffer.append ( ")" ) ; }

Target:
public void describeTo ( org.hamcrest.Description description ) { description.appendText ( "eqQueryParams(" ) ; for ( int i = 0 ; i < ( names.length ) ; i ++ ) { if ( i > 0 ) { description.appendText ( ", " ) ; } description.appendText ( names [ i ] ) ; description.appendText ( "=" ) ; description.appendText ( java.lang.String.valueOf ( values [ i ] ) ) ; } description.appendText ( ")" ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( getVds ( ) . getStaticData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDAO ( ) . update ( getParameters ( ) . getVdsStaticData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( getVds ( ) . getStaticData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . update ( getParameters ( ) . getVdsStaticData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
private void initImportClonedTemplateDisks ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getParameters ( ) . getImages ( ) ) { diskGuidList.add ( image.getId ( ) ) ; imageGuidList.add ( image.getImageId ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { image.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; image.setImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } } }

Target:
private void initImportClonedTemplateDisks ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getParameters ( ) . getImages ( ) ) { diskGuidList.add ( image.getId ( ) ) ; imageGuidList.add ( image.getImageId ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { image.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; image.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } } }
Source:
public void testAlerts ( ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 100 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( "Events: severity=error" , true ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; junit.framework.Assert.assertEquals ( "SELECT * FROM (SELECT audit_log.* FROM audit_log WHERE audit_log.severity = '2' and (not deleted) ORDER BY audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 0" , query ) ; }

Target:
public void testVms ( ) { testValidSql ( "Vms:" , "SELECT * FROM ((SELECT vms.* FROM vms ) ORDER BY vm_name ASC ) as T1 OFFSET (1 -1) LIMIT 0" ) ; testValidSql ( "Vms: storage.name = 111" , "SELECT * FROM (SELECT * FROM vms WHERE ( vm_guid IN (SELECT vms_with_tags.vm_guid FROM vms_with_tags LEFT OUTER JOIN storage_domains_with_hosts_view ON vms_with_tags.storage_id=storage_domains_with_hosts_view.id WHERE storage_domains_with_hosts_view.storage_name LIKE 111 )) ORDER BY vm_name ASC ) as T1 OFFSET (1 -1) LIMIT 0" ) ; }
Source:
public boolean storageDomainRemoved ( org.ovirt.engine.core.common.businessentities.storage_domain_static storageDomain ) { org.ovirt.engine.core.common.businessentities.storage_server_connections connection = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . get ( storageDomain.getstorage ( ) ) ; if ( connection != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } return true ; }

Target:
public boolean storageDomainRemoved ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . get ( storageDomain.getstorage ( ) ) ; if ( connection != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } return true ; }
Source:
private void updateConsoleAddressPartiallyOverridden ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { org.ovirt.engine.ui.frontend.AsyncQuery query = 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 ) { boolean isConsistent = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; setConsoleAddressPartiallyOverridden ( ( ! isConsistent ) ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsDisplayAddressConsistentInCluster , new org.ovirt.engine.core.common.queries.IdQueryParameters ( cluster.getId ( ) ) , query ) ; }

Target:
private void updateConsoleAddressPartiallyOverridden ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { org.ovirt.engine.ui.uicommonweb.models.clusters.AsyncQuery query = new org.ovirt.engine.ui.uicommonweb.models.clusters.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { boolean isConsistent = returnValue.getReturnValue ( ) ; setConsoleAddressPartiallyOverridden ( ( ! isConsistent ) ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsDisplayAddressConsistentInCluster , new org.ovirt.engine.core.common.queries.IdQueryParameters ( cluster.getId ( ) ) , query ) ; }
Source:
public org.ovirt.engine.core.compat.Guid eval ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { return diskImage.getId ( ) ; }

Target:
protected java.lang.String buildMetadataDictionaryForTemplate ( org.ovirt.engine.core.common.businessentities.VmTemplate template , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > > metaDictionary ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allTemplateImages = template.getDiskList ( ) ; java.lang.String templateMeta = generateVmTemplateMetadata ( template , allTemplateImages ) ; metaDictionary.put ( template.getId ( ) , new org.ovirt.engine.core.compat.KeyValuePairCompat ( templateMeta , allTemplateImages.stream ( ) . map ( BaseDisk :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ) ; return templateMeta ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters buildCreateVmParameters ( ) { org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters createVmParams = super . buildCreateVmParameters ( ) ; org.ovirt.engine.core.common.action.RunVmOnceParams runOnceParams = org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) ; org.ovirt.engine.core.common.action.SysPrepParams sysPrepParams = new org.ovirt.engine.core.common.action.SysPrepParams ( ) ; sysPrepParams.setSysPrepDomainName ( runOnceParams.getSysPrepDomainName ( ) ) ; sysPrepParams.setSysPrepUserName ( runOnceParams.getSysPrepUserName ( ) ) ; sysPrepParams.setSysPrepPassword ( runOnceParams.getSysPrepPassword ( ) ) ; createVmParams.setSysPrepParams ( sysPrepParams ) ; createVmParams.getVm ( ) . setVmInit ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getVmInit ( ) ) ; fillRunOnceGraphics ( ) ; return createVmParams ; }

Target:
protected java.util.List < org.ovirt.engine.core.compat.Guid > getVdsWhiteList ( ) { if ( ( getPredefinedVdsIdListToRunOn ( ) . size ( ) ) > 0 ) { return getPredefinedVdsIdListToRunOn ( ) ; } return super . getVdsWhiteList ( ) ; }
Source:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = getVmStaticDAO ( ) . get ( getVm ( ) . getId ( ) ) ; if ( duplicateVm != null ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_IMPORT_VM_EXISTS ) ; addCanDoActionMessage ( java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; return false ; } return true ; }

Target:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = org.ovirt.engine.core.bll.ImportVmCommand.getVmStaticDAO ( ) . get ( getVm ( ) . getId ( ) ) ; if ( duplicateVm != null ) { return failCanDoAction ( VdcBllMessages.VM_CANNOT_IMPORT_VM_EXISTS , java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; } return true ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForNewDisks ( disksList ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForClonedDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > disksMap = getDomainsDisksMap ( diskImages ) ; return validOrFirstFailure ( ( entry ) -> { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForClonedDisks ( disksList ) ; } ) ; }
Source:
void registerSelectionChangeHandler ( final org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef ) { final org.ovirt.engine.core.compat.IEventListener itemSelectionChangeHandler = new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.common.widget.action.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { buttonDef.update ( ) ; } } ; addSelectionChangeListener ( itemSelectionChangeHandler ) ; eventBus.addHandler ( org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.getType ( ) , new org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.UiCommonInitHandler ( ) { @ java.lang.Override public void onUiCommonInit ( org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent event ) { addSelectionChangeListener ( itemSelectionChangeHandler ) ; } } ) ; }

Target:
void registerSelectionChangeHandler ( final org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef ) { final org.ovirt.engine.ui.uicompat.IEventListener itemSelectionChangeHandler = new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.common.widget.action.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { buttonDef.update ( ) ; } } ; addSelectionChangeListener ( itemSelectionChangeHandler ) ; eventBus.addHandler ( org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.getType ( ) , new org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.UiCommonInitHandler ( ) { @ java.lang.Override public void onUiCommonInit ( org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent event ) { addSelectionChangeListener ( itemSelectionChangeHandler ) ; } } ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( getGlusterHostAddress ( ) . getEntity ( ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( getGlusterHostAddress ( ) . getEntity ( ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) { getGlusterHostAddress ( ) . setIsChangable ( true ) ; getGlusterHostPassword ( ) . setIsChangable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangable ( false ) ; getGlusterHostPassword ( ) . setIsChangable ( false ) ; } }
Source:
protected void itemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . itemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Cluster ) ) ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDSGroup > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.ClusterPredicate ( cluster.getId ( ) ) ) ) ; } }

Target:
protected void itemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . itemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Cluster ) ) ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDSGroup > cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.ClusterPredicate ( cluster.getId ( ) ) ) ) ; } }
Source:
public static void GetAllProviders ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }

Target:
public static void GetProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network > getNetworksModel ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network > networks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { org.ovirt.engine.core.common.businessentities.network net = new org.ovirt.engine.core.common.businessentities.network ( ) ; net.setId ( GUIDS [ i ] ) ; net.setname ( NAMES [ i ] ) ; networks.add ( net ) ; } return networks ; }

Target:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworksModel ( ) { java.util.List < org.ovirt.engine.api.model.Network > networks = new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { org.ovirt.engine.api.model.Network net = new org.ovirt.engine.api.model.Network ( ) ; net.setId ( GUIDS [ i ] ) ; net.setname ( NAMES [ i ] ) ; networks.add ( net ) ; } return networks ; }
Source:
public void validateVmMemoryCanStartOnVdsVmTooBigButLowOverhead ( ) { vm.setMinAllocatedMem ( 8865 ) ; vm.setVmMemSizeMb ( 8865 ) ; org.mockito.Mockito.doReturn ( 0 ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; boolean vmPassedMemoryRequirement = slaValidator.hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }

Target:
public void validateVmMemoryCanStartOnVdsVmTooBigButLowOverhead ( ) { vm.setMinAllocatedMem ( 8865 ) ; vm.setVmMemSizeMb ( 8865 ) ; org.mockito.Mockito.doReturn ( 0 ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; boolean vmPassedMemoryRequirement = slaValidator.hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.jupiter.api.Assertions.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain getNewMaster ( boolean duringReconstruct ) { if ( ( ( _newMaster ) == null ) && ( Guid.Empty.equals ( _newMasterStorageDomainId ) ) ) { _newMaster = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.electNewMaster ( duringReconstruct ) ; } else if ( ( _newMaster ) == null ) { _newMaster = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getStorageDomainDAO ( ) . get ( _newMasterStorageDomainId ) ; } return _newMaster ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain getNewMaster ( boolean duringReconstruct ) { if ( ( ( _newMaster ) == null ) && ( Guid.Empty.equals ( _newMasterStorageDomainId ) ) ) { _newMaster = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.electNewMaster ( duringReconstruct , canChooseInactiveDomainAsMaster ) ; } else if ( ( _newMaster ) == null ) { _newMaster = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getStorageDomainDAO ( ) . get ( _newMasterStorageDomainId ) ; } return _newMaster ; }
Source:
public static void setIsAdminGUIFlag ( org.ovirt.engine.core.compat.Guid userId , boolean hasPermissions ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getDbUserDao ( ) . get ( userId ) ; if ( ( user.isAdmin ( ) ) != hasPermissions ) { user.setAdmin ( hasPermissions ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getDbUserDao ( ) . update ( user ) ; } }

Target:
public void setIsAdminGUIFlag ( org.ovirt.engine.core.compat.Guid userId , boolean hasPermissions ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = dbUserDao.get ( userId ) ; if ( ( user.isAdmin ( ) ) != hasPermissions ) { user.setAdmin ( hasPermissions ) ; dbUserDao.update ( user ) ; } }
Source:
public void testNetworkIpAddressWasSameAsHostnameAndChangedWhenIpConfigurationIsNotStatic ( ) throws java.lang.Exception { for ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol networkBootProtocol : org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) ) { if ( networkBootProtocol == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) { continue ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( networkBootProtocol , null , null ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , null ) . networkIpAddressWasSameAsHostnameAndChanged ( null ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; } }

Target:
public void testValidateGateway ( ) throws java.lang.Exception { host.setVdsGroupCompatibilityVersion ( Version.v3_5 ) ; doTestValidateGateway ( "someGateway" , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_ATTACH_ILLEGAL_GATEWAY ) ) ; }
Source:
public void testGetAllOfStorageType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domain_static > result = dao.getAllOfStorageType ( StorageType.ISCSI ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domain_static domain : result ) { org.junit.Assert.assertEquals ( StorageType.ISCSI , domain.getstorage_type ( ) ) ; } }

Target:
public void testGetAllOfStorageType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainStatic > result = dao.getAllOfStorageType ( StorageType.ISCSI ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic domain : result ) { org.junit.Assert.assertEquals ( StorageType.ISCSI , domain.getstorage_type ( ) ) ; } }
Source:
public void canDoActionSucceedsOnVolumeWithRemoveBricksTaskCompleted ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.StopRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTaskCompleted , getBricks ( volumeWithRemoveBricksTaskCompleted , 2 ) ) ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void canDoActionFailsWithInvalidBricks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > paramBricks1 = getInvalidNoOfBricks ( volumeWithRemoveBricksTask ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.StopRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , paramBricks1 ) ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > paramBricks2 = getInvalidBricks ( volumeWithRemoveBricksTask ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.StopRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , paramBricks2 ) ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }
Source:
private void buildVmData ( ) { builder.buildVmProperties ( ) ; builder.buildVmVideoCards ( ) ; builder.buildVmCD ( ) ; builder.buildVmFloppy ( ) ; builder.buildVmDrives ( ) ; builder.buildVmNetworkInterfaces ( ) ; builder.buildVmNetworkCluster ( ) ; builder.buildVmBootSequence ( ) ; builder.buildVmBootOptions ( ) ; builder.buildVmSoundDevices ( ) ; builder.buildVmTimeZone ( ) ; builder.buildVmUsbDevices ( ) ; builder.buildUnmanagedDevices ( ) ; }

Target:
private void buildVmData ( ) { builder.buildVmProperties ( ) ; builder.buildVmVideoCards ( ) ; builder.buildVmCD ( ) ; builder.buildVmFloppy ( ) ; builder.buildVmDrives ( ) ; builder.buildVmNetworkInterfaces ( ) ; builder.buildVmNetworkCluster ( ) ; builder.buildVmBootSequence ( ) ; builder.buildVmBootOptions ( ) ; builder.buildVmSoundDevices ( ) ; builder.buildVmTimeZone ( ) ; builder.buildVmUsbDevices ( ) ; builder.buildVmMemoryBalloon ( ) ; builder.buildUnmanagedDevices ( ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.StoragePool.name ( ) . toLowerCase ( ) , ( ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePoolName ( ) ) == null ? "" : org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePoolName ( ) ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.StoragePool.name ( ) . toLowerCase ( ) , org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePoolName ( ) ) ; jobProperties.put ( VdcObjectType.VDS.name ( ) . toLowerCase ( ) , org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getVdsName ( ) ) ; } return jobProperties ; }
Source:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }

Target:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS ) ; }
Source:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksToCheck = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( disksToCheck ) ; return validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ; }

Target:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksToCheck = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( disksToCheck ) ; return validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ; }
Source:
private void DomainRecoveredFromProblem ( org.ovirt.engine.core.compat.Guid domainId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String vdsName ) { java.lang.String domainIdTuple = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData.getDomainIdTuple ( domainId ) ; org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.infoFormat ( "Domain {0} recovered from problem. vds: {1}" , domainIdTuple , vdsName ) ; ClearVds ( vdsId , domainId ) ; _domainsInProblem.get ( domainId ) . remove ( vdsId ) ; if ( ( _domainsInProblem.get ( domainId ) . size ( ) ) == 0 ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.infoFormat ( ( "Domain {0} has recovered from problem. No active host in the DC is reporting it as" + " problematic, so clearing the domain recovery timer." ) , domainIdTuple ) ; _domainsInProblem.remove ( domainId ) ; ClearTimer ( domainId ) ; } }

Target:
private void DomainRecoveredFromProblem ( org.ovirt.engine.core.compat.Guid domainId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String vdsName ) { java.lang.String domainIdTuple = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData.getDomainIdTuple ( domainId ) ; org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.infoFormat ( "Domain {0} recovered from problem. vds: {1}" , domainIdTuple , vdsName ) ; ClearVds ( vdsId , domainId ) ; _domainsInProblem.get ( domainId ) . remove ( vdsId ) ; if ( ( _domainsInProblem.get ( domainId ) . size ( ) ) == 0 ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.infoFormat ( ( "Domain {0} has recovered from problem. No active host in the DC is reporting it as" + " problematic, so clearing the domain recovery timer." ) , domainIdTuple ) ; _domainsInProblem.remove ( domainId ) ; clearTimer ( domainId ) ; } }
Source:
public static void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void setContent ( com.google.gwt.user.client.ui.IsWidget content ) { setPanelContent ( searchPanelContainer , content ) ; }

Target:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.HeaderPresenterWidget.TYPE_SetSearchPanel ) ) { setPanelContent ( searchPanelContainer , content ) ; } else if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.HeaderPresenterWidget.TYPE_SetTabBar ) ) { setPanelContent ( mainTabContainer , content ) ; content.asWidget ( ) . addStyleName ( style.mainTabBar ( ) ) ; } else { super . setInSlot ( slot , content ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String fingerprint = ( ( java.lang.String ) ( result ) ) ; if ( ( fingerprint != null ) && ( ( fingerprint.length ( ) ) > 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( ( ( java.lang.String ) ( result ) ) ) ; setIsFingerprintVerified ( true ) ; } else { getGlusterHostFingerprint ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . errorLoadingFingerprint ( ) ) ; setIsFingerprintVerified ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) { getGlusterHostAddress ( ) . setIsChangable ( true ) ; getGlusterHostPassword ( ) . setIsChangable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangable ( false ) ; getGlusterHostPassword ( ) . setIsChangable ( false ) ; } }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
public static void isFloppySupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.Integer osId , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) : java.lang.Boolean.FALSE ; } } ; org.ovirt.engine.core.common.queries.OsQueryParameters params = new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetFloppySupport , osId , version ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , params , aQuery ) ; }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected void setUpLogExpectations ( boolean debug ) { org.powermock.api.easymock.PowerMock.mockStatic ( org.slf4j.LoggerFactory.class ) ; org.slf4j.Logger log = org.powermock.api.easymock.PowerMock.createMock ( org.slf4j.Logger.class ) ; org.easymock.classextension.EasyMock.expect ( org.slf4j.LoggerFactory.getLogger ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource.class ) ) . andReturn ( log ) ; org.easymock.classextension.EasyMock.expect ( log.isDebugEnabled ( ) ) . andReturn ( debug ) . anyTimes ( ) ; org.powermock.api.easymock.PowerMock.replayAll ( ) ; }

Target:
protected void setUpLogExpectations ( boolean debug ) { try { java.lang.reflect.Field field = org.ovirt.engine.api.restapi.resource.BaseBackendResource.class . getDeclaredField ( "log" ) ; org.slf4j.Logger logger = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( logger.isDebugEnabled ( ) ) . thenReturn ( debug ) ; setFinalStatic ( field , logger ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; } }
Source:
protected void executeQueryCommand ( ) { try { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setReturnValue ( PKIResources.Resource.CACertificate.toString ( PKIResources.Format.X509_PEM ) ) ; org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setExceptionString ( e.getMessage ( ) ) ; } }

Target:
protected void executeQueryCommand ( ) { try { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.utils.PKIResources.getCaCertificate ( ) . toString ( PKIResources.Format.X509_PEM ) ) ; org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setExceptionString ( e.getMessage ( ) ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkQosExistsOrNull ( ) { return ( ( vnicProfile.getNetworkQosId ( ) ) == null ) || ( ( getDbFacade ( ) . getQosDao ( ) . get ( vnicProfile.getNetworkQosId ( ) ) ) != null ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkQosExistsOrNull ( ) { return ( ( vnicProfile.getNetworkQosId ( ) ) == null ) || ( ( getDbFacade ( ) . getNetworkQosDao ( ) . get ( vnicProfile.getNetworkQosId ( ) ) ) != null ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setSizeInGigabytes ( size ) ; diskImage.setActualSize ( size ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return diskImage ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setSizeInGigabytes ( size ) ; diskImage.setActualSize ( size ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return diskImage ; }