auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String uri , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMs ( uri , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( 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.irsbroker.StatusReturnForXmlRpc verifyUntrustedVolume ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.verifyUntrustedVolume ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected boolean validate ( ) { boolean result = true ; if ( ( ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) ) == null ) || ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) . getOrigin ( ) . equalsIgnoreCase ( org.ovirt.engine.core.bll.AddExternalEventCommand.OVIRT ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; result = false ; } if ( ! result ) { addValidationMessage ( EngineMessage.VAR__ACTION__ADD ) ; addValidationMessage ( EngineMessage.VAR__TYPE__EXTERNAL_EVENT ) ; } return result ; }

Target:
protected boolean validate ( ) { boolean result = true ; if ( ( ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) ) == null ) || ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) . getOrigin ( ) . equalsIgnoreCase ( AuditLog.OVIRT_ORIGIN ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; result = false ; } if ( ! result ) { addValidationMessage ( EngineMessage.VAR__ACTION__ADD ) ; addValidationMessage ( EngineMessage.VAR__TYPE__EXTERNAL_EVENT ) ; } return result ; }
Source:
public static boolean VerifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getAvailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.isVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }

Target:
public static boolean verifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getAvailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.isVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }
Source:
public void refreshAllUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DbUser > activeUsers = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DbUser dbUser : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . getAll ( ) ) { if ( dbUser.isActive ( ) ) { activeUsers.add ( dbUser ) ; } } for ( org.ovirt.engine.core.common.businessentities.DbUser user : org.ovirt.engine.core.bll.aaa.SyncUsers.sync ( activeUsers ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . update ( user ) ; } }

Target:
public void refreshAllUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbUser > activeUsers = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.aaa.DbUser dbUser : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . getAll ( ) ) { if ( dbUser.isActive ( ) ) { activeUsers.add ( dbUser ) ; } } for ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user : org.ovirt.engine.core.bll.aaa.SyncUsers.sync ( activeUsers ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . update ( user ) ; } }
Source:
public static void GetGlusterVolumeBrickDetails ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volume , java.lang.String brick ) { 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 , volume , brick , true ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.getBroker ( ) . diskSizeExtend ( org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.getParameters ( ) . getVmId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.getParameters ( ) . getDriveSpecs ( ) , java.lang.String.valueOf ( org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.getParameters ( ) . getNewSize ( ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.ProceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( result.getImageSize ( ) ) ; } }

Target:
protected void ExecuteVdsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.getBroker ( ) . diskSizeExtend ( org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.getParameters ( ) . getVmId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.getParameters ( ) . getDriveSpecs ( ) , java.lang.String.valueOf ( org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.getParameters ( ) . getNewSize ( ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.proceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( result.getImageSize ( ) ) ; } }
Source:
public void testGet ( ) { }

Target:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.GetDiskByDiskIdParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; }
Source:
public int hashCode ( ) { return java.util.Objects.hash ( auditLogId , logTime , logType , message , storageDomainId , storagePoolId , severity , userId , vdsId , quotaId , vmId , vmTemplateId , processed , correlationId , jobId , origin , customEventId , eventFloodInSec , customData , external , deleted , callStack ) ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( auditLogId , logTime , logType , message , storageDomainId , storagePoolId , severity , userId , vdsId , quotaId , vmId , vmTemplateId , processed , correlationId , jobId , origin , customId , customEventId , eventFloodInSec , customData , external , deleted , callStack ) ; }
Source:
public org.ovirt.engine.sdk.decorators.Cluster add ( org.ovirt.engine.sdk.decorators.Cluster cluster , java.lang.String expect , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Expect" , expect ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , cluster , org.ovirt.engine.sdk.entities.Cluster.class , org.ovirt.engine.sdk.decorators.Cluster.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Cluster add ( org.ovirt.engine.sdk.decorators.Cluster cluster ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , cluster , org.ovirt.engine.sdk.entities.Cluster.class , org.ovirt.engine.sdk.decorators.Cluster.class , headers ) ; }
Source:
public static void GetExternalNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }

Target:
public static void getExternalNetworkMap ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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.HashMap < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }
Source:
public org.ovirt.vdsm.jsonrpc.client.reactors.ReactorListener call ( ) throws java.lang.Exception { final java.util.concurrent.Future < org.ovirt.vdsm.jsonrpc.client.reactors.ReactorListener > futureListener = reactorForListener.createListener ( org.ovirt.vdsm.jsonrpc.client.reactors.TestReactor.HOSTNAME , 6668 , new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorListener.EventListener ( ) { @ java.lang.Override public void onAcccept ( org.ovirt.vdsm.jsonrpc.client.reactors.ReactorListener listener , final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client ) { client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.EventListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { client.sendMessage ( message ) ; } } ) ; } } ) ; return futureListener.get ( org.ovirt.vdsm.jsonrpc.client.reactors.TestReactor.TIMEOUT_SEC , java.util.concurrent.TimeUnit.SECONDS ) ; }

