auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testNetworkNotChangedWhenDifferentNetworkIds ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , null ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.CANNOT_CHANGE_ATTACHED_NETWORK ) ) ; }

Target:
public void testNetworkNotChangedWhenDifferentNetworkIds ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.CANNOT_CHANGE_ATTACHED_NETWORK ) ) ; }
Source:
public void testListFailure ( ) { setUpMacPoolsQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae ) ; } }

Target:
public void testListFailure ( ) { setUpMacPoolsQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk = baseDiskDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.DISK_ID ) ; org.junit.Assert.assertNotNull ( disk ) ; java.lang.String name = disk.getDiskAlias ( ) ; org.junit.Assert.assertEquals ( name , dao.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.DISK_ID , VdcObjectType.Disk ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk = baseDiskDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.DISK_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( disk ) ; java.lang.String name = disk.getDiskAlias ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( name , dao.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.DISK_ID , VdcObjectType.Disk ) ) ; }
Source:
protected org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource getParamsSource ( org.ovirt.engine.core.common.businessentities.Tags tag ) { org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource paramsSource = new org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource ( dbFacade.getDbEngineDialect ( ) ) ; paramsSource.addValue ( "description" , tag.getdescription ( ) ) . addValue ( "tag_id" , tag.gettag_id ( ) ) . addValue ( "tag_name" , tag.gettag_name ( ) ) . addValue ( "parent_id" , tag.getparent_id ( ) ) . addValue ( "readonly" , tag.getIsReadonly ( ) ) . addValue ( "type" , tag.gettype ( ) ) ; return paramsSource ; }

Target:
protected org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource getParamsSource ( org.ovirt.engine.core.common.businessentities.Tags tag ) { org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource paramsSource = new org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource ( dbFacade.getDbEngineDialect ( ) ) ; paramsSource.addValue ( "description" , tag.getDescription ( ) ) . addValue ( "tag_id" , tag.getTagId ( ) ) . addValue ( "tag_name" , tag.getTagName ( ) ) . addValue ( "parent_id" , tag.getParentId ( ) ) . addValue ( "readonly" , tag.getIsReadonly ( ) ) . addValue ( "type" , tag.getType ( ) ) ; return paramsSource ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVdsStaticDAO ( ) ) ; dynamicDao = prepareDAO ( dbFacade.getVdsDynamicDAO ( ) ) ; statisticsDao = prepareDAO ( dbFacade.getVdsStatisticsDAO ( ) ) ; existingVds = dao.get ( org.ovirt.engine.core.dao.VdsStaticDAOTest.EXISTING_VDS_ID ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.sethost_name ( "farkle.redhat.com" ) ; newStaticVds.setvds_group_id ( existingVds.getvds_group_id ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVdsStaticDAO ( ) ) ; dynamicDao = prepareDAO ( dbFacade.getVdsDynamicDAO ( ) ) ; statisticsDao = prepareDAO ( dbFacade.getVdsStatisticsDAO ( ) ) ; existingVds = dao.get ( org.ovirt.engine.core.dao.VdsStaticDAOTest.EXISTING_VDS_ID ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.sethost_name ( "farkle.redhat.com" ) ; newStaticVds.setvds_group_id ( existingVds.getvds_group_id ( ) ) ; newStaticVds.setSSHKeyFingerprint ( "b5:ad:16:19:06:9f:b3:41:69:eb:1c:42:1d:12:b5:31" ) ; }
Source:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }

