auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testFaultyResize ( ) { org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( parameters.getDiskInfo ( ) ) ) . setSize ( ( ( parameters.getDiskInfo ( ) . getSize ( ) ) / 2 ) ) ; initializeCommand ( parameters ) ; org.junit.Assert.assertFalse ( command.validateCanResizeDisk ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "wrong failure" , command , VdcBllMessages.ACTION_TYPE_FAILED_REQUESTED_DISK_SIZE_IS_TOO_SMALL ) ; }

Target:
public void testFaultyResize ( ) { org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( parameters.getDiskInfo ( ) ) ) . setSize ( ( ( parameters.getDiskInfo ( ) . getSize ( ) ) / 2 ) ) ; initializeCommand ( parameters ) ; org.junit.Assert.assertFalse ( command.validateCanResizeDisk ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "wrong failure" , command , EngineMessage.ACTION_TYPE_FAILED_REQUESTED_DISK_SIZE_IS_TOO_SMALL ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VDS createProxyCandidate ( ) { org.ovirt.engine.core.common.businessentities.VDS proxyCandidate = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; proxyCandidate.setVdsName ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.ANOTHER_HOST_NAME ) ; proxyCandidate.setId ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.OTHER_HOST_ID_1 ) ; proxyCandidate.setVdsGroupId ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_CLUSTER_ID ) ; proxyCandidate.setStoragePoolId ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_DATACENTER_ID ) ; proxyCandidate.setVdsGroupCompatibilityVersion ( Version.v3_0 ) ; return proxyCandidate ; }

