auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void listenOnDiskModelChangeEvent ( final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { modelProvider.getModel ( ) . getvmBasicDiskListModel ( ) . getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupDisks ( modelProvider ) ; } } ) ; }

Target:
private void listenOnDiskModelChangeEvent ( final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { modelProvider.getModel ( ) . getVmBasicDiskListModel ( ) . getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupDisks ( modelProvider ) ; } } ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( returnValue ) ) ; if ( cluster != null ) { maintenance ( cluster.isMaintenanceReasonRequired ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( returnValue ) ) ; if ( cluster != null ) { maintenance ( cluster.isMaintenanceReasonRequired ( ) , ( ( cluster.supportsGlusterService ( ) ) && ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterFeaturesUtil.isStopGlusterProcessesSupported ( cluster.getCompatibilityVersion ( ) ) ) ) ) ; } }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpDiskVmElementExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskInfo.WipeAfterDelete" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpDiskVmElementExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskInfo.WipeAfterDelete" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct , org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmJobsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVdsmCallTimestamp ( xmlRpcStruct ) ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct , org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmJobsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildInterfaceStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVdsmCallTimestamp ( xmlRpcStruct ) ) ; }
Source:
public static void pauseUploads ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.storage.ImageTransfer updates = new org.ovirt.engine.core.common.businessentities.storage.ImageTransfer ( ) ; updates.setPhase ( ImageTransferPhase.PAUSED_USER ) ; org.ovirt.engine.core.common.action.UploadImageStatusParameters parameters = new org.ovirt.engine.core.common.action.UploadImageStatusParameters ( ) ; parameters.setUpdates ( updates ) ; parameters.setDiskId ( image.getId ( ) ) ; list.add ( parameters ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.UploadImageStatus , list ) ; }

Target:
public static void pauseUploads ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.storage.ImageTransfer updates = new org.ovirt.engine.core.common.businessentities.storage.ImageTransfer ( ) ; updates.setPhase ( ImageTransferPhase.PAUSED_USER ) ; org.ovirt.engine.core.common.action.TransferImageStatusParameters parameters = new org.ovirt.engine.core.common.action.TransferImageStatusParameters ( ) ; parameters.setUpdates ( updates ) ; parameters.setDiskId ( image.getId ( ) ) ; list.add ( parameters ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.TransferImageStatus , list ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.GridTimer getRefreshTimer ( ) { if ( ( refreshTimer ) == null ) { refreshTimer = new org.ovirt.engine.ui.uicommonweb.models.GridTimer ( "VmMonitorModel" ) { @ java.lang.Override public void execute ( ) { refresh ( ) ; } } ; refreshTimer.setRefreshRate ( 1000 ) ; } return refreshTimer ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.GridTimer getRefreshTimer ( ) { if ( ( refreshTimer ) == null ) { refreshTimer = new org.ovirt.engine.ui.uicommonweb.models.GridTimer ( "VmMonitorModel" , getEventBus ( ) ) { @ java.lang.Override public void execute ( ) { refresh ( ) ; } } ; refreshTimer.setRefreshRate ( 1000 ) ; } return refreshTimer ; }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) , aQuery ) ; }
Source:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }

Target:
private void setUpGetVirtioScsiExpectations ( int ... idxs ) throws java.lang.Exception { for ( int i = 0 ; i < ( idxs.length ) ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVirtioScsiControllers , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ idxs [ i ] ] } , new java.util.ArrayList < > ( ) ) ; } }
Source:
public void testWithoutEnoughSpares ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "6" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.Assert.assertEquals ( 5 , result.size ( ) ) ; }

