auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addDiskImage ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) , vmId ) ; }

Target:
public void addDiskToVmIfNotExists ( org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk , org.ovirt.engine.core.compat.Guid vmId ) { if ( ! ( baseDiskDao.exists ( disk.getId ( ) ) ) ) { addDiskToVm ( disk , vmId ) ; } }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Permit permit ) { validateParameters ( permit , "name|id" ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > actionGroups = new java.util.ArrayList < > ( ) ; addIfNotExists ( actionGroups , map ( permit ) ) ; return performCreate ( VdcActionType.AttachActionGroupsToRole , new org.ovirt.engine.core.common.action.ActionGroupsToRoleParameter ( roleId , actionGroups ) , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource.PermitIdResolver ( actionGroups.get ( 0 ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Permit permit ) { validateParameters ( permit , "name|id" ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > actionGroups = new java.util.ArrayList < > ( ) ; addIfNotExists ( actionGroups , map ( permit ) ) ; return performCreate ( ActionType.AttachActionGroupsToRole , new org.ovirt.engine.core.common.action.ActionGroupsToRoleParameter ( roleId , actionGroups ) , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource.PermitIdResolver ( actionGroups.get ( 0 ) ) ) ; }
Source:
public void remove ( org.ovirt.engine.core.compat.Guid commandId ) { commandMap.remove ( commandId ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . remove ( commandId ) ; }

Target:
public void remove ( final org.ovirt.engine.core.compat.Guid commandId ) { commandMap.remove ( commandId ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . remove ( commandId ) ; return null ; } } ) ; }
Source:
public static com.google.gwt.safehtml.shared.SafeHtml getTooltip ( java.util.Map < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imagesToText ) { java.lang.String tooltip = "" ; for ( java.util.Map.Entry < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imageToText : imagesToText.entrySet ( ) ) { if ( ! ( tooltip.isEmpty ( ) ) ) { tooltip = tooltip.concat ( org.ovirt.engine.ui.webadmin.widget.table.column.MultiImageColumnHelper.constants.lineBreak ( ) ) ; } tooltip = tooltip.concat ( org.ovirt.engine.ui.webadmin.widget.table.column.MultiImageColumnHelper.templates.imageTextSetupNetwork ( imageToText.getKey ( ) , imageToText.getValue ( ) ) . asString ( ) ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( tooltip ) ; }

Target:
public static com.google.gwt.safehtml.shared.SafeHtml getTooltip ( java.util.Map < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imagesToText ) { java.lang.String tooltip = "" ; for ( java.util.Map.Entry < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imageToText : imagesToText.entrySet ( ) ) { if ( ! ( tooltip.isEmpty ( ) ) ) { tooltip = tooltip.concat ( org.ovirt.engine.ui.webadmin.widget.table.column.MultiImageColumnHelper.constants.lineBreak ( ) ) ; } tooltip = tooltip.concat ( org.ovirt.engine.ui.webadmin.widget.table.column.MultiImageColumnHelper.templates.imageWithText ( imageToText.getKey ( ) , imageToText.getValue ( ) ) . asString ( ) ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( tooltip ) ; }
Source:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel tagListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnVal = result.getReturnValue ( ) ; boolean success = ( returnVal != null ) && ( returnVal.getSucceeded ( ) ) ; if ( success ) { tagListModel.getSearchCommand ( ) . Execute ( ) ; } tagListModel.Cancel ( ) ; tagListModel.StopProgress ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel tagListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnVal = result.getReturnValue ( ) ; boolean success = ( returnVal != null ) && ( returnVal.getSucceeded ( ) ) ; if ( success ) { tagListModel.getSearchCommand ( ) . execute ( ) ; } tagListModel.cancel ( ) ; tagListModel.stopProgress ( ) ; }
Source:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmTemplateDAO ( ) ) . thenReturn ( vmTemplateDAO ) ; returnedVmTemplates = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getQuotaId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( vmTemplateDAO.getAllTemplatesRelatedToQuotaId ( quotaId ) ) . thenReturn ( returnedVmTemplates ) ; }

Target:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmTemplateDao ( ) ) . thenReturn ( vmTemplateDAO ) ; returnedVmTemplates = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getQuotaId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( vmTemplateDAO.getAllTemplatesRelatedToQuotaId ( quotaId ) ) . thenReturn ( returnedVmTemplates ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( ( ( ( "CREATIONDATE" . equals ( fieldName ) ) || ( "SIZE" . equals ( fieldName ) ) ) || ( "ACTUAL_SIZE" . equals ( fieldName ) ) ) || ( "PROVISIONED_SIZE" . equals ( fieldName ) ) ) { return BiggerOrSmallerRelationAutoCompleter.INSTANCE ; } else if ( "NUMBER_OF_VMS" . equals ( fieldName ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }

Target:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( ( ( ( "CREATION_DATE" . equals ( fieldName ) ) || ( "SIZE" . equals ( fieldName ) ) ) || ( "ACTUAL_SIZE" . equals ( fieldName ) ) ) || ( "PROVISIONED_SIZE" . equals ( fieldName ) ) ) { return BiggerOrSmallerRelationAutoCompleter.INSTANCE ; } else if ( "NUMBER_OF_VMS" . equals ( fieldName ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.bll.utils.VmOverheadCalculator vmOverheadCalculator ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( vmOverheadCalculator.getSnapshotMemorySizeInBytes ( vm ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setVolumeFormat ( VolumeFormat.RAW ) ; image.setContentType ( DiskContentType.MEMORY_DUMP_VOLUME ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.bll.utils.VmOverheadCalculator vmOverheadCalculator , java.lang.String diskDescription ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( vmOverheadCalculator.getSnapshotMemorySizeInBytes ( vm ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setVolumeFormat ( VolumeFormat.RAW ) ; image.setContentType ( DiskContentType.MEMORY_DUMP_VOLUME ) ; image.setDiskDescription ( diskDescription ) ; return image ; }
Source:
public void shouldNotTryToMigrateWhenNotSchedulable ( ) { org.mockito.Mockito.when ( schedulingManager.canSchedule ( org.mockito.Matchers.eq ( vdsGroup ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) , org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.anyList ( ) ) ) . thenReturn ( false ) ; affinityGroups.add ( createAffinityGroup ( vdsGroup , true , vm1 , vm2 , vm4 ) ) ; org.junit.Assert.assertNull ( enforcer.chooseNextVmToMigrate ( vdsGroup ) ) ; }

Target:
public void shouldNotTryToMigrateWhenNotSchedulable ( ) { org.mockito.Mockito.when ( schedulingManager.canSchedule ( org.mockito.Matchers.eq ( vdsGroup ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) , org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.anyList ( ) ) ) . thenReturn ( false ) ; affinityGroups.add ( createAffinityGroup ( vdsGroup , true , vm1 , vm2 , vm4 ) ) ; org.assertj.core.api.Assertions.assertThat ( enforcer.chooseNextVmToMigrate ( vdsGroup ) ) . isNull ( ) ; }
Source:
public void attestationServerConfigured ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void mixedClusterServicesNotSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , false ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ) ; }
Source:
protected org.ovirt.engine.core.common.errors.EngineError getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc xmlRpcStatus ) { try { org.ovirt.engine.core.common.errors.EngineError bllErrors = org.ovirt.engine.core.common.errors.EngineError.forValue ( xmlRpcStatus.mCode ) ; if ( bllErrors == null ) { log.warn ( "Unexpected return value: {}" , xmlRpcStatus ) ; bllErrors = org.ovirt.engine.core.common.errors.EngineError.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.EngineError.unexpected ; } }

Target:
protected org.ovirt.engine.core.common.errors.EngineError getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc xmlRpcStatus ) { try { org.ovirt.engine.core.common.errors.EngineError bllErrors = org.ovirt.engine.core.common.errors.EngineError.forValue ( xmlRpcStatus.code ) ; if ( bllErrors == null ) { log.warn ( "Unexpected return value: {}" , xmlRpcStatus ) ; bllErrors = org.ovirt.engine.core.common.errors.EngineError.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.EngineError.unexpected ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.network.cluster.DetachNetworkFromClusterInternalCommand < T > . DetachNetworkValidator validator = new DetachNetworkValidator ( getNetwork ( ) , org.ovirt.engine.core.bll.network.cluster.DetachNetworkFromClusterInternalCommand.getParameters ( ) . getNetworkCluster ( ) ) ; return ( ( ( validate ( validator.notManagementNetwork ( ) ) ) && ( validate ( validator.clusterNetworkNotUsedByVms ( ) ) ) ) && ( validate ( validator.clusterNetworkNotUsedByTemplates ( ) ) ) ) && ( validate ( validator.clusterNetworkNotUsedByBricks ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.network.cluster.DetachNetworkFromClusterInternalCommand < T > . DetachNetworkValidator validator = new DetachNetworkValidator ( vmDao , getNetwork ( ) , org.ovirt.engine.core.bll.network.cluster.DetachNetworkFromClusterInternalCommand.getParameters ( ) . getNetworkCluster ( ) ) ; return ( ( ( validate ( validator.notManagementNetwork ( ) ) ) && ( validate ( validator.clusterNetworkNotUsedByVms ( ) ) ) ) && ( validate ( validator.clusterNetworkNotUsedByTemplates ( ) ) ) ) && ( validate ( validator.clusterNetworkNotUsedByBricks ( ) ) ) ; }
Source:
public void onFailureAlertShown ( ) { mockExecutor ( false ) ; try { command.executeCommand ( ) ; org.junit.jupiter.api.Assertions.fail ( ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException ex ) { org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 3 ) ) . log ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; } }

Target:
public void onFailureAlertShown ( ) { mockExecutor ( false ) ; org.junit.jupiter.api.Assertions.assertThrows ( org.ovirt.engine.core.common.errors.EngineException.class , command :: executeCommand ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 3 ) ) . log ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected java.lang.String idToHref ( java.lang.String id ) { org.ovirt.engine.api.model.HostNIC master = new org.ovirt.engine.api.model.HostNIC ( ) ; master.setId ( id ) ; master.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; master.getHost ( ) . setId ( hostId ) ; return org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , master ) . getHref ( ) ; }

Target:
protected java.lang.String idToHref ( java.lang.String id ) { org.ovirt.engine.api.model.HostNic master = new org.ovirt.engine.api.model.HostNic ( ) ; master.setId ( id ) ; master.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; master.getHost ( ) . setId ( hostId ) ; return org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , master ) . getHref ( ) ; }
Source:
public void testListCrash ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } }

Target:
public void testListCrash ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; }
Source:
public void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public static int maxMemorySizeWithHotplugInMb ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; if ( osRepository.get64bitOss ( ) . contains ( vm.getOs ( ) ) ) { org.ovirt.engine.core.common.config.ConfigValues config = ( ( vm.getClusterArch ( ) ) == ( org.ovirt.engine.core.common.businessentities.ArchitectureType.ppc64 ) ) ? org.ovirt.engine.core.common.config.ConfigValues.VMPpc64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.config.ConfigValues.VM64BitMaxMemorySizeInMB ; return org.ovirt.engine.core.common.config.Config.getValue ( config , vm.getCompatibilityVersion ( ) . getValue ( ) ) ; } return org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.VM32BitMaxMemorySizeInMB ) ; }

Target:
public static int maxMemorySizeWithHotplugInMb ( int osId , org.ovirt.engine.core.compat.Version compatibilityVersion ) { final org.ovirt.engine.core.common.config.ConfigValues configValue = org.ovirt.engine.core.common.utils.VmCommonUtils.getMaxMemConfigValueByOsId ( osId ) ; return compatibilityVersion != null ? org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( configValue , compatibilityVersion.getValue ( ) ) : org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( configValue ) ; }
Source:
private static void logField ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromOvf , java.lang.String fieldName , java.lang.String fieldValue ) { java.lang.String vmName = vmStaticFromOvf.getName ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "FieldName" , fieldName ) ; logable.addCustomValue ( "VmName" , vmName ) ; logable.addCustomValue ( "FieldValue" , fieldValue ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_IMPORT_INFO ) ; }

Target:
private void logField ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromOvf , java.lang.String fieldName , java.lang.String fieldValue ) { java.lang.String vmName = vmStaticFromOvf.getName ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "FieldName" , fieldName ) ; logable.addCustomValue ( "VmName" , vmName ) ; logable.addCustomValue ( "FieldValue" , fieldValue ) ; auditLogDirector.log ( logable , AuditLogType.VM_IMPORT_INFO ) ; }
Source:
public void customValue ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , v ) ; }

