auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void cpuFlagsMissing ( ) { java.util.List < java.lang.String > strings = new java.util.ArrayList < java.lang.String > ( ) ; strings.add ( "foo" ) ; org.powermock.api.mockito.PowerMockito.when ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.missingServerCpuFlags ( org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( strings ) ; }

Target:
private void cpuFlagsMissing ( ) { java.util.List < java.lang.String > strings = new java.util.ArrayList < java.lang.String > ( ) ; strings.add ( "foo" ) ; org.mockito.Mockito.doReturn ( strings ) . when ( cmd ) . missingServerCpuFlags ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionDelete ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionDelete ( volumeName , remoteHost , remoteVolumeName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepSessionList ( volumeName , slaveHost , slaveVolumeName , userName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.api.v3.types.V3VM get ( ) { org.ovirt.engine.api.v3.types.V3VM vm = adaptGet ( getDelegate ( ) :: get ) ; org.ovirt.engine.api.v3.helpers.V3VmHelper.addDisksLink ( vm ) ; return vm ; }

Target:
public org.ovirt.engine.api.v3.types.V3VM get ( @ javax.ws.rs.core.Context javax.ws.rs.core.HttpHeaders headers , @ javax.ws.rs.core.Context javax.ws.rs.core.UriInfo ui ) { org.ovirt.engine.api.v3.types.V3VM vm = adaptGet ( getDelegate ( ) :: get ) ; org.ovirt.engine.api.v3.helpers.V3VmHelper.addDisksLink ( vm ) ; java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( headers , ui ) ; if ( ( details != null ) && ( ! ( details.isEmpty ( ) ) ) ) { org.ovirt.engine.api.v3.helpers.V3VmHelper.addInlineDetails ( vm , this , details ) ; } return vm ; }
Source:
public boolean supportedForUnitVmModel ( org.ovirt.engine.core.common.queries.ConfigurationValues feature , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.compat.Version version = model.getCompatibilityVersion ( ) ; if ( version == null ) { return false ; } else { return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( feature , version.getValue ( ) ) ) ) ; } }

Target:
public boolean isEnableDeprecatedClientModeSpicePlugin ( ) { return ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.EnableDeprecatedClientModeSpicePlugin , getDefaultConfigurationVersion ( ) ) ) ) ; }
Source:
protected void initFrontend ( ) { org.ovirt.engine.ui.frontend.Frontend.setEventsHandler ( frontendEventsHandler ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { user.logout ( ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }

Target:
protected void initFrontend ( ) { org.ovirt.engine.ui.frontend.Frontend.setEventsHandler ( frontendEventsHandler ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { user.logout ( ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getOsUniqueOsNames ( ) ) ) ; }
Source:
public static void enrichDiskByJsonDescription ( java.lang.String jsonDiskDescription , org.ovirt.engine.core.common.businessentities.storage.Disk disk ) throws java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > diskDescriptionMap = org.ovirt.engine.core.utils.JsonHelper.jsonToMap ( jsonDiskDescription ) ; disk.setDiskAlias ( diskDescriptionMap.get ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_ALIAS ) . toString ( ) ) ; disk.setDiskDescription ( diskDescriptionMap.get ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_DESCRIPTION ) . toString ( ) ) ; }

Target:
private java.lang.String decodeDiskProperty ( java.lang.String diskProperty ) throws org.apache.commons.codec.DecoderException { return new java.lang.String ( org.apache.commons.codec.binary.Hex.decodeHex ( diskProperty.toCharArray ( ) ) , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.CHARSET ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsIds ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.HashMap < java.lang.Integer , java.lang.String > result = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.lang.String defaultValue = result.get ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DEFAULT_OS_ID ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames = new org.ovirt.engine.ui.uicommonweb.MapWithDefaults < java.lang.Integer , java.lang.String > ( result , defaultValue ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsIds ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc create ( java.util.Map createInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.create" ) . withParameter ( "vmID" , getVmId ( createInfo ) ) . withParameter ( "vmParams" , createInfo ) . 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.OneVmReturn create ( java.util.Map createInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.create" ) . withParameter ( "vmID" , getVmId ( createInfo ) ) . withParameter ( "vmParams" , createInfo ) . 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.OneVmReturn ( response ) ; }
Source:
protected org.ovirt.engine.core.bll.aaa.SessionDataContainer getSessionDataContainer ( ) { return sessionDataContainer ; }

Target:
public void testConstructor ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.aaa.DbUser.class ) ; org.mockito.Mockito.when ( user.getId ( ) ) . thenReturn ( Guid.EVERYONE ) ; sessionDataContainer.setUser ( session , user ) ; command.postConstruct ( ) ; org.junit.Assert.assertEquals ( "wrong user id on command" , user.getId ( ) , command.getUserId ( ) ) ; }
Source:
private boolean Register ( org.ovirt.engine.core.common.businessentities.VDS vdsByUniqueId , org.ovirt.engine.core.compat.Guid vdsGroupId , boolean IsPending ) { boolean returnValue = true ; log.debugFormat ( "RegisterVdsQuery::Register - Entering" ) ; if ( vdsByUniqueId == null ) { returnValue = registerNewHost ( vdsGroupId , IsPending ) ; } else { returnValue = updateExistingHost ( vdsByUniqueId , IsPending ) ; } log.debugFormat ( "RegisterVdsQuery::Register - Leaving with value {0}" , returnValue ) ; return returnValue ; }

Target:
private boolean Register ( org.ovirt.engine.core.common.businessentities.VDS vdsByUniqueId , org.ovirt.engine.core.compat.Guid vdsGroupId , boolean IsPending ) { boolean returnValue = true ; log.debug ( "RegisterVdsQuery::Register - Entering" ) ; if ( vdsByUniqueId == null ) { returnValue = registerNewHost ( vdsGroupId , IsPending ) ; } else { returnValue = updateExistingHost ( vdsByUniqueId , IsPending ) ; } log.debug ( "RegisterVdsQuery::Register - Leaving with value {}" , returnValue ) ; return returnValue ; }
Source:
public void testCannotDisableVirtioScsi ( ) { prepareVmToPassCanDoAction ( ) ; command.getParameters ( ) . setVirtioScsiEnabled ( false ) ; org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; disk.setPlugged ( true ) ; mockDiskDaoGetAllForVm ( java.util.Collections.singletonList ( disk ) , true ) ; mockVmValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ; }

Target:
public void testChangeClusterForbidden ( ) { prepareVmToPassValidate ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newGroup = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_0 ) ; vmStatic.setClusterId ( newGroup.getId ( ) ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( command ) . getClusterDao ( ) ; org.junit.Assert.assertFalse ( "validate should have failed with can't change cluster." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public 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.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public static void GetNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }

Target:
public void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback != null ) { callback.Executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( actionType , parameters , null , state ) ) ; } }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback != null ) { callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( actionType , parameters , null , state ) ) ; } }
Source:
void pluginFailed ( org.ovirt.engine.ui.webadmin.plugin.Plugin plugin ) { com.google.gwt.dom.client.Document.get ( ) . getBody ( ) . removeChild ( plugin.getIFrameElement ( ) ) ; plugin.markAsFailed ( ) ; org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.warning ( ( ( "Plugin [" + ( plugin.getMetaData ( ) . getName ( ) ) ) + "] removed from service due to failure" ) ) ; }

