auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { if ( ( ( java.lang.Boolean ) ( returnValue ) ) ) { postCloneVmNameUnique ( targetModel , makeCreatorExplicitOwner ) ; } else { stopProgress ( ) ; getCloneName ( ) . getInvalidityReasons ( ) . add ( constants.nameMustBeUniqueInvalidReason ( ) ) ; getCloneName ( ) . setIsValid ( false ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; if ( ! ( org.ovirt.engine.ui.uicommonweb.Linq.filterDisksByStorageType ( disks , Disk.DiskStorageType.LUN ) . isEmpty ( ) ) ) { setMessage ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cloneVmLunsWontBeCloned ( ) ) ; } }
Source:
public void executeCommandWhenFailed ( ) { setUpMocksForUpdate ( ) ; mockBackend ( false , EngineError.GlusterHookUpdateFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_UPDATE_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { setUpMocksForUpdate ( ) ; mockBackend ( false , EngineError.GlusterHookUpdateFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_UPDATE_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void setIsSelectedNullable ( java.lang.Boolean value ) { if ( ( ( isSelectedNullable ) == null ) && ( value == null ) ) { return ; } if ( ( ( isSelectedNullable ) == null ) || ( ! ( isSelectedNullable.equals ( value ) ) ) ) { isSelectedNullable = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsSelectedNullable" ) ) ; if ( ! ( getIsSelectedNotificationPrevent ( ) ) ) { IsSelectedChanged ( ) ; } } }

Target:
public void setIsSelectedNullable ( java.lang.Boolean value ) { if ( ( ( isSelectedNullable ) == null ) && ( value == null ) ) { return ; } if ( ( ( isSelectedNullable ) == null ) || ( ! ( isSelectedNullable.equals ( value ) ) ) ) { isSelectedNullable = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsSelectedNullable" ) ) ; if ( ! ( getIsSelectedNotificationPrevent ( ) ) ) { isSelectedChanged ( ) ; } } }
Source:
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 ) ; }

Target:
public static 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 ) ; }
Source:
private void hostName_SelectedItemChanged ( ) { if ( java.lang.Boolean.FALSE.equals ( getIsDiscoveredHosts ( ) . getEntity ( ) ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getExternalHostName ( ) . getSelectedItem ( ) ) ) ; if ( vds == null ) { vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; } updateModelFromVds ( vds , null , false , null ) ; } }

Target:
private void hostName_SelectedItemChanged ( ) { if ( java.lang.Boolean.FALSE.equals ( getIsDiscoveredHosts ( ) . getEntity ( ) ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getExternalHostName ( ) . getSelectedItem ( ) ) ) ; if ( vds != null ) { setOriginalName ( vds.getName ( ) ) ; getName ( ) . setEntity ( vds.getName ( ) ) ; getHost ( ) . setEntity ( vds.getHostName ( ) ) ; } } }
Source:
public void testExistingPassDiscardFunctionalityIsPreservedNoDiskRequiresPassDiscardFunctionality ( ) { setSdFullDiscardSupport ( ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }

Target:
public void testExistingDiscardAfterDeleteFunctionalityPreservedAllLunsHaveDiscardAfterDeleteFunctionality ( ) { storageDomain.setDiscardAfterDelete ( true ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingDiscardAfterDeleteFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
public static 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.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void talendLogs_LOGS_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.dailytimekeepingjob_3_6.DailyTimeKeepingJob.TalendException { end_Hash.put ( "talendLogs_LOGS" , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; talendLogs_LOGS_onSubJobError ( exception , errorComponent , globalMap ) ; }

Target:
public void tContextLoad_2_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.dailytimekeepingjob_3_6.DailyTimeKeepingJob.TalendException { end_Hash.put ( errorComponent , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tJDBCInput_2_onSubJobError ( exception , errorComponent , globalMap ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; java.lang.String host = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionResource.HOST ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( host != null ) { hostId = getHostId ( host ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId , false ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; java.lang.String host = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionResource.HOST ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( host != null ) { hostId = getHostId ( host ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId , false ) ; return performAction ( ActionType.RemoveStorageServerConnection , parameters ) ; }
Source:
public static org.ovirt.engine.core.compat.backendcompat.PropertyCompat GetProperty ( java.lang.Class < ? > type , java.lang.String idField ) { try { java.beans.PropertyDescriptor [ ] pds = java.beans.Introspector.getBeanInfo ( type ) . getPropertyDescriptors ( ) ; for ( java.beans.PropertyDescriptor pd : pds ) { if ( pd.getName ( ) . equalsIgnoreCase ( idField ) ) { return new org.ovirt.engine.core.compat.backendcompat.PropertyCompat ( pd ) ; } } } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.core.compat.CompatException ( e ) ; } return null ; }

Target:
public static org.ovirt.engine.core.compat.backendcompat.PropertyInfo GetProperty ( java.lang.Class < ? > type , java.lang.String idField ) { try { java.beans.PropertyDescriptor [ ] pds = java.beans.Introspector.getBeanInfo ( type ) . getPropertyDescriptors ( ) ; for ( java.beans.PropertyDescriptor pd : pds ) { if ( pd.getName ( ) . equalsIgnoreCase ( idField ) ) { return new org.ovirt.engine.core.compat.backendcompat.PropertyInfo ( pd ) ; } } } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.core.compat.CompatException ( e ) ; } return null ; }
Source:
private void expandTree ( com.google.gwt.user.cellview.client.TreeNode node ) { if ( node == null ) { return ; } if ( ( node.getChildCount ( ) ) > 0 ) { for ( int i = 0 ; i < ( node.getChildCount ( ) ) ; i ++ ) { expandTree ( node.setChildOpen ( i , true ) ) ; } } }

Target:
public void setElementIdPrefix ( java.lang.String elementIdPrefix ) { cell.setElementIdPrefix ( elementIdPrefix ) ; }
Source:
private boolean shouldPerformMetadataUpdate ( ) { return ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) && ( ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getOldDisk ( ) . getDiskAlias ( ) , getNewDisk ( ) . getDiskAlias ( ) ) ) ) || ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getOldDisk ( ) . getDiskDescription ( ) , getNewDisk ( ) . getDiskDescription ( ) ) ) ) ) ; }

Target:
private boolean shouldPerformMetadataUpdate ( ) { return ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) && ( ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getOldDisk ( ) . getDiskAlias ( ) , getNewDisk ( ) . getDiskAlias ( ) ) ) ) || ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getOldDisk ( ) . getDiskDescription ( ) , getNewDisk ( ) . getDiskDescription ( ) ) ) ) ) ; }
Source:
public void printAvailableKeys ( ) { java.util.List < org.apache.commons.configuration.tree.ConfigurationNode > configNodes = keysConfig.getRootNode ( ) . getChildren ( ) ; for ( org.apache.commons.configuration.tree.ConfigurationNode node : configNodes ) { org.ovirt.engine.core.config.entity.ConfigKey key = configKeyFactory.generateByPropertiesKey ( node.getName ( ) ) ; printKeyInFormat ( key ) ; } }

