auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeReset ( java.lang.String volumeName , java.lang.String volumeOption , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.reset" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "option" , volumeOption ) . withParameter ( "force" , force ) . 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 ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterVolumeReset ( java.lang.String volumeName , java.lang.String volumeOption , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.reset" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "option" , volumeOption ) . withParameter ( "force" , force ) . 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:
private static boolean validateQuotaStorageLimitation ( org.ovirt.engine.core.common.businessentities.Quota quota , java.util.List < java.lang.String > messages ) { boolean isValid = true ; java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorageList = quota.getQuotaStorages ( ) ; if ( ( quota.isGlobalStorageQuota ( ) ) && ( ( quotaStorageList != null ) && ( ! ( quotaStorageList.isEmpty ( ) ) ) ) ) { messages.add ( VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_LIMIT_IS_SPECIFIC_AND_GENERAL.toString ( ) ) ; isValid = false ; } return isValid ; }

Target:
private static boolean validateQuotaStorageLimitation ( org.ovirt.engine.core.common.businessentities.Quota quota , java.util.List < java.lang.String > messages ) { boolean isValid = true ; java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorageList = quota.getQuotaStorages ( ) ; if ( ( quota.isGlobalStorageQuota ( ) ) && ( ( quotaStorageList != null ) && ( ! ( quotaStorageList.isEmpty ( ) ) ) ) ) { messages.add ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_LIMIT_IS_SPECIFIC_AND_GENERAL.toString ( ) ) ; isValid = false ; } return isValid ; }
Source:
private void Spice_Disconnected ( java.lang.Object sender , org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs e ) { getspice ( ) . getDisconnectedEvent ( ) . removeListener ( this ) ; getspice ( ) . getMenuItemSelectedEvent ( ) . removeListener ( this ) ; setIsConnected ( false ) ; UpdateActionAvailability ( ) ; if ( ( e.getErrorCode ( ) ) > 100 ) { getErrorEvent ( ) . raise ( this , e ) ; } }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > retval = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDAO ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : retval ) { AnonymousMethod1 ( template ) ; } org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getQueryReturnValue ( ) . setReturnValue ( retval ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > retval = org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getDbFacade ( ) . getVmTemplateDAO ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getParameters ( ) . isFiltered ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : retval ) { AnonymousMethod1 ( template ) ; } org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getQueryReturnValue ( ) . setReturnValue ( retval ) ; }
Source:
public void removeAll ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = getVmNetworkInterfaceDAO ( ) . getAllForVm ( vmId ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : interfaces ) { getMacPoolManager ( ) . freeMac ( iface.getMacAddress ( ) ) ; getVmNetworkInterfaceDAO ( ) . remove ( iface.getId ( ) ) ; getVmNetworkStatisticsDAO ( ) . remove ( iface.getId ( ) ) ; } } }

Target:
public void removeAll ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = getVmNetworkInterfaceDao ( ) . getAllForVm ( vmId ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : interfaces ) { getMacPoolManager ( ) . freeMac ( iface.getMacAddress ( ) ) ; getVmNetworkInterfaceDao ( ) . remove ( iface.getId ( ) ) ; getVmNetworkStatisticsDao ( ) . remove ( iface.getId ( ) ) ; } } }
Source:
private java.lang.String replaceLocaleWithUSLocale ( java.lang.String originalString , java.util.Locale locale ) { java.lang.String regex = ( ( "/" + ( locale.toLanguageTag ( ) . replaceAll ( "-" , "\\\\-" ) ) ) + "|/" ) + ( locale.toString ( ) ) ; return originalString.replaceAll ( regex , ( "/" + ( java.util.Locale.US.toLanguageTag ( ) ) ) ) ; }