Target:
public void onError ( java.lang.String message ) { org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.severe ( ( ( ( ( ( "Exception caught while invoking event handler function [" + functionName ) + "] for plugin [" ) + pluginName ) + "]: " ) + message ) ) ; com.google.gwt.dom.client.Document.get ( ) . getBody ( ) . removeChild ( plugin.getIFrameElement ( ) ) ; plugin.markAsFailed ( ) ; org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.warning ( ( ( "Plugin [" + pluginName ) + "] removed from service due to failure" ) ) ; }
Source:
private void setUpDaoMocks ( ) { snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.doReturn ( snapshotDaoMock ) . when ( getQuery ( ) ) . getSnapshotDao ( ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAllWithConfiguration ( vmId ) ) . thenReturn ( java.util.Arrays.asList ( snapshot ) ) ; }

Target:
private void setUpDaoMocks ( ) { snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.doReturn ( snapshotDaoMock ) . when ( getQuery ( ) ) . getSnapshotDao ( ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAllWithConfiguration ( vmId ) ) . thenReturn ( java.util.Collections.singletonList ( snapshot ) ) ; }
Source:
public void getDiskList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public static void getDataCentersByStorageDomain ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getGlusterRemoveBricksStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters parameters = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters ( clusterId , volumeId , bricks ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeRemoveBricksStatus , parameters , aQuery ) ; }
Source:
public java.lang.String getAdUserName ( ) { if ( ( mAdUserName ) == null ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . get ( getAdUserId ( ) ) ; if ( user != null ) { mAdUserName = user.getLoginName ( ) ; } } return mAdUserName ; }