Target:
private boolean shouldHostBeUnreachable ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { boolean unreachable ; switch ( status ) { case Down : case Reboot : case Kdumping : case NonResponsive : case PendingApproval : unreachable = true ; break ; default : unreachable = false ; } return unreachable ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; getIsoImage ( ) . setItems ( images ) ; if ( ( getIsoImage ( ) . getIsChangable ( ) ) && ( ( getIsoImage ( ) . getSelectedItem ( ) ) == null ) ) { getIsoImage ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( images ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { boolean selectVnc = false ; java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; if ( ( ( graphicsDevices.size ( ) ) == 1 ) && ( ( graphicsDevices.get ( 0 ) . getGraphicsType ( ) ) == ( org.ovirt.engine.core.common.businessentities.GraphicsType.VNC ) ) ) { selectVnc = true ; } getDisplayConsole_Vnc_IsSelected ( ) . setEntity ( selectVnc ) ; getDisplayConsole_Spice_IsSelected ( ) . setEntity ( ( ! selectVnc ) ) ; }
Source:
public static void initCache ( org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cacheConfigValues ( new org.ovirt.engine.ui.frontend.AsyncQuery ( loginModel , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( target ) ; } } ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initUniqueOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initLinuxOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initWindowsOsTypes ( ) ; }

Target:
public static void initCache ( org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cacheConfigValues ( new org.ovirt.engine.ui.frontend.AsyncQuery ( loginModel , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( target ) ; } } ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initUniqueOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initLinuxOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initWindowsOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initDisplayTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initNicHotplugSupportMap ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initDiskHotpluggableInterfacesMap ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsArchitecture ( ) ; }
Source:
public static java.util.List < org.ovirt.engine.api.model.PowerManagement > parse ( java.lang.String str , java.lang.String typeStr , boolean ignoreValues ) { java.util.List < org.ovirt.engine.api.model.PowerManagement > ret = new java.util.ArrayList < org.ovirt.engine.api.model.PowerManagement > ( ) ; java.util.Map < java.lang.String , java.lang.String > types = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parseTypes ( typeStr ) ; for ( java.lang.String agent : str.split ( ";" , ( - 1 ) ) ) { if ( ! ( agent.isEmpty ( ) ) ) { ret.add ( org.ovirt.engine.api.restapi.util.FenceOptionsParser.parseAgent ( agent , types , ignoreValues ) ) ; } } return ret ; }

Target:
public static java.util.List < org.ovirt.engine.api.model.Agent > parse ( java.lang.String str , java.lang.String typeStr , boolean ignoreValues ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = new java.util.ArrayList < > ( ) ; java.util.Map < java.lang.String , java.lang.String > types = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parseTypes ( typeStr ) ; for ( java.lang.String agent : str.split ( ";" , ( - 1 ) ) ) { if ( ! ( agent.isEmpty ( ) ) ) { ret.add ( org.ovirt.engine.api.restapi.util.FenceOptionsParser.parseAgent ( agent , types , ignoreValues ) ) ; } } return ret ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec ) { return setVmTicket ( vmId , otp64 , sec , "" , new java.util.HashMap < java.lang.String , java.lang.String > ( ) ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc freeze ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.freeze" ) . withParameter ( "vmID" , vmId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
protected void setUpSpyQuery ( ) throws java.lang.Exception { super . setUpSpyQuery ( ) ; org.ovirt.engine.core.common.businessentities.RepoImage rfmd = new org.ovirt.engine.core.common.businessentities.RepoImage ( ) ; rfmd.setFileType ( expectedType ) ; org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( rfmd ) ) . when ( getQuery ( ) ) . getUserRequestForStorageDomainRepoFileList ( ) ; }

Target:
protected void setUpSpyQuery ( ) throws java.lang.Exception { super . setUpSpyQuery ( ) ; org.ovirt.engine.core.common.businessentities.storage.RepoImage rfmd = new org.ovirt.engine.core.common.businessentities.storage.RepoImage ( ) ; rfmd.setFileType ( expectedType ) ; org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( rfmd ) ) . when ( getQuery ( ) ) . getUserRequestForStorageDomainRepoFileList ( ) ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( ( isShareableDiskEnabled && ( ( getVm ( ) ) != null ) ) && ( getVm ( ) . isDown ( ) ) ) ) ; }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; }
Source:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( ( _vds.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds = {0} : {1}" , _vds.getId ( ) , _vds.getvds_name ( ) ) ; } }

Target:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( ( _vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds = {0} : {1}" , _vds.getId ( ) , _vds.getVdsName ( ) ) ; } }
Source:
private boolean changesAreClusterCompatible ( ) { if ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) == false ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.nonVmNetwork ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; return false ; } } return true ; }

Target:
protected org.ovirt.engine.core.compat.Version getClusterVersion ( ) { return org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ; }
Source:
private org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > parseGraphicsAndDisplayPair ( java.lang.String displayAndGraphicsString ) { java.util.ArrayList < java.lang.String > splitted = trimElements ( displayAndGraphicsString.split ( "/" ) ) ; return ( splitted.size ( ) ) == 2 ? new org.ovirt.engine.core.common.utils.Pair ( splitted.get ( 0 ) , splitted.get ( 1 ) ) : null ; }

Target:
private static org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > parseSlashSeparatedPair ( java.lang.String slashSeparatedString ) { java.util.List < java.lang.String > splitted = org.ovirt.engine.core.utils.OsRepositoryImpl.trimElements ( slashSeparatedString.split ( "/" ) ) ; return ( splitted.size ( ) ) == 2 ? new org.ovirt.engine.core.common.utils.Pair ( splitted.get ( 0 ) , splitted.get ( 1 ) ) : null ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > searchVmsFromDb ( ) { org.ovirt.engine.core.aaa.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmDao ( ) . getAllUsingQuery ( data.getQuery ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmLock ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateOperationProgress ( vm ) ; } return vms ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > searchVmsFromDb ( ) { org.ovirt.engine.core.aaa.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmDao ( ) . getAllUsingQuery ( data.getQuery ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmLock ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateOperationProgress ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmStatistics ( vm ) ; } return vms ; }
Source:
public void Rollback ( ) { log.errorFormat ( "Transaction rolled-back for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { if ( ( this ) instanceof org.ovirt.engine.core.bll.quota.Quotable ) { ( ( org.ovirt.engine.core.bll.quota.Quotable ) ( this ) ) . rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.debug ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }

Target:
public void rollback ( ) { log.errorFormat ( "Transaction rolled-back for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { if ( ( this ) instanceof org.ovirt.engine.core.bll.quota.Quotable ) { ( ( org.ovirt.engine.core.bll.quota.Quotable ) ( this ) ) . rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.debug ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }
Source:
protected org.ovirt.engine.api.model.VM deprecatedPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < org.ovirt.engine.api.common.util.DetailHelper.Detail > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( getHttpHeaders ( ) ) ; parent.addInlineDetails ( details , model ) ; addStatistics ( model , entity , uriInfo , httpHeaders ) ; parent.setPayload ( model ) ; parent.setBallooning ( model ) ; parent.setCertificateInfo ( model ) ; return model ; }

Target:
private org.ovirt.engine.core.compat.Guid getTargetClusterId ( org.ovirt.engine.api.model.Action action ) { if ( ( action.isSetCluster ( ) ) && ( action.getCluster ( ) . isSetId ( ) ) ) { return asGuid ( action.getCluster ( ) . getId ( ) ) ; } return null ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.LunDisk > filterDiskBasedOnLuns ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > listOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LunDisk > lunDisks = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : listOfDisks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { lunDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( disk ) ) ) ; } } return lunDisks ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.LunDisk > filterDiskBasedOnLuns ( java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.storage.Disk > listOfDisks , boolean allowShareableDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LunDisk > lunDisks = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : listOfDisks ) { if ( ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) && ( allowShareableDisks || ( ! ( disk.isShareable ( ) ) ) ) ) { lunDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( disk ) ) ) ; } } return lunDisks ; }
Source:
protected java.lang.String imageName ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel value ) { if ( value == null ) { return defaultImageName ( value ) ; } if ( value.getIsPool ( ) ) { return "poolVmIcon" ; } else if ( value.getIsServer ( ) ) { return "serverVmIcon" ; } return "desktopVmIcon" ; }

