auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage_domains sp ) { switch ( sp.getstatus ( ) ) { case Unattached : return getApplicationResources ( ) . tornChainImage ( ) ; case Active : return getApplicationResources ( ) . upImage ( ) ; case InActive : return getApplicationResources ( ) . downImage ( ) ; case Uninitialized : return getApplicationResources ( ) . unconfiguredImage ( ) ; case Locked : return getApplicationResources ( ) . lockImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage_domains sp ) { setEnumTitle ( sp.getstatus ( ) ) ; switch ( sp.getstatus ( ) ) { case Unattached : return getApplicationResources ( ) . tornChainImage ( ) ; case Active : return getApplicationResources ( ) . upImage ( ) ; case InActive : return getApplicationResources ( ) . downImage ( ) ; case Uninitialized : return getApplicationResources ( ) . unconfiguredImage ( ) ; case Locked : return getApplicationResources ( ) . lockImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }
Source:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }

Target:
public void testCleanExpiredUsersSessionsWithUsers ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( org.ovirt.engine.ui.uicommonweb.models.EntityModel.EntityChangedEventDefinition ) ) { onEntityChanged ( ) ; } else if ( ev.matchesDefinition ( ProvidePropertyChangedEvent.Definition ) ) { entityPropertyChanged ( sender , ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( org.ovirt.engine.ui.uicommonweb.models.EntityModel.entityChangedEventDefinition ) ) { onEntityChanged ( ) ; } else if ( ev.matchesDefinition ( ProvidePropertyChangedEvent.Definition ) ) { entityPropertyChanged ( sender , ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ) ; } }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( ( compatibilityVersion ) == null ? 0 : compatibilityVersion.hashCode ( ) ) ; result = ( prime * result ) + ( ( storagePoolName ) == null ? 0 : storagePoolName.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( ( getCompatibilityVersion ( ) ) == null ? 0 : getCompatibilityVersion ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getStoragePoolName ( ) ) == null ? 0 : getStoragePoolName ( ) . hashCode ( ) ) ; return result ; }
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 ( "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 ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn 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.StatusOnlyReturn ( response ) ; }
Source:
public void canDisableVirtioScsiFail ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( disk.getId ( ) , vm.getId ( ) ) ; dve.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; disk.setDiskVmElements ( java.util.Collections.singletonList ( dve ) ) ; org.junit.Assert.assertThat ( validator.canDisableVirtioScsi ( java.util.Collections.singletonList ( disk ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ) ; }

Target:
public void canDisableVirtioScsiFail ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( disk.getId ( ) , vm.getId ( ) ) ; dve.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; disk.setDiskVmElements ( java.util.Collections.singletonList ( dve ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.canDisableVirtioScsi ( java.util.Collections.singletonList ( disk ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ) ; }
Source:
public void testGetAllClusterSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( "Cluster:" , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( vdsGroupResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllMultiVdsSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Hosts" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( vdsResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }
Source:
public static org.ovirt.engine.api.model.CdRom map ( org.ovirt.engine.core.common.businessentities.VmTemplate entity , org.ovirt.engine.api.model.CdRom template ) { org.ovirt.engine.api.model.CdRom model = ( template != null ) ? template : new org.ovirt.engine.api.model.CdRom ( ) ; model.setId ( org.ovirt.engine.api.restapi.types.CdRomMapper.CDROM_ID.toString ( ) ) ; if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getIsoPath ( ) ) ) ) { model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; model.getFile ( ) . setId ( entity.getIsoPath ( ) ) ; } return model ; }

Target:
public static org.ovirt.engine.api.model.Cdrom map ( org.ovirt.engine.core.common.businessentities.VmTemplate entity , org.ovirt.engine.api.model.Cdrom template ) { org.ovirt.engine.api.model.Cdrom model = ( template != null ) ? template : new org.ovirt.engine.api.model.Cdrom ( ) ; model.setId ( org.ovirt.engine.api.restapi.types.CdRomMapper.CDROM_ID.toString ( ) ) ; if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getIsoPath ( ) ) ) ) { model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; model.getFile ( ) . setId ( entity.getIsoPath ( ) ) ; } return model ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > getStepMessageMap ( org.ovirt.engine.core.common.job.JobExecutionStatus status , java.lang.String jobInfo ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < > ( ) ; values.put ( GlusterConstants.CLUSTER , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getVdsGroupName ( ) ) ; values.put ( GlusterConstants.VOLUME , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getGlusterVolumeName ( ) ) ; values.put ( GlusterConstants.JOB_STATUS , status.toString ( ) ) ; values.put ( GlusterConstants.JOB_INFO , ( jobInfo == null ? " " : jobInfo ) ) ; return values ; }

Target:
protected java.util.Map < java.lang.String , java.lang.String > getStepMessageMap ( org.ovirt.engine.core.common.job.JobExecutionStatus status , java.lang.String jobInfo ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < > ( ) ; values.put ( GlusterConstants.CLUSTER , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getClusterName ( ) ) ; values.put ( GlusterConstants.VOLUME , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getGlusterVolumeName ( ) ) ; values.put ( GlusterConstants.JOB_STATUS , status.toString ( ) ) ; values.put ( GlusterConstants.JOB_INFO , ( jobInfo == null ? " " : jobInfo ) ) ; return values ; }
Source:
public javax.ws.rs.core.Response doClone ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "vm.name" ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , ( "VM: id=" + ( guid ) ) ) ; org.ovirt.engine.core.common.action.CloneVmParameters cloneVmParameters = new org.ovirt.engine.core.common.action.CloneVmParameters ( vm , action.getVm ( ) . getName ( ) ) ; cloneVmParameters.setMakeCreatorExplicitOwner ( isFiltered ( ) ) ; javax.ws.rs.core.Response response = doAction ( ActionType.CloneVm , cloneVmParameters , action ) ; return response ; }