Target:
public static boolean iterateAllKeys ( org.ovirt.engine.core.config.entity.ConfigKeyFactory factory , org.apache.commons.configuration.HierarchicalConfiguration config , org.ovirt.engine.core.config.ConfigKeyHandler handler ) { java.util.List < org.apache.commons.configuration.tree.ConfigurationNode > configNodes = config.getRootNode ( ) . getChildren ( ) ; for ( org.apache.commons.configuration.tree.ConfigurationNode node : configNodes ) { org.ovirt.engine.core.config.entity.ConfigKey key = factory.generateByPropertiesKey ( node.getName ( ) ) ; if ( ! ( handler.handle ( key ) ) ) { return true ; } } return false ; }
Source:
public void protocolNotChanged ( ) { org.ovirt.engine.core.common.businessentities.VdsProtocol protocol = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.VdsProtocol.class ) ; org.mockito.Mockito.when ( oldHost.getProtocol ( ) ) . thenReturn ( protocol ) ; org.mockito.Mockito.when ( host.getProtocol ( ) ) . thenReturn ( protocol ) ; org.junit.Assert.assertThat ( validator.changeProtocolAllowed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
private org.ovirt.engine.core.bll.validator.UpdateHostValidator createValidatorForHostInstallation ( ) { return new org.ovirt.engine.core.bll.validator.UpdateHostValidator ( oldHost , host , true ) ; }
Source:
public void run ( ) { try { backend.RunAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.LogoutUserParameters ( user.getId ( ) ) ) ) ; } sh.clean ( ) ; } }

Target:
public void run ( ) { try { backend.runAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.LogoutUserParameters ( user.getId ( ) ) ) ) ; } sh.clean ( ) ; } }
Source:
public static void getDataCenterList ( 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void getClusterListByName ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }
Source:
public void getSpiceUsbAutoShare ( 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 ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getConfigurationValueBoolean ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.queries.ConfigurationValues configVal ) { 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 ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( configVal , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) , aQuery ) ; }