Target:
public void appendCustomValue ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String sep = "_" ; b.appendCustomValue ( key , value , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , s ) ; }
Source:
protected void populateTabMap ( ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.GENERAL_TAB , this . generalTab ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.CLUSTERS_TAB , this . clusterTab ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.PROFILES_TAB , this . profilesTab ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.SUBNET_TAB , this . subnetTab ) ; }

Target:
protected void populateTabMap ( ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.GENERAL_TAB , this . generalTab.getTabListItem ( ) ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.CLUSTERS_TAB , this . clusterTab.getTabListItem ( ) ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.PROFILES_TAB , this . profilesTab.getTabListItem ( ) ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.SUBNET_TAB , this . subnetTab.getTabListItem ( ) ) ; }
Source:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public static void GetTimeZoneList ( 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.HashMap < java.lang.String , java.lang.String > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setWindowsOS ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( aQuery.getModel ( ) ) ) . getModel ( ) . getIsWindowsOS ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTimeZones , params , aQuery ) ; }

Target:
public static void getTimeZoneList ( 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.HashMap < java.lang.String , java.lang.String > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setWindowsOS ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( aQuery.getModel ( ) ) ) . getModel ( ) . getIsWindowsOS ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTimeZones , params , aQuery ) ; }
Source:
private void RunVMOnSpecificHost_EntityChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getRunVMOnSpecificHost ( ) . getEntity ( ) ) ) == true ) { getDontMigrateVM ( ) . setEntity ( false ) ; getDontMigrateVM ( ) . setIsChangable ( false ) ; } else { getDontMigrateVM ( ) . setIsChangable ( true ) ; } }