Target:
private java.lang.String replaceLocaleWithUSLocale ( java.lang.String originalString , java.util.Locale locale ) { return replaceLocaleWithOtherLocale ( originalString , locale , java.util.Locale.US ) ; }
Source:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue RunQuery ( org.ovirt.engine.core.common.queries.VdcQueryType search , org.ovirt.engine.core.common.queries.VdcQueryParametersBase searchParameters ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunQuery invoked!" ) ; debugQuery ( search , searchParameters ) ; searchParameters.setSessionId ( getSessionId ( ) ) ; return getBackend ( ) . runQuery ( search , searchParameters ) ; }

Target:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue RunQuery ( org.ovirt.engine.core.common.queries.VdcQueryType search , org.ovirt.engine.core.common.queries.VdcQueryParametersBase searchParameters ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunQuery invoked!" ) ; debugQuery ( search , searchParameters ) ; searchParameters.setSessionId ( getSession ( ) . getId ( ) ) ; return getBackend ( ) . runQuery ( search , searchParameters ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getCachedIsoListByStoragePoolAndDomainId ( org.ovirt.engine.core.compat.Guid isoStoragePoolId , org.ovirt.engine.core.compat.Guid isoStorageDomainId , org.ovirt.engine.core.common.businessentities.ImageType imageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > fileListMD = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; if ( ( ( isoStorageDomainId != null ) && ( isoStoragePoolId != null ) ) && ( ( findActiveISODomain ( isoStoragePoolId ) ) != null ) ) { fileListMD = repoStorageDom.getRepoListForStorageDomainAndStoragePool ( isoStoragePoolId , isoStorageDomainId , imageType ) ; } return fileListMD ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getCachedIsoListByDomainId ( org.ovirt.engine.core.compat.Guid isoStorageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > fileListMD = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; if ( isoStorageDomainId != null ) { fileListMD = repoStorageDom.getRepoListForStorageDomain ( isoStorageDomainId , imageType ) ; } return fileListMD ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getMovedDisks ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > movedDiskIds = getMovedDiskIds ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid diskId : movedDiskIds ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setId ( diskId ) ; disks.add ( disk ) ; } return disks ; }

Target:
public void endWithFailure ( ) { org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; if ( ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getStage ( ) ) == ( org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters.LiveMigrateStage.CREATE_SNAPSHOT ) ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.OK , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; } }
Source:
public static void saveClass ( java.lang.String distPath , java.lang.String className , java.lang.String classCode ) { java.lang.String classPath = ( ( distPath + ( java.io.File.separator ) ) + ( className.replace ( '.' , java.io.File.separatorChar ) ) ) + ".java" ; org.ovirt.engine.sdk.codegen.utils.FileUtils.saveFile ( classPath , classCode ) ; }

Target:
public static void saveClass ( java.lang.String distPath , java.lang.String className , java.lang.String classCode ) throws java.io.IOException { java.io.File classFile = new java.io.File ( distPath , ( ( className.replace ( '.' , java.io.File.separatorChar ) ) + ".java" ) ) ; java.util.List < java.lang.String > classLines = java.util.Arrays.asList ( classCode.split ( "\n" ) ) ; classLines = org.ovirt.engine.sdk.codegen.utils.StringUtils.removeTrailingWhitespace ( classLines ) ; org.apache.commons.io.FileUtils.writeLines ( classFile , classLines ) ; }
Source:
public static org.ovirt.engine.core.compat.Match Match ( java.lang.String string , java.lang.String pattern , int options ) { java.util.regex.Matcher matcher = java.util.regex.Pattern.compile ( pattern , options ) . matcher ( string ) ; boolean success = matcher.find ( ) ; return new org.ovirt.engine.core.compat.Match ( matcher.toMatchResult ( ) , success ) ; }

Target:
public static org.ovirt.engine.core.compat.Match match ( java.lang.String string , java.lang.String pattern , int options ) { java.util.regex.Matcher matcher = java.util.regex.Pattern.compile ( pattern , options ) . matcher ( string ) ; boolean success = matcher.find ( ) ; return new org.ovirt.engine.core.compat.Match ( matcher.toMatchResult ( ) , success ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; setConfirmWindow ( null ) ; if ( result.getReturnValue ( ) . getSucceeded ( ) ) { disableRemoveBrickStatusPopUpActions ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; setConfirmWindow ( null ) ; if ( result.getReturnValue ( ) . getSucceeded ( ) ) { showRemoveBricksStatus ( ) ; } }
Source:
protected boolean validate ( ) { boolean returnValue = true ; if ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) . equals ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) ) ) { addValidationMessage ( EngineMessage.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } if ( org.ovirt.engine.core.bll.TagsDirector.getInstance ( ) . isTagDescestorOfTag ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) , org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) ) ) { addValidationMessage ( EngineMessage.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } return returnValue ; }