Target:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.v3.types.V3Cluster cluster ) { return adaptAdd ( delegate :: add , cluster ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.v3.types.V3Cluster v3Cluster ) { org.ovirt.engine.api.model.Cluster v4Cluster = org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( v3Cluster ) ; org.ovirt.engine.api.v3.helpers.V3ClusterHelper.assignCompatiblePolicy ( v3Cluster , v4Cluster ) ; try { return adaptResponse ( delegate.add ( v4Cluster ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult changeProtocolAllowed ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_UPDATE ) . when ( ( ( ( ( getHost ( ) . getProtocol ( ) ) != ( oldHost.getProtocol ( ) ) ) && ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) && ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallingOS ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult changeProtocolAllowed ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_UPDATE ) . when ( ( ( ( ( getHost ( ) . getProtocol ( ) ) != ( oldHost.getProtocol ( ) ) ) && ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) && ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallingOS ) ) ) ) ; }
Source:
public void testChangeQuotaForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map image_storage_domain_map = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.ovirt.engine.core.compat.Guid quotaId = image_storage_domain_map.getQuotaId ( ) ; if ( quotaId.equals ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ) { org.junit.Assert.fail ( "Same source and dest quota id, cannot perform test" ) ; } dao.updateQuotaForImageAndSnapshots ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; image_storage_domain_map = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; quotaId = image_storage_domain_map.getQuotaId ( ) ; org.junit.Assert.assertEquals ( "quota wasn't changed" , quotaId , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; }

Target:
public void testChangeQuotaForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.ovirt.engine.core.compat.Guid quotaId = imageStorageDomainMap.getQuotaId ( ) ; if ( quotaId.equals ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ) { org.junit.Assert.fail ( "Same source and dest quota id, cannot perform test" ) ; } dao.updateQuotaForImageAndSnapshots ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; quotaId = imageStorageDomainMap.getQuotaId ( ) ; org.junit.Assert.assertEquals ( "quota wasn't changed" , quotaId , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; }
Source:
protected < T > T getConfigurationValueDefault ( org.ovirt.engine.core.common.config.ConfigValues config ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( QueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ) ; if ( result.getSucceeded ( ) ) { return ( ( T ) ( result.getReturnValue ( ) ) ) ; } return null ; }

Target:
protected < T > T getConfigurationValueDefault ( org.ovirt.engine.core.common.config.ConfigValues config ) { org.ovirt.engine.core.common.queries.QueryReturnValue result = runQuery ( QueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ) ; if ( result.getSucceeded ( ) ) { return ( ( T ) ( result.getReturnValue ( ) ) ) ; } return null ; }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; }
Source:
void localize ( org.ovirt.engine.ui.userportal.ApplicationConstants constants ) { headerLabel.setText ( constants.loginHeaderLabel ( ) ) ; userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; domainEditor.setLabel ( constants.loginFormDomainLabel ( ) ) ; connectAutomatically.setLabel ( constants.loginFormConnectAutomaticallyLabel ( ) ) ; loginButton.setText ( constants.loginButtonLabel ( ) ) ; }

Target:
public void setEnabled ( boolean enabled ) { super . setEnabled ( enabled ) ; if ( enabled ) { userNameEditor.asValueBox ( ) . selectAll ( ) ; userNameEditor.setFocus ( true ) ; } }
Source:
protected boolean isVmInUpPausedDownStatus ( ) { if ( ( ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL ) ; return false ; } return true ; }

Target:
protected boolean isVmInUpPausedDownStatus ( ) { if ( ( ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) ) ; } return true ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getManageCommand ( ) ) ) { Manage ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnManage" ) ) { OnManage ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getManageCommand ( ) ) ) { Manage ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnManage" ) ) { OnManage ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getCinderVolumeTypes ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetCinderVolumeTypesByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getCinderVolumeTypes ( ) , failure ) ; }
Source:
void initTable ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( storageDomain == null ) { return ; } getTable ( ) . enableColumnResizing ( ) ; getTable ( ) . ensureColumnVisible ( org.ovirt.engine.ui.webadmin.section.main.view.tab.storage.SubTabStorageLeaseView.typeColumn , org.ovirt.engine.ui.webadmin.section.main.view.tab.storage.SubTabStorageLeaseView.constants.empty ( ) , true , "30px" ) ; getTable ( ) . ensureColumnVisible ( org.ovirt.engine.ui.webadmin.section.main.view.tab.storage.SubTabStorageLeaseView.aliasColumn , org.ovirt.engine.ui.webadmin.section.main.view.tab.storage.SubTabStorageLeaseView.constants.aliasDisk ( ) , true , "120px" ) ; }

