auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDirectoryUserById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Id" } , new java.lang.Object [ ] { DOMAIN , GUIDS [ index ] } , ( notFound ? null : getEntity ( index ) ) ) ; }

Target:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDirectoryUserById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Id" } , new java.lang.Object [ ] { DOMAIN , EXTERNAL_IDS [ index ] } , ( notFound ? null : getEntity ( index ) ) ) ; }
Source:
private static boolean hasAttribute ( int id , java.sql.Connection conn , org.ovirt.engine.api.extensions.ExtMap attribute , boolean user ) throws java.sql.SQLException { return ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Query ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "SELECT value FROM WHERE = and name = '{}'" , ( user ? "user_attributes" : "group_attributes" ) , ( user ? "user_id" : "group_id" ) , id , attribute.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.SharedKeys.ATTRIBUTE_NAME , java.lang.String.class ) ) ) . asString ( conn , "value" ) ) != null ; }

Target:
private static boolean hasAttribute ( int id , java.sql.Connection conn , org.ovirt.engine.api.extensions.ExtMap attribute , boolean user ) throws java.sql.SQLException { return ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Query ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "SELECT value FROM WHERE = and name = {}" , ( user ? "user_attributes" : "group_attributes" ) , ( user ? "user_id" : "group_id" ) , id , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( attribute.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.SharedKeys.ATTRIBUTE_NAME , java.lang.String.class ) ) ) ) . asString ( conn , "value" ) ) != null ; }
Source:
public boolean getIsQxlSupported ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( extractSelectedDisplayTypeEntity ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean isSpice = ( getGraphicsType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.SPICE ) ; boolean clusterSupportsSinglePci = ( ( getSelectedCluster ( ) ) != null ) && ( ( Version.v3_3.compareTo ( getSelectedCluster ( ) . getCompatibilityVersion ( ) ) ) <= 0 ) ; return ( ( isLinux && isQxl ) && isSpice ) && clusterSupportsSinglePci ; }

Target:
public boolean getIsQxlSupported ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( getDisplayType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean isSpice = ( getGraphicsType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.SPICE ) ; boolean clusterSupportsSinglePci = ( ( getSelectedCluster ( ) ) != null ) && ( ( Version.v3_3.compareTo ( getSelectedCluster ( ) . getCompatibilityVersion ( ) ) ) <= 0 ) ; return ( ( isLinux && isQxl ) && isSpice ) && clusterSupportsSinglePci ; }
Source:
protected org.ovirt.engine.core.compat.Guid getMasterDomainIdFromDb ( ) { org.ovirt.engine.core.compat.Guid ret = org.ovirt.engine.core.compat.Guid.Empty ; if ( ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) != null ) { ret = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDAO ( ) . getMasterStorageDomainIdForPool ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getId ( ) ) ; } return ret ; }

