auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void init ( ) { super . init ( ) ; oldVmId = org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getVmId ( ) ; setVmName ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewName ( ) ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) ) { setupParameters ( ) ; } }

Target:
protected void init ( ) { super . init ( ) ; oldVmId = org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getVmId ( ) ; setVmName ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewName ( ) ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) ) { setupParameters ( ) ; } else { setVmId ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) ; } }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.aaa.DirectoryUser directoryUser ) { org.ovirt.engine.core.dao.DbUserDAO dao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = dao.getByExternalId ( directoryUser.getDirectory ( ) . getName ( ) , directoryUser.getId ( ) ) ; if ( dbUser != null ) { dao.update ( dbUser ) ; } else { dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( directoryUser ) ; dbUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dao.save ( dbUser ) ; } return dbUser ; }

Target:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.aaa.DirectoryUser directoryUser ) { org.ovirt.engine.core.dao.DbUserDAO dao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = dao.getByExternalId ( directoryUser.getDirectoryName ( ) , directoryUser.getId ( ) ) ; if ( dbUser != null ) { dao.update ( dbUser ) ; } else { dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( directoryUser ) ; dbUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dao.save ( dbUser ) ; } return dbUser ; }
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 , boolean reply ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , null , reply ) ; }

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 canDo , boolean success , boolean reply , java.lang.String errorMessage ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , null , reply , errorMessage ) ; }
Source:
public org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore computeScore ( java.util.List < java.util.Map < java.lang.String , java.lang.String > > migrationIds ) { org.ovirt.optimizer.solver.problemspace.OptimalDistributionStepsSolution sourceSolution = null ; synchronized ( this ) { sourceSolution = bestSolution ; } return org.ovirt.optimizer.solver.util.SolverUtils.computeScore ( sourceSolution , migrationIds , java.util.Collections.< java.lang.String > emptySet ( ) , customDrlFiles ) ; }

Target:
public org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore computeScore ( org.ovirt.optimizer.rest.dto.Result oldResult ) { org.ovirt.optimizer.solver.problemspace.OptimalDistributionStepsSolution sourceSolution = null ; synchronized ( this ) { sourceSolution = bestSolution ; } return org.ovirt.optimizer.solver.util.SolverUtils.computeScore ( sourceSolution , oldResult , java.util.Collections.< java.lang.String > emptySet ( ) , customDrlFiles ) ; }
Source:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValueMock = org.mockito.Mockito.when ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) . getReturnValue ( ) ) . thenReturn ( returnValue ) . getMock ( ) ; org.mockito.Mockito.when ( mockBackend.RunPublicQuery ( org.mockito.Matchers.eq ( queryType ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( queryReturnValueMock ) ; }

Target:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValueMock = org.mockito.Mockito.when ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) . getReturnValue ( ) ) . thenReturn ( returnValue ) . getMock ( ) ; org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.Matchers.eq ( queryType ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( queryReturnValueMock ) ; }
Source:
private void copyStyleToCascadeButton ( org.ovirt.engine.ui.common.widget.action.ActionButton newActionButton ) { java.lang.String styleString = ( ( com.google.gwt.user.client.ui.Widget ) ( newActionButton ) ) . getStyleName ( ) ; if ( styleString != null ) { java.lang.String [ ] stylesArray = styleString.split ( " " ) ; for ( java.lang.String singleStyle : stylesArray ) { if ( ! ( singleStyle.startsWith ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.GWT_PREFIX ) ) ) { cascadeButton.addStyleName ( singleStyle ) ; } } } }

