auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.ui.common.widget.ImageWithDecorator getValue ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.common.businessentities.VM vm = item.getVM ( ) ; com.google.gwt.resources.client.ImageResource changesImage = null ; if ( ( vm != null ) && ( vm.isNextRunConfigurationExists ( ) ) ) { changesImage = org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.resources.vmDelta ( ) ; } return new org.ovirt.engine.ui.common.widget.ImageWithDecorator ( getMainImage ( item ) , changesImage , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_LEFT , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_TOP ) ; }

Target:
public org.ovirt.engine.ui.common.widget.ImageWithDecorator getValue ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.common.businessentities.VM vm = item.getVM ( ) ; com.google.gwt.resources.client.ImageResource changesImage = null ; java.lang.String vmStatus = "" ; if ( vm != null ) { if ( vm.isNextRunConfigurationExists ( ) ) { changesImage = org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.resources.vmDelta ( ) ; } vmStatus = vm.getStatus ( ) . toString ( ) ; } return new org.ovirt.engine.ui.common.widget.ImageWithDecorator ( getMainImage ( item ) , changesImage , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_LEFT , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_TOP , vmStatus ) ; }
Source:
public static void getClusterFeaturesByClusterId ( 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 ? ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getClusterFeaturesByVersionAndCategory ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.mode.ApplicationMode category ) { 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.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByVersionAndCategory , new org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters ( version , category ) , aQuery ) ; }
Source:
public void Initialize ( java.util.ArrayList parameters ) { super . Initialize ( parameters ) ; if ( ! ( ( parameters.get ( 3 ) ) instanceof java.lang.Boolean ) ) { throw new org.ovirt.engine.core.bll.storage.InvalidOperationException ( ) ; } _isLastMaster = ( ( java.lang.Boolean ) ( parameters.get ( 3 ) ) ) ; if ( ! ( ( parameters.get ( 4 ) ) instanceof org.ovirt.engine.core.bll.storage.Guid ) ) { throw new org.ovirt.engine.core.bll.storage.InvalidOperationException ( ) ; } _newMasterStorageDomainId = ( ( org.ovirt.engine.core.bll.storage.Guid ) ( parameters.get ( 4 ) ) ) ; }

Target:
public void initialize ( java.util.ArrayList parameters ) { super . initialize ( parameters ) ; if ( ! ( ( parameters.get ( 3 ) ) instanceof java.lang.Boolean ) ) { throw new org.ovirt.engine.core.bll.storage.InvalidOperationException ( ) ; } _isLastMaster = ( ( java.lang.Boolean ) ( parameters.get ( 3 ) ) ) ; if ( ! ( ( parameters.get ( 4 ) ) instanceof org.ovirt.engine.core.bll.storage.Guid ) ) { throw new org.ovirt.engine.core.bll.storage.InvalidOperationException ( ) ; } _newMasterStorageDomainId = ( ( org.ovirt.engine.core.bll.storage.Guid ) ( parameters.get ( 4 ) ) ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , java.lang.Object taskReturn , boolean replay , java.lang.String errorMessage ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , replay , errorMessage ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean valid , boolean success , java.lang.Object taskReturn , boolean replay , java.lang.String errorMessage ) { return setUpActionExpectations ( task , clz , names , values , valid , success , taskReturn , null , replay , errorMessage ) ; }
Source:
protected void removeVmNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = getVmNetworkInterfaceDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : interfaces ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMac ( iface.getMacAddress ( ) ) ; } } }

Target:
protected void removeVmNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces = getVmNicDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMac ( iface.getMacAddress ( ) ) ; } } }
Source:
public static void GetHighUtilizationForEvenDistribution ( 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.HighUtilizationForEvenlyDistribute ) , aQuery ) ; }

