auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addExternallyManagedVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > externalVmList ) { for ( org.ovirt.engine.core.common.businessentities.VmStatic currVm : externalVmList ) { org.ovirt.engine.core.common.action.AddVmParameters params = new org.ovirt.engine.core.common.action.AddVmParameters ( currVm , null , null ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.AddVmFromScratch , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.VdsEventListener.log.debugFormat ( "Failed adding Externally managed VM {0}" , currVm.getName ( ) ) ; } } }

Target:
public void addExternallyManagedVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > externalVmList ) { for ( org.ovirt.engine.core.common.businessentities.VmStatic currVm : externalVmList ) { org.ovirt.engine.core.common.action.AddVmParameters params = new org.ovirt.engine.core.common.action.AddVmParameters ( currVm ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.AddVmFromScratch , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.VdsEventListener.log.debugFormat ( "Failed adding Externally managed VM {0}" , currVm.getName ( ) ) ; } } }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.providers.NeutronAgentModel model ) { driver.edit ( model ) ; mappings.setExplanation ( org.ovirt.engine.ui.webadmin.widget.provider.NeutronAgentWidget.templates.italicText ( model.getInterfaceMappingsExplanation ( ) . getEntity ( ) ) ) ; model.getInterfaceMappingsExplanation ( ) . getEntityChangedEvent ( ) . 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 ) { mappings.setExplanation ( org.ovirt.engine.ui.webadmin.widget.provider.NeutronAgentWidget.templates.italicText ( model.getInterfaceMappingsExplanation ( ) . getEntity ( ) ) ) ; } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.providers.NeutronAgentModel model ) { driver.edit ( model ) ; mappings.setExplanation ( model.getInterfaceMappingsExplanation ( ) . getEntity ( ) ) ; model.getInterfaceMappingsExplanation ( ) . getEntityChangedEvent ( ) . 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 ) { mappings.setExplanation ( model.getInterfaceMappingsExplanation ( ) . getEntity ( ) ) ; } } ) ; }
Source:
private void calculateNetworkImplementationDetailsAndAssertManaged ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean expectManaged , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > networks ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( networks , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectManaged ? "" : "un" ) ) + "managed." ) , expectManaged , networkImplementationDetails.isManaged ( ) ) ; }

Target:
private void calculateNetworkImplementationDetailsAndAssertManaged ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean expectManaged , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( network , null , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectManaged ? "" : "un" ) ) + "managed." ) , expectManaged , networkImplementationDetails.isManaged ( ) ) ; }
Source:
public void close ( ) throws java.lang.Exception { org.apache.http.client.methods.HttpGet request = new org.apache.http.client.methods.HttpGet ( url ) ; this . send ( request , true ) ; for ( java.util.logging.Handler handler : java.util.logging.Logger.getLogger ( "org.apache.http" ) . getHandlers ( ) ) { if ( handler != null ) { handler.close ( ) ; } } if ( ( client ) != null ) { client.close ( ) ; } }

Target:
public void close ( ) throws java.lang.Exception { org.apache.http.client.methods.HttpGet request = new org.apache.http.client.methods.HttpGet ( url ) ; this . send ( request , true ) ; if ( ( client ) != null ) { client.close ( ) ; } }
Source:
public org.ovirt.engine.api.model.Template update ( org.ovirt.engine.api.model.Template incoming ) { validateEnums ( org.ovirt.engine.api.model.Template.class , incoming ) ; validateIconParams ( incoming ) ; org.ovirt.engine.api.model.Template result = performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , VdcActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendTemplateResource.UpdateParametersProvider ( ) ) ; if ( result != null ) { org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , result ) ; } return result ; }

