auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testAddSetAndUploadIconFailure ( ) throws java.lang.Exception { control.replay ( ) ; final org.ovirt.engine.api.model.VM model = createModel ( null ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
public void testAddSetAndUploadIconFailure ( ) throws java.lang.Exception { control.replay ( ) ; final org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MaxMemSize64 ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; }

Target:
private void updateDisplayProtocol ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > displayTypes = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDisplayTypes ( osType , cluster.getcompatibility_version ( ) ) ; initDisplayProtocolWithTypes ( displayTypes ) ; }
Source:
public void onSetupNetworks ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNetworkConnectivityCheckTimeoutInSeconds ( new org.ovirt.engine.ui.frontend.AsyncQuery ( sourceListModel , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { getConnectivityTimeout ( ) . setEntity ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; postOnSetupNetworks ( ) ; } } ) ) ; }

Target:
private void initNetworkIdToExistingAttachmentMap ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.Guid > networkIdToExistingAttachmentId = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : hostSetupNetworksParametersData.getNetworkAttachments ( ) ) { networkIdToExistingAttachmentId.put ( attachment.getNetworkId ( ) , attachment.getId ( ) ) ; } hostSetupNetworksParametersData.setNetworkIdToExistingAttachmentId ( networkIdToExistingAttachmentId ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { validateMemorySize ( getMemSize ( ) , ( ( java.lang.Integer ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) , _minMemSize ) ; if ( ! ( ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( model ) ) . getBehavior ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.TemplateVmModelBehavior ) ) { validateMemorySize ( getMinAllocatedMemory ( ) , ( ( java.lang.Integer ) ( getMemSize ( ) . getEntity ( ) ) ) , 1 ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateWatchdogItems ( ( ( java.util.HashSet < org.ovirt.engine.core.common.businessentities.VmWatchdogType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }
Source:
public void qosBaloonSupported ( ) { org.mockito.Mockito.when ( cluster.getcompatibility_version ( ) ) . thenReturn ( Version.v3_3 ) ; org.mockito.Mockito.when ( cluster.isEnableBallooning ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.qosBaloonSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void qosBaloonSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( Version.v3_3 ) ; org.mockito.Mockito.when ( cluster.isEnableBallooning ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.qosBaloonSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void auditLog ( java.util.Map < java.lang.String , java.lang.String > customValues , org.ovirt.engine.core.common.AuditLogType auditLogType ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > customValue : customValues.entrySet ( ) ) { auditLogableBase.addCustomValue ( customValue.getKey ( ) , customValue.getValue ( ) ) ; } getAuditLogDirector ( ) . log ( auditLogableBase , auditLogType ) ; }

Target:
private void auditLog ( java.util.Map < java.lang.String , java.lang.String > customValues , org.ovirt.engine.core.common.AuditLogType auditLogType ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > customValue : customValues.entrySet ( ) ) { logable.addCustomValue ( customValue.getKey ( ) , customValue.getValue ( ) ) ; } getAuditLogDirector ( ) . log ( logable , auditLogType ) ; }
Source:
public static boolean isSessionValid ( java.lang.String session ) { try { javax.naming.InitialContext ctx = null ; try { ctx = new javax.naming.InitialContext ( ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.core.aaa.filters.FiltersHelper.getBackend ( ctx ) . runPublicQuery ( VdcQueryType.ValidateSession , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( session ) ) ; return returnValue.getSucceeded ( ) ; } finally { if ( ctx != null ) { ctx.close ( ) ; } } } catch ( java.lang.Exception ex ) { throw new java.lang.RuntimeException ( ex ) ; } }

Target:
public static boolean isSessionValid ( java.lang.String session ) { try { javax.naming.InitialContext ctx = null ; try { ctx = new javax.naming.InitialContext ( ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.core.aaa.filters.FiltersHelper.getBackend ( ctx ) . runPublicQuery ( QueryType.ValidateSession , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( session ) ) ; return returnValue.getSucceeded ( ) ; } finally { if ( ctx != null ) { ctx.close ( ) ; } } } catch ( java.lang.Exception ex ) { throw new java.lang.RuntimeException ( ex ) ; } }
Source:
public void testGetByIdAll ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = dao.getById ( FixturesTool.HOOK_ID , true ) ; org.junit.Assert.assertNotNull ( hook ) ; org.junit.Assert.assertEquals ( 2 , hook.getServerHooks ( ) . size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.HOOK_ID , hook.getId ( ) ) ; }

Target:
public void testGetByIdAll ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = dao.getById ( FixturesTool.HOOK_ID , true ) ; org.junit.jupiter.api.Assertions.assertNotNull ( hook ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , hook.getServerHooks ( ) . size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.HOOK_ID , hook.getId ( ) ) ; }
Source:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }

Target:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }
Source:
private void initVncKeyboardLayout ( ) { java.util.List < java.lang.String > layouts = ( ( java.util.List < java.lang.String > ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) ) ; java.util.List < java.lang.String > vncKeyboardLayoutItems = new java.util.ArrayList < java.lang.String > ( ) ; vncKeyboardLayoutItems.add ( null ) ; vncKeyboardLayoutItems.addAll ( layouts ) ; getVncKeyboardLayout ( ) . setItems ( vncKeyboardLayoutItems ) ; getVncKeyboardLayout ( ) . setIsChangable ( false ) ; }

Target:
private void initVncKeyboardLayout ( ) { java.util.List < java.lang.String > layouts = ( ( java.util.List < java.lang.String > ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) ) ; java.util.List < java.lang.String > vncKeyboardLayoutItems = new java.util.ArrayList < java.lang.String > ( ) ; vncKeyboardLayoutItems.add ( null ) ; vncKeyboardLayoutItems.addAll ( layouts ) ; getVncKeyboardLayout ( ) . setItems ( vncKeyboardLayoutItems ) ; getVncKeyboardLayout ( ) . setIsChangeable ( false ) ; }
Source:
protected void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.ListModelObjectCellTable < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel > ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; com.google.gwt.user.client.ui.ScrollPanel appPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; appPanel.add ( appTable ) ; subTabLayoutPanel.add ( appPanel , constants.importVmApplicationslSubTabLabel ( ) ) ; }

Target:
protected void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.ListModelObjectCellTable ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; com.google.gwt.user.client.ui.ScrollPanel appPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; appPanel.add ( appTable ) ; subTabLayoutPanel.add ( appPanel , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.constants.importVmApplicationslSubTabLabel ( ) ) ; }
Source:
public org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.VMCustomProperties parseProperties ( org.ovirt.engine.core.compat.Version version , java.lang.String propertiesStr ) { java.util.HashMap < java.lang.String , java.lang.String > userDefinedPropertiesMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; java.util.HashMap < java.lang.String , java.lang.String > predefinedPropertiesMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; convertCustomPropertiesStrToMaps ( version , propertiesStr , predefinedPropertiesMap , userDefinedPropertiesMap ) ; return new org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.VMCustomProperties ( org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.vmPropertiesToString ( predefinedPropertiesMap ) , org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.vmPropertiesToString ( userDefinedPropertiesMap ) ) ; }

Target:
public org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.VMCustomProperties parseProperties ( org.ovirt.engine.core.compat.Version version , java.lang.String propertiesStr ) { java.util.HashMap < java.lang.String , java.lang.String > userDefinedPropertiesMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; java.util.HashMap < java.lang.String , java.lang.String > predefinedPropertiesMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; convertCustomPropertiesStrToMaps ( version , propertiesStr , predefinedPropertiesMap , userDefinedPropertiesMap ) ; return new org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.VMCustomProperties ( org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.vmPropertiesToString ( predefinedPropertiesMap ) , org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.vmPropertiesToString ( userDefinedPropertiesMap ) ) ; }
Source:
public static void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , 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.getInstance ( ) . 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 java.lang.String getDescription ( ) { return ( ( ( ( ( ( "MAC: " + ( mac ) ) + "\n" ) + " | DiscoverTime : " ) + ( lastReport ) ) + "\n" ) + " | Subnet: " ) + ( subnetName ) ; }

Target:
public java.lang.String getDescription ( ) { return ( ( ( ( ( ( ( ( ( "MAC: " + ( mac ) ) + "\n" ) + " | DiscoverTime : " ) + ( lastReport ) ) + "\n" ) + " | Subnet: " ) + ( subnetName ) ) + "\n" ) + " | IP: " ) + ( ip ) ; }
Source:
public java.lang.String load ( java.io.File file ) { try ( java.io.FileInputStream inputStream = new java.io.FileInputStream ( file ) ) { java.util.Properties props = new java.util.Properties ( ) ; props.load ( inputStream ) ; return loadImpl ( props , file ) ; } catch ( java.io.IOException exception ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( java.lang.String.format ( "Can't load object configuration file '%1$s'" , file.getAbsolutePath ( ) ) , exception ) ; } }

Target:
public java.lang.String load ( java.io.File file ) { try ( java.io.FileInputStream inputStream = new java.io.FileInputStream ( file ) ) { java.util.Properties props = new java.util.Properties ( ) ; props.load ( inputStream ) ; return loadImpl ( props , file ) ; } catch ( java.io.IOException exception ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( java.lang.String.format ( "Can't load object configuration file '%1$s': %2$s" , file.getAbsolutePath ( ) , exception.getMessage ( ) ) , exception ) ; } }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDisksByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; control.replay ( ) ; try { resource.update ( getUpdate ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; }
Source:
public void testAddIscsiLunDisk_IncompleteParameters_ConnectionAddress ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . get ( 0 ) . setAddress ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "validateDiskForCreation" , "address" ) ; } }

Target:
public void testAddLunDisk_MissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddLunDisk_MissingId" , "id" ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String fingerprint = ( ( java.lang.String ) ( result ) ) ; if ( ( fingerprint != null ) && ( ( fingerprint.length ( ) ) > 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( ( ( java.lang.String ) ( result ) ) ) ; setIsFingerprintVerified ( true ) ; } else { getGlusterHostFingerprint ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . errorLoadingFingerprint ( ) ) ; setIsFingerprintVerified ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) { getGlusterHostAddress ( ) . setIsChangeable ( true ) ; getGlusterHostPassword ( ) . setIsChangeable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangeable ( false ) ; getGlusterHostPassword ( ) . setIsChangeable ( false ) ; } }
Source:
private void removeNetworkFromHosts ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.bll.context.CommandContext context , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = removeNetworkParametersBuilder.buildParameters ( network , nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( parameters ) ; backend.runInternalMultipleActions ( VdcActionType.PersistentHostSetupNetworks , parameters , context ) ; } }

