auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
public static void updateVdsDomainsData ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainData ) { if ( ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.reportingVdsStatus ) ) && ( vds.getVdsGroupSupportsVirtService ( ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { proxy.updateVdsDomainsData ( vds.getId ( ) , vds.getName ( ) , vdsDomainData ) ; } } }

Target:
public static void updateVdsDomainsData ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainData ) { if ( ( StoragePoolDomainHelper.reportingVdsStatus.contains ( vds.getStatus ( ) ) ) && ( vds.getVdsGroupSupportsVirtService ( ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { proxy.updateVdsDomainsData ( vds.getId ( ) , vds.getName ( ) , vdsDomainData ) ; } } }
Source:
public static void getExternalProviderHostGroupList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalHostGroup > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostGroupsFromExternalProvider , params , aQuery ) ; }

Target:
public static void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > getNonEligibilityReasonsForSlaveVolume4 ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > nonEligibilityreasons = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_SIZE_TO_BE_AVAILABLE ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.MASTER_VOLUME_SIZE_TO_BE_AVAILABLE ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_SIZE_SHOULD_BE_GREATER_THAN_MASTER_VOLUME_SIZE ) ; return nonEligibilityreasons ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > getNonEligibilityReasonsForSlaveVolume4 ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > nonEligibilityreasons = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_SIZE_TO_BE_AVAILABLE ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.MASTER_VOLUME_SIZE_TO_BE_AVAILABLE ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_SIZE_SHOULD_BE_GREATER_THAN_MASTER_VOLUME_SIZE ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.NO_UP_SLAVE_SERVER ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_TO_BE_EMPTY ) ; return nonEligibilityreasons ; }
Source:
public void proceedBalloonCheck ( org.ovirt.engine.core.vdsbroker.VmTestPairs data ) { initMocks ( data , true ) ; org.junit.Assume.assumeNotNull ( data.dbVm ( ) , data.vdsmVm ( ) ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.atLeastOnce ( ) ) . log ( loggableCaptor.capture ( ) , logTypeCaptor.capture ( ) ) ; junit.framework.Assert.assertTrue ( logTypeCaptor.getAllValues ( ) . contains ( AuditLogType.WATCHDOG_EVENT ) ) ; }