Target:
protected org.ovirt.engine.core.compat.Guid getMasterDomainIdFromDb ( ) { org.ovirt.engine.core.compat.Guid ret = org.ovirt.engine.core.compat.Guid.Empty ; if ( ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) != null ) { ret = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getMasterStorageDomainIdForPool ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getId ( ) ) ; } return ret ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( result.getState ( ) ) ) ; dataCenterGuideModel.removeConnection = true ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; dataCenterGuideModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( result.getState ( ) ) ) ; dataCenterGuideModel.removeConnection = true ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; dataCenterGuideModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
private static void flatGroups ( java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > groupIds , java.util.List < java.lang.String > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : groupIds ) { if ( ! ( accumulator.contains ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.add ( group.get ( Authz.GroupRecord.ID ) ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }

Target:
private static void flatGroups ( java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > groupIds , java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : groupIds ) { if ( ! ( accumulator.containsKey ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.put ( group.get ( Authz.GroupRecord.ID ) , group ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( oldIface ) ; getCompensationContext ( ) . snapshotEntity ( oldVmDevice ) ; getVmNetworkInterfaceDao ( ) . update ( getInterface ( ) ) ; oldVmDevice.setCustomProperties ( getInterface ( ) . getCustomProperties ( ) ) ; getDbFacade ( ) . getVmDeviceDao ( ) . update ( oldVmDevice ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( oldIface ) ; getCompensationContext ( ) . snapshotEntity ( oldVmDevice ) ; getVmNicDao ( ) . update ( getInterface ( ) ) ; oldVmDevice.setCustomProperties ( getInterface ( ) . getCustomProperties ( ) ) ; getDbFacade ( ) . getVmDeviceDao ( ) . update ( oldVmDevice ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > getDiskInterfaceList ( org.ovirt.engine.core.compat.Version clusterVersion ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > diskInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.DiskInterface [ ] { org.ovirt.engine.core.common.businessentities.DiskInterface.IDE , org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO } ) ) ; boolean isVirtIOScsiEnabled = ( clusterVersion != null ) ? ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.VirtIoScsiEnabled , clusterVersion.getValue ( ) ) ) ) : true ; if ( isVirtIOScsiEnabled ) { diskInterfaces.add ( DiskInterface.VirtIO_SCSI ) ; } return diskInterfaces ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > getDisplayTypes ( int osId , org.ovirt.engine.core.compat.Version version ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.displayTypes.get ( osId ) . get ( version ) ; }
Source:
private void doTestBadAddTag ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { "Tag.TagName" , "Tag.ParentId" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_GUID } , canDo , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddTag ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { "Tag.TagName" , "Tag.ParentId" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_GUID } , valid , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void removeAllForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > interfaces = dao.getAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertFalse ( interfaces.isEmpty ( ) ) ; dao.removeAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ; interfaces = dao.getAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertTrue ( interfaces.isEmpty ( ) ) ; }

Target:
public void removeAllForVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > interfaces = dao.getAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertFalse ( interfaces.isEmpty ( ) ) ; dao.removeAllForVms ( java.util.Collections.singletonList ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ) ; interfaces = dao.getAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertTrue ( interfaces.isEmpty ( ) ) ; }
Source:
public static java.lang.String CreateImageFile ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { java.lang.String retVal = "" ; if ( ( image.getId ( ) ) != null ) { retVal += image.getId ( ) . toString ( ) ; } else { retVal += org.ovirt.engine.core.compat.Guid.Empty ; } retVal += "/" + ( image.getImageId ( ) . toString ( ) ) ; return retVal ; }

Target:
public static java.lang.String createImageFile ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { java.lang.String retVal = "" ; if ( ( image.getId ( ) ) != null ) { retVal += image.getId ( ) . toString ( ) ; } else { retVal += org.ovirt.engine.core.compat.Guid.Empty ; } retVal += "/" + ( image.getImageId ( ) . toString ( ) ) ; return retVal ; }
Source:
private void addDiskPermissions ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Permissions perms = new org.ovirt.engine.core.common.businessentities.Permissions ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) . getId ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; } }

Target:
private void addDiskPermissions ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Permission perms = new org.ovirt.engine.core.common.businessentities.Permission ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) . getId ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; } }
Source:
public static void getGlusterRebalanceStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRebalanceStatus , parameters , aQuery ) ; }

Target:
public static void getRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( comparator ) == null ? 0 : comparator.hashCode ( ) ) ; result = ( prime * result ) + ( sortAscending ? 1231 : 1237 ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( comparator , sortAscending ) ; }
Source:
public void initialize ( org.ovirt.engine.core.common.validation.annotation.ConfiguredRange constraintAnnotation ) { if ( ( constraintAnnotation.minConfigValue ( ) ) != ( org.ovirt.engine.core.common.config.ConfigValues.Invalid ) ) { min = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( constraintAnnotation.minConfigValue ( ) , Config.DefaultConfigurationVersion ) ; } else { min = constraintAnnotation.min ( ) ; } max = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( constraintAnnotation.maxConfigValue ( ) , Config.DefaultConfigurationVersion ) ; }