Target:
private void RunVMOnSpecificHost_EntityChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getRunVMOnSpecificHost ( ) . getEntity ( ) ) ) == true ) { clearAndDisable ( getDontMigrateVM ( ) ) ; getHostCpu ( ) . setIsChangable ( true ) ; } else { clearAndDisable ( getHostCpu ( ) ) ; getDontMigrateVM ( ) . setIsChangable ( true ) ; } }
Source:
private void setupSelectionContext ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel model : cachedConsoleModels.get ( vm.getId ( ) ) ) { org.ovirt.engine.core.common.businessentities.DisplayType vmDisplay = ( vm.isRunningOrPaused ( ) ) ? vm.getDisplayType ( ) : vm.getDefaultDisplayType ( ) ; model.setSelectionContext ( new org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext ( vm.getVmOs ( ) , vmDisplay ) ) ; } }

Target:
private void setupSelectionContext ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel model : cachedConsoleModels.get ( vm.getId ( ) ) ) { org.ovirt.engine.core.common.businessentities.DisplayType vmDisplay = ( vm.isRunningOrPaused ( ) ) ? vm.getDisplayType ( ) : vm.getDefaultDisplayType ( ) ; model.setSelectionContext ( new org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext ( vm.getVmOsId ( ) , vmDisplay ) ) ; } }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.Permissions o1 , org.ovirt.engine.core.common.businessentities.Permissions o2 ) { if ( getValue ( o1 ) . equals ( getValue ( o2 ) ) ) { return 0 ; } else { return getCommonResources ( ) . userImage ( ) . equals ( getValue ( o1 ) ) ? - 1 : 1 ; } }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.Permission o1 , org.ovirt.engine.core.common.businessentities.Permission o2 ) { if ( getValue ( o1 ) . equals ( getValue ( o2 ) ) ) { return 0 ; } else { return getCommonResources ( ) . userImage ( ) . equals ( getValue ( o1 ) ) ? - 1 : 1 ; } }
Source:
private void setModelList ( final org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel providerGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.providers.ProviderNetworkListModel providerNetworkListModel , final org.ovirt.engine.ui.uicommonweb.models.providers.ProviderSecretListModel providerSecretListModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.HasEntity < org.ovirt.engine.core.common.businessentities.Provider > > list = new java.util.ArrayList < > ( ) ; list.add ( providerGeneralModel ) ; list.add ( providerNetworkListModel ) ; list.add ( providerSecretListModel ) ; setDetailModels ( list ) ; }