Target:
public javax.ws.rs.core.Response doClone ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "vm.name" ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , QueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , ( "VM: id=" + ( guid ) ) ) ; org.ovirt.engine.core.common.action.CloneVmParameters cloneVmParameters = new org.ovirt.engine.core.common.action.CloneVmParameters ( vm , action.getVm ( ) . getName ( ) ) ; cloneVmParameters.setMakeCreatorExplicitOwner ( isFiltered ( ) ) ; javax.ws.rs.core.Response response = doAction ( ActionType.CloneVm , cloneVmParameters , action ) ; return response ; }
Source:
protected org.ovirt.engine.core.common.AuditLogType getAuditLogTypeForInvalidInterfaces ( ) { return org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_TEMPLATE_INVALID_INTERFACES ; }

Target:
private void initImportClonedTemplateDisks ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getParameters ( ) . getImages ( ) ) { if ( getParameters ( ) . isImportAsNewEntity ( ) ) { generateNewDiskId ( image ) ; updateManagedDeviceMap ( image , getVmTemplate ( ) . getManagedDeviceMap ( ) ) ; } else { newDiskIdForDisk.put ( image.getId ( ) , image ) ; } } }
Source:
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.VDS > ( ) ; } return source ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; }
Source:
public void updateUseHostCpuAvailability ( ) { if ( canUseHostCpuAvailability ( ) ) { getModel ( ) . getHostCpu ( ) . setIsChangeable ( true ) ; } else { getModel ( ) . getHostCpu ( ) . setEntity ( false ) ; getModel ( ) . getHostCpu ( ) . setChangeProhibitionReason ( constants.hosCPUUnavailable ( ) ) ; getModel ( ) . getHostCpu ( ) . setIsChangeable ( false ) ; } }

Target:
protected void updateNumOfSockets ( ) { org.ovirt.engine.core.compat.Version version = getCompatibilityVersion ( ) ; if ( version == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfVmSockets ( asyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Integer > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Integer returnValue ) { maxNumOfSockets = returnValue ; updataMaxVmsInPool ( ) ; } } ) , version.toString ( ) ) ; }
Source:
public static org.jboss.shrinkwrap.api.spec.JavaArchive createDeployment ( ) { return org.jboss.shrinkwrap.api.ShrinkWrap.create ( org.jboss.shrinkwrap.api.spec.JavaArchive.class ) . addClasses ( org.ovirt.engine.core.bll.scheduling.CommonTestMocks.class , org.ovirt.engine.core.bll.scheduling.SchedulingManager.class , org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscovery.class , org.ovirt.engine.core.bll.scheduling.BasicMigrationHandler.class ) . addAsManifestResource ( EmptyAsset.INSTANCE , org.jboss.shrinkwrap.api.ArchivePaths.create ( "beans.xml" ) ) ; }