Target:
public java.lang.String getAdUserName ( ) { if ( ( mAdUserName ) == null ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . get ( getAdUserId ( ) ) ; if ( user != null ) { mAdUserName = user.getLoginName ( ) ; } } return mAdUserName ; }
Source:
public void canRemoveBrickEmptyList ( ) { org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( java.util.Collections.emptyList ( ) , getDistributedVolume ( volumeId1 , 1 ) , 3 , false ) ; org.junit.Assert.assertFalse ( validationResult.isValid ( ) ) ; org.junit.Assert.assertTrue ( ( ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_BRICKS_REQUIRED ) == ( validationResult.getMessage ( ) ) ) ) ; }

Target:
public void canRemoveBrickEmptyList ( ) { org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( java.util.Collections.emptyList ( ) , getDistributedVolume ( volumeId1 , 1 ) , 3 , false ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_BRICKS_REQUIRED ) ) ; }
Source:
private void mockSnapshotsValidator ( ) { org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
private void mockSnapshotsValidator ( ) { org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDSGroup createCluster ( int index ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setCompatibilityVersion ( Version.v3_2 ) ; return cluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.Cluster createCluster ( int index ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setCompatibilityVersion ( Version.v3_2 ) ; return cluster ; }
Source:
public void updateDocumentationBaseURL ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDocumentationBaseURL ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.String documentationBaseURL = ( ( java.lang.String ) ( returnValue ) ) ; boolean isDocumentationAvailable = ! ( documentationBaseURL.equals ( "" ) ) ; setDocumentationAvailable ( isDocumentationAvailable ) ; setDocumentationBasePath ( documentationBaseURL ) ; onUpdateDocumentationBaseURL ( ) ; } } ) ) ; }

Target:
public void updateDocumentationBaseURL ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDocumentationBaseURL ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.String documentationBaseURL = ( ( java.lang.String ) ( returnValue ) ) ; boolean isDocumentationAvailable = ! ( documentationBaseURL.equals ( "" ) ) ; setDocumentationAvailable ( isDocumentationAvailable ) ; setDocumentationBasePath ( documentationBaseURL ) ; onUpdateDocumentationBaseURL ( ) ; } } ) ) ; }
Source:
public void updateDefaultDisplayForVmTag ( org.ovirt.engine.core.common.businessentities.TagsVmMap tagsVmMap ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "tag_id" , tagsVmMap.gettag_id ( ) ) . addValue ( "vm_id" , tagsVmMap.getvm_id ( ) ) . addValue ( "DefaultDisplayType" , tagsVmMap.getDefaultDisplayType ( ) ) ; getCallsHandler ( ) . executeModification ( "UpdateVmTagsDefaultDisplayType" , parameterSource ) ; }