Target:
private void copyStyleToCascadeButton ( org.ovirt.engine.ui.common.widget.action.ActionButton newActionButton ) { java.lang.String styleString = ( ( com.google.gwt.user.client.ui.Widget ) ( newActionButton ) ) . getStyleName ( ) . trim ( ) ; if ( ( styleString != null ) && ( ! ( styleString.isEmpty ( ) ) ) ) { java.lang.String [ ] stylesArray = styleString.split ( "\\s+" ) ; for ( java.lang.String singleStyle : stylesArray ) { if ( ! ( singleStyle.startsWith ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.GWT_PREFIX ) ) ) { cascadeButton.addStyleName ( singleStyle ) ; } } } }
Source:
protected void initCommands ( ) { org.ovirt.engine.ui.uicommonweb.UICommand command = new org.ovirt.engine.ui.uicommonweb.UICommand ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.NumaSupportModel.SUBMIT_NUMA_SUPPORT , this ) ; command.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . ok ( ) ) ; getCommands ( ) . add ( command ) ; command = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) ; command.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) ; command.setIsCancel ( true ) ; command.setIsDefault ( true ) ; getCommands ( ) . add ( command ) ; }

Target:
protected void initCommands ( ) { org.ovirt.engine.ui.uicommonweb.UICommand command = new org.ovirt.engine.ui.uicommonweb.UICommand ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.NumaSupportModel.SUBMIT_NUMA_SUPPORT , this ) ; command.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . ok ( ) ) ; getCommands ( ) . add ( command ) ; getCommands ( ) . add ( org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultCancelUiCommand ( "Cancel" , this ) ) ; }
Source:
public void setEnabled ( boolean enabled ) { contentWidget.setEnabled ( enabled ) ; if ( enabled ) { getFormLabel ( ) . getElement ( ) . replaceClassName ( OvirtCss.LABEL_DISABLED , OvirtCss.LABEL_ENABLED ) ; } else { getFormLabel ( ) . getElement ( ) . replaceClassName ( OvirtCss.LABEL_ENABLED , OvirtCss.LABEL_DISABLED ) ; } }

Target:
public void setEnabled ( boolean enabled ) { contentWidget.setEnabled ( enabled ) ; if ( enabled ) { getFormLabel ( ) . getElement ( ) . replaceClassName ( OvirtCss.LABEL_DISABLED , OvirtCss.LABEL_ENABLED ) ; setWidgetTooltip ( "" ) ; } else { getFormLabel ( ) . getElement ( ) . replaceClassName ( OvirtCss.LABEL_ENABLED , OvirtCss.LABEL_DISABLED ) ; } }
Source:
public static void getMaxNumOfCPUsPerSocket ( 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.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }
Source:
private void assertInterfaceModified ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { java.util.Set < java.lang.String > modifiedNames = new java.util.HashSet < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface modifiedIface : helper.getModifiedInterfaces ( ) ) { modifiedNames.add ( modifiedIface.getName ( ) ) ; } junit.framework.Assert.assertTrue ( java.text.MessageFormat.format ( "Expected interface ''{0}'' to be modified but it wasn''t. Modified interfaces: {1}" , iface , helper.getModifiedInterfaces ( ) ) , modifiedNames.contains ( iface.getName ( ) ) ) ; }