Target:
protected java.lang.String imageName ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel value ) { if ( value == null ) { return defaultImageName ( value ) ; } if ( value.isPool ( ) ) { return "poolVmIcon" ; } else if ( value.getIsServer ( ) ) { return "serverVmIcon" ; } return "desktopVmIcon" ; }
Source:
public void testNonExistingSnapshotQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = setupQueryBySnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = query.getQueryReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.VM returnedVm = returnValue.getReturnValue ( ) ; org.junit.Assert.assertNull ( "Return value from non existent query should be null" , returnedVm ) ; }

Target:
public void testNonExistingSnapshotQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = setupQueryBySnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.queries.QueryReturnValue returnValue = query.getQueryReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.VM returnedVm = returnValue.getReturnValue ( ) ; org.junit.Assert.assertNull ( "Return value from non existent query should be null" , returnedVm ) ; }
Source:
protected org.ovirt.engine.api.model.VM addInlineDetails ( java.util.Set < java.lang.String > details , org.ovirt.engine.api.model.VM vm ) { if ( details.contains ( "disks" ) ) { addInlineDisks ( vm ) ; } if ( details.contains ( "nics" ) ) { addInlineNics ( vm ) ; } if ( details.contains ( "tags" ) ) { addInlineTags ( vm ) ; } return vm ; }

