auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void setIsAdminGUIFlag ( org.ovirt.engine.core.compat.Guid userId , boolean hasPermissions ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getDbUserDAO ( ) . get ( userId ) ; if ( ( user.isAdmin ( ) ) != hasPermissions ) { user.setAdmin ( hasPermissions ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getDbUserDAO ( ) . update ( user ) ; } }

Target:
public static void setIsAdminGUIFlag ( org.ovirt.engine.core.compat.Guid userId , boolean hasPermissions ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getDbUserDao ( ) . get ( userId ) ; if ( ( user.isAdmin ( ) ) != hasPermissions ) { user.setAdmin ( hasPermissions ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getDbUserDao ( ) . update ( user ) ; } }
Source:
public void init ( ) throws org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult { try { utilityConfiguration = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsConfiguration ( args.get ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_CONFIG_FILE ) ) ; } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( ManageDomainsResultEnum.FAILED_READING_CONFIGURATION , e.getMessage ( ) ) ; } try { daoImpl = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsDAOImpl ( ) ; } catch ( java.sql.SQLException e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( "Please verify the following:\n1. Your database credentials are valid.\n2. The database machine is accessible.\n3. The database service is running" , ManageDomainsResultEnum.DB_EXCEPTION , e.getMessage ( ) ) ; } }

Target:
public void init ( ) throws org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult { try { utilityConfiguration = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsConfiguration ( ( ( java.lang.String ) ( args.get ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_CONFIG_FILE ) ) ) . replace ( "@ENGINE_ETC@" , org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomains.ENGINE_ETC ) ) ; } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( ManageDomainsResultEnum.FAILED_READING_CONFIGURATION , e.getMessage ( ) ) ; } try { daoImpl = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsDAOImpl ( ) ; } catch ( java.sql.SQLException e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( "Please verify the following:\n1. Your database credentials are valid.\n2. The database machine is accessible.\n3. The database service is running" , ManageDomainsResultEnum.DB_EXCEPTION , e.getMessage ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > watchdogs = getWatchdogs ( ) ; if ( watchdogs.isEmpty ( ) ) { return failCanDoAction ( EngineMessage.WATCHDOG_NOT_FOUND ) ; } if ( ( ! ( getParameters ( ) . isClusterIndependent ( ) ) ) && ( ! ( validate ( validateModelCompatibleWithOs ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > watchdogs = getWatchdogs ( ) ; if ( watchdogs.isEmpty ( ) ) { return failCanDoAction ( EngineMessage.WATCHDOG_NOT_FOUND ) ; } if ( ! ( validate ( validateWatchdog ( ) ) ) ) { return false ; } return true ; }
Source:
public static void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String 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.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testGetPeersWithFingerprint ( ) throws java.io.IOException , javax.naming.AuthenticationException { java.util.Map < java.lang.String , java.lang.String > peers = glusterUtil.getPeers ( org.ovirt.engine.core.utils.gluster.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.utils.gluster.GlusterUtilTest.PASSWORD , org.ovirt.engine.core.utils.gluster.GlusterUtilTest.FINGER_PRINT1 ) ; org.junit.Assert.assertNotNull ( peers ) ; peers.containsKey ( org.ovirt.engine.core.utils.gluster.GlusterUtilTest.SERVER_NAME1 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.utils.gluster.GlusterUtilTest.FINGER_PRINT1 , peers.get ( org.ovirt.engine.core.utils.gluster.GlusterUtilTest.SERVER_NAME1 ) ) ; peers.containsKey ( org.ovirt.engine.core.utils.gluster.GlusterUtilTest.SERVER_NAME2 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.utils.gluster.GlusterUtilTest.FINGER_PRINT2 , peers.get ( org.ovirt.engine.core.utils.gluster.GlusterUtilTest.SERVER_NAME2 ) ) ; }

Target:
public void testGetPeersWithFingerprint ( ) throws java.io.IOException , javax.naming.AuthenticationException { java.util.Map < java.lang.String , java.lang.String > peers = glusterUtil.getPeers ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.PASSWORD , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.junit.Assert.assertNotNull ( peers ) ; peers.containsKey ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 , peers.get ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 ) ) ; peers.containsKey ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME2 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT2 , peers.get ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME2 ) ) ; }
Source:
public void setUpStatus ( ) { synchronized ( getLockObj ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getVdsId ( ) ) ; if ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Error ) ) { mFailedToRunVmAttempts.set ( 0 ) ; setStatus ( VDSStatus.Up , vds ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . updateStatus ( getVdsId ( ) , VDSStatus.Up ) ; org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "Settings host {0} to up after {1} failed attempts to run a VM" , vds.getName ( ) , mFailedToRunVmAttempts ) ; } } }