Target:
public org.ovirt.engine.api.model.Template update ( org.ovirt.engine.api.model.Template incoming ) { validateEnums ( org.ovirt.engine.api.model.Template.class , incoming ) ; validateIconParams ( incoming ) ; org.ovirt.engine.api.model.Template result = performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , VdcActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendTemplateResource.UpdateParametersProvider ( ) ) ; if ( result != null ) { org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , result ) ; } return result ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( target ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue response = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( response.getSucceeded ( ) ) { model.ApplyData ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( response.getReturnValue ( ) ) ) , false ) ; model.setGetLUNsFailure ( "" ) ; } else { model.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( target ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue response = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( response.getSucceeded ( ) ) { model.ApplyData ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( response.getReturnValue ( ) ) ) , false ) ; model.setGetLUNsFailure ( "" ) ; } else { model.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }
Source:
public boolean IsBetter ( org.ovirt.engine.core.bll.VDS x , org.ovirt.engine.core.bll.VDS y , org.ovirt.engine.core.bll.VM vm ) { boolean returnValue = false ; boolean x_has_zero = ( x.getVmCount ( ) ) == 0 ; boolean y_has_zero = ( y.getVmCount ( ) ) == 0 ; if ( x_has_zero ) { if ( ! y_has_zero ) { returnValue = true ; } } else if ( ! y_has_zero ) { return super . IsBetter ( x , y , vm ) ; } return returnValue ; }

Target:
public boolean IsBetter ( org.ovirt.engine.core.common.businessentities.VDS x , org.ovirt.engine.core.common.businessentities.VDS y , org.ovirt.engine.core.common.businessentities.VM vm ) { boolean returnValue = false ; boolean x_has_zero = ( x.getVmCount ( ) ) == 0 ; boolean y_has_zero = ( y.getVmCount ( ) ) == 0 ; if ( x_has_zero ) { if ( ! y_has_zero ) { returnValue = true ; } } else if ( ! y_has_zero ) { return super . IsBetter ( x , y , vm ) ; } return returnValue ; }
Source:
protected void initTable ( ) { super . initTable ( ) ; addButtonToActionGroup ( org.ovirt.engine.ui.webadmin.section.main.view.AbstractSubTabEventView.getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminButtonDefinition < org.ovirt.engine.core.common.businessentities.AuditLog > ( org.ovirt.engine.ui.webadmin.section.main.view.AbstractSubTabEventView.constants.details ( ) , org.ovirt.engine.ui.common.widget.action.CommandLocation.OnlyFromContext ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getModelBoundTableWidget ( ) . getModel ( ) . getDetailsCommand ( ) ; } } , false ) ) ; }

Target:
protected void initTable ( ) { super . initTable ( ) ; org.ovirt.engine.ui.webadmin.section.main.view.AbstractSubTabEventView.getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminButtonDefinition < org.ovirt.engine.core.common.businessentities.AuditLog > ( org.ovirt.engine.ui.webadmin.section.main.view.AbstractSubTabEventView.constants.details ( ) , org.ovirt.engine.ui.common.widget.action.CommandLocation.OnlyFromContext ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getModelBoundTableWidget ( ) . getModel ( ) . getDetailsCommand ( ) ; } } ) ; }
Source:
private static void setupLogger ( java.util.Map < java.lang.String , java.lang.Object > args ) throws java.io.IOException { java.util.logging.Logger logger = java.util.logging.Logger.getLogger ( "" ) ; java.lang.String logfile = ( ( java.lang.String ) ( args.get ( "log-file" ) ) ) ; if ( logfile != null ) { java.util.logging.FileHandler fh = new java.util.logging.FileHandler ( logfile ) ; fh.setFormatter ( new java.util.logging.SimpleFormatter ( ) ) ; logger.addHandler ( fh ) ; } org.ovirt.engine.exttool.core.ExtensionsToolExecutor.OVIRT_LOGGER.setLevel ( ( ( java.util.logging.Level ) ( args.get ( "log-level" ) ) ) ) ; }