Target:
public void updateDefaultDisplayForVmTag ( org.ovirt.engine.core.common.businessentities.TagsVmMap tagsVmMap ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "tag_id" , tagsVmMap.getTagId ( ) ) . addValue ( "vm_id" , tagsVmMap.getVmId ( ) ) . addValue ( "DefaultDisplayType" , tagsVmMap.getDefaultDisplayType ( ) ) ; getCallsHandler ( ) . executeModification ( "UpdateVmTagsDefaultDisplayType" , parameterSource ) ; }
Source:
private void generateEnum ( org.ovirt.api.metamodel.concepts.EnumType type ) { org.ovirt.sdk.python.PythonClassName typeName = pythonNames.getTypeName ( type ) ; buffer.addLine ( "class %1$s(object):" , typeName.getClassName ( ) ) ; buffer.addLine ( ) ; buffer.startBlock ( ) ; type.values ( ) . sorted ( ) . forEach ( this :: generateEnumValue ) ; buffer.addLine ( ) ; buffer.endBlock ( ) ; buffer.addLine ( ) ; }

Target:
private void generateEnum ( org.ovirt.api.metamodel.concepts.EnumType type ) { org.ovirt.sdk.python.PythonClassName typeName = pythonNames.getTypeName ( type ) ; buffer.addLine ( "@unique" ) ; buffer.addLine ( "class %1$s(Enum):" , typeName.getClassName ( ) ) ; buffer.startBlock ( ) ; type.values ( ) . sorted ( ) . forEach ( this :: generateEnumValue ) ; buffer.addLine ( ) ; buffer.addLine ( "def __init__(self, image):" ) ; buffer.startBlock ( ) ; buffer.addLine ( "self._image = image" ) ; buffer.endBlock ( ) ; buffer.addLine ( ) ; buffer.addLine ( "def __str__(self):" ) ; buffer.startBlock ( ) ; buffer.addLine ( "return self._image" ) ; buffer.endBlock ( ) ; buffer.addLine ( ) ; buffer.endBlock ( ) ; buffer.addLine ( ) ; }
Source:
private void handleAddPermissions ( java.lang.String domainName , java.lang.String userName , java.lang.String userId ) { if ( args.contains ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_ADD_PERMISSIONS ) ) { updatePermissionsTable ( userName , domainName , userId ) ; } else if ( ! ( userHasPermissions ( userName , domainName ) ) ) { java.lang.System.out.println ( java.lang.String.format ( INFO_ABOUT_NOT_ADDING_PERMISSIONS , domainName ) ) ; } }

Target:
private void handleAddPermissions ( java.lang.String domainName , java.lang.String userName , java.lang.String userId ) { if ( args.containsKey ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_ADD_PERMISSIONS ) ) { updatePermissionsTable ( userName , domainName , userId ) ; } else if ( ! ( userHasPermissions ( userName , domainName ) ) ) { java.lang.System.out.println ( java.lang.String.format ( INFO_ABOUT_NOT_ADDING_PERMISSIONS , domainName ) ) ; } }
Source:
public void updateVnicProfileTabValidity ( boolean isValid ) { if ( isValid ) { profilesTab.markAsValid ( ) ; } else { profilesTab.markAsInvalid ( null ) ; } }

Target:
protected void populateTabMap ( ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.GENERAL_TAB , this . generalTab ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.CLUSTERS_TAB , this . clusterTab ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.PROFILES_TAB , this . profilesTab ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.SUBNET_TAB , this . subnetTab ) ; }
Source:
private static boolean updateDiskProfileForBackwardCompatibility ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage , java.util.List < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > diskProfilesList , java.util.Set < org.ovirt.engine.core.compat.Guid > permittedDiskProfilesIds , org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { for ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile diskProfile : diskProfilesList ) { if ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.isDiskProfilePermitted ( diskProfile , permittedDiskProfilesIds , user ) ) { permittedDiskProfilesIds.add ( diskProfile.getId ( ) ) ; diskImage.setDiskProfileId ( diskProfile.getId ( ) ) ; return true ; } } return false ; }

Target:
private static boolean updateDiskProfileForBackwardCompatibility ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , java.util.List < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > diskProfilesList , java.util.Set < org.ovirt.engine.core.compat.Guid > permittedDiskProfilesIds , org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { for ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile diskProfile : diskProfilesList ) { if ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.isDiskProfilePermitted ( diskProfile , permittedDiskProfilesIds , user ) ) { permittedDiskProfilesIds.add ( diskProfile.getId ( ) ) ; diskImage.setDiskProfileId ( diskProfile.getId ( ) ) ; return true ; } } return false ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
protected boolean performImagesChecks ( org.ovirt.engine.core.compat.Guid spId ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , spId , getStorageDomainId ( ) . getValue ( ) , false , true , false , false , false , true , java.util.Collections.< org.ovirt.engine.core.common.businessentities.Disk > emptyList ( ) ) ; }