Target:
protected org.ovirt.engine.api.model.Vm addInlineDetails ( java.util.Set < java.lang.String > details , org.ovirt.engine.api.model.Vm vm ) { if ( details.contains ( "disks" ) ) { addInlineDisks ( vm ) ; } if ( details.contains ( "nics" ) ) { addInlineNics ( vm ) ; } if ( details.contains ( "tags" ) ) { addInlineTags ( vm ) ; } return vm ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public 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.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn hotPlugNic ( java.util.Map info ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.hotplugNic" ) . withParameter ( "vmID" , getVmId ( info ) ) . withParameter ( "params" , info ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn updateVolume ( java.lang.String jobId , java.util.Map < ? , ? > volumeInfo , java.util.Map < ? , ? > volumeAttributes ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.update_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , volumeInfo ) . withParameter ( "vol_attr" , volumeAttributes ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getStorageDomainDynamicDao ( ) . update ( updatedStorageDomain.getStorageDynamicData ( ) ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = getStoragePoolIsoMap ( domain ) ; org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntityStatus ( map , map.getstatus ( ) ) ; updateStatus ( map , status ) ; getCompensationContext ( ) . stateChanged ( ) ; } return null ; }
Source:
protected void selectDataCenterWithCluster ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.compat.Guid selectedCluster , java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster > dataCentersWithClusters ) { if ( selectedCluster == null ) { getDataCenterWithClustersList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters ) ) ; } else { model.getDataCenterWithClustersList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterWithClusterAccordingClusterPredicate ( ( ( org.ovirt.engine.core.compat.Guid ) ( selectedCluster ) ) ) ) ) ; } }

Target:
protected void selectDataCenterWithCluster ( org.ovirt.engine.core.compat.Guid selectedCluster , java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster > dataCentersWithClusters ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster selectedDataCenterWithCluster = ( selectedCluster == null ) ? org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters ) : org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterWithClusterAccordingClusterPredicate ( selectedCluster ) ) ; getDataCenterWithClustersList ( ) . setItems ( dataCentersWithClusters , selectedDataCenterWithCluster ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.RoleGroupMap other = ( ( org.ovirt.engine.core.common.businessentities.RoleGroupMap ) ( obj ) ) ; return org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( id , other.id ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.RoleGroupMap other = ( ( org.ovirt.engine.core.common.businessentities.RoleGroupMap ) ( obj ) ) ; return java.util.Objects.equals ( id , other.id ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getSession ( java.lang.String masterVolumeName , java.util.Map < java.lang.String , java.lang.Object > innerMap ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession geoRepSession = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession ( ) ; java.lang.String sessionKey = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc.SESSION_KEY ) ) ) ; java.lang.String [ ] sessSplit = sessionKey.split ( "([://]+)" ) ; java.lang.String slaveNode = sessSplit [ ( ( sessSplit.length ) - 2 ) ] ; if ( slaveNode.contains ( "@" ) ) { java.lang.String [ ] hostComponents = slaveNode.split ( "@" ) ; slaveNode = hostComponents [ ( ( hostComponents.length ) - 1 ) ] ; geoRepSession.setUserName ( hostComponents [ 0 ] ) ; } java.lang.String slaveVolume = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc.REMOTE_VOL_NAME ) ) ) ; geoRepSession.setSlaveHostName ( slaveNode ) ; geoRepSession.setSlaveVolumeName ( slaveVolume ) ; geoRepSession.setSessionKey ( sessionKey ) ; geoRepSession.setMasterVolumeName ( masterVolumeName ) ; return geoRepSession ; }

Target:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getSession ( java.lang.String masterVolumeName , java.util.Map < java.lang.String , java.lang.Object > innerMap ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession geoRepSession = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession ( ) ; java.lang.String sessionKey = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc.SESSION_KEY ) ) ) ; java.lang.String [ ] sessSplit = sessionKey.split ( "([://]+)" ) ; java.lang.String slaveNode = sessSplit [ 2 ] ; if ( slaveNode.contains ( "@" ) ) { java.lang.String [ ] hostComponents = slaveNode.split ( "@" ) ; slaveNode = hostComponents [ ( ( hostComponents.length ) - 1 ) ] ; geoRepSession.setUserName ( hostComponents [ 0 ] ) ; } java.lang.String slaveVolume = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc.REMOTE_VOL_NAME ) ) ) ; geoRepSession.setSlaveHostName ( slaveNode ) ; geoRepSession.setSlaveVolumeName ( slaveVolume ) ; geoRepSession.setSessionKey ( sessionKey ) ; geoRepSession.setMasterVolumeName ( masterVolumeName ) ; return geoRepSession ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; getExternalProviders ( ) . setItems ( providers ) ; selectExternalProvider ( ) ; stopProgress ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( defaultProfile.getName ( ) . getEntity ( ) . equals ( getName ( ) . getEntity ( ) ) ) ) { getName ( ) . getEntityChangedEvent ( ) . removeListener ( networkNameListener ) ; defaultProfile.getName ( ) . getEntityChangedEvent ( ) . removeListener ( this ) ; } }
Source:
public void testImagesIllegal ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ) . when ( diskImagesValidator ) . diskImagesNotIllegal ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ILLEGAL.name ( ) ) ) ; }