Target:
private void removeNetworkFromHosts ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.bll.context.CommandContext context , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { java.util.ArrayList < org.ovirt.engine.core.common.action.ActionParametersBase > parameters = removeNetworkParametersBuilder.buildParameters ( network , nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( parameters ) ; backend.runInternalMultipleActions ( ActionType.PersistentHostSetupNetworks , parameters , context ) ; } }
Source:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , getTaskType ( ) , commandStatus ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }

Target:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.updateCommandStatus ( getCommandId ( ) , commandStatus ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } } }
Source:
public void addCustomValueDoesNotHandleNullKeys ( ) { 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 = null ; 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 addCustomValueDoesNotHandleNullKeys ( ) { 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 = null ; 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 ) ; }
Source:
public void cantDowngradeIfMixedTypesNotSupported ( ) { storagePoolVersion35 ( ) ; cmd.getStoragePool ( ) . setCompatibilityVersion ( Version.v3_3 ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sdISCI = createStorageDomain ( StorageFormatType.V3 , StorageType.ISCSI ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sdNFS = createStorageDomain ( StorageFormatType.V3 , StorageType.NFS ) ; setAttachedDomains ( sdISCI , sdNFS ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; }

Target:
public void cantDowngradeIfMixedTypesNotSupported ( ) { storagePoolVersion35 ( ) ; cmd.getStoragePool ( ) . setCompatibilityVersion ( Version.v3_3 ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sdISCI = createStorageDomain ( StorageFormatType.V3 , StorageType.ISCSI ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sdNFS = createStorageDomain ( StorageFormatType.V3 , StorageType.NFS ) ; setAttachedDomains ( sdISCI , sdNFS ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCpuName ( "Intel Conroe" ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; group.setClusterPolicyId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCpuName ( "Intel Conroe" ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; group.setClusterPolicyId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; group.setMaxVdsMemoryOverCommit ( 100 ) ; return group ; }
Source:
public void getIpv6AddressOfNetwork ( ) { nic.setIpv6Address ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.IPV6_ADDRESS ) ; org.junit.Assert.assertThat ( underTest.getIpv6AddressOfNetwork ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.NETWORK_NAME1 ) , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.IPV6_ADDRESS ) ) ; }

Target:
private void assertIpv6Details ( org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration ) { org.junit.Assert.assertThat ( ipConfiguration.getIpV6Addresses ( ) , org.hamcrest.Matchers.hasSize ( 1 ) ) ; final org.ovirt.engine.core.common.businessentities.network.IpV6Address ipv6Address = ipConfiguration.getIpV6Addresses ( ) . get ( 0 ) ; org.junit.Assert.assertThat ( ipv6Address.getAddress ( ) , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.IPV6_ADDRESS ) ) ; org.junit.Assert.assertThat ( ipv6Address.getBootProtocol ( ) , org.hamcrest.Matchers.is ( Ipv6BootProtocol.STATIC_IP ) ) ; org.junit.Assert.assertThat ( ipv6Address.getAddress ( ) , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.IPV6_ADDRESS ) ) ; }
Source:
private static org.ovirt.engine.api.model.IpVersion getIpVersion ( org.ovirt.engine.api.model.IpAddressAssignment ipAddressAssignment ) { if ( ! ( ( ipAddressAssignment.isSetIp ( ) ) && ( ipAddressAssignment.getIp ( ) . isSetVersion ( ) ) ) ) { return null ; } return ipAddressAssignment.getIp ( ) . getVersion ( ) ; }

Target:
private static org.ovirt.engine.api.model.IpVersion getIpVersion ( org.ovirt.engine.api.model.IpAddressAssignment ipAddressAssignment ) { return org.ovirt.engine.api.restapi.types.IpHelper.getVersion ( ipAddressAssignment.getIp ( ) ) ; }
Source:
public void testIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNotNullAndBootProtocolIsStaticAndNetmaskIsNull ( ) throws java.lang.Exception { doTestIpConfiguredForStaticBootProtocol ( "192.168.1.1" , null ) ; }

Target:
public void testNetworkExistWhenBothNetworkNameAndNetworkIdAreSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkName ( "network" ) ; networkAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( networkAttachment ) . networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static boolean verifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority , org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy macPool ) { boolean returnValue = true ; if ( ( macPool.getAvailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.isVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }

Target:
public static boolean verifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getAvailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.isVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }
Source:
public static void GetClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers ) , aQuery ) ; }