Target:
public void recoverFromError ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getVdsId ( ) ) ; if ( ( vds != null ) && ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Error ) ) ) { setStatus ( VDSStatus.Up , vds ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . updateStatus ( getVdsId ( ) , VDSStatus.Up ) ; org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "Settings host {0} to up after {1} failed attempts to run a VM" , vds.getName ( ) , mFailedToRunVmAttempts ) ; mFailedToRunVmAttempts.set ( 0 ) ; } }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getNewNetworkCommand ( ) ) ) { return popupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getManageCommand ( ) ) ) { return managePopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( windowModel instanceof org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.NewHostNetworkQosModel ) { return addQosPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getNewNetworkCommand ( ) ) ) { return popupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getManageCommand ( ) ) ) { return managePopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
public boolean isQuotaInUse ( org.ovirt.engine.core.common.businessentities.Quota quota ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "quota_id" , quota.getId ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > dbResults = new org.springframework.jdbc.core.simple.SimpleJdbcCall ( jdbcTemplate ) . withFunctionName ( "IsQuotaInUse" ) . execute ( parameterSource ) ; java.lang.String resultKey = dialect.getFunctionReturnKey ( ) ; return ( ( dbResults.get ( resultKey ) ) != null ) && ( ( java.lang.Boolean ) ( dbResults.get ( resultKey ) ) ) ; }

Target:
public boolean isQuotaInUse ( org.ovirt.engine.core.common.businessentities.Quota quota ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "quota_id" , quota.getId ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > dbResults = new org.springframework.jdbc.core.simple.SimpleJdbcCall ( getJdbcTemplate ( ) ) . withFunctionName ( "IsQuotaInUse" ) . execute ( parameterSource ) ; java.lang.String resultKey = getDialect ( ) . getFunctionReturnKey ( ) ; return ( ( dbResults.get ( resultKey ) ) != null ) && ( ( java.lang.Boolean ) ( dbResults.get ( resultKey ) ) ) ; }
Source:
public void testReplaceInvalidEmptyStringMacAddressesWithNullDoNotTouchSetMacAddresses ( ) { org.mockito.Mockito.when ( vmNetworkInterfaceMock.getMacAddress ( ) ) . thenReturn ( "00:0a:95:9d:68:16" ) ; underTest.replaceInvalidEmptyStringMacAddressesWithNull ( java.util.Collections.singletonList ( vmNetworkInterfaceMock ) ) ; org.mockito.Mockito.verify ( vmNetworkInterfaceMock , org.mockito.Mockito.never ( ) ) . setMacAddress ( org.mockito.Mockito.any ( ) ) ; }

Target:
public void testReplaceInvalidEmptyStringMacAddressesWithNullDoNotTouchSetMacAddresses ( ) { org.mockito.Mockito.when ( vmNetworkInterfaceMock.getMacAddress ( ) ) . thenReturn ( "00:0a:95:9d:68:16" ) ; underTest.replaceInvalidEmptyStringMacAddressesWithNull ( java.util.Collections.singletonList ( vmNetworkInterfaceMock ) ) ; org.mockito.Mockito.verify ( vmNetworkInterfaceMock , org.mockito.Mockito.never ( ) ) . setMacAddress ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected void endWithFailure ( ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.unLockImage ( ) ; if ( ( getMoveOrCopyImageOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Copy ) ) { if ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getAddImageDomainMapping ( ) ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; } revertTasks ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.unLockImage ( ) ; if ( ( getMoveOrCopyImageOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Copy ) ) { if ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getAddImageDomainMapping ( ) ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; } revertTasks ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.setSucceeded ( true ) ; }
Source:
public void setItems ( java.lang.Iterable value ) { super . setItems ( value ) ; if ( ( ( getSelectedItem ( ) ) == null ) && ( ( ( getSelectedItems ( ) ) == null ) || ( ( getSelectedItems ( ) . size ( ) ) == 0 ) ) ) { if ( ( value != null ) && ( value.iterator ( ) . hasNext ( ) ) ) { setSelectedItem ( value.iterator ( ) . next ( ) ) ; } } }

Target:
public void setItems ( java.util.Collection value ) { super . setItems ( value ) ; if ( ( ( getSelectedItem ( ) ) == null ) && ( ( ( getSelectedItems ( ) ) == null ) || ( ( getSelectedItems ( ) . size ( ) ) == 0 ) ) ) { if ( ( value != null ) && ( value.iterator ( ) . hasNext ( ) ) ) { setSelectedItem ( value.iterator ( ) . next ( ) ) ; } } }
Source:
public void testWithoutEnoughSparesMemory ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "3" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 2048 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.Assert.assertEquals ( 3 , result.size ( ) ) ; }

Target:
public void testWithoutEnoughSparesMemory ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "3" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 2048 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 3 , result.size ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec , java.lang.String connectionAction , java.util.Map < java.lang.String , java.lang.String > params ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.setVmTicket ( vmId , otp64 , sec , connectionAction , params ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc createVolumeContainer ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > createVolumeInfo ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.createVolumeContainer ( jobId , createVolumeInfo ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }
Source:
public void OnRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Network a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Network > Cast ( getSelectedItems ( ) ) ) { pb.add ( new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getEntity ( ) . getId ( ) , a ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RemoveNetwork , pb ) ; Cancel ( ) ; }

Target:
public void newNetwork ( ) { if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel networkModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.NewNetworkModel ( this ) ; setWindow ( networkModel ) ; networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }
Source:
public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler ( final com.google.gwt.event.logical.shared.ValueChangeHandler < T > handler ) { return asSuggestBox ( ) . addValueChangeHandler ( new com.google.gwt.event.logical.shared.ValueChangeHandler < java.lang.String > ( ) { @ java.lang.Override public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { try { T value = asEntity ( event.getValue ( ) ) ; handler.onValueChange ( new com.google.gwt.event.logical.shared.ValueChangeEvent < T > ( value ) { } ) ; } catch ( java.lang.IllegalArgumentException e ) { } } } ) ; }

Target:
public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler ( final com.google.gwt.event.logical.shared.ValueChangeHandler < T > handler ) { com.google.gwt.event.shared.HandlerRegistration handlerRegistration = asSuggestBox ( ) . addValueChangeHandler ( new com.google.gwt.event.logical.shared.ValueChangeHandler < java.lang.String > ( ) { @ java.lang.Override public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { try { T value = asEntity ( event.getValue ( ) ) ; handler.onValueChange ( new com.google.gwt.event.logical.shared.ValueChangeEvent < T > ( value ) { } ) ; } catch ( java.lang.IllegalArgumentException e ) { } } } ) ; handlerRegistrations.add ( handlerRegistration ) ; return handlerRegistration ; }
Source:
public org.ovirt.engine.api.model.Network get ( ) { org.ovirt.engine.api.model.Network entity = parent.lookupNetwork ( guid ) ; if ( entity == null ) { return notFound ( ) ; } org.ovirt.engine.api.model.Network network = map ( entity ) ; network.setDisplay ( null ) ; return addLinks ( network ) ; }

Target:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { return performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.BackendNetworkResource.UpdatedNetworkResolver ( ) , VdcActionType.UpdateNetwork , new org.ovirt.engine.api.restapi.resource.BackendNetworkResource.UpdateParametersProvider ( ) ) ; }
Source:
public void testAllowSettingHaOnNonHostedEngine ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setOrigin ( OriginType.RHEV ) ; vmStatic.setOrigin ( OriginType.RHEV ) ; command.getParameters ( ) . getVm ( ) . setAutoStartup ( true ) ; boolean validInput = command.validate ( ) ; org.junit.Assert.assertTrue ( validInput ) ; }

