auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void internalEndWithFailure ( ) { log.error ( "Ending command '{}' with failure." , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { if ( hasStepsToRevert ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }

Target:
private void internalEndWithFailure ( ) { log.error ( "Ending command '{}' with failure." , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { if ( hasStepsToRevert ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } else { getReturnValue ( ) . setEndActionTryAgain ( false ) ; } startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }
Source:
public static 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.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void GetVmNicList ( 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.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.DiskLunMap > createEntityRowMapper ( ) { return new org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.DiskLunMap > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.DiskLunMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.DiskLunMap diskLunMap = new org.ovirt.engine.core.common.businessentities.DiskLunMap ( ) ; diskLunMap.setDiskId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "disk_id" ) ) ) ; diskLunMap.setLunId ( rs.getString ( "lun_id" ) ) ; return diskLunMap ; } } ; }

Target:
protected org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.DiskLunMap > createEntityRowMapper ( ) { return org.ovirt.engine.core.dao.DiskLunMapDaoDbFacadeImpl.DiskLunMapRowMapper.instance ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedLabels ( java.lang.String ... removedLabels ) { if ( emptyParameters ( removedLabels ) ) { return this ; } if ( ( parameters.getRemovedLabels ( ) ) == null ) { parameters.setRemovedLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; } parameters.getRemovedLabels ( ) . addAll ( java.util.Arrays.asList ( removedLabels ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedLabels ( java.lang.String ... removedLabels ) { if ( nullParameters ( removedLabels ) ) { return this ; } if ( ( parameters.getRemovedLabels ( ) ) == null ) { parameters.setRemovedLabels ( new java.util.HashSet < > ( ) ) ; } parameters.getRemovedLabels ( ) . addAll ( java.util.Arrays.asList ( removedLabels ) ) ; return this ; }
Source:
private boolean networkAttachedToHost ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsAttachedToNetwork = getDbFacade ( ) . getVdsDao ( ) . getAllForNetwork ( attachment.getNetworkId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS hostAttachedToNetwork : hostsAttachedToNetwork ) { if ( hostAttachedToNetwork.getId ( ) . equals ( host.getId ( ) ) ) { return true ; } } return false ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult ipConfiguredForStaticBootProtocol ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( ( ipConfiguration != null ) && ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) && ( unsetAddress ( ipConfiguration ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) . when ( failWhen ) ; }
Source:
private java.util.Collection < java.lang.String > getFreeLabels ( ) { java.util.SortedSet < java.lang.String > freeLabels = new java.util.TreeSet < java.lang.String > ( dcLabels ) ; freeLabels.removeAll ( labelToIface.keySet ( ) ) ; return freeLabels ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { if ( ! ( labelPopup.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; java.lang.String label = labelPopup.getLabel ( ) . getEntity ( ) ; dcLabels.add ( label ) ; NetworkOperation.LABEL.getCommand ( new org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel ( label , this ) , networkCommand.getOp2 ( ) , allNics ) . execute ( ) ; redraw ( ) ; }
Source:
public void mapVmWatchdog ( ) { org.ovirt.engine.core.common.businessentities.VmWatchdog entity = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; entity.setAction ( VmWatchdogAction.RESET ) ; entity.setModel ( VmWatchdogType.i6300esb ) ; entity.setId ( Guid.Empty ) ; org.ovirt.engine.api.model.Watchdog model = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( entity , null ) ; org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( WatchdogAction.RESET , model.getAction ( ) ) ; org.junit.Assert.assertEquals ( WatchdogModel.I6300ESB , model.getModel ( ) ) ; }

Target:
public void mapVmWatchdog ( ) { org.ovirt.engine.core.common.businessentities.VmWatchdog entity = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; entity.setAction ( VmWatchdogAction.RESET ) ; entity.setModel ( VmWatchdogType.i6300esb ) ; entity.setId ( Guid.Empty ) ; org.ovirt.engine.api.model.Watchdog model = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( entity , null ) ; org.junit.jupiter.api.Assertions.assertNotNull ( model ) ; org.junit.jupiter.api.Assertions.assertEquals ( WatchdogAction.RESET , model.getAction ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( WatchdogModel.I6300ESB , model.getModel ( ) ) ; }
Source:
private void assertMajor ( java.lang.Integer expected , java.lang.String text ) { org.ovirt.engine.api.model.Version version = org.ovirt.engine.api.restapi.types.VersionMapper.fromVersionString ( text ) ; org.junit.Assert.assertNotNull ( version ) ; java.lang.Integer actual = version.getMajor ( ) ; org.junit.Assert.assertEquals ( "Incorrect major version number" , expected , actual ) ; }

Target:
private void assertMajor ( java.lang.Integer expected , java.lang.String text ) { org.ovirt.engine.api.model.Version version = org.ovirt.engine.api.restapi.types.VersionMapper.fromVersionString ( text ) ; org.junit.jupiter.api.Assertions.assertNotNull ( version ) ; java.lang.Integer actual = version.getMajor ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( expected , actual , "Incorrect major version number" ) ; }
Source:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.Converter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object source ) { return ( source != null ) && ( ! ( ( java.lang.Boolean ) ( source ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }

Target:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery , java.lang.String templateName , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.Converter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object source ) { return ( source != null ) && ( ! ( ( java.lang.Boolean ) ( source ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void refuseBalloonOnPPC ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddPpcTest ( ) ; cmd.getParameters ( ) . setBalloonEnabled ( true ) ; org.mockito.Mockito.when ( osRepository.isBalloonEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; }

Target:
public void refuseBalloonOnPPC ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddPpcTest ( ) ; cmd.getParameters ( ) . setBalloonEnabled ( true ) ; org.mockito.Mockito.when ( osRepository.isBalloonEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeWithRebalanceTask ) ) ; prepareMocks ( cmd ) ; mockBackend ( false , VdcBllErrors.GlusterVolumeRebalanceStopFailed ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . endStepJob ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeWithRebalanceTask ) ) ; prepareMocks ( cmd ) ; mockBackend ( false , VdcBllErrors.GlusterVolumeRebalanceStopFailed ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . endStepJobAborted ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED ) ; }
Source:
void initTable ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VmTemplate > nameColumn = new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VmTemplate object ) { return object.getname ( ) ; } } ; getTable ( ) . addColumn ( nameColumn , constants.nameTemplate ( ) ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VmTemplate > object ) { return object.getFirst ( ) . getName ( ) ; }
Source:
public static void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void testParseReloadActionWithUserPassFile ( ) { parser.parse ( new java.lang.String [ ] { "--reload" , "--user=username" , "--admin-pass-file=filename" } ) ; org.junit.Assert.assertEquals ( ConfigActionType.ACTION_RELOAD , parser.getConfigAction ( ) ) ; org.junit.Assert.assertEquals ( "username" , parser.getUser ( ) ) ; org.junit.Assert.assertEquals ( "filename" , parser.getAdminPassFile ( ) ) ; }

Target:
public void testParseReloadActionWithUserPassFile ( ) { parser.parse ( new java.lang.String [ ] { "--reload" , "--user=username" , "--admin-pass-file=filename" } ) ; org.junit.jupiter.api.Assertions.assertEquals ( ConfigActionType.ACTION_RELOAD , parser.getConfigAction ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "username" , parser.getUser ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "filename" , parser.getAdminPassFile ( ) ) ; }
Source:
public static void GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void setMigrationNetwork ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model , boolean value ) { if ( ! ( isMultiCluster ( ) ) ) { if ( ( getMigrationNetwork ( ) ) != null ) { getMigrationNetwork ( ) . setMigrationNetwork ( ( ! value ) ) ; } } model.setMigrationNetwork ( value ) ; }

Target:
public void setMigrationNetwork ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model , boolean value ) { if ( ! ( isMultiCluster ( ) ) ) { if ( value ) { if ( ( getMigrationNetwork ( ) ) != null ) { getMigrationNetwork ( ) . setMigrationNetwork ( false ) ; } } else { managementNetwork.setMigrationNetwork ( true ) ; } } model.setMigrationNetwork ( value ) ; }
Source:
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 ) ; }

Target:
public static void getStorageDomainListByTemplate ( 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public void testIsmonitoringNeededTrue ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setstatus ( VDSStatus.NonOperational ) ; vds.setvm_count ( 1 ) ; org.junit.Assert.assertTrue ( strategy.isMonitoringNeeded ( vds ) ) ; vds.setstatus ( VDSStatus.Up ) ; org.junit.Assert.assertTrue ( strategy.isMonitoringNeeded ( vds ) ) ; }

Target:
public void testIsmonitoringNeededTrue ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.NonOperational ) ; vds.setVmCount ( 1 ) ; org.junit.Assert.assertTrue ( strategy.isMonitoringNeeded ( vds ) ) ; vds.setStatus ( VDSStatus.Up ) ; org.junit.Assert.assertTrue ( strategy.isMonitoringNeeded ( vds ) ) ; }
Source:
public void getHostById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getClusterList ( 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void setSoundcard ( org.ovirt.engine.api.model.VM model ) { model.setSoundcardEnabled ( ( ! ( org.ovirt.engine.api.restapi.util.VmHelper.getSoundDevicesForEntity ( this , new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) . isEmpty ( ) ) ) ) ; }

Target:
protected void setVirtioScsiController ( org.ovirt.engine.api.model.Vm model ) { if ( ! ( model.isSetVirtioScsi ( ) ) ) { model.setVirtioScsi ( new org.ovirt.engine.api.model.VirtioScsi ( ) ) ; } model.getVirtioScsi ( ) . setEnabled ( ( ! ( org.ovirt.engine.api.restapi.util.VmHelper.getVirtioScsiControllersForEntity ( this , new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) . isEmpty ( ) ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String url , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMList ( url , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( 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.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc glusterVolumeGeoRepSessionStatus ( 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 = vdsServer.glusterVolumeGeoRepSessionStatus ( volumeName , slaveHost , slaveVolumeName , userName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setExternalId ( "0" ) ; newUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( "groups" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setExternalId ( "0" ) ; newUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( "groups" ) ; newUser.setNamespace ( "*" ) ; }
Source:
public void validateFailsDiscardFunctionalityBreaks ( ) { passAllValidations ( ) ; org.ovirt.engine.core.common.errors.EngineMessage lunsBreakStorageDomainDiscardSupportMessage = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_LUN_BREAKS_STORAGE_DOMAIN_PASS_DISCARD_SUPPORT ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( lunsBreakStorageDomainDiscardSupportMessage ) ) . when ( discardHelper ) . isExistingDiscardFunctionalityPreserved ( org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , lunsBreakStorageDomainDiscardSupportMessage ) ; }

Target:
public void validateFailsDiscardFunctionalityBreaks ( ) { passAllValidations ( ) ; org.ovirt.engine.core.common.errors.EngineMessage lunsBreakStorageDomainDiscardSupportMessage = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_LUN_BREAKS_STORAGE_DOMAIN_PASS_DISCARD_SUPPORT ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( lunsBreakStorageDomainDiscardSupportMessage ) ) . when ( discardHelper ) . isExistingDiscardFunctionalityPreserved ( org.mockito.ArgumentMatchers.anyList ( ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , lunsBreakStorageDomainDiscardSupportMessage ) ; }
Source:
public void testExistingPassDiscardFunctionalityIsPreservedAllLunsHaveDiscardFunctionality ( ) { storageDomain.setSupportsDiscard ( true ) ; storageDomainDisks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedAllLunsHaveDiscardFunctionality ( ) { storageDomain.setSupportsDiscard ( true ) ; storageDomainDisks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc getIsoList ( java.lang.String spUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getIsoList ( spUUID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc ( 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.VolumeInfoReturnForXmlRpc getVolumeInfo ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String imgUUID , java.lang.String volUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmpRpcReturnValue = vdsServer.getVolumeInfo ( sdUUID , spUUID , imgUUID , volUUID ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VolumeInfoReturnForXmlRpc ( xmpRpcReturnValue ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void setupNetworkClusterDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > expectedCluster = java.util.Collections.singletonList ( cluster ) ; org.ovirt.engine.core.dao.ClusterDao clusterDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; org.mockito.Mockito.when ( clusterDaoMock.getAllForStoragePool ( storagePoolId ) ) . thenReturn ( expectedCluster ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getClusterDao ( ) ) . thenReturn ( clusterDaoMock ) ; }

Target:
private void setupClusterDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > expectedNetworkCluster = java.util.Collections.singletonList ( networkCluster ) ; org.mockito.Mockito.when ( networkClusterDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedNetworkCluster ) ; }
Source:
public 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 < > ( ( ( 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 void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetVdsGroupByNameQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetVdsGroupByNameQuery.getDbFacade ( ) . getVdsGroupDao ( ) . getByName ( org.ovirt.engine.core.bll.GetVdsGroupByNameQuery.getParameters ( ) . getName ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetVdsGroupByNameQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetVdsGroupByNameQuery.getDbFacade ( ) . getVdsGroupDao ( ) . getByName ( org.ovirt.engine.core.bll.GetVdsGroupByNameQuery.getParameters ( ) . getName ( ) , org.ovirt.engine.core.bll.GetVdsGroupByNameQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVdsGroupByNameQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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 java.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public boolean canOpenRDPConsole ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { if ( ( item.getIsPool ( ) ) || ( ! ( isRDPAvailable ( ) ) ) ) return false ; if ( ( ( item.getHasAdditionalConsole ( ) ) && ( item.getAdditionalConsole ( ) . getConnectCommand ( ) . getIsAvailable ( ) ) ) && ( item.getAdditionalConsole ( ) . getConnectCommand ( ) . getIsExecutionAllowed ( ) ) ) { return true ; } return false ; }

Target:
public boolean canOpenRDPConsole ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel item ) { if ( ( item.isPool ( ) ) || ( ! ( isRDPAvailable ( ) ) ) ) return false ; if ( ( ( ( item.getAdditionalConsoleModel ( ) ) != null ) && ( item.getAdditionalConsoleModel ( ) . getConnectCommand ( ) . getIsAvailable ( ) ) ) && ( item.getAdditionalConsoleModel ( ) . getConnectCommand ( ) . getIsExecutionAllowed ( ) ) ) { return true ; } return false ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepStatus ( volumeName ) ; 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 ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionPause ( java.lang.String masterVolumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName , boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionPause ( masterVolumeName , slaveHost , slaveVolumeName , userName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.api.model.Agent update ( org.ovirt.engine.api.model.Agent agent ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > agentResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetFenceAgentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.core.common.businessentities.pm.FenceAgent entity = getEntity ( agentResolver , true ) ; return performUpdate ( agent , entity , map ( entity ) , agentResolver , ActionType.UpdateFenceAgent , new org.ovirt.engine.api.restapi.resource.BackendFenceAgentResource.UpdateParametersProvider ( ) ) ; }

Target:
public org.ovirt.engine.api.model.Agent update ( org.ovirt.engine.api.model.Agent agent ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > agentResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.QueryType.GetFenceAgentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.core.common.businessentities.pm.FenceAgent entity = getEntity ( agentResolver , true ) ; return performUpdate ( agent , entity , map ( entity ) , agentResolver , ActionType.UpdateFenceAgent , new org.ovirt.engine.api.restapi.resource.BackendFenceAgentResource.UpdateParametersProvider ( ) ) ; }
Source:
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.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
private static void initMigrationSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.migrationSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetMigrationSupport ) , callback ) ; }
Source:
public static void GetDataCenterMaxNameLength ( 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.StoragePoolNameSizeLimit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetAllowClusterWithVirtGlusterEnabled ( 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 ? source : java.lang.Boolean.TRUE ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.utils.pm.VdsFencingOptions options = new org.ovirt.engine.core.utils.pm.VdsFencingOptions ( ) ; java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > map = options.getFencingOptionMappingMap2 ( ) ; org.ovirt.engine.core.bll.GetAgentFenceOptions2Query.getQueryReturnValue ( ) . setReturnValue ( map ) ; org.ovirt.engine.core.bll.GetAgentFenceOptions2Query.getQueryReturnValue ( ) . setSucceeded ( ( ( map.size ( ) ) > 0 ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( ) ; java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > map = options.getFencingOptionMappingMap2 ( ) ; org.ovirt.engine.core.bll.GetAgentFenceOptions2Query.getQueryReturnValue ( ) . setReturnValue ( map ) ; org.ovirt.engine.core.bll.GetAgentFenceOptions2Query.getQueryReturnValue ( ) . setSucceeded ( ( ( map.size ( ) ) > 0 ) ) ; }
Source:
private void restoreVmFromBaseSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( snapshotDao.exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { log.info ( "Deleting snapshots for stateless vm '{}'" , vm.getId ( ) ) ; org.ovirt.engine.core.common.action.VmOperationParameterBase restoreParams = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vm.getId ( ) ) ; restoreParams.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , restoreParams , org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getContext ( ) . withCompensationContext ( null ) ) ; } }

Target:
private void restoreVmFromBaseSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( snapshotDao.exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { log.info ( "Deleting snapshots for stateless vm '{}'" , vm.getId ( ) ) ; org.ovirt.engine.core.common.action.VmOperationParameterBase restoreParams = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vm.getId ( ) ) ; restoreParams.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; runInternalAction ( ActionType.RestoreStatelessVm , restoreParams , org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getContext ( ) . withCompensationContext ( null ) ) ; } }
Source:
protected boolean isInterfaceSupportedForPlugUnPlug ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( ! ( DiskInterface.VirtIO.equals ( disk.getDiskInterface ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO ) ; return false ; } return true ; }

Target:
protected boolean isInterfaceSupportedForPlugUnPlug ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( ! ( ( DiskInterface.VirtIO.equals ( disk.getDiskInterface ( ) ) ) || ( DiskInterface.VirtIO_SCSI.equals ( disk.getDiskInterface ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO ) ; return false ; } return true ; }
Source:
public void networkQosExists ( ) { org.mockito.Mockito.when ( vnicProfile.getNetworkQosId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkQosDao.get ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ) . thenReturn ( networkQos ) ; org.junit.Assert.assertThat ( validator.networkQosExistsOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void networkQosExists ( ) { org.mockito.Mockito.when ( vnicProfile.getNetworkQosId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkQosDao.get ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ) . thenReturn ( networkQos ) ; org.hamcrest.MatcherAssert.assertThat ( validator.networkQosExistsOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testValidModifiedBondsFailsWhenBondIsUnnamed ( ) throws java.lang.Exception { doTestValidModifiedBonds ( new org.ovirt.engine.core.common.businessentities.network.Bond ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }
Source:
public void teardown ( ) { try { if ( ( sched ) != null ) { sched.shutdown ( ) ; } } catch ( org.quartz.SchedulerException e ) { log.error ( "Failed to shutdown Quartz service" , e ) ; } }

Target:
public void teardown ( ) { try { if ( ( sched ) != null ) { sched.shutdown ( ) ; } } catch ( org.quartz.SchedulerException e ) { log.error ( "Failed to shutdown Quartz service: {}" , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } }
Source:
private void initCustomPropertySheet ( ) { setCustomPropertySheet ( new org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueModel ( ) ) ; if ( ( clusterPolicy.getParameterMap ( ) ) != null ) { getCustomProperties ( ) . putAll ( clusterPolicy.getParameterMap ( ) ) ; } customPropertiesInitialized = true ; refreshCustomProperties ( null , false ) ; }

Target:
private void initCustomPropertySheet ( ) { setCustomPropertySheet ( new org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueModel ( ) ) ; if ( ( clusterPolicy.getParameterMap ( ) ) != null ) { getCustomProperties ( ) . putAll ( clusterPolicy.getParameterMap ( ) ) ; } getCustomPropertySheet ( ) . setIsChangable ( ( ! ( clusterPolicy.isLocked ( ) ) ) ) ; customPropertiesInitialized = true ; refreshCustomProperties ( null , false ) ; }