Target:
public static org.jboss.shrinkwrap.api.spec.JavaArchive createDeployment ( ) { return org.jboss.shrinkwrap.api.ShrinkWrap.create ( org.jboss.shrinkwrap.api.spec.JavaArchive.class ) . addClasses ( org.ovirt.engine.core.di.Injector.class , org.ovirt.engine.core.bll.scheduling.CommonTestMocks.class , org.ovirt.engine.core.bll.scheduling.SchedulingManager.class , org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscovery.class , org.ovirt.engine.core.bll.scheduling.BasicMigrationHandler.class ) . addClasses ( org.ovirt.engine.core.bll.scheduling.CommonTestMocks.commonClasses ( ) ) . addAsManifestResource ( EmptyAsset.INSTANCE , org.jboss.shrinkwrap.api.ArchivePaths.create ( "beans.xml" ) ) ; }
Source:
private java.lang.String getDiskIsBeingExportedMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_BEING_EXPORTED.name ( ) ) ; if ( ( getDiskImage ( ) ) != null ) { builder.append ( java.lang.String.format ( "$DiskAlias %1$s" , getDiskImage ( ) . getDiskAlias ( ) ) ) ; } return builder.toString ( ) ; }

Target:
private java.lang.String getDiskIsBeingExportedMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_BEING_EXPORTED.name ( ) ) ; if ( ( getDiskImage ( ) ) != null ) { builder.append ( java.lang.String.format ( "$DiskAlias %1$s" , getDiskImage ( ) . getDiskAlias ( ) ) ) ; } return builder.toString ( ) ; }
Source:
protected org.ovirt.engine.api.model.VM deprecatedPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < org.ovirt.engine.api.common.util.DetailHelper.Detail > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( getHttpHeaders ( ) ) ; parent.addInlineDetails ( details , model ) ; addStatistics ( model , entity , uriInfo , httpHeaders ) ; parent.setPayload ( model ) ; parent.setBallooning ( model ) ; parent.setCertificateInfo ( model ) ; return model ; }

Target:
private org.ovirt.engine.core.common.businessentities.GraphicsType deriveGraphicsType ( ) { org.ovirt.engine.api.model.VM vm = getEntity ( org.ovirt.engine.api.model.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , "GetVmByVmId" ) ; return vm == null ? null : org.ovirt.engine.api.restapi.types.VmMapper.deriveGraphicsType ( vm.getGraphicsInfos ( ) ) ; }
Source:
private static boolean ValidateSubscription ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.event_subscriber > subscriptions , org.ovirt.engine.core.common.businessentities.event_subscriber current ) { boolean retValue = false ; for ( org.ovirt.engine.core.common.businessentities.event_subscriber event_subscriber : subscriptions ) { if ( ( ( event_subscriber.getsubscriber_id ( ) . equals ( current.getsubscriber_id ( ) ) ) && ( org.ovirt.engine.core.compat.StringHelper.EqOp ( event_subscriber.getevent_up_name ( ) , current.getevent_up_name ( ) ) ) ) && ( ( event_subscriber.getmethod_id ( ) ) == ( current.getmethod_id ( ) ) ) ) { retValue = true ; break ; } } return retValue ; }

Target:
private static boolean ValidateSubscription ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.event_subscriber > subscriptions , org.ovirt.engine.core.common.businessentities.event_subscriber current ) { boolean retValue = false ; for ( org.ovirt.engine.core.common.businessentities.event_subscriber event_subscriber : subscriptions ) { if ( ( ( event_subscriber.getsubscriber_id ( ) . equals ( current.getsubscriber_id ( ) ) ) && ( org.apache.commons.lang.StringUtils.equals ( event_subscriber.getevent_up_name ( ) , current.getevent_up_name ( ) ) ) ) && ( ( event_subscriber.getmethod_id ( ) ) == ( current.getmethod_id ( ) ) ) ) { retValue = true ; break ; } } return retValue ; }
Source:
protected void setActionMessageParameters ( ) { addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__CLUSTER ) ; addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__UPDATE ) ; }