Target:
public void testWithoutEnoughSpares ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "6" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 5 , result.size ( ) ) ; }
Source:
private void storeVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . update ( vm.getDynamicData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStatisticsDAO ( ) . update ( vm.getStatisticsData ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = vm.getInterfaces ( ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface ifc : interfaces ) { org.ovirt.engine.core.common.businessentities.VmNetworkStatistics stats = ifc.getStatistics ( ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkStatisticsDAO ( ) . update ( stats ) ; } } }

Target:
private void storeVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vm.getDynamicData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStatisticsDao ( ) . update ( vm.getStatisticsData ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = vm.getInterfaces ( ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface ifc : interfaces ) { org.ovirt.engine.core.common.businessentities.VmNetworkStatistics stats = ifc.getStatistics ( ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkStatisticsDao ( ) . update ( stats ) ; } } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ( model.dataCenter.getstorage_pool_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) { model.UpdateOptionsNonLocalFSData ( ) ; } else { model.UpdateOptionsLocalFSData ( ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ( model.dataCenter.getstorage_pool_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) { model.updateOptionsNonLocalFSData ( ) ; } else { model.updateOptionsLocalFSData ( ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CancelMigrate , new org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrationVDSParameters ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getRunOnVds ( ) , org.ovirt.engine.core.bll.CancelMigrateVmCommand.getParameters ( ) . getVmId ( ) , false ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = runVdsCommand ( VDSCommandType.CancelMigrate , new org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrationVDSParameters ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getRunOnVds ( ) , org.ovirt.engine.core.bll.CancelMigrateVmCommand.getParameters ( ) . getVmId ( ) , false ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }
Source:
private int getResourceType ( org.ovirt.engine.core.compat.backendcompat.XmlNode node , java.lang.String resource ) { if ( ( ( node.SelectSingleNode ( resource , _xmlNS ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.SelectSingleNode ( resource , _xmlNS ) . innerText ) ) ) ) { return java.lang.Integer.valueOf ( node.SelectSingleNode ( resource , _xmlNS ) . innerText ) ; } return - 1 ; }

Target:
private void buildImageReference ( ) { org.ovirt.engine.core.utils.ovf.xml.XmlNodeList list = _document.SelectNodes ( "//*/File" , _xmlNS ) ; for ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node : list ) { org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setImageId ( new org.ovirt.engine.core.compat.Guid ( node.attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; image.setId ( org.ovirt.engine.core.utils.ovf.OvfParser.GetImageGrupIdFromImageFile ( node.attributes.get ( "ovf:href" ) . getValue ( ) ) ) ; image.setActive ( true ) ; image.setImageStatus ( ImageStatus.OK ) ; image.setDescription ( node.attributes.get ( "ovf:description" ) . getValue ( ) ) ; _images.add ( image ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.VM getVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = super . getVm ( ) ; if ( vm == null ) { vm = org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getVmDAO ( ) . getForDisk ( org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getImageGroupId ( ) ) . get ( java.lang.Boolean.TRUE ) . get ( 0 ) ; setVm ( vm ) ; setVmId ( vm.getId ( ) ) ; } return vm ; }

Target:
public org.ovirt.engine.core.common.businessentities.VM getVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = super . getVm ( ) ; if ( vm == null ) { vm = org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getVmDAO ( ) . getVmsListForDisk ( org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getImageGroupId ( ) ) . get ( 0 ) ; setVm ( vm ) ; setVmId ( vm.getId ( ) ) ; } return vm ; }
Source:
private java.lang.String onlyTheseChars ( ) { java.lang.String characterGroupStart = "[" ; java.lang.String characterGroupEnd = "]" ; return ( ( ( ( characterGroupStart + ( letters ( ) ) ) + ( numbers ( ) ) ) + ( specialCharacters ( ) ) ) + characterGroupEnd ) + ( characterGroupQuantifier ( ) ) ; }

Target:
protected java.lang.String composeRegex ( ) { return ( ( ( ( start ( ) ) + ( letters ( ) ) ) + ( numbers ( ) ) ) + ( specialCharacters ( ) ) ) + ( end ( ) ) ; }
Source:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getMaxSpmPriority ( 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 ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public static < E extends org.ovirt.engine.core.common.businessentities.Nameable > java.util.Set < java.lang.String > objectNames ( java.util.List < E > entityList ) { if ( ( entityList != null ) && ( ! ( entityList.isEmpty ( ) ) ) ) { java.util.Set < java.lang.String > names = new java.util.HashSet < java.lang.String > ( ) ; for ( E e : entityList ) { names.add ( e.getName ( ) ) ; } return names ; } else { return java.util.Collections.emptySet ( ) ; } }

Target:
public static < E extends org.ovirt.engine.core.common.businessentities.Nameable > java.util.Set < java.lang.String > objectNames ( java.util.Collection < E > entities ) { if ( ( entities != null ) && ( ! ( entities.isEmpty ( ) ) ) ) { java.util.Set < java.lang.String > names = new java.util.HashSet < java.lang.String > ( ) ; for ( E e : entities ) { if ( e != null ) { names.add ( e.getName ( ) ) ; } } return names ; } else { return java.util.Collections.emptySet ( ) ; } }
Source:
private boolean isNoSelection ( ) { for ( org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > > listModel : attachableDisksMap.values ( ) ) { if ( ( ( listModel.getSelectedItems ( ) ) != null ) && ( ! ( listModel.getSelectedItems ( ) . isEmpty ( ) ) ) ) { return false ; } } return true ; }

Target:
private boolean isNoSelection ( ) { for ( org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > > listModel : attachableDisksMap.values ( ) ) { boolean multipleSelectionSelected = ( ( listModel.getSelectedItems ( ) ) != null ) && ( ! ( listModel.getSelectedItems ( ) . isEmpty ( ) ) ) ; boolean singleSelectionSelected = ( listModel.getSelectedItem ( ) ) != null ; if ( multipleSelectionSelected || singleSelectionSelected ) { return false ; } } return true ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.equals ( ChangeCDModel.ExecutedEventDefinition ) ) { changeCD ( sender , args ) ; } else if ( ( ev.equals ( ConsoleModel.ErrorEventDefinition ) ) && ( sender instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ) { SpiceConsoleModel_Error ( sender , ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs ) ( args ) ) ) ; } }

Target:
public void setSystemTreeSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel value ) { systemTreeSelectedItem = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SystemTreeSelectedItem" ) ) ; }
Source:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map entry : entries ) { org.junit.Assert.assertFalse ( entry.getstorage_domain_id ( ) . equals ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }

Target:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry : entries ) { org.junit.Assert.assertFalse ( entry.getstorage_domain_id ( ) . equals ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }
Source:
public void testGetAllForRoleAndObject ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForRoleAndObject ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , permission.getrole_id ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , permission.getObjectId ( ) ) ; } }

Target:
public void testGetAllForRoleAndObject ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permission > result = dao.getAllForRoleAndObject ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , permission.getRoleId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , permission.getObjectId ( ) ) ; } }
Source:
private void checkReturnValue ( org.ovirt.engine.core.bll.GetoVirtISOsQuery < org.ovirt.engine.core.common.queries.VdsIdParametersBase > query ) { java.util.List < org.ovirt.engine.core.compat.RpmVersion > isosList = ( ( java.util.List < org.ovirt.engine.core.compat.RpmVersion > ) ( query.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; assertTrue ( ( ! ( isosList.isEmpty ( ) ) ) ) ; }

Target:
private static void checkReturnValue ( org.ovirt.engine.core.bll.GetoVirtISOsQuery < org.ovirt.engine.core.common.queries.VdsIdParametersBase > query ) { java.util.List < org.ovirt.engine.core.compat.RpmVersion > isosList = ( ( java.util.List < org.ovirt.engine.core.compat.RpmVersion > ) ( query.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertTrue ( ( ! ( isosList.isEmpty ( ) ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > newItems = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; setItems ( newItems ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( getEntity ( ) . getId ( ) ) ; parameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnregisteredCinderDisksByStorageDomainId , parameters , new org.ovirt.engine.ui.uicommonweb.models.storage.SetSortedItemsAsyncQuery ( new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ) ; }
Source:
private void updateSpiceUsbAutoShare ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetSpiceUsbAutoShare ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.setUsbAutoShare ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ) ; }

Target:
private void updateSpiceUsbAutoShare ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getSpiceUsbAutoShare ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.setUsbAutoShare ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.job.Job > jobs = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getJobDao ( ) . getJobsByCorrelationId ( org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getParameters ( ) . getCorrelationId ( ) ) ; org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getQueryReturnValue ( ) . setReturnValue ( jobs ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.job.Job > jobs = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getJobDao ( ) . getJobsByCorrelationId ( org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getParameters ( ) . getCorrelationId ( ) ) ; for ( org.ovirt.engine.core.common.job.Job job : jobs ) { org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . loadJobSteps ( job ) ; } org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getQueryReturnValue ( ) . setReturnValue ( jobs ) ; }
Source:
public static void getClusterById ( 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.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getAuthzGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAuthzGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return object.getReadOnly ( ) ? getDefaultImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getDiskVmElements ( ) . size ( ) ) == 1 ) { return object.getDiskVmElements ( ) . iterator ( ) . next ( ) . isReadOnly ( ) ? getDefaultImage ( ) : null ; } return null ; }
Source:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runPublicQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: runPublicQuery invoked! '{}'" , queryType ) ; debugQuery ( queryType , params ) ; return getBackend ( ) . runPublicQuery ( queryType , params ) ; }

Target:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runPublicQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: runPublicQuery invoked! '{}'" , queryType ) ; if ( ( params.getCorrelationId ( ) ) == null ) { params.setCorrelationId ( org.ovirt.engine.core.utils.CorrelationIdTracker.getCorrelationId ( ) ) ; } debugQuery ( queryType , params ) ; return getBackend ( ) . runPublicQuery ( queryType , params ) ; }
Source:
private void LoginAll ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > items = ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > ) ( getItems ( ) ) ) ; targetsToConnect = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel item : items ) { if ( ! ( item.getIsLoggedIn ( ) ) ) { targetsToConnect.add ( item ) ; } } connectTargets ( ) ; }

Target:
private void loginAll ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > items = ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > ) ( getItems ( ) ) ) ; targetsToConnect = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel item : items ) { if ( ! ( item.getIsLoggedIn ( ) ) ) { targetsToConnect.add ( item ) ; } } connectTargets ( ) ; }
Source:
protected org.ovirt.engine.core.common.queries.VdcQueryParametersBase getQueryParams ( java.lang.Class < ? extends org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryParamsClass , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.queries.VdcQueryParametersBase params = null ; try { params = queryParamsClass.getConstructor ( org.ovirt.engine.core.compat.Guid.class ) . newInstance ( id ) ; } catch ( java.lang.Exception e ) { } return params ; }