Target:
void initTable ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( storageDomain == null ) { return ; } getTable ( ) . enableColumnResizing ( ) ; getTable ( ) . ensureColumnVisible ( typeColumn , org.ovirt.engine.ui.webadmin.section.main.view.tab.storage.SubTabStorageLeaseView.constants.empty ( ) , true , "30px" ) ; getTable ( ) . ensureColumnVisible ( aliasColumn , org.ovirt.engine.ui.webadmin.section.main.view.tab.storage.SubTabStorageLeaseView.constants.aliasDisk ( ) , true , "120px" ) ; }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
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.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public boolean hasSpaceForSnapthosts ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < java.lang.String > message ) { java.lang.Integer minSnapshotSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.InitStorageSparseSizeInGB ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.storage_domains , java.lang.Integer > e : mapStorageDomainsToNumOfDisks ( vm ) . entrySet ( ) ) { if ( ! ( destinationHasSpace ( e.getKey ( ) , ( minSnapshotSize * ( e.getValue ( ) ) ) , message ) ) ) { return false ; } } return true ; }

Target:
public boolean hasSpaceForSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < java.lang.String > message ) { java.lang.Integer minSnapshotSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.InitStorageSparseSizeInGB ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.StorageDomain , java.lang.Integer > e : mapStorageDomainsToNumOfDisks ( vm ) . entrySet ( ) ) { if ( ! ( destinationHasSpace ( e.getKey ( ) , ( minSnapshotSize * ( e.getValue ( ) ) ) , message ) ) ) { return false ; } } return true ; }
Source:
private boolean isUsingSPDMFlow ( ) { return ( ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.isDataOperationsByHSM ( ) ) && ( ! ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getUseCopyCollapse ( ) ) ) ) && ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.MoveOrCopyDisk ) ) ) && ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) ; }

Target:
private boolean isUsingSPDMFlow ( ) { return ( ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.isDataOperationsByHSM ( ) ) && ( ! ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getUseCopyCollapse ( ) ) ) ) && ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.ActionType.MoveOrCopyDisk ) ) ) && ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) ; }
Source:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.common.eventqueue.EventResult result = null ; if ( _domainsInProblem.containsKey ( domainId ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.info ( ( "starting ProcessDomainRecovery for domain " + ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData.getDomainIdTuple ( domainId ) ) ) ) ; result = ProcessDomainRecovery ( domainId ) ; } _timers.remove ( domainId ) ; return result ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.common.eventqueue.EventResult result = new org.ovirt.engine.core.common.eventqueue.EventResult ( true , org.ovirt.engine.core.common.eventqueue.EventType.DOMAINMONITORING ) ; updateProblematicVdsData ( vdsId , vdsName , domainsInProblems ) ; return result ; }
Source:
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.GetStorageDomainsByVmTemplateIdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getTemplateListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.bll.CommandBase < ? > constructCommand ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , boolean runAsInternal , org.ovirt.engine.core.bll.context.CommandContext context ) { org.ovirt.engine.core.bll.job.ExecutionHandler.evaluateCorrelationId ( parameters ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( actionType , parameters ) ; command.setInternalExecution ( runAsInternal ) ; command.setContext ( context ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , actionType , runAsInternal ) ; return command ; }

Target:
private void addToReturnValueTaskPlaceHolderIdList ( org.ovirt.engine.core.compat.Guid taskId ) { if ( ! ( getReturnValue ( ) . getTaskPlaceHolderIdList ( ) . contains ( taskId ) ) ) { getReturnValue ( ) . getTaskPlaceHolderIdList ( ) . add ( taskId ) ; } }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.volumes.VolumeListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getNewVolumeCommand ( ) ) ) { return popupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getStatusRebalanceCommand ( ) ) ) { return rebalanceStatusPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.volumes.VolumeListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getNewVolumeCommand ( ) ) ) { return popupProvider.get ( ) ; } else if ( ( lastExecutedCommand == ( getModel ( ) . getStatusRebalanceCommand ( ) ) ) || ( lastExecutedCommand.getName ( ) . equals ( "onStopRebalance" ) ) ) { return rebalanceStatusPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public static void getAllDataCenterStorageConnections ( 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.StorageServerConnections > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( ) ; } } ; 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.GetConnectableStorageServerConnectionsByStoragePoolId , params , aQuery ) ; }