Target:
public org.ovirt.vdsm.jsonrpc.client.reactors.ReactorListener call ( ) throws java.lang.Exception { final java.util.concurrent.Future < org.ovirt.vdsm.jsonrpc.client.reactors.ReactorListener > futureListener = reactorForListener.createListener ( org.ovirt.vdsm.jsonrpc.client.reactors.TestReactor.HOSTNAME , 6668 , new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorListener.EventListener ( ) { @ java.lang.Override public void onAcccept ( final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client ) { client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { client.sendMessage ( message ) ; } } ) ; } } ) ; return futureListener.get ( org.ovirt.vdsm.jsonrpc.client.reactors.TestReactor.TIMEOUT_SEC , java.util.concurrent.TimeUnit.SECONDS ) ; }
Source:
public void clearSession ( ) { org.ovirt.engine.core.utils.ThreadLocalParamsContainer.clean ( ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( "session" ) ; org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . removeSession ( ) ; }

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 ) ; java.lang.String session = org.jgroups.util.UUID.randomUUID ( ) . toString ( ) ; org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . setUser ( session , user ) ; org.ovirt.engine.core.common.queries.VdcQueryParametersBase params = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( session ) ; params.setRefresh ( false ) ; org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( params ) ; org.junit.Assert.assertEquals ( "wrong guid" , Guid.EVERYONE , query.getUserID ( ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Tag tag ) { validateParameters ( tag , "name" ) ; if ( isSetParentName ( tag ) ) { tag.getParent ( ) . setId ( getParentId ( tag ) ) ; } return performCreate ( VdcActionType.AddTag , new org.ovirt.engine.core.common.action.TagsOperationParameters ( map ( tag ) ) , new org.ovirt.engine.api.restapi.resource.BackendTagsResource.TagNameResolver ( tag.getName ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Tag tag ) { validateParameters ( tag , "name" ) ; if ( isSetParentName ( tag ) ) { tag.getParent ( ) . setId ( getParentId ( tag ) ) ; } return performCreate ( ActionType.AddTag , new org.ovirt.engine.core.common.action.TagsOperationParameters ( map ( tag ) ) , new org.ovirt.engine.api.restapi.resource.BackendTagsResource.TagNameResolver ( tag.getName ( ) ) ) ; }
Source:
public java.lang.String getNoun ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { assert ! ( isUnary ( ) ) : ( "The Unary Operation " + ( name ( ) ) ) + " has no Noun" ; if ( op2 == null ) { return "Unassigned Logical Networks panel" ; } return op2.getName ( ) ; }

Target:
public java.lang.String getNoun ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { assert ! ( isUnary ( ) ) : ( "The Unary Operation " + ( name ( ) ) ) + " has no Noun" ; if ( op2 == null ) { return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . unassignedLogicalNetworksPanel ( ) ; } return op2.getName ( ) ; }
Source:
public static void GetGlusterHosts ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress , java.lang.String rootPassword , java.lang.String fingerprint ) { 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.GlusterServersQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterServersQueryParameters ( hostAddress , rootPassword ) ; parameters.setFingerprint ( fingerprint ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServers , parameters , aQuery ) ; }

Target:
public static 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 , "" , "" , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.Network getEntity ( int index ) { org.ovirt.engine.api.model.Network entity = org.mockito.Mockito.mock ( org.ovirt.engine.api.model.Network.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; org.mockito.Mockito.when ( entity.getDataCenterId ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.resource.BackendNetworksResourceTest.DATA_CENTER_ID ) ; return entity ; }

Target:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , getEntityList ( ) , failure ) ; } }
Source:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; importSources.setSelectedItem ( ImportSource.EXPORT_DOMAIN ) ; importSources.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { clearVms ( ) ; } } ) ; }