Target:
private static void setupLogger ( java.util.Map < java.lang.String , java.lang.Object > args ) throws java.io.IOException { java.util.logging.Logger log = java.util.logging.Logger.getLogger ( "" ) ; java.lang.String logfile = ( ( java.lang.String ) ( args.get ( "log-file" ) ) ) ; if ( logfile != null ) { java.util.logging.FileHandler fh = new java.util.logging.FileHandler ( logfile ) ; fh.setFormatter ( new java.util.logging.SimpleFormatter ( ) ) ; log.addHandler ( fh ) ; } org.ovirt.engine.exttool.core.ExtensionsToolExecutor.OVIRT_LOGGER.setLevel ( ( ( java.util.logging.Level ) ( args.get ( "log-level" ) ) ) ) ; }
Source:
public boolean Validate ( ) { getLatch ( ) . setIsValid ( true ) ; if ( ( getLatch ( ) . getIsAvailable ( ) ) && ( ! ( ( java.lang.Boolean ) ( getLatch ( ) . getEntity ( ) ) ) ) ) { getLatch ( ) . getInvalidityReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . youMustApproveTheActionByClickingOnThisCheckboxInvalidReason ( ) ) ; getLatch ( ) . setIsValid ( false ) ; } return getLatch ( ) . getIsValid ( ) ; }

Target:
public boolean validate ( ) { getLatch ( ) . setIsValid ( true ) ; if ( ( getLatch ( ) . getIsAvailable ( ) ) && ( ! ( ( java.lang.Boolean ) ( getLatch ( ) . getEntity ( ) ) ) ) ) { getLatch ( ) . getInvalidityReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . youMustApproveTheActionByClickingOnThisCheckboxInvalidReason ( ) ) ; getLatch ( ) . setIsValid ( false ) ; } return getLatch ( ) . getIsValid ( ) ; }
Source:
public void setup ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.instance = this ; try { org.quartz.SchedulerFactory sf = new org.quartz.impl.StdSchedulerFactory ( ) ; sched = sf.getScheduler ( ) ; sched.start ( ) ; sched.getListenerManager ( ) . addJobListener ( new org.ovirt.engine.core.utils.timer.FixedDelayJobListener ( this ) , org.quartz.impl.matchers.GroupMatcher.jobGroupEquals ( Scheduler.DEFAULT_GROUP ) ) ; } catch ( org.quartz.SchedulerException se ) { log.error ( "there is a problem with the underlying Scheduler: {}" , se.getMessage ( ) ) ; log.debug ( "Exception" , se ) ; } }

Target:
public void setup ( ) { try { org.quartz.SchedulerFactory sf = new org.quartz.impl.StdSchedulerFactory ( ) ; sched = sf.getScheduler ( ) ; sched.start ( ) ; sched.getListenerManager ( ) . addJobListener ( new org.ovirt.engine.core.utils.timer.FixedDelayJobListener ( this ) , org.quartz.impl.matchers.GroupMatcher.jobGroupEquals ( Scheduler.DEFAULT_GROUP ) ) ; } catch ( org.quartz.SchedulerException se ) { log.error ( "there is a problem with the underlying Scheduler: {}" , se.getMessage ( ) ) ; log.debug ( "Exception" , se ) ; } }
Source:
protected void updateActionAvailability ( ) { int numOfSelectedItems = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) . size ( ) : 0 ; getEditInstanceTypeCommand ( ) . setIsExecutionAllowed ( ( numOfSelectedItems == 1 ) ) ; getDeleteInstanceTypeCommand ( ) . setIsExecutionAllowed ( ( numOfSelectedItems > 0 ) ) ; }

Target:
protected void updateActionAvailability ( ) { int numOfSelectedItems = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) . size ( ) : 0 ; getEditInstanceTypeCommand ( ) . setIsExecutionAllowed ( ( numOfSelectedItems == 1 ) ) ; getDeleteInstanceTypeCommand ( ) . setIsExecutionAllowed ( ( numOfSelectedItems == 1 ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > queryGroups ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapQueryData data ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.SearchGroupsByQuery , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByQueryParameters ( null , getProfileName ( ) , data ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.LdapGroup > ldapGroups = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapGroup > ) ( ldapResult.getReturnValue ( ) ) ) ; return mapGroups ( ldapGroups ) ; }