Target:
protected boolean validate ( ) { boolean returnValue = true ; if ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) . equals ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) ) ) { addValidationMessage ( EngineMessage.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } if ( tagsDirector.isTagDescestorOfTag ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) , org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) ) ) { addValidationMessage ( EngineMessage.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } return returnValue ; }
Source:
private boolean equals ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item2 ) { if ( ( item1 == null ) && ( item2 == null ) ) { return true ; } return item1 != null ? item1.equals ( item2 ) : item2.equals ( item1 ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachmentForNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { if ( networkId == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment updatedAttachment = new org.ovirt.engine.core.common.utils.MapNetworkAttachments ( hostSetupNetworksParametersData.newOrModifiedNetworkAttachments ) . byNetworkId ( ) . get ( networkId ) ; if ( updatedAttachment != null ) { return updatedAttachment ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment = getExistingAttachmentByNetworkId ( networkId ) ; if ( ( existingAttachment != null ) && ( ! ( shouldBeRemoved ( existingAttachment.getId ( ) ) ) ) ) { return existingAttachment ; } return null ; }
Source:
public org.ovirt.engine.core.common.eventqueue.EventResult storageDomainNotOperational ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase parameters = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( storageDomainId , storagePoolId ) ; parameters.setIsInternal ( true ) ; parameters.setInactive ( true ) ; boolean isSucceeded = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.DeactivateStorageDomain , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) . getSucceeded ( ) ; return new org.ovirt.engine.core.common.eventqueue.EventResult ( isSucceeded , org.ovirt.engine.core.common.eventqueue.EventType.DOMAINNOTOPERATIONAL ) ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult masterDomainNotOperational ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId , boolean isReconstructToInactiveDomains , boolean canReconstructToCurrentMaster ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = new org.ovirt.engine.core.common.action.ReconstructMasterParameters ( storagePoolId , storageDomainId , true , isReconstructToInactiveDomains , canReconstructToCurrentMaster ) ; boolean isSucceeded = backend.runInternalAction ( VdcActionType.ReconstructMasterDomain , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) . getSucceeded ( ) ; return new org.ovirt.engine.core.common.eventqueue.EventResult ( isSucceeded , org.ovirt.engine.core.common.eventqueue.EventType.RECONSTRUCT ) ; }
Source:
public static java.lang.String decrypt ( java.lang.String source ) throws java.security.GeneralSecurityException { if ( ( source == null ) || ( ( source.length ( ) ) == 0 ) ) { return source ; } else { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( "RSA" ) ; rsa.init ( javax.crypto.Cipher.DECRYPT_MODE , org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.getPrivateKeyEntry ( ) . getPrivateKey ( ) ) ; return new java.lang.String ( rsa.doFinal ( new org.apache.commons.codec.binary.Base64 ( ) . decode ( source ) ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } }

Target:
public static java.lang.String decrypt ( java.lang.String source ) throws java.security.GeneralSecurityException { if ( ( source == null ) || ( ( source.length ( ) ) == 0 ) ) { return source ; } else { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( "RSA" ) ; rsa.init ( javax.crypto.Cipher.DECRYPT_MODE , org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.getPrivateKeyEntry ( ) . getPrivateKey ( ) ) ; return new java.lang.String ( rsa.doFinal ( new org.apache.commons.codec.binary.Base64 ( ) . decode ( source ) ) , java.nio.charset.StandardCharsets.UTF_8 ) ; } }
Source:
public void deleteCompletedJobs ( ) throws java.text.ParseException { int sizeBeforeDelete = dao.getAll ( ) . size ( ) ; java.text.DateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; java.util.Date dateToDelete = df.parse ( "2013-02-9 10:11:00" ) ; dao.deleteCompletedJobs ( dateToDelete , dateToDelete ) ; int sizeAfterDelete = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertTrue ( "Check an entry was deleted" , ( sizeBeforeDelete > sizeAfterDelete ) ) ; }

Target:
public void deleteCompletedJobs ( ) throws java.text.ParseException { int sizeBeforeDelete = dao.getAll ( ) . size ( ) ; java.text.DateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; java.util.Date dateToDelete = df.parse ( "2013-02-9 10:11:00" ) ; dao.deleteCompletedJobs ( dateToDelete , dateToDelete ) ; int sizeAfterDelete = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertTrue ( "Check job with step and no async task deleted" , ( ( dao.get ( new org.ovirt.engine.core.compat.Guid ( "54947df8-0e9e-4471-a2f9-9af509fb0002" ) ) ) == null ) ) ; org.junit.Assert.assertTrue ( "Check an entry was deleted" , ( sizeBeforeDelete > sizeAfterDelete ) ) ; }
Source:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.UnlabelNetwork , org.ovirt.engine.core.common.action.UnlabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.NETWORK_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.UnlabelNetwork , org.ovirt.engine.core.common.action.UnlabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.NETWORK_ID } , valid , success ) ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: remove ) , detail ) ; }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void SelectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . SelectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "storage_domain_shared_status" ) ) { UpdateActionAvailability ( ) ; } }