Target:
public static void GetTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public void calculateNetworkImplementationDetailsInterfaceQosMissing ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setQos ( null ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , createQos ( ) ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkQosMissing ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , null ) ; }
Source:
protected boolean validateQuota ( ) { getParameters ( ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Disk dit : getVm ( ) . getDiskMap ( ) . values ( ) ) { ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( dit ) ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; } return true ; }

Target:
private boolean hasSnappableDisks ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ! ( vm.getImages ( ) . isEmpty ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain currDomain : domainsInPool ) { updateDisksStorage ( currDomain , disksList ) ; if ( ( ( currDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( currDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) && ( validateSpaceRequirements ( currDomain , disksList ) ) ) { return currDomain ; } } return null ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( storagePoolId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainForMemory = findStorageDomainForMemory ( domainsInPool , disksList ) ; if ( storageDomainForMemory != null ) { updateDisksStorage ( storageDomainForMemory , disksList ) ; } return storageDomainForMemory ; }
Source:
public static void getClusterList ( 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 ) { 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.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isReadOnlyPropertyCompatibleWithInterface ( ) { if ( ( java.lang.Boolean.TRUE.equals ( disk.getReadOnly ( ) ) ) && ( ( disk.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.IDE ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_IDE_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isReadOnlyPropertyCompatibleWithInterface ( ) { if ( java.lang.Boolean.TRUE.equals ( disk.getReadOnly ( ) ) ) { org.ovirt.engine.core.common.businessentities.DiskInterface diskInterface = disk.getDiskInterface ( ) ; if ( diskInterface == ( org.ovirt.engine.core.common.businessentities.DiskInterface.IDE ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_IDE_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ; } if ( disk.isScsiPassthrough ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.SCSI_PASSTHROUGH_IS_NOT_SUPPORTED_FOR_READ_ONLY_DISK ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void clusterNotChanged ( ) { org.ovirt.engine.core.compat.Guid clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( oldHost.getClusterId ( ) ) . thenReturn ( clusterId ) ; org.mockito.Mockito.when ( host.getClusterId ( ) ) . thenReturn ( clusterId ) ; org.junit.Assert.assertThat ( validator.clusterNotChanged ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void clusterNotChanged ( ) { org.ovirt.engine.core.compat.Guid clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( oldHost.getClusterId ( ) ) . thenReturn ( clusterId ) ; org.mockito.Mockito.when ( host.getClusterId ( ) ) . thenReturn ( clusterId ) ; org.hamcrest.MatcherAssert.assertThat ( validator.clusterNotChanged ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void qosValuesModified ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; iface.setQosOverridden ( true ) ; mockExistingIfaces ( iface ) ; iface.setQos ( createQos ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; validateAndAssertNetworkModified ( helper , network ) ; }

Target:
public void customPropertiesModified ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNetworkModified ( helper , network ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; assertInterfaceModified ( helper , iface ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.VDSGroup group ) { org.ovirt.engine.core.compat.Guid id = group.getId ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; group.setId ( id ) ; } getCallsHandler ( ) . executeModification ( "InsertVdsGroups" , getVdsGroupParamSource ( group ) ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.VDSGroup group ) { org.ovirt.engine.core.compat.Guid id = group.getId ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; group.setId ( id ) ; } getCallsHandler ( ) . executeModification ( "InsertVdsGroups" , getVdsGroupParamSource ( group ) ) ; }
Source:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesForVm ( ) { return org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) , true , true , true ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allDisks = new java.util.ArrayList ( getDiskImages ( disks ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( disks , true ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinder : cinderDisks ) { allDisks.add ( org.ovirt.engine.core.bll.ImagesHandler.getSnapshotLeaf ( cinder.getId ( ) ) ) ; } return allDisks ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult canVnicWithExternalNetworkBePlugged ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.PLUGGED_UNLINKED_VM_INTERFACE_WITH_EXTERNAL_NETWORK_IS_NOT_SUPPORTED ) . when ( ( ( ( ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.PLUG ) == ( getRequiredAction ( ) ) ) && ( ! ( nic.isLinked ( ) ) ) ) && ( isVnicAttachedToExternalNetwork ( ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult canVnicWithExternalNetworkBePlugged ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.PLUGGED_UNLINKED_VM_INTERFACE_WITH_EXTERNAL_NETWORK_IS_NOT_SUPPORTED ) . when ( ( ( ( ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.PLUG ) == ( getRequiredAction ( ) ) ) && ( ! ( nic.isLinked ( ) ) ) ) && ( isVnicAttachedToExternalNetwork ( ) ) ) ) ; }
Source:
protected org.ovirt.engine.api.model.Disk postPopulate ( org.ovirt.engine.api.model.Disk model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) . value ( ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskInterface.class ) . value ( ) ) ; model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ) ; model.setLunStorage ( new org.ovirt.engine.api.model.Storage ( ) ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Disk postPopulate ( org.ovirt.engine.api.model.Disk model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) . value ( ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskInterface.class ) . value ( ) ) ; model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ) ; model.setLunStorage ( new org.ovirt.engine.api.model.HostStorage ( ) ) ; return model ; }
Source:
protected org.ovirt.engine.core.compat.Guid getVdsIdInPool ( ) { if ( ( ( vdsInPool ) == null ) && ( ( getVdsGroupId ( ) ) != null ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsInPoolList = org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVdsDAO ( ) . getAllForVdsGroupWithStatus ( getVdsGroupId ( ) , VDSStatus.Up ) ; if ( ! ( vdsInPoolList.isEmpty ( ) ) ) { vdsInPool = vdsInPoolList.get ( 0 ) . getId ( ) ; } } return vdsInPool ; }

Target:
protected org.ovirt.engine.core.compat.Guid getVdsIdInGroup ( ) { if ( ( ( vdsInPool ) == null ) && ( ( org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVdsGroup ( ) ) != null ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsInPoolList = org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVdsDAO ( ) . getAllForVdsGroupWithStatus ( org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVdsGroup ( ) . getId ( ) , VDSStatus.Up ) ; if ( ! ( vdsInPoolList.isEmpty ( ) ) ) { vdsInPool = vdsInPoolList.get ( 0 ) . getId ( ) ; } } return vdsInPool ; }
Source:
public void schedulJobs ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil sched = org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) ; duringFailureJobId = sched.scheduleAFixedDelayJob ( this , "onVdsDuringFailureTimer" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_DURING_FAILURE_TIMEOUT_IN_MINUTES , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_DURING_FAILURE_TIMEOUT_IN_MINUTES , java.util.concurrent.TimeUnit.MINUTES ) ; sched.pauseJob ( duringFailureJobId ) ; _refreshIteration = ( _numberRefreshesBeforeSave ) - 1 ; onTimerJobId = sched.scheduleAFixedDelayJob ( this , "onTimer" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_REFRESH_RATE , org.ovirt.engine.core.vdsbroker.VdsManager.VDS_REFRESH_RATE , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void schedulJobs ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil sched = org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) ; duringFailureJobId = sched.scheduleAFixedDelayJob ( this , "onVdsDuringFailureTimer" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , VDS_DURING_FAILURE_TIMEOUT_IN_MINUTES , VDS_DURING_FAILURE_TIMEOUT_IN_MINUTES , java.util.concurrent.TimeUnit.MINUTES ) ; sched.pauseJob ( duringFailureJobId ) ; _refreshIteration = ( _numberRefreshesBeforeSave ) - 1 ; onTimerJobId = sched.scheduleAFixedDelayJob ( this , "onTimer" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , VDS_REFRESH_RATE , VDS_REFRESH_RATE , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }
Source:
public void testMissingXsrfToken ( ) { mockXsrfRpcRequestBuilder.setXsrfToken ( null ) ; org.ovirt.engine.core.common.queries.VdcQueryParametersBase testParameters = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ; final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.QueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList = new java.util.ArrayList < > ( ) ; final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.QueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > testOperation = new org.ovirt.engine.ui.frontend.communication.VdcOperation ( org.ovirt.engine.core.common.queries.QueryType.Search , testParameters , null ) ; operationList.add ( testOperation ) ; testProvider.transmitOperation ( testOperation ) ; org.mockito.Mockito.verify ( mockXsrfService ) . getNewXsrfToken ( ( ( com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.user.client.rpc.XsrfToken > ) ( org.mockito.ArgumentMatchers.any ( ) ) ) ) ; }

Target:
public void testMissingXsrfToken ( ) { mockXsrfRpcRequestBuilder.setXsrfToken ( null ) ; org.ovirt.engine.core.common.queries.QueryParametersBase testParameters = new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) ; final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.QueryType , org.ovirt.engine.core.common.queries.QueryParametersBase > > operationList = new java.util.ArrayList < > ( ) ; final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.QueryType , org.ovirt.engine.core.common.queries.QueryParametersBase > testOperation = new org.ovirt.engine.ui.frontend.communication.VdcOperation ( org.ovirt.engine.core.common.queries.QueryType.Search , testParameters , null ) ; operationList.add ( testOperation ) ; testProvider.transmitOperation ( testOperation ) ; org.mockito.Mockito.verify ( mockXsrfService ) . getNewXsrfToken ( ( ( com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.user.client.rpc.XsrfToken > ) ( org.mockito.ArgumentMatchers.any ( ) ) ) ) ; }
Source:
protected < T extends org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionWeightPolicyUnit > org.ovirt.engine.core.compat.Guid selectedBestHost ( T unit , org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = unit.score ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) , hosts , vm , null ) ; scores.sort ( java.util.Comparator.comparing ( Pair :: getSecond ) ) ; return scores.get ( 0 ) . getFirst ( ) ; }

Target:
private < T extends org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl > org.ovirt.engine.core.compat.Guid selectedBestHost ( T unit , org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = unit.score ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) , hosts , vm , null ) ; scores.sort ( java.util.Comparator.comparing ( Pair :: getSecond ) ) ; return scores.get ( 0 ) . getFirst ( ) ; }
Source:
protected void initSelectedNetwork ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { getNetwork ( ) . setSelectedItem ( ( ( networks.size ( ) ) > 0 ? networks.get ( 0 ) : null ) ) ; }

Target:
protected void initSelectedNetwork ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { for ( org.ovirt.engine.core.common.businessentities.network.Network network : networks ) { if ( org.ovirt.engine.ui.uicommonweb.models.vms.ENGINE_NETWORK_NAME.equals ( network.getName ( ) ) ) { getNetwork ( ) . setSelectedItem ( network ) ; return ; } } getNetwork ( ) . setSelectedItem ( ( ( networks.size ( ) ) > 0 ? networks.get ( 0 ) : null ) ) ; }
Source:
public org.ovirt.engine.core.common.job.Job getJob ( final org.ovirt.engine.core.compat.Guid jobId ) { return org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < org.ovirt.engine.core.common.job.Job > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.job.Job runInTransaction ( ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { job.getJobSubjectEntities ( ) ; } return job ; } } ) ; }

Target:
public void saveJob ( final org.ovirt.engine.core.common.job.Job job ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { jobDao.save ( job ) ; java.util.Set < java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > > entrySet = job.getJobSubjectEntities ( ) . entrySet ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entry : entrySet ) { jobSubjectEntityDao.save ( job.getId ( ) , entry.getKey ( ) , entry.getValue ( ) ) ; } return null ; } } ) ; }
Source:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.compat.Guid networkId = entity.getId ( ) ; org.ovirt.engine.core.common.businessentities.IscsiBond bond = getBond ( ) ; bond.getNetworkIds ( ) . add ( networkId ) ; return performCreate ( VdcActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( bond ) , new org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworksResource.AddedNetworkResolver ( networkId ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { org.ovirt.engine.api.model.Network entity = org.ovirt.engine.api.restapi.types.NetworkMapper.map ( network , null ) ; org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = getIscsiBond ( ) ; iscsiBond.getNetworkIds ( ) . add ( entity.getId ( ) ) ; return performAction ( VdcActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( iscsiBond ) ) ; }
Source:
public void testNameNotChanged ( ) { prepareVmToPassCanDoAction ( ) ; vm.setName ( "vm1" ) ; mockSameNameQuery ( true ) ; junit.framework.Assert.assertTrue ( "canDoAction should have passed." , command.canDoAction ( ) ) ; }

Target:
public void testValidDedicatedHost ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( group.getId ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertTrue ( "canDoAction should have passed." , command.canDoAction ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.lang.String configuration = getConfigurationFromDb ( org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getParameters ( ) . getSnapshotId ( ) , org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getParameters ( ) . isFiltered ( ) ) ; org.ovirt.engine.core.common.businessentities.VM result = null ; if ( configuration != null ) { result = getVmFromConfiguration ( configuration ) ; markImagesIllegalIfNotInDb ( result ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksForVm ( result , result.getImages ( ) ) ; } org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { java.lang.String configuration = getConfigurationFromDb ( org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getParameters ( ) . getSnapshotId ( ) , org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getParameters ( ) . isFiltered ( ) ) ; org.ovirt.engine.core.common.businessentities.VM result = null ; if ( configuration != null ) { result = getVmFromConfiguration ( configuration ) ; markImagesIllegalIfNotInDb ( result ) ; } else { result = getVmWithoutConfiguration ( ) ; } org.ovirt.engine.core.bll.VmHandler.updateDisksForVm ( result , result.getImages ( ) ) ; org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( getDataCenterWithClustersList ( ) . getSelectedItem ( ) ) ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; }

Target:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; handleQxlClusterLevel ( ) ; updateWatchdogModels ( ) ; }
Source:
public void testValidModifiedBonds_failsWhenBondIsNullOrUnnamed ( ) throws java.lang.Exception { doTestValidModifiedBonds ( null , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST , false , false ) ; }

Target:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) ) ; }