Target:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; importSources.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { clearVms ( ) ; clearValidations ( ) ; loadProviders ( ) ; } } ) ; importSources.setSelectedItem ( ImportSource.EXPORT_DOMAIN ) ; }
Source:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
void initComboBox ( ) { keyListBoxEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.StringRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String render ( java.lang.Object object ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo optionInfo = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ) ( object ) ) ; if ( optionInfo != null ) { return optionInfo.getKey ( ) ; } return null ; } } ) ; keyTextBoxEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelTextBoxEditor ( ) ; keyComboBox = new org.ovirt.engine.ui.common.widget.ComboBox ( keyListBoxEditor , keyTextBoxEditor ) ; }

Target:
void initComboBox ( ) { keyListBoxEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( new org.ovirt.engine.ui.common.widget.renderer.StringRenderer < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ) { @ java.lang.Override public java.lang.String render ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo optionInfo ) { if ( optionInfo != null ) { return optionInfo.getKey ( ) ; } return null ; } } ) ; keyTextBoxEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxEditor ( ) ; keyComboBox = new org.ovirt.engine.ui.common.widget.ComboBox < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( keyListBoxEditor , keyTextBoxEditor ) ; }
Source:
public void changeProtocolAllowed ( ) { org.mockito.Mockito.when ( oldHost.getProtocol ( ) ) . thenReturn ( VdsProtocol.XML ) ; org.mockito.Mockito.when ( host.getProtocol ( ) ) . thenReturn ( VdsProtocol.STOMP ) ; org.mockito.Mockito.when ( oldHost.getStatus ( ) ) . thenReturn ( VDSStatus.Maintenance ) ; org.junit.Assert.assertThat ( validator.changeProtocolAllowed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void oldHostDoesNotExist ( ) { validator = new org.ovirt.engine.core.bll.validator.UpdateHostValidator ( oldHost , null , false ) ; org.junit.Assert.assertThat ( validator.hostExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_INVALID_SERVER_ID ) ) ; }
Source:
public void prepareFromRequest ( com.gwtplatform.mvp.client.proxy.PlaceRequest request ) { super . prepareFromRequest ( request ) ; if ( getModel ( ) . getIsAvailable ( ) ) { org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabPresenter.getProxy ( ) . manualReveal ( this ) ; } else { org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabPresenter.getProxy ( ) . manualRevealFailed ( ) ; revealActiveMainModelPresenter ( ) ; } }

Target:
public void prepareFromRequest ( com.gwtplatform.mvp.shared.proxy.PlaceRequest request ) { super . prepareFromRequest ( request ) ; if ( getModel ( ) . getIsAvailable ( ) ) { org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabPresenter.getProxy ( ) . manualReveal ( this ) ; } else { org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabPresenter.getProxy ( ) . manualRevealFailed ( ) ; revealActiveMainModelPresenter ( ) ; } }
Source:
protected org.ovirt.engine.core.common.AuditLogType executeFailure ( ) { try { getCommand ( ) . executeVmCommand ( ) ; } catch ( java.lang.Exception expected ) { } org.junit.Assert.assertFalse ( getCommand ( ) . getReturnValue ( ) . getSucceeded ( ) ) ; return getCommand ( ) . getAuditLogTypeValue ( ) ; }

Target:
protected org.ovirt.engine.core.common.AuditLogType executeFailure ( ) { try { getCommand ( ) . executeVmCommand ( ) ; } catch ( java.lang.Exception expected ) { } org.junit.jupiter.api.Assertions.assertFalse ( getCommand ( ) . getReturnValue ( ) . getSucceeded ( ) ) ; return getCommand ( ) . getAuditLogTypeValue ( ) ; }
Source:
public boolean getIsQxlSupported ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( getDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean clusterSupportsSinglePci = ( ( getSelectedCluster ( ) ) != null ) && ( ( Version.v3_3.compareTo ( getSelectedCluster ( ) . getcompatibility_version ( ) ) ) <= 0 ) ; return ( isLinux && isQxl ) && clusterSupportsSinglePci ; }

Target:
private void updateNumOfMonitors ( ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.DisplayType > selectedDisplayType = getDisplayType ( ) . getSelectedItem ( ) ; if ( ( selectedDisplayType != null ) && ( ( selectedDisplayType.getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) ) { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangable ( false ) ; } else { getNumOfMonitors ( ) . setIsChangable ( true ) ; } }
Source:
public void OnTimer ( ) { try { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "AuditLogCleanupManager::deleteAgedOutAuditLogs - entered" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . AddDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.AuditLogAgingThreashold ) ) * ( - 1 ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . removeAllBeforeDate ( latestTimeToKeep ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.error ( "AuditLogCleanupManager::deleteAgedOutAuditLogs() - failed with exception" , e ) ; } }

Target:
public void OnTimer ( ) { try { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "Start deleteAgedOutAuditLogs" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . AddDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.AuditLogAgingThreashold ) ) * ( - 1 ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . removeAllBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "Finished deleteAgedOutAuditLogs" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.error ( "deleteAgedOutAuditLog failed with exception" , e ) ; } }
Source:
public void canDoActionFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO.toString ( ) ) ) ; }