Target:
public void proceedBalloonCheck ( org.ovirt.engine.core.vdsbroker.VmTestPairs data ) { initMocks ( data , true ) ; org.junit.Assume.assumeNotNull ( data.dbVm ( ) , data.vdsmVm ( ) ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.atLeastOnce ( ) ) . log ( loggableCaptor.capture ( ) , logTypeCaptor.capture ( ) ) ; org.junit.Assert.assertTrue ( logTypeCaptor.getAllValues ( ) . contains ( AuditLogType.WATCHDOG_EVENT ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getActionGroupDao ( ) ; existingActionMap = dao.getActionVersionMapByActionType ( VdcActionType.AddVm ) ; newActionMap = new org.ovirt.engine.core.common.businessentities.ActionVersionMap ( ) ; newActionMap.setaction_type ( VdcActionType.ActivateStorageDomain ) ; newActionMap.setcluster_minimal_version ( "3.0" ) ; newActionMap.setstorage_pool_minimal_version ( "3.0" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getActionGroupDao ( ) ; existingActionMap = dao.getActionVersionMapByActionType ( VdcActionType.AddVm ) ; newActionMap = new org.ovirt.engine.core.common.businessentities.ActionVersionMap ( ) ; newActionMap.setActionType ( VdcActionType.ActivateStorageDomain ) ; newActionMap.setClusterMinimalVersion ( "3.0" ) ; newActionMap.setStoragePoolMinimalVersion ( "3.0" ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( getEntity ( ) . getId ( ) ) ; parameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworkQosByStoragePoolId , parameters , new org.ovirt.engine.ui.uicommonweb.models.datacenters.SetItemsAsyncQuery ( ) ) ; }
Source:
private org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters buildGetVmsFromExternalProviderQueryParameters ( ) { return new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( provider.getUrl ( ) , provider.getUsername ( ) , provider.getPassword ( ) , provider.getAdditionalProperties ( ) . getProxyHostId ( ) , provider.getAdditionalProperties ( ) . getStoragePoolId ( ) ) ; }

Target:
private org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters buildGetVmsFromExternalProviderQueryParameters ( ) { return new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( provider.getUrl ( ) , provider.getUsername ( ) , provider.getPassword ( ) , org.ovirt.engine.core.common.businessentities.OriginType.VMWARE , provider.getAdditionalProperties ( ) . getProxyHostId ( ) , provider.getAdditionalProperties ( ) . getStoragePoolId ( ) ) ; }
Source:
protected boolean canAddVm ( ) { boolean exists = ( ( java.lang.Boolean ) ( getBackend ( ) . runInternalQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmWithSameNameExistParameters ( getVm ( ) . getName ( ) ) ) . getReturnValue ( ) ) ) ; if ( exists ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_IMPORT_VM_NAME_EXISTS ) ; } return ! exists ; }

Target:
protected boolean validateUsbPolicy ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getParameters ( ) . getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.updateImportedVmUsbPolicy ( vm.getStaticData ( ) ) ; return org.ovirt.engine.core.bll.VmHandler.isUsbPolicyLegal ( vm.getUsbPolicy ( ) , vm.getOs ( ) , getVdsGroup ( ) , getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.GetConnectionsByDataCenterAndStorageTypeQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.storage.GetConnectionsByDataCenterAndStorageTypeQuery.getDbFacade ( ) . getStorageServerConnectionDao ( ) . getConnectableStorageConnectionsByStorageType ( org.ovirt.engine.core.bll.storage.GetConnectionsByDataCenterAndStorageTypeQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.GetConnectionsByDataCenterAndStorageTypeQuery.getParameters ( ) . getStorageType ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.GetConnectionsByDataCenterAndStorageTypeQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.storage.GetConnectionsByDataCenterAndStorageTypeQuery.getDbFacade ( ) . getStorageServerConnectionDao ( ) . getStorageConnectionsByStorageTypeAndStatus ( org.ovirt.engine.core.bll.storage.GetConnectionsByDataCenterAndStorageTypeQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.GetConnectionsByDataCenterAndStorageTypeQuery.getParameters ( ) . getStorageType ( ) , java.util.EnumSet.allOf ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.class ) ) ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Label model = new org.ovirt.engine.api.model.Label ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Label" , "add" , "id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.NetworkLabel model = new org.ovirt.engine.api.model.NetworkLabel ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkLabel" , "add" , "id" ) ; } }
Source:
protected void executeCommand ( ) { if ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.getInstance ( ) . isSessionExists ( org.ovirt.engine.core.bll.aaa.SetSesssionSoftLimitCommand.getParameters ( ) . getSessionId ( ) ) ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.getInstance ( ) . setSoftLimitInterval ( org.ovirt.engine.core.bll.aaa.SetSesssionSoftLimitCommand.getParameters ( ) . getSessionId ( ) , org.ovirt.engine.core.bll.aaa.SetSesssionSoftLimitCommand.getParameters ( ) . getSoftLimit ( ) ) ; org.ovirt.engine.core.bll.aaa.SetSesssionSoftLimitCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.aaa.SetSesssionSoftLimitCommand.setSucceeded ( false ) ; } }

Target:
protected void executeCommand ( ) { if ( sessionDataContainer.isSessionExists ( org.ovirt.engine.core.bll.aaa.SetSesssionSoftLimitCommand.getParameters ( ) . getSessionId ( ) ) ) { sessionDataContainer.setSoftLimitInterval ( org.ovirt.engine.core.bll.aaa.SetSesssionSoftLimitCommand.getParameters ( ) . getSessionId ( ) , org.ovirt.engine.core.bll.aaa.SetSesssionSoftLimitCommand.getParameters ( ) . getSoftLimit ( ) ) ; org.ovirt.engine.core.bll.aaa.SetSesssionSoftLimitCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.aaa.SetSesssionSoftLimitCommand.setSucceeded ( false ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MinMemSize ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; }

Target:
private < T > void maybeSetEntity ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > entityModel , T value ) { if ( ( ( entityModel != null ) && ( entityModel.getIsChangable ( ) ) ) && ( entityModel.getIsAvailable ( ) ) ) { entityModel.setEntity ( value ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.LdapUser getUserByUPN ( java.lang.String userName ) { org.ovirt.engine.core.common.businessentities.LdapUser retVal = null ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = org.ovirt.engine.core.bll.adbroker.InternalBrokerUtils.getDbUserDAO ( ) . getByUsernameAndDomain ( userName , "internal" ) ; if ( dbUser != null ) { retVal = new org.ovirt.engine.core.common.businessentities.LdapUser ( dbUser ) ; } return retVal ; }

Target:
public static org.ovirt.engine.core.common.businessentities.LdapUser getUserByUPN ( java.lang.String userName ) { org.ovirt.engine.core.common.businessentities.LdapUser retVal = null ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = org.ovirt.engine.core.bll.adbroker.InternalBrokerUtils.getDbUserDAO ( ) . getByUsernameAndDomain ( userName , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AdminDomain ) ) ; if ( dbUser != null ) { retVal = new org.ovirt.engine.core.common.businessentities.LdapUser ( dbUser ) ; } return retVal ; }
Source:
public static void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
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.VdsIdParametersBase parameters = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }

Target:
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 ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.aaa.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.aaa.DirectoryUser directoryUser ) { org.ovirt.engine.core.dao.DbUserDAO dao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser dbUser = dao.getByExternalId ( directoryUser.getDirectoryName ( ) , directoryUser.getId ( ) ) ; if ( dbUser != null ) { dao.update ( dbUser ) ; } else { dbUser = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( directoryUser ) ; dbUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dao.save ( dbUser ) ; } return dbUser ; }

Target:
public static org.ovirt.engine.core.common.businessentities.aaa.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.aaa.DirectoryUser directoryUser ) { org.ovirt.engine.core.dao.DbUserDao dao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser dbUser = dao.getByExternalId ( directoryUser.getDirectoryName ( ) , directoryUser.getId ( ) ) ; if ( dbUser != null ) { dao.update ( dbUser ) ; } else { dbUser = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( directoryUser ) ; dbUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dao.save ( dbUser ) ; } return dbUser ; }
Source:
void refreshClustersTable ( ) { clustersTable.edit ( clustersTable.flush ( ) ) ; }

Target:
java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.EntityModel > getClustersTableItems ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel tableModel = clustersTable.asEditor ( ) . flush ( ) ; return ( tableModel != null ) && ( ( tableModel.getItems ( ) ) != null ) ? tableModel.getItems ( ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; }
Source:
public org.ovirt.engine.core.common.interfaces.IVdcUser addUserToThreadContext ( java.lang.String sessionId , boolean refresh ) { org.ovirt.engine.core.common.interfaces.IVdcUser vdcUser = org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getVdcUser ( ) ; if ( vdcUser == null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( sessionId ) ) ) { vdcUser = getUser ( sessionId , refresh ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( sessionId ) ; } else { vdcUser = getUser ( refresh ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setVdcUser ( vdcUser ) ; } return vdcUser ; }

Target:
public org.ovirt.engine.core.common.interfaces.IVdcUser addUserToThreadContext ( java.lang.String sessionId , boolean refresh ) { org.ovirt.engine.core.common.interfaces.IVdcUser vdcUser = org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getVdcUser ( ) ; if ( vdcUser == null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( sessionId ) ) ) { vdcUser = getUser ( sessionId , refresh ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( sessionId ) ; } else { vdcUser = getUser ( refresh ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setVdcUser ( vdcUser ) ; } return vdcUser ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue ; if ( volumeName == null ) { xmlRpcReturnValue = vdsServer.glusterSnapshotConfigGet ( "" ) ; } else { xmlRpcReturnValue = vdsServer.glusterSnapshotConfigGet ( volumeName ) ; } org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc glusterVolumeGeoRepSessionStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response = vdsServer.glusterVolumeGeoRepSessionStatus ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.sdk.decorators.VmPool update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.VmPool.class , org.ovirt.engine.sdk.decorators.VmPool.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VmPool update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.VmPool.class , org.ovirt.engine.sdk.decorators.VmPool.class , headers ) ; }
Source:
protected void removeCommand ( ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.removeCommand ( getCommandId ( ) ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

Target:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.updateCommandStatus ( getCommandId ( ) , commandStatus ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } } }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ! ( areRequiredNetworksAvailable ( vds ) ) ) { sb.append ( "is missing networks required by VM nics " ) . append ( org.ovirt.engine.core.common.businessentities.Entities.interfacesByNetworkName ( getVmNICs ( ) ) . keySet ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_NETWORKS ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( isVdsFailedToRunVm ( vds.getId ( ) ) ) { sb.append ( "have failed running this VM in the current selection cycle" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }
Source:
private void cancelTasks ( ) { if ( hasTasks ( ) ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; } } } ) ; } }