Target:
public java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > queryGroups ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapQueryData data ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.SearchGroupsByQuery , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByQueryParameters ( null , getName ( ) , data ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.LdapGroup > ldapGroups = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapGroup > ) ( ldapResult.getReturnValue ( ) ) ) ; return mapGroups ( ldapGroups ) ; }
Source:
private static java.util.concurrent.locks.Lock getSyncObject ( org.ovirt.engine.core.compat.Guid domainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.ImageFileType > domainPerFileType = new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.ImageFileType > ( domainId , imageType ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.syncDomainForFileTypeMap.putIfAbsent ( domainPerFileType , new java.util.concurrent.locks.ReentrantLock ( ) ) ; return org.ovirt.engine.core.bll.IsoDomainListSyncronizer.syncDomainForFileTypeMap.get ( domainPerFileType ) ; }

Target:
private static java.util.concurrent.locks.Lock getSyncObject ( org.ovirt.engine.core.compat.Guid domainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.ImageFileType > domainPerFileType = new org.ovirt.engine.core.common.utils.Pair ( domainId , imageType ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.syncDomainForFileTypeMap.putIfAbsent ( domainPerFileType , new java.util.concurrent.locks.ReentrantLock ( ) ) ; return org.ovirt.engine.core.bll.IsoDomainListSyncronizer.syncDomainForFileTypeMap.get ( domainPerFileType ) ; }
Source:
private void mockNullVm ( ) { org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; mockGetForDisk ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( null ) ) ) ; mockGetVmsListForDisk ( null ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( null ) ; }

Target:
private void mockNullVm ( ) { mockGetForDisk ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( null ) ) ) ; mockGetVmsListForDisk ( null ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( null ) ; }
Source:
public void testAllDomainsHaveSpaceForNewDisksFailure ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }

Target:
public void testAllDomainsHaveSpaceForNewDisksFailure ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }
Source:
public void testGetRelatedTableName ( ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( true ) ; org.junit.Assert.assertEquals ( "EVENTS" , "audit_log" , comp.getRelatedTableName ( "EVENTS" ) ) ; org.junit.Assert.assertNull ( "Garbage" , comp.getRelatedTableName ( "kjfhkjdshkjfs" ) ) ; org.junit.Assert.assertNull ( "Null" , comp.getRelatedTableName ( null ) ) ; }

Target:
public void testGetRelatedTableName ( ) { org.junit.Assert.assertEquals ( "EVENTS" , "audit_log" , comp.getRelatedTableName ( "EVENTS" ) ) ; org.junit.Assert.assertNull ( "Garbage" , comp.getRelatedTableName ( "kjfhkjdshkjfs" ) ) ; org.junit.Assert.assertNull ( "Null" , comp.getRelatedTableName ( null ) ) ; }
Source:
private void writeJaxbCustomization ( org.ovirt.api.metamodel.tool.XmlWriter writer , java.lang.String tag , java.lang.String name , java.lang.String value ) { writer.writeStartElement ( org.ovirt.api.metamodel.tool.SchemaGenerator.XS_URI , "annotation" ) ; writer.writeStartElement ( org.ovirt.api.metamodel.tool.SchemaGenerator.XS_URI , "appinfo" ) ; writer.writeStartElement ( org.ovirt.api.metamodel.tool.SchemaGenerator.JAXB_URI , tag ) ; writer.writeAttribute ( name , value ) ; writer.writeEndElement ( ) ; writer.writeEndElement ( ) ; writer.writeEndElement ( ) ; }

Target:
private void writeJaxbCustomization ( java.lang.String tag , java.lang.String name , java.lang.String value ) { writer.writeStartElement ( org.ovirt.api.metamodel.tool.SchemaGenerator.XS_URI , "annotation" ) ; writer.writeStartElement ( org.ovirt.api.metamodel.tool.SchemaGenerator.XS_URI , "appinfo" ) ; writer.writeStartElement ( org.ovirt.api.metamodel.tool.SchemaGenerator.JAXB_URI , tag ) ; writer.writeAttribute ( name , value ) ; writer.writeEndElement ( ) ; writer.writeEndElement ( ) ; writer.writeEndElement ( ) ; }
Source:
public java.util.Map getVmStats ( java.lang.String uuid ) { final org.ovirt.vdsmfake.domain.Host host = getActiveHost ( ) ; java.util.Map resultMap = getDoneStatus ( ) ; java.util.List statusList = new java.util.ArrayList ( ) ; org.ovirt.vdsmfake.domain.VM vm = host.getRunningVMs ( ) . get ( uuid ) ; if ( vm != null ) { statusList.add ( fillVmStatsMap ( vm ) ) ; } resultMap.put ( "statsList" , statusList ) ; org.ovirt.vdsmfake.Utils.getLatency ( ) ; return resultMap ; }