Target:
public void testAllowSettingHaOnNonHostedEngine ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setOrigin ( OriginType.RHEV ) ; vmStatic.setOrigin ( OriginType.RHEV ) ; command.getParameters ( ) . getVm ( ) . setAutoStartup ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.DELETE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) ) ; } if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.INSERT ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.getGroupKeys ( args , context.get ( ContextKeys.POSITIONAL , java.lang.String.class ) ) ) ; if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.put ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
Source:
public static void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void testCheckGlusterQuorumWithVolumeDown ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true ) ; org.mockito.Mockito.doReturn ( getGlusterVolumes ( GlusterStatus.DOWN ) ) . when ( volumeDao ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; org.junit.Assert.assertTrue ( "Quorum check is failing with volumes in down status" , hostValidator.checkGlusterQuorum ( cluster , hostIds ) . isEmpty ( ) ) ; }

Target:
public void testCheckGlusterQuorumWithVolumeDown ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true ) ; org.mockito.Mockito.doReturn ( getGlusterVolumes ( GlusterStatus.DOWN ) ) . when ( volumeDao ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; org.junit.jupiter.api.Assertions.assertTrue ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) . isEmpty ( ) , "Quorum check is failing with volumes in down status" ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; java.util.List < org.ovirt.engine.ui.common.widget.form.FormItem > formItems = propertyNameMap.get ( propertyName ) ; if ( formItems != null ) { for ( org.ovirt.engine.ui.common.widget.form.FormItem item : formItems ) { item.update ( ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; java.util.List < org.ovirt.engine.ui.common.widget.form.FormItem > formItems = propertyNameMap.get ( propertyName ) ; if ( formItems != null ) { for ( org.ovirt.engine.ui.common.widget.form.FormItem item : formItems ) { item.update ( ) ; } } }
Source:
private static void computeSmallByLargeIconId ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmIconDefault > iconDefaultsByLargeIconId = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmIconsDefaultDao ( ) . getByLargeIconId ( vmBase.getLargeIconId ( ) ) ; if ( ! ( iconDefaultsByLargeIconId.isEmpty ( ) ) ) { vmBase.setSmallIconId ( iconDefaultsByLargeIconId.get ( 0 ) . getSmallIconId ( ) ) ; } else { vmBase.setSmallIconId ( org.ovirt.engine.core.bll.utils.IconUtils.ensureSmallIconInDatabase ( vmBase.getLargeIconId ( ) ) ) ; } }

Target:
private static void computeSmallByLargeIconId ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { if ( ( vmBase.getLargeIconId ( ) ) == null ) { return ; } final java.util.List < org.ovirt.engine.core.common.businessentities.VmIconDefault > iconDefaultsByLargeIconId = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmIconsDefaultDao ( ) . getByLargeIconId ( vmBase.getLargeIconId ( ) ) ; if ( ! ( iconDefaultsByLargeIconId.isEmpty ( ) ) ) { vmBase.setSmallIconId ( iconDefaultsByLargeIconId.get ( 0 ) . getSmallIconId ( ) ) ; } else { vmBase.setSmallIconId ( org.ovirt.engine.core.bll.utils.IconUtils.ensureSmallIconInDatabase ( vmBase.getLargeIconId ( ) ) ) ; } }
Source:
public void validateSpaceAndThreshold ( ) { mockGetAllSnapshots ( ) ; org.junit.Assert.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void validateSpaceAndThreshold ( ) { mockGetAllSnapshots ( ) ; org.junit.Assert.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDao ( ) ) . thenReturn ( vmDAO ) ; returnedVms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getQuotaId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( vmDAO.getAllVmsRelatedToQuotaId ( quotaId ) ) . thenReturn ( returnedVms ) ; }

Target:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDao ( ) ) . thenReturn ( vmDAO ) ; returnedVms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( vmDAO.getAllVmsRelatedToQuotaId ( quotaId ) ) . thenReturn ( returnedVms ) ; }
Source:
private void initOsRepository ( ) { OsInfoPreferencesLoader.INSTANCE.init ( java.nio.file.FileSystems.getDefault ( ) . getPath ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getEtcDir ( ) . getAbsolutePath ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.OsRepositoryConfDir ) ) ) ; OsRepositoryImpl.INSTANCE.init ( OsInfoPreferencesLoader.INSTANCE.getPreferences ( ) ) ; org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.utils.OsRepositoryImpl.INSTANCE ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . populateDwhOsInfo ( osRepository.getOsNames ( ) ) ; }