Target:
public static void IsUSBEnabledByDefault ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault ) , aQuery ) ; }
Source:
private void revertPreviousHandlers ( ) { getParameters ( ) . decrementExecutionIndex ( ) ; if ( ( getExecutionIndex ( ) ) >= 0 ) { logRollbackedTask ( ) ; getParameters ( ) . setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; getCurrentTaskHandler ( ) . compensate ( ) ; if ( ! ( hasRevertTask ( ) ) ) { revertPreviousHandlers ( ) ; } } }

Target:
private void revertPreviousHandlers ( ) { getParameters ( ) . decrementExecutionIndex ( ) ; if ( hasStepsToRevert ( ) ) { logRollbackedTask ( ) ; getParameters ( ) . setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; getCurrentTaskHandler ( ) . compensate ( ) ; if ( ! ( hasRevertTask ( ) ) ) { revertPreviousHandlers ( ) ; } } else { setSucceeded ( true ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionDelete ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionDelete ( volumeName , remoteHost , remoteVolumeName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStop ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStop ( volumeName , remoteHost , remoteVolumeName , userName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
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.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; 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.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; 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.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }
Source:
private boolean hostEmulationModeMatchesTheConfigValues ( org.ovirt.engine.core.common.businessentities.VDS vds ) { java.lang.String matchedEmulatedMachine = org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > getValue ( ConfigValues.ClusterEmulatedMachines , vds.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) . stream ( ) . filter ( org.ovirt.engine.core.vdsbroker.VirtMonitoringStrategy.getSupportedEmulatedMachinesAsSet ( vds ) :: contains ) . findFirst ( ) . orElse ( null ) ; if ( ( matchedEmulatedMachine != null ) && ( ! ( matchedEmulatedMachine.isEmpty ( ) ) ) ) { setClusterEmulatedMachine ( vds , matchedEmulatedMachine ) ; return true ; } return false ; }

Target:
private boolean hostEmulationModeMatchesTheConfigValues ( org.ovirt.engine.core.common.businessentities.VDS vds ) { java.lang.String matchedEmulatedMachine = org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > getValue ( ConfigValues.ClusterEmulatedMachines , vds.getClusterCompatibilityVersion ( ) . getValue ( ) ) . stream ( ) . filter ( org.ovirt.engine.core.vdsbroker.VirtMonitoringStrategy.getSupportedEmulatedMachinesAsSet ( vds ) :: contains ) . findFirst ( ) . orElse ( null ) ; if ( ( matchedEmulatedMachine != null ) && ( ! ( matchedEmulatedMachine.isEmpty ( ) ) ) ) { setClusterEmulatedMachine ( vds , matchedEmulatedMachine ) ; return true ; } return false ; }
Source:
boolean validateMtu ( java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > nicsToNetworks ) { boolean passed = true ; for ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networksOnNic : nicsToNetworks.values ( ) ) { if ( ! ( networksOnNicMatchMtu ( networksOnNic ) ) ) { reportMtuDifferences ( networksOnNic ) ; passed = false ; } } return passed ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS ) ; }
Source:
private void add ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.datacenters.IscsiBondModel model = new org.ovirt.engine.ui.uicommonweb.models.datacenters.IscsiBondModel ( ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . addIscsiBondTitle ( ) ) ; model.setHashName ( "new_iscsi_bundle" ) ; model.setStoragePool ( getEntity ( ) ) ; setWindow ( model ) ; model.setCancelCommand ( createCancelCommand ( ) ) ; model.initialize ( ) ; }

Target:
private void add ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.datacenters.IscsiBondModel model = new org.ovirt.engine.ui.uicommonweb.models.datacenters.IscsiBondModel ( ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . addIscsiBondTitle ( ) ) ; model.setHelpTag ( HelpTag.new_iscsi_bundle ) ; model.setHashName ( "new_iscsi_bundle" ) ; model.setStoragePool ( getEntity ( ) ) ; setWindow ( model ) ; model.setCancelCommand ( createCancelCommand ( ) ) ; model.initialize ( ) ; }
Source:
public static boolean osNameExists ( java.lang.Integer osId ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.keySet ( ) . contains ( osId ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VmInterfaceType getDefaultNicType ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > items ) { if ( ( items == null ) || ( items.isEmpty ( ) ) ) { return null ; } else if ( items.contains ( VmInterfaceType.pv ) ) { return org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.pv ; } else { return items.iterator ( ) . next ( ) ; } }
Source:
protected org.ovirt.engine.ui.common.widget.AbstractUiCommandButton createCommandButton ( java.lang.String label , java.lang.String uniqueId ) { if ( VmBasedWidgetSwitchModeCommand.NAME.equals ( uniqueId ) ) { return new org.ovirt.engine.ui.common.widget.LeftAlignedUiCommandButton ( label ) ; } return super . createCommandButton ( label , uniqueId ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.AbstractUiCommandButton createCommandButton ( java.lang.String label , java.lang.String uniqueId ) { if ( VmBasedWidgetSwitchModeCommand.NAME.equals ( uniqueId ) ) { org.ovirt.engine.ui.common.widget.LeftAlignedUiCommandButton leftAlignedUiCommandButton = new org.ovirt.engine.ui.common.widget.LeftAlignedUiCommandButton ( label ) ; leftAlignedUiCommandButton.setCustomContentStyle ( style.showAdvancedOptionsButton ( ) ) ; return leftAlignedUiCommandButton ; } return super . createCommandButton ( label , uniqueId ) ; }
Source:
protected org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters param = new org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters ( vmPools , testVm , VM_COUNT , DISK_SIZE ) ; param.setStorageDomainId ( firstStorageDomainId ) ; return org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > ( param ) { @ java.lang.Override protected void initTemplate ( ) { } } ) ; }

Target:
protected org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters param = new org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters ( vmPools , testVm , VM_COUNT , DISK_SIZE ) ; param.setStorageDomainId ( firstStorageDomainId ) ; org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > ( param ) { @ java.lang.Override protected void initTemplate ( ) { } } ) ; command.postConstruct ( ) ; return command ; }
Source:
public void afterUpdates ( ) { getInstanceTypeManager ( ) . activate ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.ENTITY , Schema.Entities.GROUP ) . mput ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.GroupIdentifiers.NAME , args.get ( "group" ) ) . mput ( Schema.SharedKeys.REMOVE_GROUP , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.DELETE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.GroupIdentifiers.NAME , context.get ( ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }
Source:
public static void getGlusterSwiftServices ( 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( p.getVmCount ( ) ) < ( highVdsCountTemp * ( org.ovirt.engine.core.bll.scheduling.VdsSelector.getEffectiveCpuCores ( p ) ) ) ) && ( ( p.getVmCount ( ) ) >= ( lowVdsCountTemp * ( org.ovirt.engine.core.bll.scheduling.VdsSelector.getEffectiveCpuCores ( p ) ) ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( p.getVmCount ( ) ) < ( highVdsCountTemp * ( org.ovirt.engine.core.bll.scheduling.SlaValidator.getEffectiveCpuCores ( p ) ) ) ) && ( ( p.getVmCount ( ) ) >= ( lowVdsCountTemp * ( org.ovirt.engine.core.bll.scheduling.SlaValidator.getEffectiveCpuCores ( p ) ) ) ) ; }
Source:
private static < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < ? > > void updateAllInTransaction ( final java.util.Collection < T > entities , final org.ovirt.engine.core.dao.MassOperationsDao < T > dao ) { if ( ! ( entities.isEmpty ( ) ) ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { dao.updateAll ( entities ) ; return null ; } } ) ; } }

Target:
private static < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < ? > > void updateAllInTransaction ( final java.lang.String procedureName , final java.util.Collection < T > entities , final org.ovirt.engine.core.dao.MassOperationsDao < T > dao ) { if ( ! ( entities.isEmpty ( ) ) ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { dao.updateAll ( procedureName , entities ) ; return null ; } } ) ; } }
Source:
public void setIsDatacenterAvailable ( java.lang.Boolean value ) { if ( ( ( isDatacenterAvailable ) == null ) && ( value == null ) ) { return ; } if ( ( ( isDatacenterAvailable ) == null ) || ( ! ( isDatacenterAvailable.equals ( value ) ) ) ) { isDatacenterAvailable = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsDatacenterAvailable" ) ) ; } }

Target:
public void setIsDatacenterAvailable ( java.lang.Boolean value ) { if ( ( ( isDatacenterAvailable ) == null ) && ( value == null ) ) { return ; } if ( ( ( isDatacenterAvailable ) == null ) || ( ! ( isDatacenterAvailable.equals ( value ) ) ) ) { isDatacenterAvailable = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsDatacenterAvailable" ) ) ; } }