Target:
public java.util.Map getVmStats ( java.lang.String uuid ) { final org.ovirt.vdsmfake.domain.Host host = getActiveHost ( ) ; java.util.Map resultMap = getDoneStatus ( ) ; java.util.List statusList = new java.util.ArrayList ( ) ; org.ovirt.vdsmfake.domain.VM vm = host.getRunningVMs ( ) . get ( uuid ) ; if ( vm != null ) { statusList.add ( fillVmStatsMap ( vm ) ) ; } resultMap.put ( "statsList" , statusList ) ; utils.getLatency ( ) ; return resultMap ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.DbUser object ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; int counter = 0 ; for ( java.lang.String name : object.getGroupNames ( ) ) { builder.append ( name ) ; if ( counter < ( ( object.getGroupNames ( ) . size ( ) ) - 1 ) ) { builder.append ( "," ) ; } } return builder.toString ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.DbUser object ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( java.lang.String name : object.getGroupNames ( ) ) { if ( ( builder.length ( ) ) > 0 ) { builder.append ( "," ) ; } builder.append ( name ) ; } return builder.toString ( ) ; }
Source:
public void testRemoveWithHostId ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveStorageDomain , org.ovirt.engine.core.common.action.RemoveStorageDomainParameters.class , new java.lang.String [ ] { "StorageDomainId" , "VdsId" , "DoFormat" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 1 ] , java.lang.Boolean.FALSE } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendStorageDomainResource.HOST , GUIDS [ 1 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemoveWithHostId ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveStorageDomain , org.ovirt.engine.core.common.action.RemoveStorageDomainParameters.class , new java.lang.String [ ] { "StorageDomainId" , "VdsId" , "DoFormat" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 1 ] , java.lang.Boolean.FALSE } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendStorageDomainResource.HOST , GUIDS [ 1 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
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 ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > items = getModel ( ) . getItems ( ) ; if ( ( items != null ) && ( ! ( items.isEmpty ( ) ) ) ) { selectionModel.setSelected ( items.get ( 0 ) , true ) ; } }

Target:
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 ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > items = model.getItems ( ) ; if ( ( items != null ) && ( ! ( items.isEmpty ( ) ) ) ) { selectionModel.setSelected ( items.get ( 0 ) , true ) ; } }
Source:
protected void updateLinkChangability ( ) { super . updateLinkChangability ( ) ; if ( ! ( getLinked ( ) . getIsChangable ( ) ) ) { return ; } boolean isPlugged = isPluggedBeforeAndAfterEdit ( ) ; if ( ( ( ( isVmUp ( ) ) && ( hotUpdateSupported ) ) && isPlugged ) && ( selectedNetworkExternal ( ) ) ) { getLinked ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . hotLinkStateUpdateNotSupportedExternalNetworks ( ) ) ; getLinked ( ) . setIsChangeable ( false ) ; initLinked ( ) ; } }

Target:
protected void updateLinkChangability ( ) { super . updateLinkChangability ( ) ; if ( ! ( getLinked ( ) . getIsChangable ( ) ) ) { return ; } boolean isPlugged = isPluggedBeforeAndAfterEdit ( ) ; if ( ( ( isVmUp ( ) ) && isPlugged ) && ( selectedNetworkExternal ( ) ) ) { getLinked ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . hotLinkStateUpdateNotSupportedExternalNetworks ( ) ) ; getLinked ( ) . setIsChangeable ( false ) ; initLinked ( ) ; } }
Source:
public void testGetEntityNameByIdAndTypeForHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = vdsStaticDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.VDS_ID ) ; org.junit.Assert.assertNotNull ( vds ) ; java.lang.String name = vds.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.VDS_ID , VdcObjectType.VDS ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = vdsStaticDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.VDS_ID ) ; org.junit.Assert.assertNotNull ( vds ) ; java.lang.String name = vds.getName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.VDS_ID , VdcObjectType.VDS ) ) ; }
Source:
protected boolean isDomainAttached ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( storageDomain.getStoragePoolId ( ) ) == null ) { return false ; } org.ovirt.engine.core.compat.Guid storageDomainId = storageDomain.getId ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = storageDomain.getStoragePoolId ( ) . getValue ( ) ; return ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ) != null ; }