Target:
private void setModelList ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.HasEntity < org.ovirt.engine.core.common.businessentities.Provider > > list = new java.util.ArrayList < > ( ) ; list.add ( generalModel ) ; list.add ( networkListModel ) ; list.add ( secretListModel ) ; setDetailModels ( list ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3Hosts list ( ) { return adaptList ( getDelegate ( ) :: list ) ; }

Target:
public org.ovirt.engine.api.v3.types.V3Hosts list ( @ javax.ws.rs.core.Context javax.ws.rs.core.HttpHeaders headers , @ javax.ws.rs.core.Context javax.ws.rs.core.UriInfo ui ) { org.ovirt.engine.api.v3.types.V3Hosts hosts = adaptList ( getDelegate ( ) :: list ) ; java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( headers , ui ) ; if ( details.contains ( "statistics" ) ) { hosts.getHosts ( ) . forEach ( V3HostHelper :: addStatistics ) ; } return hosts ; }
Source:
public void testGetAllByImageId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > result = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap mapping : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , mapping.getImageId ( ) ) ; } }

Target:
public void testGetAllByImageId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > result = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap mapping : result ) { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , mapping.getImageId ( ) ) ; } }
Source:
public void writeEndDocument ( ) { try { writer.writeEndDocument ( ) ; } catch ( javax.xml.stream.XMLStreamException exception ) { throw new org.ovirt.api.metamodel.tool.XmlWriterException ( "Can't write end of document" , exception ) ; } }