Target:
public void canDoActionFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.mockito.Mockito.when ( osRepository.hasSpiceSupport ( 0 , Version.v3_1 ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 0 ) ) . thenReturn ( "RHEL6" ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO.toString ( ) ) ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { java.util.List < java.lang.String > bricks = org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.getQualifiedBrickList ( org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getBricks ( ) ) ; status = org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getBroker ( ) . glusterVolumeBrickAdd ( org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getVolumeName ( ) , bricks.toArray ( new java.lang.String [ 0 ] ) , org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getReplicaCount ( ) , org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getStripeCount ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { java.util.List < java.lang.String > bricks = org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.getQualifiedBrickList ( org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getBricks ( ) ) ; status = org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getBroker ( ) . glusterVolumeBrickAdd ( org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getVolumeName ( ) , bricks.toArray ( new java.lang.String [ 0 ] ) , org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getReplicaCount ( ) , org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getStripeCount ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { initiateResumeUploadCheckStatus ( result ) ; }

Target:
private void initiateResumeUpload ( ) { startProgress ( null ) ; setProgressStr ( "Resuming upload" ) ; final org.ovirt.engine.core.common.action.UploadImageStatusParameters parameters = new org.ovirt.engine.core.common.action.UploadImageStatusParameters ( ) ; parameters.setDiskId ( getDiskModel ( ) . getDisk ( ) . getId ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UploadImageStatus , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { initiateResumeUploadCheckStatus ( result ) ; } } , this ) ; }
Source:
private void UpdateVmData ( org.ovirt.engine.core.bll.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) . getValue ( ) , vmDynamicData ) ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . update ( vmDynamicData ) ; } }