Target:
public void initialize ( org.ovirt.engine.core.common.validation.annotation.ConfiguredRange constraintAnnotation ) { if ( ( constraintAnnotation.minConfigValue ( ) ) != ( org.ovirt.engine.core.common.config.ConfigValues.Invalid ) ) { min = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( constraintAnnotation.minConfigValue ( ) , ConfigCommon.defaultConfigurationVersion ) ; } else { min = constraintAnnotation.min ( ) ; } max = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( constraintAnnotation.maxConfigValue ( ) , ConfigCommon.defaultConfigurationVersion ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isGlusterSupportedInDC ( ) { if ( ( ! ( storagePool.isLocal ( ) ) ) && ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.GlusterFsStorageEnabled , storagePool.getcompatibility_version ( ) . toString ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.DATA_CENTER_GLUSTER_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isAnyDomainInProcess ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > poolIsoMaps = getStoragePoolIsoMapDao ( ) . getAllForStoragePool ( storagePool.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap domainIsoMap : poolIsoMaps ) { if ( ( ( domainIsoMap.getStatus ( ) ) != null ) && ( domainIsoMap.getStatus ( ) . isStorageDomainInProcess ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 , java.lang.String.format ( "$status %1$s" , domainIsoMap.getStatus ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void PctThresholdMoreThan100 ( ) { org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings = new org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings ( ) ; settings.diskSpaceFree = 10 ; settings.diskSpaceUsed = 0 ; settings.spaceThresholdGB = 5 ; settings.spaceThresholdPct = 110 ; org.ovirt.engine.core.common.businessentities.storage_domains domain = setupForSpaceTest ( settings ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.isBelowThresholds ( domain ) ) ; }

Target:
public void PctThresholdMoreThan100 ( ) { org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings = new org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings ( ) ; settings.diskSpaceFree = 10 ; settings.diskSpaceUsed = 0 ; settings.spaceThresholdGB = 5 ; settings.spaceThresholdPct = 110 ; org.ovirt.engine.core.common.businessentities.storage_domains domain = setupForSpaceTest ( settings ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.isWithinThresholds ( domain ) ) ; }
Source:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveGroup , org.ovirt.engine.core.common.action.IdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveGroup , org.ovirt.engine.core.common.action.IdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void setJobOrStepId ( org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { java.lang.String jobId = org.ovirt.engine.api.common.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendResource.JOB_ID_CONSTRAINT ) ; if ( jobId != null ) { params.setJobId ( asGuid ( jobId ) ) ; } java.lang.String stepId = org.ovirt.engine.api.common.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendResource.STEP_ID_CONSTRAINT ) ; if ( stepId != null ) { params.setJobId ( asGuid ( stepId ) ) ; } }

Target:
private void setJobOrStepId ( org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { java.lang.String jobId = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendResource.JOB_ID_CONSTRAINT ) ; if ( jobId != null ) { params.setJobId ( asGuid ( jobId ) ) ; } java.lang.String stepId = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendResource.STEP_ID_CONSTRAINT ) ; if ( stepId != null ) { params.setJobId ( asGuid ( stepId ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc migrateStatus ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.getMigrationStatus" ) . 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 ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.BooleanReturnForXmlRpc glusterVolumeEmptyCheck ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.volumeEmptyCheck" ) . withParameter ( "volumeName" , volumeName ) . 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.BooleanReturnForXmlRpc ( response , "volumeEmptyCheck" ) ; }
Source:
protected void readBytes ( java.nio.ByteBuffer ibuff ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { int read = readBuffer ( ibuff ) ; if ( read <= 0 ) { return ; } ibuff.rewind ( ) ; byte [ ] message = new byte [ read ] ; ibuff.get ( message ) ; emitOnMessageReceived ( message ) ; this . ibuff = null ; }

Target:
public void process ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { processIncoming ( ) ; processHeartbeat ( ) ; processOutgoing ( ) ; }
Source:
private java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > createRunningVms ( ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > vms = new java.util.HashMap < > ( ) ; vms.put ( org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfoTest.VM_1 , new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vm_1_vdsm.getDynamicData ( ) , null , null , null ) ) ; return vms ; }

Target:
private java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > createRunningVms ( ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > vms = new java.util.HashMap < > ( ) ; vms.put ( org.ovirt.engine.core.vdsbroker.HostMonitoringTest.VM_1 , new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vm_1_vdsm.getDynamicData ( ) , null , null , null ) ) ; return vms ; }
Source:
public static void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
protected java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile object ) { return object.getName ( ) ; }

Target:
void initEditors ( ) { volumeTypeListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.VolumeType > ( ) ) ; storageListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer ( ) ) ; sourceStorageListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer ( ) ) ; diskProfileListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > ( ) ) ; quotaListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.Quota > ( ) ) ; }
Source:
protected void init ( ) { resource = new org.ovirt.engine.api.restapi.resource.BackendClusterResource ( GUIDS [ 0 ] . toString ( ) ) ; resource.setBackend ( backend ) ; resource.setMappingLocator ( mapperLocator ) ; resource.setSessionHelper ( sessionHelper ) ; resource.setMessageBundle ( messageBundle ) ; resource.setHttpHeaders ( httpHeaders ) ; }

Target:
protected void init ( ) { resource = new org.ovirt.engine.api.restapi.resource.BackendHostResource ( GUIDS [ 0 ] . toString ( ) , new org.ovirt.engine.api.restapi.resource.BackendHostsResource ( ) ) ; resource.setBackend ( backend ) ; resource.setMappingLocator ( mapperLocator ) ; resource.setSessionHelper ( sessionHelper ) ; resource.setMessageBundle ( messageBundle ) ; resource.setHttpHeaders ( httpHeaders ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.compat.Guid > mockStorageGuidList ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { java.util.List < org.ovirt.engine.core.compat.Guid > storageGuidList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { storageGuidList.add ( storageDomain.getId ( ) ) ; } return storageGuidList ; }

Target:
private void mockVds ( ) { mockGetStorageDomainList ( 100 , 100 ) ; mockGetImagesList ( ) ; }
Source:
public void testUpdateGlusterServerUuid ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entityToUpdate = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ( org.ovirt.engine.core.dao.FixturesTool.GLUSTER_BRICK_SERVER1 , org.ovirt.engine.core.dao.FixturesTool.GLUSTER_SERVER_UUID_NEW ) ; dao.update ( entityToUpdate ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = dao.getByServerId ( FixturesTool.GLUSTER_BRICK_SERVER1 ) ; org.junit.Assert.assertNotNull ( entity ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_SERVER_UUID_NEW , entity.getGlusterServerUuid ( ) ) ; }

Target:
public void testUpdateGlusterServerUuid ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entityToUpdate = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ( org.ovirt.engine.core.dao.FixturesTool.GLUSTER_BRICK_SERVER1 , org.ovirt.engine.core.dao.FixturesTool.GLUSTER_SERVER_UUID_NEW ) ; dao.update ( entityToUpdate ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = dao.getByServerId ( FixturesTool.GLUSTER_BRICK_SERVER1 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( entity ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.GLUSTER_SERVER_UUID_NEW , entity.getGlusterServerUuid ( ) ) ; }
Source:
protected java.lang.Long getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getactual_size ( ) : ( ( long ) ( ( ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( object ) ) . getLun ( ) . getDeviceSize ( ) ) * ( java.lang.Math.pow ( 1024 , 3 ) ) ) ) ; }

Target:
protected java.lang.Long getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? java.lang.Math.round ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getActualDiskWithSnapshotsSize ( ) ) : ( ( long ) ( ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( object ) ) . getLun ( ) . getDeviceSize ( ) ) ) ; }
Source:
protected void updateEntityPhaseToPausedBySystem ( org.ovirt.engine.core.common.AuditLogType pausedBySystemReason ) { auditLog ( this , pausedBySystemReason ) ; updateEntityPhase ( ImageTransferPhase.PAUSED_SYSTEM ) ; }