Target:
public static 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 boolean isColumnVisible ( com.google.gwt.user.cellview.client.Column < T , ? > column ) { if ( ! ( isColumnPresent ( column ) ) ) { return false ; } boolean visible = true ; if ( columnVisibleMap.containsKey ( column ) ) { visible = columnVisibleMap.get ( column ) ; } if ( visible && ( columnVisibleMapOverride.containsKey ( column ) ) ) { visible = columnVisibleMapOverride.get ( column ) ; } return visible ; }

Target:
public boolean isColumnVisible ( com.google.gwt.user.cellview.client.Column < T , ? > column ) { if ( ! ( isColumnPresent ( column ) ) ) { return false ; } boolean visible = true ; if ( columnVisibleMap.containsKey ( column ) ) { visible = columnVisibleMap.get ( column ) ; } if ( visible && ( columnVisibleMapOverride.containsKey ( column ) ) ) { visible = columnVisibleMapOverride.get ( column ) ; } visible = visible && ( ( getHiddenPersistedColumnWidth ( column ) ) == null ) ; return visible ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskSnapshotsForVmSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images = org.ovirt.engine.core.bll.RestoreStatelessVmCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ; return images != null ? images : java.util.Collections.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > emptyList ( ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskSnapshotsForVmSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images = diskImageDao.getAllSnapshotsForVmSnapshot ( snapshotId ) ; return images != null ? images : java.util.Collections.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > emptyList ( ) ; }
Source:
public java.lang.Void runInTransaction ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.CommandBase < ? > > childCommands = buildChildCommands ( ) ; for ( org.ovirt.engine.core.bll.CommandBase < ? > command : childCommands.values ( ) ) { command.checkCanDoAction ( ) ; command.insertAsyncTaskPlaceHolders ( ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { buildChildCommandInfos ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > entry : childCommandInfoMap.entrySet ( ) ) { org.ovirt.engine.core.bll.CommandBase < ? > command = getBackendCommandObjectsHandler ( ) . createAction ( entry.getValue ( ) . getFirst ( ) , entry.getValue ( ) . getSecond ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; childCommandsMap.put ( entry.getKey ( ) , command ) ; } return null ; }
Source:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.lang.Throwable caught ) { try { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleQueries: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { raiseQueryCompleteEvent ( queryTypeList , state ) ; } }

Target:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.lang.Throwable caught ) { try { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleQueries: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { fireAsyncOperationCompleteEvent ( state ) ; raiseQueryCompleteEvent ( queryTypeList , state ) ; } }
Source:
protected void onPreviewNativeEvent ( com.google.gwt.user.client.Event.NativePreviewEvent event ) { super . onPreviewNativeEvent ( event ) ; if ( ( ( keyPressHandler ) != null ) && ( ( event.getTypeInt ( ) ) == ( com.google.gwt.user.client.Event.ONKEYPRESS ) ) ) { keyPressHandler.onKeyPress ( event.getNativeEvent ( ) ) ; } }

Target:
protected void onPreviewNativeEvent ( com.google.gwt.user.client.Event.NativePreviewEvent event ) { super . onPreviewNativeEvent ( event ) ; if ( ( ( keyPressHandler ) != null ) && ( ( event.getTypeInt ( ) ) == ( com.google.gwt.user.client.Event.ONKEYDOWN ) ) ) { keyPressHandler.onKeyPress ( event.getNativeEvent ( ) ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getByVdsmTaskId ( org.ovirt.engine.core.compat.Guid vdsmTaskId ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getByVdsmTaskId ( vdsmTaskId ) ; if ( asyncTask != null ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTask ; }

Target:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getByVdsmTaskId ( org.ovirt.engine.core.compat.Guid vdsmTaskId ) { return coCoAsyncTaskHelper.getByVdsmTaskId ( vdsmTaskId ) ; }
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 getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected void updateIsHotPlugAvailable ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = ( ( vm.getvds_group_compatibility_version ( ) ) != null ) ? vm.getvds_group_compatibility_version ( ) : new org.ovirt.engine.core.compat.Version ( ) ; isHotPlugSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ; }

Target:
protected void updateIsHotPlugAvailable ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = ( ( vm.getVdsGroupCompatibilityVersion ( ) ) != null ) ? vm.getVdsGroupCompatibilityVersion ( ) : new org.ovirt.engine.core.compat.Version ( ) ; isHotPlugSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ; }
Source:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard populateUtilizationCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { long startTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard = getDashboard ( ) ; long endTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.dashboardCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY , dashboard , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_CACHE_UPDATE_INTERVAL , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.log.debug ( "Dashboard utilization cache updated in {}ms" , ( endTime - startTime ) ) ; return dashboard ; }

Target:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard populateUtilizationCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { long startTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard = getDashboard ( ) ; long endTime = java.lang.System.currentTimeMillis ( ) ; if ( enableBackgroundCacheUpdate ) { org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.dashboardCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY , dashboard ) ; } else { org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.dashboardCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY , dashboard , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_CACHE_UPDATE_INTERVAL , java.util.concurrent.TimeUnit.SECONDS ) ; } org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.log.debug ( "Dashboard utilization cache updated in {}ms" , ( endTime - startTime ) ) ; return dashboard ; }
Source:
public org.ovirt.optimizer.common.ScoreResult recomputeScore ( org.ovirt.optimizer.service.problemspace.OptimalDistributionStepsSolution situation , org.ovirt.optimizer.common.Result result ) { org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore score = org.ovirt.optimizer.service.ClusterOptimizer.computeScore ( situation , result.getMigrations ( ) , java.util.Collections.< java.lang.String > emptySet ( ) , configProvider.customRuleFiles ( ) ) ; org.ovirt.optimizer.common.ScoreResult scoreResult = new org.ovirt.optimizer.common.ScoreResult ( ) ; scoreResult.setHardScore ( score.getHardScore ( ) ) ; scoreResult.setSoftScore ( score.getSoftScore ( ) ) ; return scoreResult ; }

Target:
public org.ovirt.optimizer.common.ScoreResult recomputeScore ( org.ovirt.optimizer.service.problemspace.OptimalDistributionStepsSolution situation , org.ovirt.optimizer.common.Result result ) { org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore score = org.ovirt.optimizer.service.ScoreOnlySolver.computeScore ( situation , result.getMigrations ( ) , java.util.Collections.< java.lang.String > emptySet ( ) , configProvider.customRuleFiles ( ) ) ; org.ovirt.optimizer.common.ScoreResult scoreResult = new org.ovirt.optimizer.common.ScoreResult ( ) ; scoreResult.setHardScore ( score.getHardScore ( ) ) ; scoreResult.setSoftScore ( score.getSoftScore ( ) ) ; return scoreResult ; }
Source:
public void testConflictedUpdate ( ) { setUpGetEntityExpectations ( 1 ) ; org.ovirt.engine.core.common.businessentities.Cluster model = org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) { setUpGetEntityExpectations ( 1 ) ; org.ovirt.engine.core.common.businessentities.Cluster model = org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
protected org.ovirt.engine.api.model.StorageDomain getInverse ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic to ) { org.ovirt.engine.api.model.StorageDomain inverse = new org.ovirt.engine.api.model.StorageDomain ( ) ; inverse.setId ( to.getId ( ) ) ; inverse.setstorage_name ( to.getstorage_name ( ) ) ; inverse.setstorage_domain_type ( to.getstorage_domain_type ( ) ) ; inverse.setstorage_type ( to.getstorage_type ( ) ) ; inverse.setStorageFormat ( to.getStorageFormat ( ) ) ; return inverse ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain getInverse ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic to ) { org.ovirt.engine.api.model.StorageDomain inverse = new org.ovirt.engine.api.model.StorageDomain ( ) ; inverse.setId ( to.getId ( ) ) ; inverse.setStorageName ( to.getstorage_name ( ) ) ; inverse.setStorageDomainType ( to.getstorage_domain_type ( ) ) ; inverse.setStorageType ( to.getstorage_type ( ) ) ; inverse.setStorageFormat ( to.getStorageFormat ( ) ) ; return inverse ; }
Source:
public javax.ws.rs.core.Response updateVirtualFunctionsConfiguration ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "virtualFunctionsConfiguration.numberOfVirtualFunctions|allNetworksAllowed" ) ; final org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig = parent.findVfsConfig ( guid ) ; if ( vfsConfig == null ) { return notAllowed ( localize ( Messages.INVALID_OPERATION_ON_NON_SRIOV_NIC ) , guid.toString ( ) ) ; } org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters params = prepareUpdateHostNicVfsConfigParameters ( action , vfsConfig ) ; return doAction ( VdcActionType.UpdateHostNicVfsConfig , params , action ) ; }

Target:
public javax.ws.rs.core.Response updateVirtualFunctionsConfiguration ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "virtualFunctionsConfiguration.numberOfVirtualFunctions|allNetworksAllowed" ) ; final org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig = parent.findVfsConfig ( guid ) ; if ( vfsConfig == null ) { return notAllowed ( localize ( Messages.INVALID_OPERATION_ON_NON_SRIOV_NIC ) , guid.toString ( ) ) ; } org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters params = prepareUpdateHostNicVfsConfigParameters ( action , vfsConfig ) ; return doAction ( ActionType.UpdateHostNicVfsConfig , params , action ) ; }
Source:
private void configureLocalStorage ( ) { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItem ( ) ; if ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel model = new org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel ( ) ; setWindow ( model ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . configureLocalStorageTitle ( ) ) ; model.setHelpTag ( HelpTag.configure_local_storage ) ; model.setHashName ( "configure_local_storage" ) ; if ( host.isOvirtNode ( ) ) { configureLocalStorage2 ( model ) ; } else { configureLocalStorage3 ( model ) ; } }