Target:
private void UpdateVmData ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) . getValue ( ) , vmDynamicData ) ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . update ( vmDynamicData ) ; } }
Source:
public boolean isFenceAgentVersionCompatible ( org.ovirt.engine.core.common.businessentities.FenceAgent agent , java.lang.String clusterCompatibilityVersion , java.util.List < java.lang.String > messages ) { if ( ! ( org.ovirt.engine.core.compat.Regex.IsMatch ( org.ovirt.engine.core.utils.pm.FenceConfigHelper.getFenceConfigurationValue ( ConfigValues.VdsFenceType.name ( ) , clusterCompatibilityVersion ) , java.lang.String.format ( "(,|^)%1$s(,|$)" , agent.getType ( ) ) ) ) ) { messages.add ( VdcBllMessages.ACTION_TYPE_FAILED_AGENT_NOT_SUPPORTED.name ( ) ) ; return false ; } else { return true ; } }

Target:
public boolean isFenceAgentVersionCompatible ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent , java.lang.String clusterCompatibilityVersion , java.util.List < java.lang.String > messages ) { if ( ! ( org.ovirt.engine.core.compat.Regex.IsMatch ( org.ovirt.engine.core.utils.pm.FenceConfigHelper.getFenceConfigurationValue ( ConfigValues.VdsFenceType.name ( ) , clusterCompatibilityVersion ) , java.lang.String.format ( "(,|^)%1$s(,|$)" , agent.getType ( ) ) ) ) ) { messages.add ( VdcBllMessages.ACTION_TYPE_FAILED_AGENT_NOT_SUPPORTED.name ( ) ) ; return false ; } else { return true ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension createConnectionExtension ( org.ovirt.engine.core.compat.Guid hostId , java.lang.String target , java.lang.String userName , java.lang.String password ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = new org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension ( ) ; connExt.setHostId ( hostId ) ; connExt.setIqn ( target ) ; connExt.setUserName ( userName ) ; connExt.setPassword ( password ) ; return connExt ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension createConnectionExtension ( org.ovirt.engine.core.compat.Guid hostId ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = new org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension ( ) ; connExt.setHostId ( hostId ) ; connExt.setIqn ( "target1" ) ; connExt.setUserName ( "userConnExt" ) ; connExt.setPassword ( "pwdConnExt" ) ; return connExt ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setId ( diskImageGuid ) ; disk.setSize ( 100000L ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singleton ( sdId ) ) ) ; disk.setStoragePoolId ( spId ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setId ( diskImageGuid ) ; disk.setSize ( 100000L ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singleton ( sdId ) ) ) ; disk.setStoragePoolId ( spId ) ; disk.setDescription ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; return disk ; }
Source:
public void setSelectedItem ( java.lang.Object value ) { if ( ( selectedItem ) != value ) { OnSelectedItemChanging ( value , selectedItem ) ; selectedItem = value ; OnSelectedItemChanged ( ) ; getSelectedItemChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "SelectedItem" ) ) ; } }