Target:
public void testImagesIllegal ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ) . when ( diskImagesValidator ) . diskImagesNotIllegal ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ILLEGAL.name ( ) ) ) ; }
Source:
protected void executeCommand ( ) { getNetworkQoS ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getNetworkQoSDao ( ) . save ( getNetworkQoS ( ) ) ; getReturnValue ( ) . setActionReturnValue ( getNetworkQoS ( ) . getId ( ) ) ; setSucceeded ( true ) ; }

Target:
protected org.ovirt.engine.core.bll.validator.NetworkQosValidator getQosValidator ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS networkQos ) { return new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( networkQos ) ; }
Source:
public java.lang.Object runInTransaction ( ) { getStoragePool ( ) . setstatus ( StoragePoolStatus.Maintenance ) ; getStoragePool ( ) . setStoragePoolFormatType ( masterStorageDomain.getStorageFormat ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( getStoragePool ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.PoolStatusChanged ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getstatus ( ) ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { getStoragePool ( ) . setstatus ( StoragePoolStatus.Maintenance ) ; getStoragePool ( ) . setStoragePoolFormatType ( masterStorageDomain.getStorageFormat ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( getStoragePool ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.poolStatusChanged ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getstatus ( ) ) ; return null ; }
Source:
private boolean isRngDeviceSupported ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.compat.Version clusterVersion = clusterVersionOrNull ( model ) ; return clusterVersion == null ? false : ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VirtIoRngDeviceSupported , clusterVersion.getValue ( ) ) ) ) ; }

Target:
protected void updateMemoryBalloon ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getModel ( ) . getSelectedCluster ( ) ; java.lang.Integer osType = getModel ( ) . getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster != null ) && ( osType != null ) ) { updateMemoryBalloon ( getModel ( ) . getCompatibilityVersion ( ) , osType ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StoragePool dc ) { setEnumTitle ( dc.getStatus ( ) ) ; switch ( dc.getStatus ( ) ) { case Contend : return getApplicationResources ( ) . waitImage ( ) ; case Maintenance : return getApplicationResources ( ) . maintenanceImage ( ) ; case NotOperational : case NonResponsive : case Uninitialized : return getApplicationResources ( ) . downImage ( ) ; case Up : return getApplicationResources ( ) . upImage ( ) ; default : break ; } return null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StoragePool dc ) { setEnumTitle ( dc.getStatus ( ) ) ; switch ( dc.getStatus ( ) ) { case Contend : return org.ovirt.engine.ui.webadmin.widget.table.column.DcStatusColumn.resources.waitImage ( ) ; case Maintenance : return org.ovirt.engine.ui.webadmin.widget.table.column.DcStatusColumn.resources.maintenanceImage ( ) ; case NotOperational : case NonResponsive : case Uninitialized : return org.ovirt.engine.ui.webadmin.widget.table.column.DcStatusColumn.resources.downImage ( ) ; case Up : return org.ovirt.engine.ui.webadmin.widget.table.column.DcStatusColumn.resources.upImage ( ) ; default : break ; } return null ; }
Source:
public static void updateImageStatus ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.common.businessentities.ImageStatus imageStatus ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . updateStatus ( imageId , imageStatus ) ; }