Target:
public static void GetDefaultSpmPriority ( 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 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( age ) ; result = ( prime * result ) + ( ( name ) == null ? 0 : name.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( age , name ) ; }
Source:
public void canDoActionFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForUpdate ( false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForUpdate ( false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
private void onConfigureVmsToImport ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel importVmsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel ) ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) ) ; if ( importVmsModel == null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel model = importVmsModel.getSpecificImportModel ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.setWindow ( null ) ; setWindow ( model ) ; }

Target:
private void onConfigureVmsToImport ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel importVmsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel ) ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) ) ; if ( importVmsModel == null ) { return ; } if ( ! ( importVmsModel.validateArchitectures ( ) ) ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel model = importVmsModel.getSpecificImportModel ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.setWindow ( null ) ; setWindow ( model ) ; }
Source:
protected static boolean doesStorageDomainHaveSpaceForRequest ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { return new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( storageDomain ) . hasSpaceForClonedDisks ( disksList ) . isValid ( ) ; }

Target:
private static boolean validateSpaceRequirements ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( storageDomain ) ; return ( storageDomainValidator.isDomainWithinThresholds ( ) . isValid ( ) ) && ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) . isValid ( ) ) ; }
Source:
protected void setVdsNetworkError ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ex ) { getVDSReturnValue ( ) . setSucceeded ( false ) ; getVDSReturnValue ( ) . setExceptionString ( ex.toString ( ) ) ; getVDSReturnValue ( ) . setExceptionObject ( ex ) ; org.ovirt.engine.core.common.errors.VDSError tempVar = ex.getVdsError ( ) ; org.ovirt.engine.core.common.errors.VDSError tempVar2 = new org.ovirt.engine.core.common.errors.VDSError ( ) ; tempVar2.setCode ( VdcBllErrors.VDS_NETWORK_ERROR ) ; tempVar2.setMessage ( ex.getMessage ( ) ) ; getVDSReturnValue ( ) . setVdsError ( ( tempVar != null ? tempVar : tempVar2 ) ) ; }

Target:
protected void setVdsNetworkError ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ex ) { getVDSReturnValue ( ) . setSucceeded ( false ) ; getVDSReturnValue ( ) . setExceptionString ( ex.toString ( ) ) ; getVDSReturnValue ( ) . setExceptionObject ( ex ) ; org.ovirt.engine.core.common.errors.VDSError tempVar = ex.getVdsError ( ) ; org.ovirt.engine.core.common.errors.VDSError tempVar2 = new org.ovirt.engine.core.common.errors.VDSError ( ) ; tempVar2.setCode ( VdcBllErrors.VDS_NETWORK_ERROR ) ; tempVar2.setMessage ( ex.getMessage ( ) ) ; getVDSReturnValue ( ) . setVdsError ( ( tempVar != null ? tempVar : tempVar2 ) ) ; logException ( ex ) ; }
Source:
public static boolean needsAlert ( org.ovirt.engine.core.common.businessentities.VM vm ) { boolean alertRequired = false ; if ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { alertRequired = ( ( ! ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasGuestAgent ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasDifferentTimezone ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasDifferentOSType ( vm ) ) ; } return ( alertRequired || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.isUpdateNeeded ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasPauseError ( vm ) ) ; }

Target:
public static boolean needsAlert ( org.ovirt.engine.core.common.businessentities.VM vm ) { boolean alertRequired = false ; if ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { alertRequired = ( ( ! ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasGuestAgent ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasDifferentTimezone ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasDifferentOSType ( vm ) ) ; } return ( ( alertRequired || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.isUpdateNeeded ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasPauseError ( vm ) ) ) || ( org.ovirt.engine.ui.webadmin.widget.table.column.VmStatusColumn.hasIllegalImages ( vm ) ) ; }
Source:
public void updateQuota ( org.ovirt.engine.core.common.businessentities.storage_pool datacenter ) { if ( ( datacenter.getQuotaEnforcementType ( ) . equals ( QuotaEnforcementTypeEnum.DISABLED ) ) || ( ! ( ( java.lang.Boolean ) ( getIsInternal ( ) . getEntity ( ) ) ) ) ) { getQuota ( ) . setIsAvailable ( false ) ; } else { getQuota ( ) . setIsAvailable ( true ) ; quota_storageSelectedItemChanged ( null ) ; } }

Target:
public void updateQuota ( org.ovirt.engine.core.common.businessentities.storage_pool datacenter ) { if ( ( datacenter.getQuotaEnforcementType ( ) . equals ( QuotaEnforcementTypeEnum.DISABLED ) ) || ( ! ( ( java.lang.Boolean ) ( getIsInternal ( ) . getEntity ( ) ) ) ) ) { getQuota ( ) . setIsAvailable ( false ) ; } else { getQuota ( ) . setIsAvailable ( true ) ; quota_storageSelectedItemChanged ( ( getIsNew ( ) ? null : ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getDisk ( ) ) ) . getQuotaId ( ) ) ) ; } }
Source:
private void verifyApplications ( org.ovirt.engine.api.model.Applications applications ) { assertNotNull ( applications ) ; assertEquals ( NAMES.length , applications.getApplications ( ) . size ( ) ) ; int index = 0 ; for ( org.ovirt.engine.api.model.Application app : applications.getApplications ( ) ) { assertEquals ( NAMES [ index ] , app.getName ( ) ) ; verifyLinks ( app ) ; index ++ ; } }