Target:
protected < T > org.ovirt.engine.core.common.queries.VdcQueryParametersBase getQueryParams ( java.lang.Class < ? extends org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryParamsClass , T id ) { org.ovirt.engine.core.common.queries.VdcQueryParametersBase params = null ; try { params = queryParamsClass.getConstructor ( id.getClass ( ) ) . newInstance ( id ) ; } catch ( java.lang.Exception e ) { } return params ; }
Source:
protected boolean validateObject ( java.lang.Object value ) { java.util.List < java.lang.String > messages = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( getValidationGroups ( ) , value ) ; if ( ! ( messages.isEmpty ( ) ) ) { getReturnValue ( ) . getCanDoActionMessages ( ) . addAll ( messages ) ; return false ; } return true ; }

Target:
protected boolean validateObject ( java.lang.Object value ) { java.util.List < java.lang.String > messages = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( getValidationGroups ( ) , value ) ; if ( ! ( messages.isEmpty ( ) ) ) { getReturnValue ( ) . getValidationMessages ( ) . addAll ( messages ) ; return false ; } return true ; }
Source:
private void mockBackend ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.UpdateGlusterHook ) , org.mockito.Matchers.argThat ( anyHookVDS ( ) ) ) ) . thenReturn ( vdsReturnValue ) ; }