Target:
private boolean validateManagementNetworkAttachement ( ) { final org.ovirt.engine.core.common.businessentities.network.Network managementNetwork = getDefaultManagementNetworkFinder ( ) . findDefaultManagementNetwork ( org.ovirt.engine.core.bll.UpdateVdsGroupCommand.getVdsGroup ( ) . getStoragePoolId ( ) ) ; if ( managementNetwork == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEFAULT_MANAGEMENT_NETWORK_NOT_FOUND ) ; return false ; } managementNetworkCluster = createManagementNetworkCluster ( managementNetwork ) ; final org.ovirt.engine.core.bll.network.cluster.UpdateClusterNetworkClusterValidator networkClusterValidator = createManagementNetworkClusterValidator ( ) ; return validate ( networkClusterValidator.managementNetworkChange ( ) ) ; }
Source:
private static void assertEmptyCanDoActionMessage ( java.util.List < ? > list ) { org.junit.Assert.assertTrue ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.EXPECTED_EMPTY_CAN_DO_MESSAGE , ( ( list == null ) || ( ( list.size ( ) ) == 0 ) ) ) ; }

Target:
public void testValidateAndSetStorageQuotaSpecificNotExceeded ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > parameters = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; parameters.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.STORAGE_QUOTA_SPECIFIC_NOT_EXCEEDED , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1 ) ) ; org.junit.Assert.assertTrue ( quotaManager.validateAndSetStorageQuota ( storage_pool , parameters , canDoActionMessages ) ) ; assertEmptyCanDoActionMessage ( ) ; assertAuditLogNotWritten ( ) ; }
Source:
public void run ( ) { this . isRunning = true ; while ( this . isRunning ) { select ( ) ; this . scheduler.performPendingOperations ( ) ; processChannels ( ) ; } }

Target:
public void run ( ) { this . isRunning = true ; while ( this . isRunning ) { select ( ) ; try { this . scheduler.performPendingOperations ( ) ; } catch ( java.lang.Exception e ) { org.ovirt.vdsm.jsonrpc.client.reactors.Reactor.LOG.error ( "Exception occured during running scheduled task" , e ) ; } processChannels ( ) ; } }
Source:
public void PostOnAddStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; if ( ! ( model.Validate ( ) ) ) { return ; } if ( ( model.getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) { SaveNfsStorage ( ) ; } else if ( ( model.getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ) { SaveLocalStorage ( ) ; } else { SaveSanStorage ( ) ; } }

Target:
public void postOnAddStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; if ( ! ( model.validate ( ) ) ) { return ; } if ( ( model.getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) { saveNfsStorage ( ) ; } else if ( ( model.getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ) { saveLocalStorage ( ) ; } else { saveSanStorage ( ) ; } }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.AdUser > getAllUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.AdUser > users = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AdUser > ( ) ; org.ovirt.engine.core.common.businessentities.AdUser user = org.ovirt.engine.core.bll.adbroker.InternalBrokerUtils.getUserByUserGuid ( org.ovirt.engine.core.bll.adbroker.InternalBrokerUtils.ADMIN_GUID ) ; if ( user != null ) { users.add ( user ) ; } return users ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > getAllUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > users = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LdapUser > ( ) ; org.ovirt.engine.core.common.businessentities.LdapUser user = org.ovirt.engine.core.bll.adbroker.InternalBrokerUtils.getUserByUserGuid ( org.ovirt.engine.core.bll.adbroker.InternalBrokerUtils.ADMIN_GUID ) ; if ( user != null ) { users.add ( user ) ; } return users ; }
Source:
public void testRemoveByStorageDomain ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; action.getStorageDomain ( ) . setId ( GUIDS [ 0 ] . toString ( ) ) ; verifyRemove ( resource.remove ( action ) ) ; }