Target:
private void verifyApplications ( org.ovirt.engine.api.model.Applications applications ) { org.junit.Assert.assertNotNull ( applications ) ; org.junit.Assert.assertEquals ( NAMES.length , applications.getApplications ( ) . size ( ) ) ; int index = 0 ; for ( org.ovirt.engine.api.model.Application app : applications.getApplications ( ) ) { org.junit.Assert.assertEquals ( NAMES [ index ] , app.getName ( ) ) ; verifyLinks ( app ) ; index ++ ; } }
Source:
protected boolean desiredImage ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return ( org.ovirt.engine.core.common.businessentities.storage.ImageFileType.Unknown ) == ( repoImage.getFileType ( ) ) ; }

Target:
public static void getUnknownImageList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < java.lang.String > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean forceRefresh ) { org.ovirt.engine.ui.uicommonweb.dataprovider.ImagesDataProvider.getIrsImageList ( aQuery , storagePoolId , forceRefresh , ImageFileType.All , new org.ovirt.engine.ui.uicommonweb.dataprovider.ImagesDataProvider.RepoImageToImageFileNameAsyncConverter ( ( image ) -> ( org.ovirt.engine.ui.uicommonweb.dataprovider.ImagesDataProvider.ISO_PREFIX ) + ( image.getRepoImageId ( ) ) , ( image ) -> ( org.ovirt.engine.core.common.businessentities.storage.ImageFileType.Unknown ) == ( image.getFileType ( ) ) ) ) ; }
Source:
private double getVdsCurrentMemoryInUse ( org.ovirt.engine.core.common.businessentities.VDS curVds ) { return ( ( ( curVds.getMemCommited ( ) ) + ( curVds.getPendingVmemSize ( ) ) ) + ( curVds.getGuestOverhead ( ) ) ) + ( curVds.getReservedMem ( ) ) ; }