Target:
protected org.ovirt.engine.core.common.action.LockProperties getLockProperties ( ) { org.ovirt.engine.core.common.action.LockProperties lockProperties = _parameters.getLockProperties ( ) ; if ( lockProperties == null ) { lockProperties = applyLockProperties ( getLockingPropertiesSettings ( ) ) ; _parameters.setLockProperties ( lockProperties ) ; } return lockProperties ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( "groups" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setExternalId ( new byte [ 0 ] ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( "groups" ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClustersResourceTest.dataCenterId } , setUpVDSGroups ( ) , null ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; 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 ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClustersResourceTest.dataCenterId } , setUpVDSGroups ( ) , null ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private boolean canDoSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ! ( isLiveSnapshotEnabled ( ) ) ) && ( ! ( vm.isDown ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_DATA_CENTER_VERSION_DOESNT_SUPPORT_LIVE_SNAPSHOT ) ; } org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVds ( ) ; if ( ( vds != null ) && ( ! ( vds.getLiveSnapshotSupport ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_QEMU_UNSUPPORTED_OPERATION ) ; } return true ; }

Target:
protected boolean validateVM ( org.ovirt.engine.core.bll.validator.VmValidator vmValidator ) { org.ovirt.engine.core.bll.validator.LiveSnapshotValidator validator = new org.ovirt.engine.core.bll.validator.LiveSnapshotValidator ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getStoragePool ( ) . getcompatibility_version ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVds ( ) ) ; return ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . isDown ( ) ) || ( validate ( validator.canDoSnapshot ( ) ) ) ) && ( validate ( vmValidator.vmNotSavingRestoring ( ) ) ) ; }
Source:
public void appendCustomValueUsesNullSeparator ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String newVal = "bar" ; final java.lang.String sep = null ; b.addCustomValue ( key , value ) ; b.appendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }

Target:
public void appendCustomValueUsesNullSeparator ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String newVal = "bar" ; final java.lang.String sep = null ; b.addCustomValue ( key , value ) ; b.appendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.jupiter.api.Assertions.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }
Source:
public void testIsSane ( ) { org.junit.Assert.assertTrue ( "/etc should be sane" , org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( "/etc" ) ) ; java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { builder.append ( "/abcdefghijkl" ) ; } org.junit.Assert.assertFalse ( "longPath is not sane" , org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( builder.toString ( ) ) ) ; org.junit.Assert.assertFalse ( "path with .. is not sane" , org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( "/something/../etc/password" ) ) ; org.junit.Assert.assertFalse ( "path with // is not sane" , org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( "/something//etc/password" ) ) ; org.junit.Assert.assertFalse ( "path with ./ is not sane" , org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( "/something/./etc/password" ) ) ; }

Target:
public void testIsSane ( ) { org.junit.jupiter.api.Assertions.assertTrue ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( "/etc" ) , "/etc should be sane" ) ; java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { builder.append ( "/abcdefghijkl" ) ; } org.junit.jupiter.api.Assertions.assertFalse ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( builder.toString ( ) ) , "longPath is not sane" ) ; org.junit.jupiter.api.Assertions.assertFalse ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( "/something/../etc/password" ) , "path with .. is not sane" ) ; org.junit.jupiter.api.Assertions.assertFalse ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( "/something//etc/password" ) , "path with // is not sane" ) ; org.junit.jupiter.api.Assertions.assertFalse ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( "/something/./etc/password" ) , "path with ./ is not sane" ) ; }
Source:
private void acquireLockAndWait ( ) { if ( ( context.getLock ( ) ) == null ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > exclusiveLocks = getExclusiveLocks ( ) ; if ( exclusiveLocks != null ) { org.ovirt.engine.core.utils.lock.EngineLock lock = new org.ovirt.engine.core.utils.lock.EngineLock ( exclusiveLocks , null ) ; getLockManager ( ) . acquireLockWait ( lock ) ; context.withLock ( lock ) ; } } }