Target:
protected boolean isDomainAttached ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( storageDomain.getStoragePoolId ( ) ) == null ) { return false ; } org.ovirt.engine.core.compat.Guid storageDomainId = storageDomain.getId ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = storageDomain.getStoragePoolId ( ) ; return ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ) != null ; }
Source:
public void testDiscoverGeoRepData ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( 2 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . save ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }

Target:
public void testDiscoverGeoRepData ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( 2 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionList ) , org.mockito.ArgumentMatchers.any ( ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . save ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , true , true , false , false , true , true , getImagesList ( ) ) ; }

Target:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , true , false , false , true , getImagesList ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( returnValue ) ) ; model.applyData ( lunList , true , org.ovirt.engine.ui.uicommonweb.Linq.findSelectedItems ( ( ( java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > > ) ( getSelectedItem ( ) ) ) ) ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunList ) { model.applyData ( lunList , true , org.ovirt.engine.ui.uicommonweb.Linq.findSelectedItems ( ( ( java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > > ) ( getSelectedItem ( ) ) ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateCinderDisksAlreadyRegistered ( ) { return validate ( new java.util.concurrent.Callable < org.ovirt.engine.core.bll.ValidationResult > ( ) { @ java.lang.Override public org.ovirt.engine.core.bll.ValidationResult call ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk disk : cinderDisks ) { org.ovirt.engine.core.common.businessentities.storage.Disk diskFromDB = getDiskDao ( ) . get ( disk.getId ( ) ) ; if ( diskFromDB != null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.CINDER_DISK_ALREADY_REGISTERED , java.lang.String.format ( "$diskAlias %s" , diskFromDB.getDiskAlias ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateCinderDisksAlreadyRegistered ( ) { return validate ( ( ) -> { for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk disk : cinderDisks ) { org.ovirt.engine.core.common.businessentities.storage.Disk diskFromDB = getDiskDao ( ) . get ( disk.getId ( ) ) ; if ( diskFromDB != null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.CINDER_DISK_ALREADY_REGISTERED , java.lang.String.format ( "$diskAlias %s" , diskFromDB.getDiskAlias ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; } ) ; }
Source:
private static java.lang.String mockConfig ( java.lang.String version , org.ovirt.engine.core.common.queries.ConfigurationValues configurationValues ) { java.lang.String returnValue = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 , true ) ; org.ovirt.engine.core.common.config.ConfigValues configValues = org.ovirt.engine.core.common.config.ConfigValues.valueOf ( configurationValues.name ( ) ) ; org.ovirt.engine.core.bll.GetConfigurationValueQueryTest.mcr.mockConfigValue ( configValues , version , returnValue ) ; return returnValue ; }

Target:
private static java.lang.String mockConfig ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.queries.ConfigurationValues configurationValues ) { java.lang.String returnValue = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 , true ) ; org.ovirt.engine.core.common.config.ConfigValues configValues = org.ovirt.engine.core.common.config.ConfigValues.valueOf ( configurationValues.name ( ) ) ; org.ovirt.engine.core.bll.GetConfigurationValueQueryTest.mcr.mockConfigValue ( configValues , version , returnValue ) ; return returnValue ; }
Source:
public void testRemove ( ) { dao.remove ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_DIST_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertTrue ( ( ( volumes.size ( ) ) == 1 ) ) ; org.junit.Assert.assertFalse ( volumes.contains ( existingDistVol ) ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingReplVol ) ) ; }

Target:
public void testRemove ( ) { dao.remove ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_DIST_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertEquals ( 1 , volumes.size ( ) ) ; org.junit.Assert.assertFalse ( volumes.contains ( existingDistVol ) ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingReplVol ) ) ; }
Source:
public void testNotCreatingImageIfSupplied ( ) { org.ovirt.engine.core.compat.Guid suppliedImageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . handleImageIsReadyForTransfer ( suppliedImageId ) ; transferImageCommand.getParameters ( ) . setImageId ( suppliedImageId ) ; transferImageCommand.executeCommand ( ) ; org.mockito.Mockito.verify ( transferImageCommand , org.mockito.Mockito.never ( ) ) . createImage ( ) ; org.mockito.Mockito.verify ( transferImageCommand , org.mockito.Mockito.times ( 1 ) ) . handleImageIsReadyForTransfer ( suppliedImageId ) ; }

Target:
public void testNotCreatingImageIfSupplied ( ) { org.ovirt.engine.core.compat.Guid suppliedImageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . handleImageIsReadyForTransfer ( ) ; transferImageCommand.getParameters ( ) . setImageId ( suppliedImageId ) ; transferImageCommand.executeCommand ( ) ; org.mockito.Mockito.verify ( transferImageCommand , org.mockito.Mockito.never ( ) ) . createImage ( ) ; org.mockito.Mockito.verify ( transferImageCommand , org.mockito.Mockito.times ( 1 ) ) . handleImageIsReadyForTransfer ( ) ; }
Source:
private void registerListeners ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager managedFieldsManager = new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager ( ) ; model.getInstanceTypes ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; model.getTemplate ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; model.getOSType ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { } } ) ; }

Target:
private void registerListeners ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager managedFieldsManager = new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager ( ) ; model.getInstanceTypes ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; model.getTemplate ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; model.getOSType ( ) . 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 ) { } } ) ; }
Source:
private void createSnapshotsForDisks ( org.ovirt.engine.core.compat.Guid vmSnapshotId ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = executeChildCommand ( image.getImageId ( ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcReturnValue.getFault ( ) . getError ( ) , "Failed to create snapshot!" ) ; } } }