Target:
public boolean hasOvercommitMemoryToRunVM ( org.ovirt.engine.core.common.businessentities.VDS curVds , org.ovirt.engine.core.common.businessentities.VM vm ) { double vmMemRequired = ( vm.getMemSizeMb ( ) ) + ( curVds.getGuestOverhead ( ) ) ; double vdsMemLimit = curVds.getMaxSchedulingMemory ( ) ; org.ovirt.engine.core.bll.scheduling.SlaValidator.log.debug ( "hasOvercommitMemoryToRunVM: host '{}'; max scheduling memory : MB; required memory is MB; Guest overhead MB" , curVds.getName ( ) , vdsMemLimit , vmMemRequired , curVds.getGuestOverhead ( ) ) ; org.ovirt.engine.core.bll.scheduling.SlaValidator.log.debug ( "{} <= ??? {}" , vmMemRequired , vdsMemLimit ) ; return vmMemRequired <= vdsMemLimit ; }
Source:
private void writeServiceLocator ( org.ovirt.api.metamodel.concepts.Locator locator ) { writer.writeStartObject ( ) ; writeCommon ( locator ) ; writer.writeStartArray ( "parameters" ) ; locator.parameters ( ) . forEach ( this :: writeParameter ) ; writer.writeEnd ( ) ; writer.writeEnd ( ) ; }

Target:
private void writeServiceLocator ( org.ovirt.api.metamodel.concepts.Locator locator ) { writer.writeStartObject ( ) ; writeCommon ( locator ) ; writeServiceRef ( locator.getService ( ) ) ; writer.writeStartArray ( "parameters" ) ; locator.parameters ( ) . forEach ( this :: writeParameter ) ; writer.writeEnd ( ) ; writer.writeEnd ( ) ; }
Source:
public void setupMocks ( ) { org.mockito.Mockito.when ( vdsGroupDao.get ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getVdsGroup ( ) ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( cmd ) . getVdsGroupDAO ( ) ; org.mockito.Mockito.when ( cmd.getSyncJobInstance ( ) ) . thenReturn ( hookSyncJob ) ; }

Target:
public void setupMocks ( ) { org.mockito.Mockito.when ( vdsGroupDao.get ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getVdsGroup ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getFromCache ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getVdsGroup ( ) ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( cmd ) . getVdsGroupDAO ( ) ; org.mockito.Mockito.when ( cmd.getSyncJobInstance ( ) ) . thenReturn ( hookSyncJob ) ; }
Source:
public static void GetVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageEventListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand.equals ( getModel ( ) . getDetailsCommand ( ) ) ) { return eventPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( ( source.getConfirmWindow ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.ImportCloneModel ) { return importClonePopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public void testUpdate ( ) { updateExistingEntity ( ) ; dao.update ( existingEntity ) ; T result = dao.get ( existingEntity.getId ( ) ) ; org.ovirt.engine.core.dao.BaseGenericDaoTestCase.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingEntity , result ) ; verifyUpdate ( existingEntity , result ) ; }

Target:
public void testUpdate ( ) { updateExistingEntity ( ) ; dao.update ( existingEntity ) ; T result = dao.get ( existingEntity.getId ( ) ) ; org.ovirt.engine.core.dao.BaseGenericDaoTestCase.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingEntity , result ) ; verifyUpdate ( existingEntity , result ) ; }
Source:
private long getImageSizeInBytes ( ) { return ( ( ( long ) ( ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getvm_mem_size_mb ( ) ) + 200 ) + ( 64 * ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getnum_of_monitors ( ) ) ) ) ) * 1024 ) * 1024 ; }

Target:
private long getImageSizeInBytes ( ) { return ( ( ( long ) ( ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getVmMemSizeMb ( ) ) + 200 ) + ( 64 * ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getNumOfMonitors ( ) ) ) ) ) * 1024 ) * 1024 ; }
Source:
private void doDataCenterSearch ( ) { final org.ovirt.engine.ui.frontend.AsyncQuery dcQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; dcQuery.setModel ( this ) ; dcQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { final org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel systemTreeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel ) ( model ) ) ; systemTreeModel.setDataCenters ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( result ) ) ) ; doNetworksSearch ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterList ( dcQuery , false ) ; }