Target:
private void initOsRepository ( ) { OsInfoPreferencesLoader.INSTANCE.init ( java.nio.file.FileSystems.getDefault ( ) . getPath ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getEtcDir ( ) . getAbsolutePath ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.OsRepositoryConfDir ) ) ) ; OsRepositoryImpl.INSTANCE.init ( OsInfoPreferencesLoader.INSTANCE.getPreferences ( ) ) ; org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.utils.OsRepositoryImpl.INSTANCE ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . populateDwhOsInfo ( osRepository.getOsNames ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getResolveMissingConflict ( ) . getEntity ( ) ) == null ) { getResolveMissingConflictCopy ( ) . setIsChangable ( false ) ; getResolveMissingConflictRemove ( ) . setIsChangable ( false ) ; } else { getResolveMissingConflictCopy ( ) . setIsChangable ( ( ( java.lang.Boolean ) ( getResolveMissingConflict ( ) . getEntity ( ) ) ) ) ; getResolveMissingConflictRemove ( ) . setIsChangable ( ( ( java.lang.Boolean ) ( getResolveMissingConflict ( ) . getEntity ( ) ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getResolveMissingConflict ( ) . getEntity ( ) ) == null ) { getResolveMissingConflictCopy ( ) . setIsChangable ( false ) ; getResolveMissingConflictRemove ( ) . setIsChangable ( false ) ; } else { getResolveMissingConflictCopy ( ) . setIsChangable ( getResolveMissingConflict ( ) . getEntity ( ) ) ; getResolveMissingConflictRemove ( ) . setIsChangable ( getResolveMissingConflict ( ) . getEntity ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VmStatic [ ] initVmStaticsOrderedByAutoStartup ( java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vmStatics ) { org.ovirt.engine.core.common.businessentities.VmStatic [ ] vmStaticArray = new org.ovirt.engine.core.common.businessentities.VmStatic [ org.ovirt.engine.core.dao.DbFacadeDAOTest.NUM_OF_VM_STATIC_IN_FIXTURES ] ; vmStaticArray = initVmStaticsOrderedByPriority ( vmStatics ) ; org.ovirt.engine.core.common.businessentities.VmStatic tempVmStatic = vmStaticArray [ 0 ] ; vmStaticArray [ 0 ] = vmStaticArray [ 1 ] ; vmStaticArray [ 1 ] = tempVmStatic ; vmStaticArray [ 0 ] . setAutoStartup ( true ) ; updateArrayOfVmStaticsInDb ( vmStaticArray ) ; return vmStaticArray ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmStatic [ ] initVmStaticsOrderedByAutoStartup ( java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vmStatics ) { org.ovirt.engine.core.common.businessentities.VmStatic [ ] vmStaticArray = initVmStaticsOrderedByPriority ( vmStatics ) ; org.ovirt.engine.core.common.businessentities.VmStatic tempVmStatic = vmStaticArray [ 0 ] ; vmStaticArray [ 0 ] = vmStaticArray [ 1 ] ; vmStaticArray [ 1 ] = tempVmStatic ; vmStaticArray [ 0 ] . setAutoStartup ( true ) ; updateArrayOfVmStaticsInDb ( vmStaticArray ) ; return vmStaticArray ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; if ( getIsShareable ( ) . getIsChangable ( ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; } }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; }
Source:
private void SleepOnReboot ( ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ServerRebootTimeout ) ; log.infoFormat ( "Waiting {0} seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ; }

Target:
private void SleepOnReboot ( ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ServerRebootTimeout ) ; log.infoFormat ( "Waiting {0} seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ; }
Source:
public void validateFailsForCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) , null ) ) ; prepareMocks ( VDSStatus.Up ) ; mockIsGlusterEnabled ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; mockIsGlusterEnabled ( true ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForCluster ( ) { prepareMocks ( VDSStatus.Up ) ; mockIsGlusterEnabled ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; mockIsGlusterEnabled ( true ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void failDomainIsActive ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections NFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; org.mockito.Mockito.when ( command.getConnection ( ) ) . thenReturn ( NFSConnection ) ; org.mockito.Mockito.doReturn ( oldNFSConnection ) . when ( storageConnDao ) . get ( org.mockito.ArgumentMatchers.anyString ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStatus ( StorageDomainStatus.Active ) ; domain.setStorageDomainSharedStatus ( StorageDomainSharedStatus.Active ) ; initDomainListForConnection ( NFSConnection.getId ( ) , domain ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_DOMAIN_MUST_BE_IN_MAINTENANCE_OR_UNATTACHED ) ; }

Target:
public void failDomainIsActive ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections NFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; org.mockito.Mockito.when ( command.getConnection ( ) ) . thenReturn ( NFSConnection ) ; org.mockito.Mockito.doReturn ( oldNFSConnection ) . when ( storageConnDao ) . get ( org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStatus ( StorageDomainStatus.Active ) ; domain.setStorageDomainSharedStatus ( StorageDomainSharedStatus.Active ) ; initDomainListForConnection ( NFSConnection.getId ( ) , domain ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_DOMAIN_MUST_BE_IN_MAINTENANCE_OR_UNATTACHED ) ; }
Source:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getStatus ( ) ; org.ovirt.engine.core.common.businessentities.VMStatus currentVmStatus = runningVm.getstatus ( ) ; if ( ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( currentVmStatus != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) ) && ( currentVmStatus.isRunning ( ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setMigratingToVds ( null ) ; } }

Target:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getStatus ( ) ; org.ovirt.engine.core.common.businessentities.VMStatus currentVmStatus = runningVm.getStatus ( ) ; if ( ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( currentVmStatus != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) ) && ( currentVmStatus.isRunning ( ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setMigratingToVds ( null ) ; } }
Source:
public org.ovirt.engine.api.model.Template update ( org.ovirt.engine.api.model.Template incoming ) { validateEnums ( org.ovirt.engine.api.model.Template.class , incoming ) ; validateIconParams ( incoming ) ; org.ovirt.engine.api.model.Template result = performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , VdcActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendTemplateResource.UpdateParametersProvider ( ) ) ; if ( result != null ) { org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , result ) ; } return result ; }

Target:
public org.ovirt.engine.api.model.Template update ( org.ovirt.engine.api.model.Template incoming ) { validateIconParams ( incoming ) ; org.ovirt.engine.api.model.Template result = performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , VdcActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendTemplateResource.UpdateParametersProvider ( ) ) ; if ( result != null ) { org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , result ) ; } return result ; }
Source:
protected void determineMigrationFailueForAuditLog ( ) { if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.MigrateStatus , new org.ovirt.engine.core.common.vdscommands.MigrateStatusVDSCommandParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { migrationErrorCode = e.getErrorCode ( ) ; } } }

Target:
protected void determineMigrationFailueForAuditLog ( ) { if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.MigrateStatus , new org.ovirt.engine.core.common.vdscommands.MigrateStatusVDSCommandParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { migrationErrorCode = e.getErrorCode ( ) ; } } }
Source:
private void testValidSql ( java.lang.String dynamicQuery , java.lang.String exepctedSQLResult ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 20 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( dynamicQuery , true ) ; org.junit.Assert.assertTrue ( ( "Invalid syntax: " + dynamicQuery ) , res.getvalid ( ) ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; org.junit.Assert.assertEquals ( exepctedSQLResult , query ) ; }

Target:
private void testValidSql ( java.lang.String dynamicQuery , java.lang.String exepctedSQLResult ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( dynamicQuery , true ) ; org.junit.Assert.assertTrue ( ( "Invalid syntax: " + dynamicQuery ) , res.getvalid ( ) ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; org.junit.Assert.assertEquals ( exepctedSQLResult , query ) ; }