Target:
private boolean isExceedMaxBlockDiskSize ( ) { if ( org.ovirt.engine.core.bll.AddDiskCommand.getStorageDomain ( ) . getStorageType ( ) . isBlockDomain ( ) ) { return ( getRequestDiskSpace ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxBlockDiskSize ) ) ; } return false ; }
Source:
public void getUsbPolicyUsbTypeLegacy ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "legacy" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicyOnUpdateCurrentlyDisabledGotNullUsb ( ) { org.ovirt.engine.api.model.Usb usb = null ; org.ovirt.engine.core.common.businessentities.UsbPolicy currentPolicy = org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , currentPolicy ) , currentPolicy ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.ServerCpu FindMaxServerCpu ( java.lang.String clusterCpuName , java.lang.String serverFlags , org.ovirt.engine.core.compat.Version ver ) { final org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager cpuFlagsManager = org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.get ( ver ) ; if ( cpuFlagsManager != null ) { return cpuFlagsManager.FindMaxServerCpu ( clusterCpuName , serverFlags ) ; } return null ; }

Target:
public static boolean isCpuUpdatable ( java.lang.String cpuName , org.ovirt.engine.core.compat.Version ver ) { final org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager cpuFlagsManager = org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.get ( ver ) ; org.ovirt.engine.core.common.businessentities.ServerCpu server = null ; if ( cpuFlagsManager != null ) { server = cpuFlagsManager.getServerCpuByName ( cpuName ) ; } int serverLevel = ( server != null ) ? server.getLevel ( ) : 0 ; return serverLevel != 0 ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getAddCommand ( ) ) ) { add ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getAddCommand ( ) ) ) { add ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } }
Source:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
private boolean validate ( org.ovirt.engine.core.bll.ValidationResult validationResult ) { if ( ! ( validationResult.isValid ( ) ) ) { addViolation ( validationResult.getMessage ( ) , null ) ; } return validationResult.isValid ( ) ; }

Target:
private java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > getNicNameToNetworksMap ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > nicNameToNetworksMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : attachmentsToConfigure ) { java.lang.String mapKey = attachment.getNicName ( ) ; org.ovirt.engine.core.common.businessentities.network.Network networkToConfigure = existingNetworkRelatedToAttachment ( attachment ) ; org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( mapKey , networkToConfigure , nicNameToNetworksMap , new org.ovirt.engine.core.utils.collections.MultiValueMapUtils.ListCreator < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ) ; } return nicNameToNetworksMap ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.SetDataCenter ( model , list ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.setDataCenter ( model , list ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWithNoCpuName ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.undefined ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWithNoCpuName ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.undefined ) ; group.setClusterPolicyId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return group ; }
Source:
private void assertValidationFailure ( org.ovirt.engine.core.bll.ValidationResult validationResult , org.ovirt.engine.core.common.errors.EngineMessage engineMessage ) { assertFalse ( validationResult.isValid ( ) ) ; assertTrue ( java.lang.String.format ( "Expected %s but got %s" , engineMessage.name ( ) , validationResult.getMessage ( ) . name ( ) ) , ( ( validationResult.getMessage ( ) ) == engineMessage ) ) ; }

Target:
public void shouldDetectNonContinuousNodeIndices ( ) { vmNumaNodes.get ( 0 ) . setIndex ( 0 ) ; vmNumaNodes.get ( 1 ) . setIndex ( 2 ) ; assertValidationFailure ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_NON_CONTINUOUS_INDEX ) ; }
Source:
public void testAddVersionNoBaseTemplateId ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Template t = org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.getModel ( 2 ) ; t.getVersion ( ) . setBaseTemplate ( null ) ; try { collection.add ( t ) ; org.junit.jupiter.api.Assertions.fail ( "Should have failed with 400 error due to a missing base template" ) ; } catch ( javax.ws.rs.WebApplicationException e ) { verifyBadRequest ( e ) ; } }