Target:
public void testRemoveByStorageDomain ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendTemplateDiskResource.STORAGE_DOMAIN , GUIDS [ 0 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.image_storage_domain_map imageStorageDomainMap , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.ImagesHandler.addDiskToVmIfNotExists ( image , vmId ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }

Target:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.image_storage_domain_map imageStorageDomainMap , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.ImagesHandler.addDiskToVmIfNotExists ( image , vmId ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }
Source:
void addStyles ( ) { storageTypeListEditor.setLabelStyleName ( style.label ( ) ) ; storageTypeListEditor.addContentWidgetStyleName ( style.storageContentWidget ( ) ) ; formatListEditor.setLabelStyleName ( style.label ( ) ) ; formatListEditor.addContentWidgetStyleName ( style.formatContentWidget ( ) ) ; activateDomainEditor.addContentWidgetStyleName ( style.activateDomainEditor ( ) ) ; }

Target:
void addStyles ( ) { storageTypeListEditor.setLabelStyleName ( style.label ( ) ) ; storageTypeListEditor.addContentWidgetStyleName ( style.storageContentWidget ( ) ) ; formatListEditor.setLabelStyleName ( style.label ( ) ) ; formatListEditor.addContentWidgetStyleName ( style.formatContentWidget ( ) ) ; activateDomainEditor.addContentWidgetStyleName ( style.activateDomainEditor ( ) ) ; advancedParametersExpanderContent.setStyleName ( style.advancedParametersExpanderContent ( ) ) ; }
Source:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { java.lang.String authzName = null ; if ( ( getProfile ( sessionId ) ) != null ) { authzName = getProfile ( sessionId ) . getAuthz ( ) . getContext ( ) . < java.lang.String > get ( Base.ContextKeys.INSTANCE_NAME ) ; } org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , authzName , getPrincipalName ( sessionId ) , message , msgArgs ) ; engineSessionDao.remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }

Target:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { if ( ssoSessionUtils.isSessionInUse ( getEngineSessionSeqId ( sessionId ) ) ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser dbUser = getUser ( sessionId , false ) ; log.info ( "Not removing session '{}', session has running commands{}" , sessionId , ( dbUser == null ? "." : java.lang.String.format ( " for user '%s@%s'." , dbUser.getLoginName ( ) , dbUser.getDomain ( ) ) ) ) ; return ; } java.lang.String authzName = null ; if ( ( getProfile ( sessionId ) ) != null ) { authzName = getProfile ( sessionId ) . getAuthzName ( ) ; } org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , authzName , getPrincipalName ( sessionId ) , message , msgArgs ) ; engineSessionDao.remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }
Source:
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.storage.Disk > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; if ( source != null ) { java.lang.Iterable listEnumerable = ( ( java.lang.Iterable ) ( source ) ) ; java.util.Iterator listIterator = listEnumerable.iterator ( ) ; while ( listIterator.hasNext ( ) ) { list.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.Disk ) ( listIterator.next ( ) ) ) ) ; } } return list ; }

Target:
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.storage.Disk > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { java.lang.Iterable listEnumerable = ( ( java.lang.Iterable ) ( source ) ) ; java.util.Iterator listIterator = listEnumerable.iterator ( ) ; while ( listIterator.hasNext ( ) ) { list.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.Disk ) ( listIterator.next ( ) ) ) ) ; } } return list ; }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; getBackend ( ) . EndAction ( getImagesActionType ( ) , p ) ; } }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . EndAction ( org.ovirt.engine.core.bll.ImportVmCommand.getImagesActionType ( ) , p ) ; } }
Source:
public void onSuccessDontTryNextAgent ( ) { mockExecutor ( agent1 , true ) ; mockCheckStatus ( "on" ) ; org.mockito.Mockito.when ( executor.fence ( org.mockito.Mockito.eq ( FenceActionType.Start ) , org.mockito.Mockito.eq ( agent2 ) ) ) . thenThrow ( new java.lang.IllegalStateException ( ) ) ; command.executeCommand ( ) ; }