Target:
public static void removeImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . remove ( diskImage.getImageId ( ) ) ; }
Source:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterPolicyModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterHostListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; setDetailModels ( list ) ; }

Target:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterHostListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; setDetailModels ( list ) ; }
Source:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { updateDataCenterVersion ( ) ; getSearchCommand ( ) . execute ( ) ; updateIsDiskHotPlugAvailable ( ) ; updateLiveStorageMigrationEnabled ( ) ; } updateActionAvailability ( ) ; }

Target:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { updateDataCenterVersion ( ) ; getSearchCommand ( ) . execute ( ) ; updateIsDiskHotPlugAvailable ( ) ; updateLiveStorageMigrationEnabled ( ) ; updateScanAlignmentEnabled ( ) ; } updateActionAvailability ( ) ; }
Source:
private void addQuotaRow ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.VerticalPanel list , java.lang.String quotaName , org.ovirt.engine.ui.userportal.widget.QuotaProgressBar progressBar ) { org.ovirt.engine.ui.userportal.section.main.view.tab.extended.FlowPanel flowPanel = new org.ovirt.engine.ui.userportal.section.main.view.tab.extended.FlowPanel ( ) ; org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Label quotaNameLabel = new org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Label ( ) ; quotaNameLabel.setText ( quotaName ) ; flowPanel.add ( quotaNameLabel ) ; flowPanel.add ( progressBar ) ; flowPanel.setWidth ( "100%" ) ; list.add ( flowPanel ) ; }

Target:
private void addQuotaToMemoryQuotaList ( org.ovirt.engine.core.common.businessentities.QuotaUsagePerUser quotaPerUserUsageEntity ) { org.ovirt.engine.ui.userportal.widget.QuotaProgressBar memoryQuotaProgressBar = new org.ovirt.engine.ui.userportal.widget.QuotaProgressBar ( QuotaProgressBar.QuotaType.MEM ) ; memoryQuotaProgressBar.setValues ( quotaPerUserUsageEntity.getMemoryLimit ( ) , ( ( quotaPerUserUsageEntity.getMemoryTotalUsage ( ) ) - ( quotaPerUserUsageEntity.getMemoryUsageForUser ( ) ) ) , quotaPerUserUsageEntity.getMemoryUsageForUser ( ) ) ; addQuotaRow ( memoryQuotasList , quotaPerUserUsageEntity.getQuotaName ( ) , memoryQuotaProgressBar ) ; }
Source:
public void testAddExistingBlockDomainWhenVgInfoReturnsEmptyLunList ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; org.junit.Assert.assertFalse ( "Could not connect to Storage Domain" , command.canAddDomain ( ) ) ; org.junit.Assert.assertTrue ( "Import block Storage Domain should have failed due to empty Lun list returned from VGInfo " , command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_PROBLEM_WITH_CANDIDATE_INFO.toString ( ) ) ) ; }

Target:
public void testAddExistingBlockDomainWhenVgInfoReturnsEmptyLunList ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; org.junit.Assert.assertFalse ( "Could not connect to Storage Domain" , command.canAddDomain ( ) ) ; org.junit.Assert.assertTrue ( "Import block Storage Domain should have failed due to empty Lun list returned from VGInfo " , command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_PROBLEM_WITH_CANDIDATE_INFO.toString ( ) ) ) ; }
Source:
private boolean initRange ( java.lang.String start , java.lang.String end ) { java.util.List < java.lang.String > macAddresses = org.ovirt.engine.core.utils.MacAddressRangeUtils.initRange ( start , end ) ; if ( ( ( macAddresses.size ( ) ) + ( availableMacs.size ( ) ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxMacsCountInPool ) ) ) { throw new org.ovirt.engine.core.bll.network.MacPoolManager.MacPoolExceededMaxException ( ) ; } availableMacs.addAll ( macAddresses ) ; return true ; }