Target:
private void init ( javax.xml.transform.Result result , boolean indent ) { try { javax.xml.stream.XMLOutputFactory factory = javax.xml.stream.XMLOutputFactory.newFactory ( ) ; writer = factory.createXMLStreamWriter ( result ) ; if ( indent ) { com.sun.xml.txw2.output.IndentingXMLStreamWriter indenter = new com.sun.xml.txw2.output.IndentingXMLStreamWriter ( writer ) ; indenter.setIndentStep ( " " ) ; writer = indenter ; } } catch ( javax.xml.stream.XMLStreamException exception ) { throw new org.ovirt.api.metamodel.runtime.xml.XmlException ( "Can't create XML writer" , exception ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterSnapshotConfigSet ( java.lang.String configName , java.lang.String configValue ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configSet" ) . withParameter ( "option" , configName ) . withParameter ( "value" , configValue ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterSnapshotConfigSet ( java.lang.String configName , java.lang.String configValue ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configSet" ) . withParameter ( "optionName" , configName ) . withParameter ( "optionValue" , configValue ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
private static void toStringBuilder ( java.lang.Iterable xmlRpc , java.lang.StringBuilder builder ) { if ( xmlRpc == null ) { return ; } for ( java.lang.Object value : xmlRpc ) { if ( value instanceof java.lang.Iterable ) { org.ovirt.engine.core.vdsbroker.ObjectDescriptor.toStringBuilder ( ( ( java.lang.Iterable ) ( value ) ) , builder ) ; } else { builder.append ( value.toString ( ) ) ; builder.append ( "\n" ) ; } } }

Target:
private static void toStringBuilder ( java.lang.Iterable iterable , java.lang.StringBuilder builder ) { if ( iterable == null ) { return ; } for ( java.lang.Object value : iterable ) { if ( value instanceof java.lang.Iterable ) { org.ovirt.engine.core.vdsbroker.ObjectDescriptor.toStringBuilder ( ( ( java.lang.Iterable ) ( value ) ) , builder ) ; } else { builder.append ( value.toString ( ) ) ; builder.append ( "\n" ) ; } } }
Source:
protected void addStoragePermissionByQuotaMode ( java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permsList , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid StorageDomainId ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool = null ; if ( storagePoolId != null ) { storagePool = org.ovirt.engine.core.bll.CommandBase.getStoragePoolDAO ( ) . get ( storagePoolId ) ; if ( storagePool != null ) { if ( ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) || ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT ) ) ) { permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( StorageDomainId , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; } } } }

Target:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , getParentParameters ( parentCommand ) , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }
Source:
private boolean bondWasModified ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingIface = getExistingIfaces ( ) . get ( iface.getName ( ) ) ; if ( existingIface == null ) { return true ; } return ! ( org.apache.commons.lang.ObjectUtils.equals ( iface.getBondOptions ( ) , existingIface.getBondOptions ( ) ) ) ; }