Target:
public void onSuccessDontTryNextAgent ( ) { mockExecutor ( agent1 , true ) ; mockCheckStatus ( "on" ) ; org.mockito.Mockito.when ( executor.fence ( org.mockito.Matchers.eq ( FenceActionType.Start ) , org.mockito.Matchers.eq ( agent2 ) ) ) . thenThrow ( new java.lang.IllegalStateException ( ) ) ; command.executeCommand ( ) ; }
Source:
public static void getAllVnicProfiles ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVnicProfiles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
private boolean isRemoveAutoGeneratedSnapshotRequired ( ) { return ( ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getStage ( ) ) != ( org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters.LiveMigrateStage.CREATE_SNAPSHOT ) ) && ( ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getStage ( ) ) != ( org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters.LiveMigrateStage.AUTO_GENERATED_SNAPSHOT_REMOVE_END ) ) ; }

Target:
private boolean isRemoveAutoGeneratedSnapshotRequired ( ) { boolean removeSnapshotRequired = ( ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getStage ( ) ) != ( org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters.LiveMigrateStage.CREATE_SNAPSHOT ) ) && ( ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getStage ( ) ) != ( org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters.LiveMigrateStage.AUTO_GENERATED_SNAPSHOT_REMOVE_END ) ) ; if ( removeSnapshotRequired ) { if ( ! ( getVm ( ) . getStatus ( ) . isQualifiedForLiveSnapshotMerge ( ) ) ) { log.warn ( "Auto-generated snapshot cannot be removed because VM isn't qualified for live merge. VM status is '{}'" , getVm ( ) . getStatus ( ) ) ; removeSnapshotRequired = false ; } } return removeSnapshotRequired ; }
Source:
public static void enableHaReservationCheck ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start HA Reservation check" ) ; java.lang.Integer interval = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsHaReservationIntervalInMinutes ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "performHaResevationCheck" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , interval , interval , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished HA Reservation check" ) ; } }

Target:
public void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleAFixedDelayJob ( this , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }
Source:
public static void addOrUpdateTaskInDB ( org.ovirt.engine.core.common.businessentities.AsyncTasks task , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { try { if ( task != null ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.getAsyncTaskDao ( ) . saveOrUpdate ( task , entityType , entityIds ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.log.error ( java.lang.String.format ( "Adding/Updating task %1$s to DataBase threw an exception." , task.getTaskId ( ) ) , e ) ; } }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTaskEntity > buildAsyncTaskEntities ( org.ovirt.engine.core.compat.Guid taskId , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap ) { if ( entitiesMap == null ) { entitiesMap = java.util.Collections.emptyMap ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTaskEntity > results = new java.util.ArrayList ( entitiesMap.size ( ) ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entry : entitiesMap.entrySet ( ) ) { results.add ( new org.ovirt.engine.core.common.businessentities.AsyncTaskEntity ( taskId , entry.getValue ( ) , entry.getKey ( ) ) ) ; } return results ; }
Source:
private void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId ) { if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) ; decreasePendingVms ( vdsId , vm.getNumOfCpus ( ) , vm.getMinAllocatedMem ( ) , vm.getName ( ) ) ; }

Target:
private void decreasePendingVms ( ) { org.ovirt.engine.core.compat.Guid vdsId = getCurrentVdsId ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) ; if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "PendingVms for the guest {0} running on host {1} was already released, not releasing again" , vm.getName ( ) , vdsId ) ; return ; } lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( vm , vdsId ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; }
Source:
public static void GetCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void GetAllVmTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.VdcQueryParametersBase params = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmTemplates , params , aQuery ) ; }
Source:
public boolean supportedForUnitVmModel ( org.ovirt.engine.core.common.queries.ConfigurationValues feature , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.compat.Version version = model.getCompatibilityVersion ( ) ; if ( version == null ) { return false ; } else { return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( feature , version.getValue ( ) ) ) ) ; } }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; }
Source:
public void setSelectedItems ( java.util.List value ) { if ( ( selectedItems ) != value ) { SelectedItemsChanging ( value , selectedItems ) ; selectedItems = value ; SelectedItemsChanged ( ) ; getSelectedItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "SelectedItems" ) ) ; } }