Target:
private void createSnapshotsForDisks ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = executeChildCommand ( image.getImageId ( ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcReturnValue.getFault ( ) . getError ( ) , "Failed to create snapshot!" ) ; } } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.core.compat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Progress" . equals ( pcArgs.PropertyName ) ) { if ( ( modelProvider.getModel ( ) . getProgress ( ) ) != null ) { getView ( ) . setLoadingState ( LoadingState.LOADING ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.core.compat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Progress" . equals ( pcArgs.PropertyName ) ) { if ( ( modelProvider.getModel ( ) . getProgress ( ) ) != null ) { if ( ( getView ( ) . getTable ( ) ) != null ) { getView ( ) . getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } } } }
Source:
private static org.ovirt.engine.core.common.businessentities.RepoImage getNewIsoRepoFile ( ) { org.ovirt.engine.core.common.businessentities.RepoImage newRepoFileMap = new org.ovirt.engine.core.common.businessentities.RepoImage ( ) ; newRepoFileMap.setFileType ( ImageFileType.ISO ) ; newRepoFileMap.setRepoImageId ( "isoDomain.iso" ) ; newRepoFileMap.setLastRefreshed ( java.lang.System.currentTimeMillis ( ) ) ; newRepoFileMap.setSize ( 0 ) ; newRepoFileMap.setDateCreated ( null ) ; newRepoFileMap.setRepoDomainId ( FixturesTool.STORAGE_DOAMIN_NFS_ISO ) ; return newRepoFileMap ; }

Target:
private static org.ovirt.engine.core.common.businessentities.RepoImage getNewIsoRepoFile ( ) { org.ovirt.engine.core.common.businessentities.RepoImage newRepoFileMap = new org.ovirt.engine.core.common.businessentities.RepoImage ( ) ; newRepoFileMap.setFileType ( ImageFileType.ISO ) ; newRepoFileMap.setRepoImageId ( "isoDomain.iso" ) ; newRepoFileMap.setLastRefreshed ( java.lang.System.currentTimeMillis ( ) ) ; newRepoFileMap.setSize ( null ) ; newRepoFileMap.setDateCreated ( null ) ; newRepoFileMap.setRepoDomainId ( FixturesTool.STORAGE_DOAMIN_NFS_ISO ) ; return newRepoFileMap ; }
Source:
protected void initProfiles ( ) { java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > existingProfiles = getProfiles ( ) . getItems ( ) ; if ( existingProfiles == null ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > profiles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > ( ) ; profiles.add ( createDefaultProfile ( ) ) ; getProfiles ( ) . setItems ( profiles ) ; } else { for ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profile : existingProfiles ) { profile.updateDc ( getSelectedDc ( ) . getcompatibility_version ( ) , false , getSelectedDc ( ) . getId ( ) , null ) ; } } }