Target:
public void testAddVersionNoBaseTemplateId ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Template t = org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.getModel ( 2 ) ; t.getVersion ( ) . setBaseTemplate ( null ) ; verifyBadRequest ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( t ) ) ) ; }
Source:
private boolean showWarningForByVmSnapshotsValidation ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : snapshots ) { if ( ( ! ( validateNewSnapshotByStatus ( snapshot.getStatus ( ) ) ) ) || ( ! ( validateNewSnapshotByType ( snapshot.getType ( ) ) ) ) ) { getDescription ( ) . setIsAvailable ( false ) ; return true ; } } return false ; }

Target:
private boolean showWarningForByVmSnapshotsValidation ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : snapshots ) { if ( ( ! ( validateNewSnapshotByStatus ( snapshot.getStatus ( ) ) ) ) || ( ! ( validateNewSnapshotByType ( snapshot.getType ( ) ) ) ) ) { getDescription ( ) . setIsAvailable ( false ) ; getMemory ( ) . setIsAvailable ( false ) ; return true ; } } return false ; }
Source:
public void parseReport ( java.lang.String xmlPath ) { com.google.gwt.xml.client.Document messageDom = com.google.gwt.xml.client.XMLParser.parse ( xmlPath ) ; com.google.gwt.xml.client.Element reportsElement = ( ( com.google.gwt.xml.client.Element ) ( messageDom.getElementsByTagName ( "reports" ) . item ( 0 ) ) ) ; com.google.gwt.xml.client.NodeList dashboradsNodeList = reportsElement.getElementsByTagName ( "dashboard" ) ; initDashboards ( dashboradsNodeList ) ; com.google.gwt.xml.client.NodeList resourcesNodeList = reportsElement.getElementsByTagName ( "resource" ) ; initResources ( resourcesNodeList ) ; }

Target:
public boolean parseReport ( java.lang.String xmlPath ) { try { com.google.gwt.xml.client.Document messageDom = com.google.gwt.xml.client.XMLParser.parse ( xmlPath ) ; com.google.gwt.xml.client.Element reportsElement = ( ( com.google.gwt.xml.client.Element ) ( messageDom.getElementsByTagName ( "reports" ) . item ( 0 ) ) ) ; com.google.gwt.xml.client.NodeList dashboradsNodeList = reportsElement.getElementsByTagName ( "dashboard" ) ; initDashboards ( dashboradsNodeList ) ; com.google.gwt.xml.client.NodeList resourcesNodeList = reportsElement.getElementsByTagName ( "resource" ) ; initResources ( resourcesNodeList ) ; } catch ( java.lang.Throwable e ) { return false ; } return true ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityInfo" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID ) } , true , true , false ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( ActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityInfo" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID ) } , true , true , false ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public int hashCode ( ) { return java.util.Objects.hash ( id , hostName , consoleAddress , name , otpValidity , pmEnabled , pmKdumpDetection , port , sshPort , sshUsername , serverSslEnabled , uniqueId , clusterId , vdsStrength , vdsType , disablePowerManagementPolicy , hostProviderId , openstackNetworkProviderId , currentKernelCmdline , kernelCmdlineParsable , lastStoredKernelCmdline , kernelCmdlineIommu , kernelCmdlineKvmNested , kernelCmdlinePciRealloc , kernelCmdlineUnsafeInterrupts ) ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( id , hostName , consoleAddress , name , otpValidity , pmEnabled , pmKdumpDetection , port , sshPort , sshUsername , serverSslEnabled , uniqueId , clusterId , vdsStrength , vdsType , disablePowerManagementPolicy , hostProviderId , openstackNetworkProviderId , currentKernelCmdline , kernelCmdlineParsable , lastStoredKernelCmdline , kernelCmdlineIommu , kernelCmdlineKvmNested , kernelCmdlinePciRealloc , kernelCmdlineUnsafeInterrupts , reinstallRequired ) ; }