Target:
private boolean initRange ( java.lang.String start , java.lang.String end ) { java.util.List < java.lang.String > macAddresses = org.ovirt.engine.core.utils.MacAddressRangeUtils.initRange ( start , end , org.ovirt.engine.core.bll.network.MacPoolManager.MAX_MACS_IN_POOL ) ; if ( ( ( macAddresses.size ( ) ) + ( availableMacs.size ( ) ) ) > ( org.ovirt.engine.core.bll.network.MacPoolManager.MAX_MACS_IN_POOL ) ) { availableMacs.addAll ( macAddresses.subList ( 0 , ( ( org.ovirt.engine.core.bll.network.MacPoolManager.MAX_MACS_IN_POOL ) - ( availableMacs.size ( ) ) ) ) ) ; throw new org.ovirt.engine.core.bll.network.MacPoolManager.MacPoolExceededMaxException ( ) ; } availableMacs.addAll ( macAddresses ) ; return true ; }
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.event_subscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.event_subscriber entity = new org.ovirt.engine.core.common.businessentities.event_subscriber ( ) ; entity.setevent_up_name ( rs.getString ( "event_up_name" ) ) ; entity.setevent_notification_method ( org.ovirt.engine.core.common.EventNotificationMethod.valueOf ( rs.getString ( "notification_method" ) ) ) ; entity.setmethod_address ( rs.getString ( "method_address" ) ) ; entity.setsubscriber_id ( getGuidDefaultEmpty ( rs , "subscriber_id" ) ) ; entity.settag_name ( rs.getString ( "tag_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.event_subscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.event_subscriber entity = new org.ovirt.engine.core.common.businessentities.event_subscriber ( ) ; entity.setevent_up_name ( rs.getString ( "event_up_name" ) ) ; entity.setevent_notification_method ( org.ovirt.engine.core.common.EventNotificationMethod.valueOfString ( rs.getString ( "notification_method" ) ) ) ; entity.setmethod_address ( rs.getString ( "method_address" ) ) ; entity.setsubscriber_id ( getGuidDefaultEmpty ( rs , "subscriber_id" ) ) ; entity.settag_name ( rs.getString ( "tag_name" ) ) ; return entity ; }
Source:
protected void OnSelectedItemChanging ( java.lang.Object newValue , java.lang.Object oldValue ) { super . OnSelectedItemChanging ( newValue , oldValue ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel oldModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( oldValue ) ) ; if ( oldValue != null ) { oldModel.setIsEmpty ( false ) ; oldModel.setItems ( null ) ; org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel listWithDetails = ( ( org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ( ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ? oldValue : null ) ) ; if ( listWithDetails != null ) { listWithDetails.setActiveDetailModel ( null ) ; } oldModel.EnsureAsyncSearchStopped ( ) ; } }

Target:
protected void onSelectedItemChanging ( java.lang.Object newValue , java.lang.Object oldValue ) { super . onSelectedItemChanging ( newValue , oldValue ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel oldModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( oldValue ) ) ; if ( oldValue != null ) { oldModel.setIsEmpty ( false ) ; oldModel.setItems ( null ) ; org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel listWithDetails = ( ( org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ( ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ? oldValue : null ) ) ; if ( listWithDetails != null ) { listWithDetails.setActiveDetailModel ( null ) ; } oldModel.ensureAsyncSearchStopped ( ) ; } }
Source:
public static void isClusterEmpty ( 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.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static boolean canVmsBePaused ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > items ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : items ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSuspendSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ) { return false ; } } return true ; }
Source:
public static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap principal ) { java.util.List < org.ovirt.engine.api.extensions.ExtMap > accumulator = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.aaa.DirectoryUtils.flatGroups ( accumulator , principal.get ( GroupRecord.GROUPS , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) ; principal.put ( GroupRecord.GROUPS , accumulator ) ; }

Target:
public static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap principal ) { principal.put ( PrincipalRecord.GROUPS , org.ovirt.engine.core.aaa.DirectoryUtils.flatGroups ( principal , PrincipalRecord.GROUPS , new java.util.ArrayList < org.ovirt.engine.api.extensions.ExtMap > ( ) ) ) ; }