Target:
private boolean bondWasModified ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingIface = getExistingIfaces ( ) . get ( iface.getName ( ) ) ; if ( existingIface == null ) { return true ; } return ! ( java.util.Objects.equals ( iface.getBondOptions ( ) , existingIface.getBondOptions ( ) ) ) ; }
Source:
protected void perform ( ) { switch ( getFlow ( ) ) { case RESUME_PAUSE : resumeVm ( ) ; break ; case REMOVE_STATELESS_IMAGES : removeStatlessSnapsoht ( ) ; break ; case CREATE_STATELESS_IMAGES : createStatelessSnapshot ( ) ; break ; case RESUME_HIBERNATE : case RUN : default : runVm ( ) ; } }

Target:
protected void perform ( ) { switch ( getFlow ( ) ) { case RESUME_PAUSE : resumeVm ( ) ; break ; case REMOVE_STATELESS_IMAGES : removeStatlessSnapshot ( ) ; break ; case CREATE_STATELESS_IMAGES : createStatelessSnapshot ( ) ; break ; case RESUME_HIBERNATE : case RUN : default : runVm ( ) ; } }
Source:
protected R linkSubResource ( R model , java.lang.String subResource , java.lang.String oid ) { addOrUpdateLink ( model , subResource , org.ovirt.engine.api.restapi.util.LinkHelper.getUriBuilder ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource.getUriInfo ( ) , model ) . path ( subResource ) . path ( oid ) . build ( ) . toString ( ) ) ; return model ; }

Target:
protected R linkSubResource ( R model , java.lang.String subResource , java.lang.String oid ) { java.lang.String href = java.lang.String.join ( "/" , org.ovirt.engine.api.restapi.util.LinkHelper.getPath ( model ) , oid , subResource ) ; addOrUpdateLink ( model , subResource , href ) ; return model ; }
Source:
private static void logNullParameters ( org.ovirt.engine.core.common.businessentities.AsyncTasks task ) { if ( ( task.getaction_parameters ( ) ) == null ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "Null action_parameters:\n" ) ; java.lang.StackTraceElement [ ] st = java.lang.Thread.currentThread ( ) . getStackTrace ( ) ; for ( java.lang.StackTraceElement element : st ) { sb.append ( java.lang.String.format ( "\tMethod: %1$s\n" , element.getMethodName ( ) ) ) ; } org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.log.error ( sb.toString ( ) ) ; } }