Target:
private void mockBackend ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.UpdateGlusterHook ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters.class ) ) ) . thenReturn ( vdsReturnValue ) ; }
Source:
public void vdspysGroupWithVirtGlusterNotSupported ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; canDoActionFailedWithReason ( VdcBllMessages.GLUSTER_NOT_SUPPORTED ) ; }

Target:
public void vdspysGroupWithVirtGlusterNotSupported ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; canDoActionFailedWithReason ( VdcBllMessages.GLUSTER_NOT_SUPPORTED ) ; }
Source:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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.util.Collections.emptyList ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setName ( NAMES [ 0 ] ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "dataCenter.name|id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "dataCenter.name|id" ) ; } }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondarySources ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) ? java.lang.Long.valueOf ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) : 0L ; return getOverUtilizedMemoryHosts ( candidateHosts , requiredMemory ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondarySources ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) ? java.lang.Long.parseLong ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) : 0L ; return getOverUtilizedMemoryHosts ( candidateHosts , requiredMemory ) ; }
Source:
public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( object ) ) . getstorage_name ( ) ; }

Target:
void initEditors ( ) { volumeTypeListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer ( ) ) ; storageListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer ( ) ) ; sourceStorageListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer ( ) ) ; quotaListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.Quota ) ( object ) ) . getQuotaName ( ) ; } } ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.FenceAgent agent ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource params = getInsertOrUpdateParams ( agent ) ; org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; params.addValue ( "id" , id ) ; agent.setId ( id ) ; getCallsHandler ( ) . executeModification ( "InsertFenceAgent" , params ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource params = getInsertOrUpdateParams ( agent ) ; org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; params.addValue ( "id" , id ) ; agent.setId ( id ) ; getCallsHandler ( ) . executeModification ( "InsertFenceAgent" , params ) ; }
Source:
protected boolean acquireLockInternal ( ) { final boolean acquireLock = super . acquireLockInternal ( ) ; if ( ( ( ! acquireLock ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isAutoStartup ( ) ) ) { org.ovirt.engine.core.bll.AutoStartVmsRunner.getInstance ( ) . addVmToRun ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getVmId ( ) ) ; } return acquireLock ; }