Target:
private void saveGlusterStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . StartProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveGluster" } ) ) ) . Run ( ) ; }
Source:
protected org.ovirt.engine.api.model.GlusterBrick populateAdvancedDetails ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class , VdcQueryType.GetGlusterVolumeById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( entity.getVolumeId ( ) ) , null , true ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails detailsEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , VdcQueryType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( volumeEntity.getClusterId ( ) , volumeEntity.getId ( ) , entity.getId ( ) , true ) , null , true ) ; model = getMapper ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , org.ovirt.engine.api.model.GlusterBrick.class ) . map ( detailsEntity , model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.GlusterBrick populateAdvancedDetails ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class , QueryType.GetGlusterVolumeById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( entity.getVolumeId ( ) ) , null , true ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails detailsEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , QueryType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( volumeEntity.getClusterId ( ) , volumeEntity.getId ( ) , entity.getId ( ) , true ) , null , true ) ; model = getMapper ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , org.ovirt.engine.api.model.GlusterBrick.class ) . map ( detailsEntity , model ) ; return model ; }
Source:
protected boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getBackend ( ) . runInternalAction ( VdcActionType.ActivateDeactivateVmNic , createActivateDeactivateParameters ( nic , plugAction ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }

Target:
private boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction , boolean newNic ) { org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters parameters = new org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters ( nic , plugAction , newNic ) ; parameters.setVmId ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getBackend ( ) . runInternalAction ( VdcActionType.ActivateDeactivateVmNic , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }
Source:
public boolean isCidrNetworkAddressValid ( java.lang.String cidr ) { java.lang.String [ ] temp = cidr.split ( "/" ) ; long ipAsInteger = org.ovirt.engine.core.common.validation.CidrValidator.covnertIpToInt ( temp [ 0 ] ) ; int mask = java.lang.Integer.parseInt ( temp [ 1 ] ) ; return org.ovirt.engine.core.common.validation.CidrValidator.isNetworkAddress ( ipAsInteger , mask ) ; }

Target:
public boolean isCidrNetworkAddressValid ( java.lang.String cidr ) { java.lang.String [ ] temp = cidr.split ( "/" ) ; long ipAsInteger = org.ovirt.engine.core.common.utils.IpAddressConverter.getInstance ( ) . convertIpToLong ( temp [ 0 ] ) ; int mask = java.lang.Integer.parseInt ( temp [ 1 ] ) ; return org.ovirt.engine.core.common.validation.CidrValidator.isNetworkAddress ( ipAsInteger , mask ) ; }
Source:
public void testGetWithInvalidNetworkId ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondWithNoMatchingNetworks ( ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetWithInvalidNetworkId ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondWithNoMatchingNetworks ( ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private java.lang.String getTimeZoneForVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) ) { return vm.getTimeZone ( ) ; } if ( vm.getOs ( ) . isWindows ( ) ) { return org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.DefaultWindowsTimeZone ) ; } else { return "Etc/GMT" ; } }