Target:
private void doDataCenterSearch ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterList ( new org.ovirt.engine.ui.uicommonweb.models.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > > ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > result ) { setDataCenters ( result ) ; doNetworksSearch ( ) ; } } ) , false ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesToPreview ( ) { return ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getParameters ( ) . getDisks ( ) ) != null ? org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getParameters ( ) . getDisks ( ) : org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getDbFacade ( ) . getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( getDstSnapshot ( ) . getId ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesToPreview ( ) { if ( ( imagesToPreview ) == null ) { imagesToPreview = ( ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getParameters ( ) . getDisks ( ) ) != null ) ? org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getParameters ( ) . getDisks ( ) : org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getDbFacade ( ) . getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( getDstSnapshot ( ) . getId ( ) ) ; imagesToPreview = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( imagesToPreview , true , true , false ) ; } return imagesToPreview ; }
Source:
private boolean registerLibvirtSecretsImpl ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets , boolean clearUnusedSecrets ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.RegisterLibvirtSecrets , new org.ovirt.engine.core.common.vdscommands.RegisterLibvirtSecretsVDSParameters ( vds.getId ( ) , libvirtSecrets , clearUnusedSecrets ) ) ; return returnValue.getSucceeded ( ) ; }

Target:
private boolean registerLibvirtSecretsImpl ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets , boolean clearUnusedSecrets ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.RegisterLibvirtSecrets , new org.ovirt.engine.core.common.vdscommands.RegisterLibvirtSecretsVDSParameters ( vds.getId ( ) , libvirtSecrets , clearUnusedSecrets ) ) ; return returnValue.getSucceeded ( ) ; }
Source:
private void handleFinalizingFailure ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { log.error ( "Finalizing failed transfer. {}" , getTransferDescription ( ) ) ; stopImageTransferSession ( context.entity ) ; setImageStatus ( ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Upload ) ? org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL : org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) ; updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; setAuditLogTypeFromPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; }

Target:
private void handleFinalizingFailure ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { log.error ( "Finalizing failed transfer. {}" , getTransferDescription ( ) ) ; stopImageTransferSession ( context.entity ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageGroupID ( ) ) ) { setImageStatus ( ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Upload ) ? org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL : org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) ; } updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; setAuditLogTypeFromPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getCachedIsoListByStoragePoolAndDomainId ( org.ovirt.engine.core.compat.Guid isoStoragePoolId , org.ovirt.engine.core.compat.Guid isoStorageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > fileListMD = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; if ( ( ( isoStorageDomainId != null ) && ( isoStoragePoolId != null ) ) && ( ( org.ovirt.engine.core.bll.VmRunHandler.getInstance ( ) . findActiveISODomain ( isoStoragePoolId ) ) != null ) ) { fileListMD = repoStorageDom.getRepoListForStorageDomainAndStoragePool ( isoStoragePoolId , isoStorageDomainId , imageType ) ; } return fileListMD ; }