Target:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParametersForEndAction ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters parameters = buildCreateSnapshotParameters ( ) ; parameters.setImagesParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) ) ; return parameters ; }
Source:
protected org.ovirt.engine.api.model.Storage postPopulate ( org.ovirt.engine.api.model.Storage from ) { from.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageType.class ) . value ( ) ) ; org.ovirt.engine.api.model.LogicalUnit unit = new org.ovirt.engine.api.model.LogicalUnit ( ) ; unit.setId ( from.getId ( ) ) ; from.getLogicalUnits ( ) . unsetLogicalUnits ( ) ; from.getLogicalUnits ( ) . getLogicalUnits ( ) . add ( unit ) ; return from ; }

Target:
protected org.ovirt.engine.api.model.HostStorage postPopulate ( org.ovirt.engine.api.model.HostStorage from ) { from.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageType.class ) . value ( ) ) ; org.ovirt.engine.api.model.LogicalUnit unit = new org.ovirt.engine.api.model.LogicalUnit ( ) ; unit.setId ( from.getId ( ) ) ; from.getLogicalUnits ( ) . unsetLogicalUnits ( ) ; from.getLogicalUnits ( ) . getLogicalUnits ( ) . add ( unit ) ; return from ; }
Source:
public void writeData ( java.io.ObjectOutputStream dos ) { try { dos.writeInt ( this . history_id ) ; writeDate ( this . history_datetime , dos ) ; dos.writeObject ( this . storage_domain_id ) ; dos.writeShort ( this . storage_domain_status ) ; dos.writeDouble ( this . minutes_in_status ) ; writeInteger ( this . available_disk_size_gb , dos ) ; writeInteger ( this . used_disk_size_gb , dos ) ; writeInteger ( this . storage_configuration_version , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void writeData ( java.io.ObjectOutputStream dos ) { try { dos.writeLong ( this . history_id ) ; writeDate ( this . history_datetime , dos ) ; dos.writeObject ( this . storage_domain_id ) ; dos.writeShort ( this . storage_domain_status ) ; dos.writeDouble ( this . minutes_in_status ) ; writeInteger ( this . available_disk_size_gb , dos ) ; writeInteger ( this . used_disk_size_gb , dos ) ; writeInteger ( this . storage_configuration_version , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public void testUpdateUploadIcon ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUpUpdateExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { "VmLargeIcon" } , new java.lang.Object [ ] { org.ovirt.engine.core.common.businessentities.VmIcon.typeAndDataToDataUrl ( IconTestHelpler.MEDIA_TYPE , IconTestHelpler.DATA_URL ) } , true , true ) ) ; final org.ovirt.engine.api.model.Template model = getRestModel ( 0 ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; verifyModel ( resource.update ( model ) , 0 ) ; }

Target:
public void testUpdateUploadIcon ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUpUpdateExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { "VmLargeIcon" } , new java.lang.Object [ ] { org.ovirt.engine.core.common.businessentities.VmIcon.typeAndDataToDataUrl ( IconTestHelpler.MEDIA_TYPE , IconTestHelpler.DATA_URL ) } , true , true ) ) ; final org.ovirt.engine.api.model.Template model = getRestModel ( 0 ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; verifyModel ( resource.update ( model ) , 0 ) ; }