Target:
private java.lang.String getTimeZoneForVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) ) { return vm.getTimeZone ( ) ; } if ( OsRepositoryImpl.INSTANCE.isWindows ( vm.getOs ( ) ) ) { return org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.DefaultWindowsTimeZone ) ; } else { return "Etc/GMT" ; } }
Source:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "name" ) ; } }
Source:
protected boolean validateImages ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , false , true , true , true , true , true , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) ) ; }

Target:
protected boolean validateImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesToValidate = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) , true , false ) ; org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( imagesToValidate ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ; }
Source:
private java.util.concurrent.locks.ReentrantReadWriteLock lockForMacPool ( org.ovirt.engine.core.compat.Guid macPoolId ) { if ( poolLocks.containsKey ( macPoolId ) ) { return poolLocks.get ( macPoolId ) ; } java.util.concurrent.locks.ReentrantReadWriteLock lock = new java.util.concurrent.locks.ReentrantReadWriteLock ( ) ; poolLocks.put ( macPoolId , lock ) ; return lock ; }

Target:
private synchronized java.util.concurrent.locks.ReentrantReadWriteLock lockForMacPool ( org.ovirt.engine.core.compat.Guid macPoolId ) { if ( poolLocks.containsKey ( macPoolId ) ) { org.ovirt.engine.core.bll.network.macpool.DecoratedMacPoolFactory.log.debug ( "Returning cached read/write lock for macPoolId={}" , macPoolId ) ; return poolLocks.get ( macPoolId ) ; } org.ovirt.engine.core.bll.network.macpool.DecoratedMacPoolFactory.log.debug ( "Creating read/write lock for macPoolId={}" , macPoolId ) ; java.util.concurrent.locks.ReentrantReadWriteLock lock = new java.util.concurrent.locks.ReentrantReadWriteLock ( ) ; poolLocks.put ( macPoolId , lock ) ; return lock ; }
Source:
public void validateBadUUIDSFiltered ( ) { java.util.Map < java.lang.String , java.lang.Object > innerMap = new java.util.HashMap < > ( ) ; innerMap.put ( org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturnTest.IMAGES_LIST , new java.lang.Object [ ] { "28e983b9-c2f6-4a50-a5d5-7a38089797c7" , "c3d75234-b360-4aed-8d78-413d7488bd9b" , "_remove_me_2f17489c-285e-496d-bd86-0d63d1be2efe" } ) ; org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturn imagesListReturn = new org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturn ( innerMap ) ; java.lang.String [ ] expectedUUIDList = new java.lang.String [ ] { "28e983b9-c2f6-4a50-a5d5-7a38089797c7" , "c3d75234-b360-4aed-8d78-413d7488bd9b" } ; org.junit.Assert.assertArrayEquals ( expectedUUIDList , imagesListReturn.getImageList ( ) ) ; }