Target:
public static java.lang.String getRegexToolPattern ( ) { java.lang.String regexPattern = java.lang.String.format ( "%1$s(?<%2$s>[0-9]{1,}.[0-9])_{1}(?<%3$s>[0-9]{1,}).[i|I][s|S][o|O]$" , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.getGuestToolsSetupIsoPrefix ( ) , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.TOOL_CLUSTER_LEVEL , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.TOOL_VERSION ) ; return regexPattern ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { returnValue = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getBroker ( ) . glusterHookRead ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getGlusterCommand ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getHookStage ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getHookName ( ) ) ; setReturnValue ( returnValue.getHookcontent ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { returnValue = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getBroker ( ) . glusterHookRead ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getGlusterCommand ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getHookStage ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.getParameters ( ) . getHookName ( ) ) ; setReturnValue ( returnValue.getHookcontent ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterHookContentVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public static boolean IsAnyStorageDomainIsMatserAndActive ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > sdl ) { for ( org.ovirt.engine.core.common.businessentities.storage_domains a : sdl ) { if ( ( ( ( a.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) && ( ( a.getstatus ( ) ) != null ) ) && ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return true ; } } return false ; }

Target:
public static boolean IsAnyStorageDomainIsMatserAndActive ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > sdl ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : sdl ) { if ( ( ( ( a.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) && ( ( a.getStatus ( ) ) != null ) ) && ( ( a.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return true ; } } return false ; }
Source:
public void setSelectedItem ( java.lang.Object value ) { if ( ( selectedItem ) != value ) { OnSelectedItemChanging ( value , selectedItem ) ; selectedItem = value ; OnSelectedItemChanged ( ) ; getSelectedItemChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SelectedItem" ) ) ; } }

Target:
public void setSelectedItem ( java.lang.Object value ) { if ( ( selectedItem ) != value ) { onSelectedItemChanging ( value , selectedItem ) ; selectedItem = value ; onSelectedItemChanged ( ) ; getSelectedItemChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SelectedItem" ) ) ; } }
Source:
private void endInternalCommandWithFailure ( ) { org.ovirt.engine.core.common.action.ExtendImageSizeParameters params = createExtendImageSizeParameters ( ) ; params.setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.UpdateVmDiskCommand.getBackend ( ) . endAction ( VdcActionType.ExtendImageSize , params ) ; }

Target:
private void endInternalCommandWithFailure ( ) { org.ovirt.engine.core.common.action.ExtendImageSizeParameters params = createExtendImageSizeParameters ( ) ; params.setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.UpdateVmDiskCommand.getBackend ( ) . endAction ( VdcActionType.ExtendImageSize , params , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; }
Source:
public void start ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.StartVds , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void refreshCapabilities ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RefreshHost , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
private void addClusterDetails ( org.ovirt.engine.core.compat.Guid vdsGroupID , java.util.List < java.lang.String > clustersWithRunningVms ) { if ( ( vdsGroupID != null ) && ( ! ( vdsGroupID.equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . getWithRunningVms ( vdsGroupID ) ; if ( vdsGroup != null ) { clustersWithRunningVms.add ( vdsGroup.getName ( ) ) ; } } }

Target:
private void addClusterDetails ( org.ovirt.engine.core.compat.Guid clusterID , java.util.List < java.lang.String > clustersWithRunningVms ) { if ( ( clusterID != null ) && ( ! ( clusterID.equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getClusterDao ( ) . getWithRunningVms ( clusterID ) ; if ( cluster != null ) { clustersWithRunningVms.add ( cluster.getName ( ) ) ; } } }
Source:
public void generate ( org.ovirt.api.metamodel.concepts.Model model ) { model.types ( ) . filter ( org.ovirt.api.metamodel.concepts.StructType.class :: isInstance ) . map ( org.ovirt.api.metamodel.concepts.StructType.class :: cast ) . forEach ( this :: generateClasses ) ; }

Target:
public void generate ( org.ovirt.api.metamodel.concepts.Model model ) { model.types ( ) . filter ( org.ovirt.api.metamodel.concepts.StructType.class :: isInstance ) . map ( org.ovirt.api.metamodel.concepts.StructType.class :: cast ) . forEach ( this :: generateStructSupportClasses ) ; model.types ( ) . filter ( org.ovirt.api.metamodel.concepts.EnumType.class :: isInstance ) . map ( org.ovirt.api.metamodel.concepts.EnumType.class :: cast ) . forEach ( this :: generateEnumSupportClasses ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { if ( ! ( interfacePopupModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks = computeLabelChanges ( interfacePopupModel.getLabelsModel ( ) , nicMap.get ( entity.getName ( ) ) . getItems ( ) ) ; if ( validateLabelChanges ( potentialNetworks ) ) { commitLabelChanges ( interfacePopupModel.getLabelsModel ( ) , entity , potentialNetworks ) ; redraw ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { if ( ! ( vfsConfigPopupModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; commitVfsConfigChanges ( hostNicVfsConfig , vfsConfigPopupModel ) ; }
Source:
private static java.util.Map < java.lang.String , java.lang.Object > getVideoDeviceSpecParams ( int numOfMonitors , boolean singleQxlPci ) { int heads = ( singleQxlPci ) ? numOfMonitors : 1 ; java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.HEADS , java.lang.String.valueOf ( heads ) ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.VRAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciVRamByHeads ( heads ) ) ; if ( singleQxlPci ) { specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.RAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciRamByHeads ( heads ) ) ; } return specParams ; }

Target:
public static void init ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( org.ovirt.engine.core.compat.Guid guid , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.Integer size ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( guid ) ; storageDomain.setStorageDomainType ( StorageDomainType.Data ) ; storageDomain.setStorageType ( storageType ) ; storageDomain.setStatus ( StorageDomainStatus.Active ) ; storageDomain.setAvailableDiskSize ( size ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storageDomain.setStorageDomainType ( StorageDomainType.Data ) ; storageDomain.setStatus ( StorageDomainStatus.Active ) ; return storageDomain ; }
Source:
public void onKeyPress ( com.google.gwt.dom.client.NativeEvent event ) { if ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) == ( event.getKeyCode ( ) ) ) { handleEnterKey ( commandInvoker ) ; } else if ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE ) == ( event.getKeyCode ( ) ) ) { handleEscapeKey ( commandInvoker ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getView ( ) . flush ( ) ; beforeCommandExecuted ( button.getCommand ( ) ) ; button.getCommand ( ) . Execute ( ) ; }
Source:
public static void getMaxSpmPriority ( 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 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public static void getClusterDesktopMemoryOverCommit ( 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.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void mockBackend ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.UpdateGlusterHook ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters.class ) ) ) . thenReturn ( vdsReturnValue ) ; }

Target:
private void mockBackend ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.UpdateGlusterHook ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters.class ) ) ) . thenReturn ( vdsReturnValue ) ; }
Source:
protected void setUpCreationExpectations ( ) { setUpCreationExpectations ( VdcActionType.AddVmTemplate , org.ovirt.engine.core.common.action.AddVmTemplateParameters.class , new java.lang.String [ ] { "Name" , "Description" } , new java.lang.Object [ ] { NAMES [ 0 ] , DESCRIPTIONS [ 0 ] } , true , true , GUIDS [ 0 ] , asList ( GUIDS [ 2 ] ) , org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.asList ( new org.ovirt.engine.core.common.businessentities.AsyncTaskStatus ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) , VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.getEntity ( 0 ) ) ; }

Target:
protected void setUpCreationExpectations ( ) { setUpCreationExpectations ( ActionType.AddVmTemplate , org.ovirt.engine.core.common.action.AddVmTemplateParameters.class , new java.lang.String [ ] { "Name" , "Description" } , new java.lang.Object [ ] { NAMES [ 0 ] , DESCRIPTIONS [ 0 ] } , true , true , GUIDS [ 0 ] , asList ( GUIDS [ 2 ] ) , org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.asList ( new org.ovirt.engine.core.common.businessentities.AsyncTaskStatus ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) , VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.getEntity ( 0 ) ) ; }
Source:
protected boolean checkStorageDomainNameLengthValid ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getstorage_name ( ) . length ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.StorageDomainNameSizeLimit ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ; result = false ; } return result ; }

Target:
protected boolean checkStorageDomainNameLengthValid ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStorageName ( ) . length ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.StorageDomainNameSizeLimit ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ; result = false ; } return result ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { for ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model : getItems ( ) ) { if ( model.isManagement ( ) ) { managementNetwork = model ; } if ( model.isGlusterNetwork ( ) ) { glusterNetwork = model ; } } }

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 ) { for ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model : getItems ( ) ) { if ( model.isManagement ( ) ) { managementNetwork = model ; } if ( model.isGlusterNetwork ( ) ) { glusterNetwork = model ; } if ( model.isDefaultRouteNetwork ( ) ) { defaultRouteNetwork = model ; } } }