Target:
private void assertInterfaceModified ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { java.util.Set < java.lang.String > modifiedNames = new java.util.HashSet < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface modifiedIface : helper.getModifiedInterfaces ( ) ) { modifiedNames.add ( modifiedIface.getName ( ) ) ; } org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "Expected interface ''{0}'' to be modified but it wasn''t. Modified interfaces: {1}" , iface , helper.getModifiedInterfaces ( ) ) , modifiedNames.contains ( iface.getName ( ) ) ) ; }
Source:
public static void GetDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void GetMinimalVmMemSize ( 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 ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void testGetVmNumaNodeInfoByBdsGroupIdAsMap ( ) { org.ovirt.engine.core.compat.Guid vdsGroupId = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > > result = vmNumaNodeDao.getVmNumaNodeInfoByClusterIdAsMap ( vdsGroupId ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( 2 , result.get ( vmId ) . size ( ) ) ; }

Target:
public void testGetVmNumaNodeInfoByBdsGroupId ( ) { org.ovirt.engine.core.compat.Guid vdsGroupId = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > > result = vmNumaNodeDao.getVmNumaNodeInfoByClusterId ( vdsGroupId ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( 2 , result.get ( vmId ) . size ( ) ) ; }
Source:
public static void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsNone ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL ) , network , attachment ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network createNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; network.setName ( "networkName" ) ; return network ; }
Source:
public org.ovirt.engine.core.dao.network.InterfaceDao getInterfaceDAO ( ) { return getDbFacade ( ) . getInterfaceDao ( ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getNewUpServer ( org.ovirt.engine.core.common.businessentities.VDS upServer ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = getVdsDAO ( ) . getAllForVdsGroupWithStatus ( getVdsGroupId ( ) , VDSStatus.Up ) ; org.ovirt.engine.core.common.businessentities.VDS newUpServer = null ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdsList ) { if ( ( ! ( getVdsId ( ) . equals ( vds.getId ( ) ) ) ) && ( ! ( upServer.getId ( ) . equals ( vds.getId ( ) ) ) ) ) { newUpServer = vds ; break ; } } return newUpServer ; }
Source:
public org.ovirt.engine.core.common.businessentities.UserProfile mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.UserProfile entity = new org.ovirt.engine.core.common.businessentities.UserProfile ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "profile_id" ) ) ; entity.setUserId ( getGuidDefaultEmpty ( rs , "user_id" ) ) ; entity.setSshPublicKey ( rs.getString ( "ssh_public_key" ) ) ; entity.setLoginName ( rs.getString ( "login_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.UserProfile mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.UserProfile entity = new org.ovirt.engine.core.common.businessentities.UserProfile ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "profile_id" ) ) ; entity.setUserId ( getGuidDefaultEmpty ( rs , "user_id" ) ) ; entity.setSshPublicKeyId ( getGuidDefaultEmpty ( rs , "ssh_public_key_id" ) ) ; entity.setSshPublicKey ( rs.getString ( "ssh_public_key" ) ) ; entity.setLoginName ( rs.getString ( "login_name" ) ) ; return entity ; }
Source:
public org.ovirt.engine.core.common.businessentities.vds_spm_id_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.vds_spm_id_map entity = new org.ovirt.engine.core.common.businessentities.vds_spm_id_map ( ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "vds_id" ) ) ) ; entity.setvds_spm_id ( rs.getInt ( "vds_spm_id" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.vds_spm_id_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.vds_spm_id_map entity = new org.ovirt.engine.core.common.businessentities.vds_spm_id_map ( ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "vds_id" ) ) ) ; entity.setvds_spm_id ( rs.getInt ( "vds_spm_id" ) ) ; return entity ; }
Source:
private void handleGenericException ( java.lang.Exception e ) { log.error ( "Error: {}" , e.getMessage ( ) ) ; log.error ( "Exception" , e ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FutureVDSCommand.setVdsRuntimeErrorAndReport ( ( e instanceof java.lang.RuntimeException ? ( ( java.lang.RuntimeException ) ( e ) ) : new java.lang.RuntimeException ( e ) ) ) ; }

Target:
private void handleGenericException ( java.lang.Exception e ) { log.error ( "Error: {}" , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FutureVDSCommand.setVdsRuntimeErrorAndReport ( ( e instanceof java.lang.RuntimeException ? ( ( java.lang.RuntimeException ) ( e ) ) : new java.lang.RuntimeException ( e ) ) ) ; }
Source:
private void setVmTicket ( ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.SetVmTicket , new org.ovirt.engine.core.common.action.SetVmTicketParameters ( getEntity ( ) . getId ( ) , null , 120 ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel spiceConsoleModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( result.getState ( ) ) ) ; spiceConsoleModel.postSendVmTicket ( result.getReturnValue ( ) ) ; } } , this ) ; }