Target:
protected void updateEntityPhaseToStoppedBySystem ( org.ovirt.engine.core.common.AuditLogType stoppedBySystemReason ) { auditLog ( this , stoppedBySystemReason ) ; if ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Upload ) ) { updateEntityPhase ( ImageTransferPhase.PAUSED_SYSTEM ) ; } else { updateEntityPhase ( ImageTransferPhase.CANCELLED ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getGeoRepSession ( org.ovirt.engine.core.compat.Guid masterVolumeId , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { return getCallsHandler ( ) . executeRead ( "GetGlusterGeoRepSessionBySlaveHostAndVolume" , org.ovirt.engine.core.dao.gluster.GlusterGeoRepDaoDbFacadeImpl.georepSessionRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "master_volume_id" , masterVolumeId ) . addValue ( "slave_host_name" , slaveHost ) . addValue ( "slave_volume_name" , slaveVolumeName ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getGeoRepSession ( org.ovirt.engine.core.compat.Guid masterVolumeId , org.ovirt.engine.core.compat.Guid slaveHostId , java.lang.String slaveVolumeName ) { return getCallsHandler ( ) . executeRead ( "GetGlusterGeoRepSessionBySlaveHostAndVolume" , org.ovirt.engine.core.dao.gluster.GlusterGeoRepDaoDbFacadeImpl.georepSessionRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "master_volume_id" , masterVolumeId ) . addValue ( "slave_host_uuid" , slaveHostId ) . addValue ( "slave_volume_name" , slaveVolumeName ) ) ; }
Source:
public void testGuestFQDN ( ) { org.ovirt.engine.api.restapi.types.VM vm = new org.ovirt.engine.api.restapi.types.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setFqdn ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.Vm map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; org.junit.Assert.assertNotNull ( map.getFqdn ( ) ) ; org.junit.Assert.assertEquals ( "localhost.localdomain" , map.getFqdn ( ) ) ; }

Target:
public void testGuestFQDN ( ) { org.ovirt.engine.api.restapi.types.VM vm = new org.ovirt.engine.api.restapi.types.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setFqdn ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.Vm map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( map.getFqdn ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "localhost.localdomain" , map.getFqdn ( ) ) ; }
Source:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }

Target:
public void getVmTemplatesByBaseTemplateId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid baseTemplate ) { asyncQuery.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.VmTemplate > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesByBaseTemplateId , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( baseTemplate ) , asyncQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.qos.QosBase createNewQosEntityForQosType ( org.ovirt.engine.api.model.QosType qosType ) { switch ( qosType ) { case STORAGE : return new org.ovirt.engine.core.common.businessentities.qos.StorageQos ( ) ; case CPU : return new org.ovirt.engine.core.common.businessentities.qos.CpuQos ( ) ; case NETWORK : return new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; default : throw new java.lang.IllegalArgumentException ( ( ( "Unsupported QoS type \"" + qosType ) + "\"" ) ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.qos.QosBase createNewQosEntityForQosType ( org.ovirt.engine.api.model.QosType qosType ) { switch ( qosType ) { case STORAGE : return new org.ovirt.engine.core.common.businessentities.qos.StorageQos ( ) ; case CPU : return new org.ovirt.engine.core.common.businessentities.qos.CpuQos ( ) ; case NETWORK : return new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; case HOSTNETWORK : return new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; default : throw new java.lang.IllegalArgumentException ( ( ( "Unsupported QoS type \"" + qosType ) + "\"" ) ) ; } }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected void updateScsiPassthroguhChangeability ( ) { getIsScsiPassthrough ( ) . setIsChangable ( ( ( ! ( getIsReadOnly ( ) . getEntity ( ) ) ) && ( isEditEnabled ( ) ) ) ) ; getIsScsiPassthrough ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.cannotEnableScsiPassthroughForLunReadOnlyDisk ( ) ) ; updateSgIoUnfilteredChangeability ( ) ; }

Target:
protected void updateScsiPassthroguhChangeability ( ) { getIsScsiPassthrough ( ) . setIsChangeable ( ( ( ! ( getIsReadOnly ( ) . getEntity ( ) ) ) && ( isEditEnabled ( ) ) ) ) ; getIsScsiPassthrough ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.cannotEnableScsiPassthroughForLunReadOnlyDisk ( ) ) ; updateSgIoUnfilteredChangeability ( ) ; }
Source:
protected void analyze ( ) { proceedDownVms ( ) ; proceedWatchdogEvents ( ) ; proceedBalloonCheck ( ) ; proceedGuaranteedMemoryCheck ( ) ; updateRepository ( ) ; prepareGuestAgentNetworkDevicesForUpdate ( ) ; updateLunDisks ( ) ; updateVmJobs ( ) ; analyzeExternalVms ( ) ; analyzeHostedEngineVm ( ) ; if ( ( vmDynamicToSave ) != null ) { vmsMonitoring.addVmDynamicToList ( vmDynamicToSave ) ; } if ( saveVmInterfaces ) { vmsMonitoring.addVmInterfaceStatisticsToList ( dbVm.getInterfaces ( ) ) ; } }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics > getVmNetworkStatistics ( ) { return saveVmInterfaces ? dbVm.getInterfaces ( ) . stream ( ) . map ( VmNetworkInterface :: getStatistics ) . collect ( java.util.stream.Collectors.toList ( ) ) : java.util.Collections.emptyList ( ) ; }
Source:
protected boolean commandSpecificCanDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage targetDisk = org.ovirt.engine.core.bll.UploadStreamCommand.getDiskImage ( ) ; if ( ( targetDisk.getVolumeType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Preallocated ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_VOLUME_TYPE_UNSUPPORTED , java.lang.String.format ( "$volumeType %1$s" , targetDisk.getVolumeType ( ) . toString ( ) ) , java.lang.String.format ( "$supportedVolumeTypes %1$s" , VolumeType.Preallocated ) ) ; } return true ; }

Target:
protected boolean commandSpecificCanDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage targetDisk = org.ovirt.engine.core.bll.UploadStreamCommand.getDiskImage ( ) ; if ( ( targetDisk.getVolumeType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Preallocated ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_DISK_VOLUME_TYPE_UNSUPPORTED , java.lang.String.format ( "$volumeType %1$s" , targetDisk.getVolumeType ( ) . toString ( ) ) , java.lang.String.format ( "$supportedVolumeTypes %1$s" , VolumeType.Preallocated ) ) ; } return true ; }
Source:
protected javax.ws.rs.core.UriInfo setUpBasicUriExpectations ( java.lang.String path ) { javax.ws.rs.core.UriInfo uriInfo = control.createMock ( javax.ws.rs.core.UriInfo.class ) ; java.net.URI baseUri = java.net.URI.create ( ( ( org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.URI_BASE ) + '/' ) ) ; org.easymock.EasyMock.expect ( uriInfo.getBaseUri ( ) ) . andReturn ( baseUri ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( uriInfo.getPath ( ) ) . andReturn ( path ) . anyTimes ( ) ; return uriInfo ; }

Target:
protected javax.ws.rs.core.UriInfo setUpBasicUriExpectations ( java.lang.String path ) { javax.ws.rs.core.UriInfo uriInfo = control.createMock ( javax.ws.rs.core.UriInfo.class ) ; java.net.URI baseUri = java.net.URI.create ( ( ( org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.URI_BASE ) + '/' ) ) ; org.easymock.EasyMock.expect ( uriInfo.getBaseUri ( ) ) . andReturn ( baseUri ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( uriInfo.getPath ( ) ) . andReturn ( path ) . anyTimes ( ) ; org.ovirt.engine.api.restapi.invocation.Current current = org.ovirt.engine.api.restapi.invocation.CurrentManager.get ( ) ; current.setPath ( path ) ; return uriInfo ; }
Source:
public void testIsNotHeHostWithVmCountGreaterThanZero ( ) { final int vmCount = 1 ; final boolean isHostedEngine = false ; setupHostedEngineTests ( isHostedEngine , vmCount ) ; boolean isHostedEngineHost = dao.get ( existingVds.getId ( ) ) . isHostedEngineHost ( ) ; org.junit.Assert.assertFalse ( isHostedEngineHost ) ; }

Target:
public void testIsNotHeHostWithVmCountGreaterThanZero ( ) { final int vmCount = 1 ; final boolean isHostedEngine = false ; setupHostedEngineTests ( isHostedEngine , vmCount ) ; boolean isHostedEngineHost = dao.get ( existingVds.getId ( ) ) . isHostedEngineHost ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( isHostedEngineHost ) ; }
Source:
private void doInit ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { context = input.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; java.util.Properties configuration = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.EXTENSION_NAME , "Internal Authz (Built-in)" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , "N/A" ) . mput ( Authz.ContextKeys.QUERY_MAX_FILTER_SIZE , configuration.get ( "config.query.filter.size" ) ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) ; adminUser = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.PrincipalRecord.NAME , configuration.getProperty ( "config.authz.user.name" ) ) . mput ( Authz.PrincipalRecord.ID , configuration.getProperty ( "config.authz.user.id" ) ) ; }

Target:
private void doLoad ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { context = input.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; java.util.Properties configuration = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.EXTENSION_NAME , "Internal Authz (Built-in)" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , "N/A" ) . mput ( Authz.ContextKeys.QUERY_MAX_FILTER_SIZE , java.lang.Integer.parseInt ( configuration.getProperty ( "config.query.filter.size" ) ) ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) . mput ( Authz.ContextKeys.AVAILABLE_NAMESPACES , java.util.Arrays.asList ( "*" ) ) ; adminUser = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.PrincipalRecord.NAME , configuration.getProperty ( "config.authz.user.name" ) ) . mput ( Authz.PrincipalRecord.ID , configuration.getProperty ( "config.authz.user.id" ) ) ; }
Source:
public void testImportVMFromConfigurationWhenStorageDomainIsInMaintenance ( ) { initCommand ( getOvfEntityData ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = createStorageDomain ( ) ; storageDomain.setStatus ( StorageDomainStatus.Maintenance ) ; org.mockito.Mockito.doReturn ( storageDomain ) . when ( cmd ) . getStorageDomain ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; }

Target:
public void testImportVMFromConfigurationWhenStorageDomainIsInMaintenance ( ) { initCommand ( getOvfEntityData ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = createStorageDomain ( ) ; storageDomain.setStatus ( StorageDomainStatus.Maintenance ) ; final org.ovirt.engine.core.dao.StorageDomainDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.doReturn ( dao ) . when ( cmd ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( dao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.doReturn ( storageDomain ) . when ( cmd ) . getStorageDomain ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; }