Target:
public void setSelectedItems ( java.util.List value ) { if ( ( selectedItems ) != value ) { SelectedItemsChanging ( value , selectedItems ) ; selectedItems = value ; SelectedItemsChanged ( ) ; getSelectedItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SelectedItems" ) ) ; } }
Source:
private org.ovirt.engine.core.common.action.VdcActionType addActionTypeForQosType ( org.ovirt.engine.core.common.businessentities.qos.QosType qosType ) { switch ( qosType ) { case STORAGE : return org.ovirt.engine.core.common.action.VdcActionType.AddStorageQos ; case CPU : return org.ovirt.engine.core.common.action.VdcActionType.AddCpuQos ; case NETWORK : return org.ovirt.engine.core.common.action.VdcActionType.AddNetworkQoS ; default : throw new java.lang.IllegalArgumentException ( ( ( "Unsupported QoS type \"" + qosType ) + "\"" ) ) ; } }

Target:
private org.ovirt.engine.core.common.action.VdcActionType addActionTypeForQosType ( org.ovirt.engine.api.model.QosType qosType ) { switch ( qosType ) { case STORAGE : return org.ovirt.engine.core.common.action.VdcActionType.AddStorageQos ; case CPU : return org.ovirt.engine.core.common.action.VdcActionType.AddCpuQos ; case NETWORK : return org.ovirt.engine.core.common.action.VdcActionType.AddNetworkQoS ; case HOSTNETWORK : return org.ovirt.engine.core.common.action.VdcActionType.AddHostNetworkQos ; default : throw new java.lang.IllegalArgumentException ( ( ( "Unsupported QoS type \"" + qosType ) + "\"" ) ) ; } }
Source:
private void readCpuItem ( org.ovirt.engine.core.compat.backendcompat.XmlNode node ) { _vm.getStaticData ( ) . setNumOfSockets ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:num_of_sockets" , _xmlNS ) . innerText ) ) ; _vm.getStaticData ( ) . setCpuPerSocket ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:cpu_per_socket" , _xmlNS ) . innerText ) ) ; }

Target:
private void readCpuItem ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node ) { _vm.getStaticData ( ) . setNumOfSockets ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:num_of_sockets" , _xmlNS ) . innerText ) ) ; _vm.getStaticData ( ) . setCpuPerSocket ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:cpu_per_socket" , _xmlNS ) . innerText ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StorageDomainDynamic mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic entity = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; entity.setavailable_disk_size ( ( ( java.lang.Integer ) ( rs.getObject ( "available_disk_size" ) ) ) ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "id" ) ) ) ; entity.setused_disk_size ( ( ( java.lang.Integer ) ( rs.getObject ( "used_disk_size" ) ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomainDynamic mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic entity = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; entity.setAvailableDiskSize ( ( ( java.lang.Integer ) ( rs.getObject ( "available_disk_size" ) ) ) ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "id" ) ) ) ; entity.setUsedDiskSize ( ( ( java.lang.Integer ) ( rs.getObject ( "used_disk_size" ) ) ) ) ; return entity ; }
Source:
protected void disableElement ( com.google.gwt.dom.client.Element element ) { element.getStyle ( ) . setProperty ( "disabled" , "true" ) ; element.getStyle ( ) . setColor ( "#999999" ) ; if ( ( getNodeDisabledTooltip ( ) ) != null ) { element.setTitle ( getNodeDisabledTooltip ( ) ) ; } }

Target:
protected void disableElement ( com.google.gwt.dom.client.Element element ) { element.getStyle ( ) . setProperty ( "disabled" , "true" ) ; element.getStyle ( ) . setColor ( "#999999" ) ; if ( ( getNodeDisabledTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( getNodeDisabledTooltip ( ) ) , element ) ; } }
Source:
public org.ovirt.engine.ui.uicommonweb.models.GridTimer getTimer ( ) { if ( ( gettimer ( ) ) == null ) { settimer ( new org.ovirt.engine.ui.uicommonweb.models.GridTimer ( getListName ( ) ) { @ java.lang.Override public void execute ( ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.logger.fine ( ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.this . getClass ( ) . getName ( ) ) + ": Executing search" ) ) ; syncSearch ( ) ; } } ) ; gettimer ( ) . setRefreshRate ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getConfigurator ( ) . getPollingTimerInterval ( ) ) ; } return gettimer ( ) ; }

Target:
public void execute ( ) { doGridTimerExecute ( ) ; }