Target:
private void acquireLockAndWait ( ) { if ( ( context.getLock ( ) ) == null ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > exclusiveLocks = getExclusiveLocks ( ) ; if ( exclusiveLocks != null ) { org.ovirt.engine.core.utils.lock.EngineLock lock = new org.ovirt.engine.core.utils.lock.EngineLock ( exclusiveLocks , null ) ; log.info ( "Before acquiring and wait lock '{}'" , lock ) ; getLockManager ( ) . acquireLockWait ( lock ) ; context.withLock ( lock ) ; log.info ( "Lock-wait acquired to object '{}'" , lock ) ; } } }
Source:
private boolean shouldUpdateImageProperties ( ) { if ( ( getOldDisk ( ) . getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; return ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( oldQuotaId , getQuotaId ( ) ) ) ; }

Target:
private boolean updateImageParametersRequiringVmDownRequested ( ) { if ( ( getOldDisk ( ) . getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; return ! ( java.util.Objects.equals ( oldQuotaId , getQuotaId ( ) ) ) ; }
Source:
public void shouldNotMigrateVmOnCluster2NothingToDo ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.eq ( vdsGroup2 ) ) ) . thenReturn ( null ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void shouldNotMigrateVmOnClusterTwoWhenEnforced ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.eq ( vdsGroup2 ) ) ) . thenReturn ( null ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
public void getUsbPolicyUsbTypeNull30 ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setcompatibility_version ( Version.v3_0 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicyUsbTypeNull30 ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setCompatibilityVersion ( Version.v3_0 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_LEGACY ) ; }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getClusterGlusterServices ( 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 ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public boolean getAllCleared ( ) { synchronized ( _listTasks ) { for ( org.ovirt.engine.core.bll.CommandAsyncTask task : _listTasks.values ( ) ) { if ( ! ( taskWasCleared ( task ) ) ) { org.ovirt.engine.core.bll.CommandMultiAsyncTasks.log.infoFormat ( "[within thread]: Some of the tasks related to command id {0} were not cleared yet (Task id {1} is in state {2})." , getCommandId ( ) , task.getVdsmTaskId ( ) , task.getState ( ) ) ; return false ; } } } return true ; }

Target:
public boolean getAllCleared ( ) { synchronized ( _listTasks ) { for ( org.ovirt.engine.core.bll.tasks.CommandAsyncTask task : _listTasks.values ( ) ) { if ( ! ( taskWasCleared ( task ) ) ) { org.ovirt.engine.core.bll.CommandMultiAsyncTasks.log.infoFormat ( "[within thread]: Some of the tasks related to command id {0} were not cleared yet (Task id {1} is in state {2})." , getCommandId ( ) , task.getVdsmTaskId ( ) , task.getState ( ) ) ; return false ; } } } return true ; }
Source:
public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > paramT1 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > paramT2 ) { int compareValue = paramT1.getSecond ( ) . getvds_group_name ( ) . compareTo ( paramT2.getSecond ( ) . getvds_group_name ( ) ) ; if ( compareValue != 0 ) { return compareValue ; } return paramT1.getSecond ( ) . getvm_name ( ) . compareTo ( paramT2.getSecond ( ) . getvm_name ( ) ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > paramT1 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > paramT2 ) { int compareValue = paramT1.getSecond ( ) . getVdsGroupName ( ) . compareTo ( paramT2.getSecond ( ) . getVdsGroupName ( ) ) ; if ( compareValue != 0 ) { return compareValue ; } return paramT1.getSecond ( ) . getVmName ( ) . compareTo ( paramT2.getSecond ( ) . getVmName ( ) ) ; }
Source:
private boolean templateExists ( ) { if ( ( ( getVmTemplate ( ) ) == null ) && ( ! ( getParameters ( ) . getCopyCollapse ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST ) ; return false ; } return true ; }

Target:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }
Source:
protected void buildVmSoundDevices ( ) { if ( ( vm.getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) { createInfo.put ( VdsProperties.soundDevice , getSoundDevice ( vm.getStaticData ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ; } }

Target:
protected void buildVmSoundDevices ( ) { if ( ( vm.getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) { createInfo.put ( VdsProperties.soundDevice , OsRepositoryImpl.INSTANCE.getSoundDevice ( vm.getStaticData ( ) . getOsId ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult canAddRngDevice ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.VmRngDevice rngDevice ) { org.ovirt.engine.core.common.businessentities.VmRngDevice.Source source = rngDevice.getSource ( ) ; boolean supported = ( ( cluster != null ) && ( isFeatureSupported ( cluster.getcompatibility_version ( ) ) ) ) && ( cluster.getRequiredRngSources ( ) . contains ( source ) ) ; if ( ! supported ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult canAddRngDevice ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.VmRngDevice rngDevice ) { org.ovirt.engine.core.common.businessentities.VmRngDevice.Source source = rngDevice.getSource ( ) ; boolean supported = ( ( cluster != null ) && ( isFeatureSupported ( cluster.getCompatibilityVersion ( ) ) ) ) && ( cluster.getRequiredRngSources ( ) . contains ( source ) ) ; if ( ! supported ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected < T > T getConfigurationValueDefault ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.ConfigurationValues config ) { return getEntity ( clz , VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) , config.toString ( ) ) ; }

Target:
protected < T > T getConfigurationValueDefault ( org.ovirt.engine.core.common.queries.ConfigurationValues config ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ) ; if ( result.getSucceeded ( ) ) { return ( ( T ) ( result.getReturnValue ( ) ) ) ; } return null ; }
Source:
private java.lang.Integer getWarningLowSpaceSize ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel ) { if ( ! ( storageModel.isNewStorage ( ) ) ) { java.lang.Integer percentageValue = warningLowSpaceIndicatorEditor.asValueBox ( ) . getValue ( ) ; return percentageValue == null ? 0 : ( ( storageModel.getStorage ( ) . getTotalDiskSize ( ) ) * percentageValue ) / 100 ; } return 0 ; }

Target:
public void onKeyUp ( com.google.gwt.event.dom.client.KeyUpEvent event ) { if ( ! ( storageModel.isNewStorage ( ) ) ) { storageModel.getWarningLowSpaceSize ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . bracketsWithGB ( getWarningLowSpaceSize ( storageModel ) ) ) ; } }
Source:
public void testGetUserID ( ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.DbUser.class ) ; org.mockito.Mockito.when ( user.getId ( ) ) . thenReturn ( Guid.EVERYONE ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setUser ( user ) ; org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; junit.framework.Assert.assertEquals ( "wrong guid" , Guid.EVERYONE , query.getUserID ( ) ) ; }

Target:
public void testGetUserID ( ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.DbUser.class ) ; org.mockito.Mockito.when ( user.getId ( ) ) . thenReturn ( Guid.EVERYONE ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setUser ( user ) ; org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; org.junit.Assert.assertEquals ( "wrong guid" , Guid.EVERYONE , query.getUserID ( ) ) ; }
Source:
private java.lang.String mapToJson ( java.util.Map < java.lang.String , java.lang.Object > input ) throws java.io.IOException , org.codehaus.jackson.JsonGenerationException , org.codehaus.jackson.map.JsonMappingException { org.codehaus.jackson.map.ObjectMapper mapper = new org.codehaus.jackson.map.ObjectMapper ( ) ; org.codehaus.jackson.JsonFactory factory = new org.codehaus.jackson.JsonFactory ( ) ; java.io.StringWriter writer = new java.io.StringWriter ( ) ; org.codehaus.jackson.JsonGenerator generator = factory.createJsonGenerator ( writer ) ; generator.useDefaultPrettyPrinter ( ) ; mapper.writeValue ( generator , input ) ; return writer.toString ( ) ; }

Target:
private java.lang.String mapToJson ( java.util.Map < java.lang.String , java.lang.Object > input ) throws java.io.IOException { return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( input ) ; }