Target:
private static void logNullParameters ( org.ovirt.engine.core.common.businessentities.AsyncTasks task ) { if ( ( task.getaction_parameters ( ) ) == null ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "Null action_parameters:\n" ) ; java.lang.StackTraceElement [ ] st = java.lang.Thread.currentThread ( ) . getStackTrace ( ) ; for ( java.lang.StackTraceElement element : st ) { sb.append ( java.lang.String.format ( "\tMethod: %1$s%n" , element.getMethodName ( ) ) ) ; } org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.log.error ( sb.toString ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotSchedule fetchedSchedule = getGlusterVolumeSnapshotScheduleDao ( ) . getByVolumeId ( getGlusterVolumeId ( ) ) ; if ( fetchedSchedule == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_NOT_SCHEDULED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotSchedule fetchedSchedule = getGlusterVolumeSnapshotScheduleDao ( ) . getByVolumeId ( getGlusterVolumeId ( ) ) ; if ( fetchedSchedule == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_NOT_SCHEDULED ) ; } return true ; }
Source:
private java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > getStorageToDiskMap ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > storageToDisksMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getSourceImages ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( disk.getStorageIds ( ) . get ( 0 ) , disk , storageToDisksMap ) ; } return storageToDisksMap ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getSnapshotsDummiesForStorageAllocations ( ) { return org.ovirt.engine.core.bll.ImagesHandler.getSnapshotsDummiesForStorageAllocations ( getSourceImages ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.SetupNetworksParameters createSetupNetworksParameters ( org.ovirt.engine.core.compat.Guid hostId ) { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( hostId ) ; org.ovirt.engine.core.bll.network.NetworkConfigurator configurator = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( host ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = configurator.filterBondsWithoutSlaves ( getHostInterfaces ( hostId ) ) ; return configurator.createSetupNetworkParams ( nics ) ; }

Target:
protected org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters createSetupNetworksParameters ( org.ovirt.engine.core.compat.Guid hostId ) { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( hostId ) ; org.ovirt.engine.core.bll.network.NetworkConfigurator configurator = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( host ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = configurator.filterBondsWithoutSlaves ( getHostInterfaces ( hostId ) ) ; org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters ( ) ; parameters.setVdsId ( host.getId ( ) ) ; parameters.setInterfaces ( nics ) ; parameters.setCheckConnectivity ( true ) ; return parameters ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForDisplayNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( getNetworkCluster ( ) . isDisplay ( ) ) && ( ( ( ipConfiguration == null ) || ( ! ( ipConfiguration.hasPrimaryAddressSet ( ) ) ) ) || ( ( ipConfiguration.getPrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , getNetwork ( ) . getName ( ) ) ) . when ( failWhen ) ; }

Target:
protected boolean isRoleNetwork ( ) { return ( ( getNetworkCluster ( ) . isDisplay ( ) ) || ( getNetworkCluster ( ) . isMigration ( ) ) ) || ( getNetworkCluster ( ) . isGluster ( ) ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue runUpdateMomPolicy ( final org.ovirt.engine.core.common.businessentities.VDSGroup cluster , final org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; if ( ( cluster.getcompatibility_version ( ) . compareTo ( Version.v3_3 ) ) >= 0 ) { try { returnValue = runVdsCommand ( VDSCommandType.SetMOMPolicyParameters , new org.ovirt.engine.core.common.vdscommands.MomPolicyVDSParameters ( vds , cluster.isEnableBallooning ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.errorFormat ( "Could not update MoM policy on host {0}" , vds.getName ( ) ) ; returnValue.setSucceeded ( false ) ; } } return returnValue ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue runUpdateMomPolicy ( final org.ovirt.engine.core.common.businessentities.VDSGroup cluster , final org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; if ( ( cluster.getcompatibility_version ( ) . compareTo ( Version.v3_3 ) ) >= 0 ) { try { returnValue = runVdsCommand ( VDSCommandType.SetMOMPolicyParameters , new org.ovirt.engine.core.common.vdscommands.MomPolicyVDSParameters ( vds , cluster.isEnableBallooning ( ) , cluster.isEnableKsm ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.errorFormat ( "Could not update MoM policy on host {0}" , vds.getName ( ) ) ; returnValue.setSucceeded ( false ) ; } } return returnValue ; }