Target:
private void setVmTicket ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.SetVmTicket , new org.ovirt.engine.core.common.action.SetVmTicketParameters ( getEntity ( ) . getId ( ) , null , 120 ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel spiceConsoleModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( result.getState ( ) ) ) ; spiceConsoleModel.postSendVmTicket ( result.getReturnValue ( ) ) ; } } , this ) ; }
Source:
public void fakeVlanNicWithVmNetworkDenied ( ) { org.ovirt.engine.core.common.businessentities.network.Network net1 = createNetwork ( "net1" ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = createNetwork ( "net2" ) ; net2.setVlanId ( 100 ) ; mockExistingNetworks ( net1 , net2 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface fakeVlanNic = createVlan ( nic.getName ( ) , 100 , net2.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , fakeVlanNic ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , nic.getName ( ) ) ; }

Target:
public void nonVmNetworkWithVlanVmNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network net1 = createNetwork ( "net1" ) ; net1.setVmNetwork ( false ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = createNetwork ( "net2" ) ; net2.setVlanId ( 200 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = createVlan ( nic , net2.getVlanId ( ) , net2.getName ( ) ) ; mockExistingNetworks ( net1 , net2 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , vlan ) ) ; validateAndExpectNoViolations ( helper ) ; }
Source:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { setSdDiscardSupport ( true , false ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
public void testMigrateMacsToAnotherMacPool ( ) throws java.lang.Exception { underTest.migrateMacsToAnotherMacPool ( sourceMacPoolId , targetMacPoolId , macsToMigrate , false , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( sourceMacPoolId , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( targetMacPoolId , commandContext ) ; org.mockito.InOrder inOrder = org.mockito.Mockito.inOrder ( sourceMacPool , targetMacPool ) ; inOrder.verify ( sourceMacPool ) . freeMacs ( macsToMigrate ) ; inOrder.verify ( targetMacPool ) . forceAddMacs ( macsToMigrate ) ; }

Target:
public void canMigrateMacsToAnotherMacPoolWhenThereAreThereIsNothingToMigrate ( ) { org.mockito.Mockito.when ( vmNicDao.getAllMacsByClusterId ( cluster.getId ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( underTest.canMigrateMacsToAnotherMacPool ( cluster , targetMacPoolId ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return validateCoherentIdentification ( bond.getId ( ) , nicId , nicName , message , existingInterfacesMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( bond.getName ( ) , nicId , nicName , message , existingInterfacesMap ) ; }
Source:
public void testBlockSettingHaOnHostedEngine ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; vmStatic.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; command.getParameters ( ) . getVm ( ) . setAutoStartup ( true ) ; boolean validInput = command.validate ( ) ; org.junit.Assert.assertFalse ( validInput ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_BE_HIGHLY_AVAILABLE_AND_HOSTED_ENGINE.name ( ) ) ) ; }

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:
private void applyModeCustomizations ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.getUiMode ( ) ) == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) { optimizationTab.setVisible ( false ) ; resiliencePolicyTab.setVisible ( false ) ; clusterPolicyTab.setVisible ( false ) ; dataCenterPanel.addStyleName ( style.generalTabTopDecoratorEmpty ( ) ) ; } }

Target:
private void applyModeCustomizations ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.getUiMode ( ) ) == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) { optimizationTab.setVisible ( false ) ; resiliencePolicyTab.setVisible ( false ) ; clusterPolicyTab.setVisible ( false ) ; consoleTab.setVisible ( false ) ; dataCenterPanel.addStyleName ( style.generalTabTopDecoratorEmpty ( ) ) ; } }
Source:
public static void updateMemoryBalloon ( org.ovirt.engine.core.compat.Guid id , boolean shouldHaveBalloon ) { boolean hasBalloon = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.isMemBalloonEnabled ( id ) ; if ( hasBalloon != shouldHaveBalloon ) { if ( ( ! hasBalloon ) && shouldHaveBalloon ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addEmptyMemoryBalloon ( id ) ; } else { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( id , VmDeviceGeneralType.BALLOON ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.removeNumberOfDevices ( list , 1 ) ; } } }

Target:
public static void addImportedDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , boolean isImportAsNewEntity ) { if ( isImportAsNewEntity ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setNewIdInImportedCollections ( vmBase ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToAdd = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToUpdate = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDiskDevices ( vmBase , vmDevicesToUpdate ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedInterfaces ( vmBase , vmDevicesToUpdate ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedOtherDevices ( vmBase , vmDevicesToAdd ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.saveAll ( vmDevicesToAdd ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.updateAll ( vmDevicesToUpdate ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc changeFloppy ( java.lang.String vmId , java.lang.String imageLocation ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.changeFloppy" ) . withParameter ( "vmID" , vmId ) . withParameter ( "driveSpec" , imageLocation ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn amendVolume ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > volInfo , java.util.Map < java.lang.String , java.lang.Object > volAttr ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.amend_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , volInfo ) . withParameter ( "vol_attr" , volAttr ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , valid , success ) ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: remove ) , detail ) ; }
Source:
protected void onBrowserEvent2 ( com.google.gwt.user.client.Event event ) { mousePosition [ 0 ] = event.getClientX ( ) ; mousePosition [ 1 ] = event.getClientY ( ) ; if ( ( org.ovirt.engine.ui.common.widget.table.AbstractActionTable.CLICK.equals ( event.getType ( ) ) ) && ( ! ( multiSelectionDisabled ) ) ) { selectionModel.setMultiSelectEnabled ( event.getCtrlKey ( ) ) ; selectionModel.setMultiRangeSelectEnabled ( event.getShiftKey ( ) ) ; } super . onBrowserEvent2 ( event ) ; }

Target:
protected void onBrowserEvent2 ( com.google.gwt.user.client.Event event ) { mousePosition [ 0 ] = event.getClientX ( ) ; mousePosition [ 1 ] = event.getClientY ( ) ; if ( ( org.ovirt.engine.ui.common.widget.table.AbstractActionTable.CLICK.equals ( event.getType ( ) ) ) && ( ! ( multiSelectionDisabled ) ) ) { selectionModel.setMultiSelectEnabled ( event.getCtrlKey ( ) ) ; selectionModel.setMultiRangeSelectEnabled ( event.getShiftKey ( ) ) ; } table.setFocus ( false ) ; super . onBrowserEvent2 ( event ) ; }
Source:
public static 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 static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void setLangPageShown ( javax.servlet.http.HttpServletResponse response , boolean value ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.DocsServlet.LANG_PAGE_SHOWN , java.lang.Boolean.toString ( value ) ) ; cookie.setPath ( getServletContext ( ) . getContextPath ( ) ) ; cookie.setHttpOnly ( true ) ; response.addCookie ( cookie ) ; }

Target:
private void setLangPageShown ( javax.servlet.http.HttpServletResponse response , boolean value ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.DocsServlet.LANG_PAGE_SHOWN , java.lang.Boolean.toString ( value ) ) ; cookie.setSecure ( true ) ; cookie.setPath ( getServletContext ( ) . getContextPath ( ) ) ; cookie.setHttpOnly ( true ) ; response.addCookie ( cookie ) ; }
Source:
public void onSuccess ( java.lang.String currentOsDefaultIcon ) { java.lang.String iconToShow = getIconToShow ( currentOsDefaultIcon ) ; org.ovirt.engine.core.compat.Guid smallIconId = getSmallIconId ( iconToShow , oldIcon , currentOsDefaultIcon , osDefaultIconId ) ; org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault newIconPair = new org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault ( iconToShow , currentOsDefaultIcon , smallIconId ) ; getIcon ( ) . setEntity ( newIconPair ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getBehavior ( ) . deactivateInstanceTypeManager ( ) ; updateWatchdogItems ( ( ( java.util.HashSet < org.ovirt.engine.core.common.businessentities.VmWatchdogType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; getBehavior ( ) . activateInstanceTypeManager ( ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.provider.UpdateProviderCommand.getProviderDao ( ) . update ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.UpdateProviderCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.provider.UpdateProviderCommand.getProviderDao ( ) . update ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( getProvider ( ) ) ; if ( providerProxy != null ) { providerProxy.onModification ( ) ; } org.ovirt.engine.core.bll.provider.UpdateProviderCommand.setSucceeded ( true ) ; }
Source:
protected void updateCpuSharesAvailability ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean availableCpuShares = ( cluster.getCompatibilityVersion ( ) . compareTo ( Version.v3_3 ) ) >= 0 ; getModel ( ) . getCpuSharesAmountSelection ( ) . setIsAvailable ( availableCpuShares ) ; getModel ( ) . getCpuSharesAmount ( ) . setIsAvailable ( availableCpuShares ) ; } }

Target:
protected void updateMemoryBalloon ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getModel ( ) . getSelectedCluster ( ) ; java.lang.Integer osType = getModel ( ) . getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster != null ) && ( osType != null ) ) { updateMemoryBalloon ( getModel ( ) . getCompatibilityVersion ( ) , osType ) ; } }
Source:
public void testVmInPreview ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW.name ( ) ) ) ; }

Target:
public void testVmDuringMigration ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ) . when ( vmValidator ) . vmNotDuringMigration ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ; }
Source:
protected void executeVmCommand ( ) { try { vmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.exportimport.ExtractOvaCommand.getVm ( ) ) ; java.util.List < java.lang.String > diskPaths = prepareImages ( ) ; boolean succeeded = runAnsibleImportOvaPlaybook ( diskPaths ) ; teardownImages ( ) ; if ( ! succeeded ) { log.error ( "Failed to extract OVA file" ) ; removeVm ( ) ; } org.ovirt.engine.core.bll.exportimport.ExtractOvaCommand.setSucceeded ( succeeded ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { log.error ( "Failed to extract OVA file" ) ; removeVm ( ) ; throw e ; } }

Target:
protected void executeVmCommand ( ) { try { vmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.exportimport.ExtractOvaCommand.getVm ( ) ) ; java.util.List < java.lang.String > diskPaths = prepareImages ( ) ; boolean succeeded = runAnsibleImportOvaPlaybook ( diskPaths ) ; teardownImages ( ) ; if ( ! succeeded ) { log.error ( "Failed to extract OVA file" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } else { org.ovirt.engine.core.bll.exportimport.ExtractOvaCommand.setSucceeded ( true ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { log.error ( "Failed to extract OVA file" , e ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc startImageTransferSession ( java.lang.String ticketId , java.lang.String ops , long expiration , java.lang.String spId , java.lang.String sdId , java.lang.String imgId , java.lang.String volId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.startImageTransferSession ( ticketId , ops , expiration , spId , sdId , imgId , volId ) ; 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 add_image_ticket ( java.lang.String ticketId , java.lang.String [ ] ops , long timeout , long size , java.lang.String url ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.add_image_ticket ( ticketId , ops , timeout , size , url ) ; 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 ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.HostJobInfo pollStorageJob ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.compat.Guid vdsId ) { if ( jobId == null ) { return null ; } org.ovirt.engine.core.common.vdscommands.GetHostJobsVDSCommandParameters p = new org.ovirt.engine.core.common.vdscommands.GetHostJobsVDSCommandParameters ( vdsId , java.util.Collections.singletonList ( jobId ) , getHostJobType ( ) ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.GetHostJobs , p ) ; return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.HostJobInfo > ) ( returnValue.getReturnValue ( ) ) ) . get ( jobId ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.HostJobInfo pollStorageJob ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.compat.Guid vdsId ) { if ( jobId == null ) { return null ; } org.ovirt.engine.core.common.vdscommands.GetHostJobsVDSCommandParameters p = new org.ovirt.engine.core.common.vdscommands.GetHostJobsVDSCommandParameters ( vdsId , java.util.Collections.singletonList ( jobId ) , getHostJobType ( ) ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = backend.getResourceManager ( ) . runVdsCommand ( VDSCommandType.GetHostJobs , p ) ; return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.HostJobInfo > ) ( returnValue.getReturnValue ( ) ) ) . get ( jobId ) ; }
Source:
public void testCredentialsWithNoConnectionExtension ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections conn = org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.createConnectionWithCredentials ( "target1" , "userConn" , "pwdConn" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > credentials = helper.getStorageConnectionCredentialsForhost ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , conn ) ; org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.assertCredentials ( credentials , conn.getuser_name ( ) , conn.getpassword ( ) ) ; }

Target:
public void testCredentialsWithNoConnectionExtension ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections conn = org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.createConnectionWithCredentials ( "target1" , "userConn" , "pwdConn" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > credentials = helper.getStorageConnectionCredentialsForhost ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , conn ) ; org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.assertCredentials ( credentials , conn.getUserName ( ) , conn.getPassword ( ) ) ; }