Target:
public void setSelectedItem ( java.lang.Object value ) { if ( ( selectedItem ) != value ) { OnSelectedItemChanging ( value , selectedItem ) ; selectedItem = value ; OnSelectedItemChanged ( ) ; getSelectedItemChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SelectedItem" ) ) ; } }
Source:
protected org.ovirt.engine.api.model.DataCenter deprecatedPopulate ( org.ovirt.engine.api.model.DataCenter model , org.ovirt.engine.core.common.businessentities.StoragePool entity ) { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( model.getId ( ) ) ) ; model.setSupportedVersions ( getMapper ( java.util.List.class , org.ovirt.engine.api.model.SupportedVersions.class ) . map ( getEntity ( java.util.List.class , VdcQueryType.GetAvailableStoragePoolVersions , parameters , model.getId ( ) ) , null ) ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.DataCenter deprecatedPopulate ( org.ovirt.engine.api.model.DataCenter model , org.ovirt.engine.core.common.businessentities.StoragePool entity ) { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( model.getId ( ) ) ) ; model.setSupportedVersions ( getMapper ( java.util.List.class , org.ovirt.engine.api.model.Versions.class ) . map ( getEntity ( java.util.List.class , VdcQueryType.GetAvailableStoragePoolVersions , parameters , model.getId ( ) ) , null ) ) ; return model ; }
Source:
private void createCommand ( ) { org.ovirt.engine.core.bll.profiles.AddCpuProfileCommand addCpuProfileCommandInstance = new org.ovirt.engine.core.bll.profiles.AddCpuProfileCommand ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.parameters , org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.commandContext ) { @ java.lang.Override protected org.ovirt.engine.core.bll.interfaces.BackendInternal getBackend ( ) { return org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.backend ; } } ; org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.addCpuProfileCommand = org.mockito.Mockito.spy ( addCpuProfileCommandInstance ) ; org.mockito.Mockito.doReturn ( cpuProfilesDao ) . when ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.addCpuProfileCommand ) . getProfileDao ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.commandContext ) . when ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.addCpuProfileCommand ) . getContext ( ) ; }

Target:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = addCpuProfileCommand.getPermissionCheckSubjects ( ) ; org.junit.Assert.assertEquals ( 1 , permissions.size ( ) ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.CLUSTER_ID , permissionSubject.getObjectId ( ) ) ; org.junit.Assert.assertEquals ( VdcObjectType.Cluster , permissionSubject.getObjectType ( ) ) ; }
Source:
public void getStorageDomainMaxNameLength ( 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 ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc startSpice ( java.lang.String vdsIp , int port , java.lang.String ticket ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.startSpice ( vdsIp , port , ticket ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( 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.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String userName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepKeysUpdate ( userName , geoRepPubKeys ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private static int getNextImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
private java.lang.String getMemoryVolumeFromActiveSnapshotInExportDomain ( ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) return snapshot.getMemoryVolume ( ) ; } org.ovirt.engine.core.bll.ImportVmCommand.log.warnFormat ( "VM {0} doesn't have active snapshot in export domain" , getVmId ( ) ) ; return org.apache.commons.lang.StringUtils.EMPTY ; }
Source:
public void testUpdate ( ) { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmNicFilterParameter , org.ovirt.engine.core.common.action.VmNicFilterParameterParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.VM_ID } , true , true ) ) ; org.ovirt.engine.api.model.NetworkFilterParameter parameter = resource.update ( getParameter ( ) ) ; org.junit.Assert.assertNotNull ( parameter ) ; }

Target:
public void testUpdate ( ) { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmNicFilterParameter , org.ovirt.engine.core.common.action.VmNicFilterParameterParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.VM_ID } , true , true ) ) ; org.ovirt.engine.api.model.NetworkFilterParameter parameter = resource.update ( getParameter ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( parameter ) ; }
Source:
public void appendCustomValueDoesntHandleNullKeys ( ) { final java.lang.String key = null ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String sep = "_" ; b.appendCustomValue ( key , value , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , s ) ; }

Target:
public void appendCustomValueDoesntHandleNullKeys ( ) { final java.lang.String key = null ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String sep = "_" ; org.junit.jupiter.api.Assertions.assertThrows ( java.lang.NullPointerException.class , ( ) -> b.appendCustomValue ( key , value , sep ) ) ; }
Source:
protected static java.lang.String getMessageOrNull ( org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String key = logType.name ( ) ; try { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resourceBundle.getString ( key ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( ( ( ( ( "Key '" + key ) + "' is not translated in '" ) + ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getResourceBundleName ( ) ) ) + "'" ) ) ; return null ; } }

Target:
public static java.lang.String getMessage ( org.ovirt.engine.core.common.AuditLogType logType ) { java.lang.String value = "" ; if ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.containsKey ( logType ) ) { value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.get ( logType ) ; } return value ; }