Target:
public void validateBadUUIDSFiltered ( ) { java.util.Map < java.lang.String , java.lang.Object > innerMap = java.util.Collections.singletonMap ( org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturnTest.IMAGES_LIST , new java.lang.Object [ ] { "28e983b9-c2f6-4a50-a5d5-7a38089797c7" , "c3d75234-b360-4aed-8d78-413d7488bd9b" , "_remove_me_2f17489c-285e-496d-bd86-0d63d1be2efe" } ) ; org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturn imagesListReturn = new org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturn ( innerMap ) ; java.lang.String [ ] expectedUUIDList = new java.lang.String [ ] { "28e983b9-c2f6-4a50-a5d5-7a38089797c7" , "c3d75234-b360-4aed-8d78-413d7488bd9b" } ; org.junit.Assert.assertArrayEquals ( expectedUUIDList , imagesListReturn.getImageList ( ) ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.networks.NetworkClusterListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getManageCommand ( ) ) ) { return managePopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.networks.NetworkExternalSubnetListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getNewCommand ( ) ) ) { return newExternalSubnetPopupProvider.get ( ) ; } return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }
Source:
public void canDoActionCanNotFindTemplate ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initTemplateDiskImage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }
Source:
private static void generateRsdlFile ( org.ovirt.engine.api.rsdl.MetaData metadata , java.lang.String outputFileName , java.util.List < java.lang.String > rels ) throws java.io.IOException , java.lang.ClassNotFoundException { org.ovirt.engine.api.model.RSDL rsdl = org.ovirt.engine.api.rsdl.RsdlManager.buildRsdl ( metadata , rels ) ; org.ovirt.engine.api.rsdl.RsdlManager.serializeRsdl ( rsdl , outputFileName ) ; }

Target:
private static void generateRsdlFile ( org.ovirt.engine.api.rsdl.MetaData metadata , java.lang.String outputFileName , java.util.List < java.lang.String > rels ) throws java.io.IOException , java.lang.ClassNotFoundException { org.ovirt.engine.api.model.RSDL rsdl = org.ovirt.engine.api.rsdl.RsdlManager.buildRsdl ( metadata , rels ) ; org.ovirt.engine.api.model.DetailedLinks additionalLinks = org.ovirt.engine.api.rsdl.RsdlManager.loadLinks ( ) ; rsdl.getLinks ( ) . getLinks ( ) . addAll ( additionalLinks.getLinks ( ) ) ; org.ovirt.engine.api.rsdl.RsdlManager.serializeRsdl ( rsdl , outputFileName ) ; }
Source:
public java.lang.Void runInTransaction ( ) { if ( ( isNameChanged ( ) ) || ( isDescriptionChanged ( ) ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . update ( getExistingIscsiBond ( ) ) ; } updateNetworksIds ( ) ; updateConnectionsIds ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { if ( ( isNameChanged ( ) ) || ( isDescriptionChanged ( ) ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . update ( getIscsiBond ( ) ) ; } updateNetworksIds ( ) ; updateConnectionsIds ( ) ; return null ; }
Source:
public void canDoActionShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createShareableDiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , Version.v3_1 ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertCanDoActionSuccess ( ) ; }

Target:
public void canDoActionShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.AddDiskCommandTest.createShareableDiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , Version.v3_1 ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertCanDoActionSuccess ( ) ; }
Source:
private boolean isTemplateInDestStorageDomain ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid sourceDomainId ) { org.ovirt.engine.core.compat.Guid templateId = getDiskImageByImageId ( imageId ) . getImageTemplateId ( ) ; if ( ! ( Guid.Empty.equals ( templateId ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateImage = getDiskImageDao ( ) . get ( templateId ) ; if ( ! ( templateImage.getStorageIds ( ) . contains ( sourceDomainId ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN ) ; } } return true ; }

Target:
private boolean isTemplateInDestStorageDomain ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid sourceDomainId ) { org.ovirt.engine.core.compat.Guid templateId = getDiskImageByImageId ( imageId ) . getImageTemplateId ( ) ; if ( ! ( Guid.Empty.equals ( templateId ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateImage = getDiskImageDao ( ) . get ( templateId ) ; if ( ! ( templateImage.getStorageIds ( ) . contains ( sourceDomainId ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN ) ; } } return true ; }
Source:
public static boolean CanRemoveUser ( org.ovirt.engine.core.compat.Guid user_guid , java.util.ArrayList < java.lang.String > errors ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . get ( user_guid ) ) == null ) { errors.add ( VdcBllMessages.USER_MUST_EXIST_IN_DB.toString ( ) ) ; returnValue = false ; } return returnValue ; }

Target:
public static boolean canRemoveUser ( org.ovirt.engine.core.compat.Guid user_guid , java.util.ArrayList < java.lang.String > errors ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . get ( user_guid ) ) == null ) { errors.add ( VdcBllMessages.USER_MUST_EXIST_IN_DB.toString ( ) ) ; returnValue = false ; } return returnValue ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testBadGet ( ) { org.ovirt.engine.api.restapi.resource.BackendFileResource resource = new org.ovirt.engine.api.restapi.resource.BackendFileResource ( "foo" , collection ) ; collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpQueryExpectations ( "" , null ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testBadGet ( ) { org.ovirt.engine.api.restapi.resource.BackendFileResource resource = new org.ovirt.engine.api.restapi.resource.BackendFileResource ( "foo" , collection ) ; collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpQueryExpectations ( "" , null ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterVolumeOptionInfoList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeOptionsInfo , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
private static void setNewIdInImportedCollections ( org.ovirt.engine.core.common.businessentities.VmBase entity ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice managedDevice : entity.getManagedDeviceMap ( ) . values ( ) ) { if ( ! ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.isDiskOrInterface ( managedDevice ) ) ) { managedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , entity.getId ( ) ) ) ; } } for ( org.ovirt.engine.core.common.businessentities.VmDevice unMnagedDevice : entity.getUnmanagedDeviceList ( ) ) { unMnagedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , entity.getId ( ) ) ) ; } }