Target:
private void configureLocalStorage ( ) { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItem ( ) ; if ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel model = new org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel ( ) ; setWindow ( model ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . configureLocalStorageTitle ( ) ) ; model.setHelpTag ( HelpTag.configure_local_storage ) ; model.setHashName ( "configure_local_storage" ) ; if ( host.isOvirtVintageNode ( ) ) { configureLocalStorage2 ( model ) ; } else { configureLocalStorage3 ( model ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > sdIds = new java.util.ArrayList ( java.util.Arrays.asList ( storageDomainId ) ) ; image.setStorageIds ( sdIds ) ; return image ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > sdIds = new java.util.ArrayList ( java.util.Collections.singletonList ( storageDomainId ) ) ; image.setStorageIds ( sdIds ) ; return image ; }
Source:
public void testGetAllEventNotificationMethods ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > result = dao.getAllEventNotificationMethods ( ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; assertEquals ( org.ovirt.engine.core.dao.EventDAOTest.NOTIFICATION_METHOD_COUNT , result.size ( ) ) ; }

Target:
public void testGetEventNotificationMethodsByType ( ) { java.lang.String target = "Email" ; java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > result = dao.getEventNotificationMethodsByType ( target ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.EventNotificationMethod method : result ) { org.junit.Assert.assertEquals ( EventNotificationMethods.EMAIL , method.getmethod_type ( ) ) ; } }