Target:
protected void initProfiles ( ) { java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > existingProfiles = getProfiles ( ) . getItems ( ) ; if ( existingProfiles == null ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > profiles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > ( ) ; profiles.add ( createDefaultProfile ( ) ) ; getProfiles ( ) . setItems ( profiles ) ; } else { for ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profile : existingProfiles ) { profile.updateDc ( getSelectedDc ( ) . getcompatibility_version ( ) , getSelectedDc ( ) . getId ( ) ) ; } } }
Source:
private void mockStorageDomainDao ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDao ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomain.getId ( ) , storagePoolId ) ) . thenReturn ( storageDomain ) ; } }

Target:
private void mockStorageDomainDao ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomain.getId ( ) , storagePoolId ) ) . thenReturn ( storageDomain ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( getInboundEnabled ( ) . equals ( sender ) ) { updateInboundAvailability ( ) ; } else if ( getOutboundEnabled ( ) . equals ( sender ) ) { updateOutboundAvailability ( ) ; } else if ( getInboundAverage ( ) . equals ( sender ) ) { updateInboundValues ( ) ; } else if ( getOutboundAverage ( ) . equals ( sender ) ) { updateOutboundValues ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( getInboundEnabled ( ) . equals ( sender ) ) { updateInboundAvailability ( ) ; } else if ( getOutboundEnabled ( ) . equals ( sender ) ) { updateOutboundAvailability ( ) ; } }
Source:
protected R linkSubResource ( R model , java.lang.String subResource , java.lang.String oid ) { java.lang.String path = org.ovirt.engine.api.restapi.util.LinkHelper.getPath ( model ) ; if ( path != null ) { java.lang.String href = java.lang.String.join ( "/" , path , oid , subResource ) ; addOrUpdateLink ( model , subResource , href ) ; } return model ; }

Target:
protected R linkSubResource ( R model , java.lang.String subResource , java.lang.String oid ) { java.lang.String path = org.ovirt.engine.api.restapi.util.LinkHelper.getPath ( model ) ; if ( path != null ) { java.lang.String href = java.lang.String.join ( "/" , path , subResource , oid ) ; addOrUpdateLink ( model , subResource , href ) ; } return model ; }
Source:
protected void executeVmCommand ( ) { super . executeVmCommand ( ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . setVmtGuid ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . getStaticData ( ) . setQuotaId ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getParameters ( ) . getVmStaticData ( ) . getQuotaId ( ) ) ; vmStaticDao.update ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . getStaticData ( ) ) ; checkTrustedService ( ) ; logIfDisksHaveIllegalPassDiscard ( ) ; }

Target:
protected void executeVmCommand ( ) { super . executeVmCommand ( ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . setVmtGuid ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . getStaticData ( ) . setQuotaId ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getParameters ( ) . getVmStaticData ( ) . getQuotaId ( ) ) ; vmStaticDao.update ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . getStaticData ( ) ) ; checkTrustedService ( ) ; }
Source:
public void testChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.getChangedFields ( jedi1 , jedi2 ) ; org.junit.Assert.assertTrue ( "Should be 1 changes" , ( ( changes.size ( ) ) == 1 ) ) ; }

Target:
public void testChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.getChangedFields ( jedi1 , jedi2 ) ; org.junit.Assert.assertEquals ( "Should be 1 changes" , 1 , changes.size ( ) ) ; }
Source:
public void validateFailure ( ) { org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.TRUE ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_ALREADY_EXISTS ) ; }

Target:
public void validateFailure ( ) { org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.TRUE ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_ALREADY_EXISTS ) ; }