Target:
private static void setNewIdInImportedCollections ( org.ovirt.engine.core.common.businessentities.VmBase entity ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice managedDevice : entity.getManagedDeviceMap ( ) . values ( ) ) { if ( ! ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.isDiskOrInterface ( managedDevice ) ) ) { managedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , entity.getId ( ) ) ) ; } } for ( org.ovirt.engine.core.common.businessentities.VmDevice unMnagedDevice : entity.getUnmanagedDeviceList ( ) ) { unMnagedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , entity.getId ( ) ) ) ; } }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void setThreadsPerCore ( java.lang.String value ) { if ( ( ( threadsPerCore ) == null ) && ( value == null ) ) { return ; } if ( ( ( threadsPerCore ) == null ) || ( ! ( threadsPerCore.equals ( value ) ) ) ) { threadsPerCore = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "ThreadsPerCore" ) ) ; } }

Target:
public java.lang.String getSpmPriority ( ) { return spmPriority ; }
Source:
public void testExecuteQueryForType ( org.ovirt.engine.core.common.businessentities.storage.StorageType type ) { org.junit.Assume.assumeTrue ( ( type + " is not a concrete type, skipping" ) , type.isConcreteStorageType ( ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getStorageType ( ) ) . thenReturn ( type ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( ( "Wrong 'Wipe After Delete' value returned for Storage Domain type " + type ) , type.isBlockDomain ( ) , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testExecuteQueryForType ( org.ovirt.engine.core.common.businessentities.storage.StorageType type ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getStorageType ( ) ) . thenReturn ( type ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( type.isBlockDomain ( ) , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) , ( "Wrong 'Wipe After Delete' value returned for Storage Domain type " + type ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllOfTypes ( org.ovirt.engine.core.common.businessentities.VDSType [ ] types ) { java.lang.Integer [ ] intTypes = new java.lang.Integer [ types.length ] ; for ( int index = 0 ; index < ( types.length ) ; index ++ ) { intTypes [ index ] = types [ index ] . getValue ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VdsStatic > found = vdsStaticDAO.findByCriteria ( org.hibernate.criterion.Restrictions.in ( "vdsType" , intTypes ) ) ; return convertToVdsList ( found ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getVdsToRun ( org.ovirt.engine.core.common.businessentities.VDSType [ ] types , org.ovirt.engine.core.compat.Guid groupId , org.ovirt.engine.core.common.businessentities.VDSStatus status , int minNrOfCpus ) { return null ; }