auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterHook model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.CHECKSUM , model.getChecksum ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.CONTENT , model.getContent ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterHook model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.CHECKSUM , model.getChecksum ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.CONTENT , model.getContent ( ) ) ; verifyLinks ( model ) ; }
Source:
boolean isTaskOverPrePollingLapse ( ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters parameters = getParameters ( ) ; long taskStartTime = parameters.getDbAsyncTask ( ) . getStartTime ( ) . getTime ( ) ; java.lang.Integer prePollingPeriod = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( org.ovirt.engine.core.common.config.ConfigValues.UnknownTaskPrePollingLapse ) ; boolean idlePeriodPassed = ( ( java.lang.System.currentTimeMillis ( ) ) - taskStartTime ) > prePollingPeriod ; org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.infoFormat ( "task id {0} {1}. Pre-polling period is {2} millis. " , parameters.getVdsmTaskId ( ) , ( idlePeriodPassed ? "has passed pre-polling period time and should be polled" : "is in pre-polling period and should not be polled" ) , prePollingPeriod ) ; return idlePeriodPassed ; }

Target:
boolean isTaskOverPrePollingLapse ( ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters parameters = getParameters ( ) ; long taskStartTime = parameters.getDbAsyncTask ( ) . getStartTime ( ) . getTime ( ) ; java.lang.Integer prePollingPeriod = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( org.ovirt.engine.core.common.config.ConfigValues.UnknownTaskPrePollingLapse ) ; boolean idlePeriodPassed = ( ( java.lang.System.currentTimeMillis ( ) ) - taskStartTime ) > prePollingPeriod ; org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.info ( "Task id '{}' {}. Pre-polling period is millis. " , parameters.getVdsmTaskId ( ) , ( idlePeriodPassed ? "has passed pre-polling period time and should be polled" : "is in pre-polling period and should not be polled" ) , prePollingPeriod ) ; return idlePeriodPassed ; }
Source:
protected void validateParameters ( org.ovirt.engine.api.model.CpuProfile cpuProfile ) { validateParameters ( cpuProfile , "name" , "cluster.id" ) ; java.lang.String clusterId = cpuProfile.getCluster ( ) . getId ( ) ; getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( clusterId ) ) , ( "cluster: id=" + clusterId ) ) ; }

Target:
protected void validateParameters ( org.ovirt.engine.api.model.CpuProfile cpuProfile ) { validateParameters ( cpuProfile , "name" , "cluster.id" ) ; java.lang.String clusterId = cpuProfile.getCluster ( ) . getId ( ) ; getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , VdcQueryType.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( clusterId ) ) , ( "cluster: id=" + clusterId ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage_server_connections > getAllForConnection ( org.ovirt.engine.core.common.businessentities.storage_server_connections connection ) { return getCallsHandler ( ) . executeReadList ( "Getstorage_server_connectionsByKey" , org.ovirt.engine.core.dao.StorageServerConnectionDAODbFacadeImpl.mapper , getCustomMapSqlParameterSource ( ) . addValue ( "iqn" , connection.getiqn ( ) ) . addValue ( "connection" , connection.getconnection ( ) ) . addValue ( "port" , connection.getport ( ) ) . addValue ( "portal" , connection.getportal ( ) ) . addValue ( "username" , connection.getuser_name ( ) ) . addValue ( "password" , connection.getpassword ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage_server_connections > getAllForConnection ( org.ovirt.engine.core.common.businessentities.storage_server_connections connection ) { return getCallsHandler ( ) . executeReadList ( "Getstorage_server_connectionsByKey" , org.ovirt.engine.core.dao.StorageServerConnectionDAODbFacadeImpl.mapper , getCustomMapSqlParameterSource ( ) . addValue ( "iqn" , connection.getiqn ( ) ) . addValue ( "connection" , connection.getconnection ( ) ) . addValue ( "port" , connection.getport ( ) ) . addValue ( "portal" , connection.getportal ( ) ) . addValue ( "username" , connection.getuser_name ( ) ) . addValue ( "password" , org.ovirt.engine.core.dal.dbbroker.DbFacadeUtils.encryptPassword ( connection.getpassword ( ) ) ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.job.Step > getStepsByJobIdForVdsmAndGluster ( org.ovirt.engine.core.compat.Guid jobId ) { return multipleResults ( getEntityManager ( ) . createNamedQuery ( "Step.getStepsByJobIdForVdsmAndGluster" , org.ovirt.engine.core.common.job.Step.class ) . setParameter ( "jobId" , jobId ) . setParameter ( "systemType" , java.util.EnumSet.of ( ExternalSystemType.VDSM , ExternalSystemType.GLUSTER ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.compat.Guid > getExternalIdsForRunningSteps ( org.ovirt.engine.core.common.job.ExternalSystemType systemType ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "external_system_type" , systemType.name ( ) ) . addValue ( "status" , JobExecutionStatus.STARTED.name ( ) ) ; return getCallsHandler ( ) . executeReadList ( "GetExternalIdsFromSteps" , createGuidMapper ( ) , parameterSource ) ; }
Source:
private java.lang.String getSearchPattern ( ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.common.businessentities.LdapGroup.class , false ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( org.ovirt.engine.api.restapi.resource.BackendDomainGroupsResource.SEARCH_TEMPLATE , parent.getDirectory ( ) . getName ( ) ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "allnames=*" : constraint ) ) ; return sb.toString ( ) ; }

Target:
private java.lang.String getSearchPattern ( ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.authentication.DirectoryGroup.class , false ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( org.ovirt.engine.api.restapi.resource.BackendDomainGroupsResource.SEARCH_TEMPLATE , parent.getDirectory ( ) . getName ( ) ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "allnames=*" : constraint ) ) ; return sb.toString ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ( model.dataCenter.getstorage_pool_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) { model.UpdateOptionsNonLocalFSData ( ) ; } else { model.UpdateOptionsLocalFSData ( ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ( model.dataCenter.getstorage_pool_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) { model.updateOptionsNonLocalFSData ( ) ; } else { model.updateOptionsLocalFSData ( ) ; } }
Source:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { 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.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType ) { 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.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public java.util.Collection < ? > getProblemFacts ( ) { java.util.Collection < java.lang.Object > facts = new java.util.ArrayList < > ( ) ; facts.addAll ( vms ) ; facts.addAll ( hosts ) ; facts.addAll ( otherFacts ) ; return facts ; }

Target:
public java.util.Collection < ? > getProblemFacts ( ) { java.util.Collection < java.lang.Object > facts = new java.util.ArrayList < > ( ) ; facts.addAll ( vms ) ; facts.addAll ( hosts ) ; facts.addAll ( otherFacts ) ; facts.addAll ( fixedFacts ) ; return facts ; }
Source:
void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VM > nameColumn = new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VM > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { return object.getName ( ) ; } } ; nameColumn.makeSortable ( ) ; getTable ( ) . addColumn ( nameColumn , constants.nameVm ( ) , "300px" ) ; }

Target:
void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VM > nameColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VM > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { return object.getName ( ) ; } } ; nameColumn.makeSortable ( ) ; getTable ( ) . addColumn ( nameColumn , constants.nameVm ( ) , "300px" ) ; }
Source:
private org.ovirt.engine.api.extensions.ExtMap mapLdapGroup ( org.ovirt.engine.core.common.businessentities.LdapGroup group ) { org.ovirt.engine.api.extensions.ExtMap result = new org.ovirt.engine.api.extensions.ExtMap ( ) ; result.mput ( Authz.GroupRecord.ID , group.getid ( ) ) . mput ( Authz.GroupRecord.NAME , group.getname ( ) ) ; return result ; }

Target:
private org.ovirt.engine.api.extensions.ExtMap mapLdapGroup ( org.ovirt.engine.core.common.businessentities.LdapGroup group ) { org.ovirt.engine.api.extensions.ExtMap result = new org.ovirt.engine.api.extensions.ExtMap ( ) ; result.mput ( Authz.GroupRecord.ID , group.getid ( ) ) . mput ( Authz.GroupRecord.NAMESPACE , org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosLdapAuthz.NAMESPACE ) . mput ( Authz.GroupRecord.NAME , group.getname ( ) ) ; return result ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void updateInterface ( org.ovirt.engine.core.compat.Version clusterVersion ) { getDiskInterface ( ) . setItems ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDiskInterfaceList ( clusterVersion ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue2 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > diskInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > ) ( returnValue2 ) ) ; if ( java.lang.Boolean.FALSE.equals ( getIsVirtioScsiEnabled ( ) . getEntity ( ) ) ) { diskInterfaces.remove ( DiskInterface.VirtIO_SCSI ) ; } setInterfaces ( diskInterfaces ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainDynamicDao ( ) ; staticDao = dbFacade.getStorageDomainStaticDao ( ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDaoTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setStorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newStaticDomain.setStorageFormat ( StorageFormatType.V1 ) ; newStaticDomain.setWipeAfterDelete ( true ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setAvailableDiskSize ( org.ovirt.engine.core.dao.StorageDomainDynamicDaoTest.USED_DISK_SIZE ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainDynamicDao ( ) ; staticDao = dbFacade.getStorageDomainStaticDao ( ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDaoTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setStorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newStaticDomain.setStorageFormat ( StorageFormatType.V1 ) ; newStaticDomain.setWipeAfterDelete ( true ) ; newStaticDomain.setDiscardAfterDelete ( false ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setAvailableDiskSize ( org.ovirt.engine.core.dao.StorageDomainDynamicDaoTest.USED_DISK_SIZE ) ; }
Source:
public void setUpContainer ( ) { org.mockito.Mockito.when ( engineSessionDao.remove ( org.mockito.Matchers.any ( java.lang.Long.class ) ) ) . thenReturn ( 1 ) ; org.mockito.Mockito.when ( ssoSessionValidator.isSessionValid ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( true ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.aaa.DbUser.class ) ; container.setSSOSessionValidaor ( ssoSessionValidator ) ; container.setUser ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , user ) ; }

Target:
public void testCleanExpiredSessionsWithRunningCommands ( ) { org.mockito.Mockito.when ( ssoSessionUtils.isSessionInUse ( org.mockito.Matchers.anyLong ( ) ) ) . thenReturn ( true ) ; initDataForClearTest ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_KEY ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get found the session" , container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_KEY , false ) ) ; }
Source:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
protected org.ovirt.engine.core.bll.SPMAsyncTask ConcreteCreateTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parametersForTask = getParametersForTask ( parentCommand , org.ovirt.engine.core.bll.CreateSnapshotCommand.getParameters ( ) ) ; org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , new org.ovirt.engine.core.common.businessentities.async_tasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getTaskID ( ) , parametersForTask , asyncTaskCreationInfo.getStepId ( ) , org.ovirt.engine.core.bll.CreateSnapshotCommand.getCommandId ( ) ) ) ; p.setEntityId ( org.ovirt.engine.core.bll.CreateSnapshotCommand.getParameters ( ) . getEntityId ( ) ) ; return org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CreateTask ( AsyncTaskType.createVolume , p ) ; }

Target:
protected org.ovirt.engine.core.common.asynctasks.AsyncTaskType getTaskType ( ) { return org.ovirt.engine.core.common.asynctasks.AsyncTaskType.createVolume ; }
Source:
private boolean loginSuccess ( org.ovirt.engine.api.common.security.auth.Principal principal , org.ovirt.engine.core.common.action.VdcReturnValueBase ret ) { org.ovirt.engine.api.restapi.security.auth.LoginValidator.LOG.debugFormat ( org.ovirt.engine.api.restapi.security.auth.LoginValidator.LOGIN_SUCCESS , principal.getUser ( ) , principal.getDomain ( ) ) ; current.set ( ret.getActionReturnValue ( ) ) ; return true ; }

Target:
private boolean loginSuccess ( org.ovirt.engine.api.common.security.auth.Principal principal , org.ovirt.engine.core.common.action.VdcReturnValueBase ret ) { org.ovirt.engine.api.restapi.security.auth.LoginValidator.LOG.debugFormat ( org.ovirt.engine.api.restapi.security.auth.LoginValidator.LOGIN_SUCCESS , principal.getUser ( ) , principal.getDomain ( ) ) ; current.set ( ret.getActionReturnValue ( ) ) ; current.set ( getApplicationMode ( ) ) ; return true ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getEntry ( widget ) . removeLastButton ( ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < T > event ) { T value = event.getValue ( ) ; boolean becomingGhost = isGhost ( value ) ; if ( becomingGhost != ( wasGhost ) ) { wasGhost = becomingGhost ; if ( enabled ) { toggleGhost ( value , widget , becomingGhost ) ; } } }
Source:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface findInterfaceByIsBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ( ( i.getBonded ( ) ) != null ) && ( i.getBonded ( ) ) ) { return i ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface findInterfaceByIsBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { return org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( items , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i ) { return ( ( i.getBonded ( ) ) != null ) && ( i.getBonded ( ) ) ; } } ) ; }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void init ( java.lang.String configFilePath ) throws org.ovirt.engine.core.domains.ManageDomainsResult { try { utilityConfiguration = new org.ovirt.engine.core.domains.ManageDomainsConfiguration ( configFilePath ) ; } catch ( org.apache.commons.configuration.ConfigurationException e ) { throw new org.ovirt.engine.core.domains.ManageDomainsResult ( ManageDomainsResultEnum.FAILED_READING_CONFIGURATION , e.getMessage ( ) ) ; } try { daoImpl = new org.ovirt.engine.core.domains.ManageDomainsDAOImpl ( ) ; } catch ( java.sql.SQLException e ) { throw new org.ovirt.engine.core.domains.ManageDomainsResult ( "Please verify the following:\n1. Your database credentials are valid.\n2. The database machine is accessible.\n3. The database service is running" , ManageDomainsResultEnum.DB_EXCEPTION , e.getMessage ( ) ) ; } }

Target:
public void init ( ) throws org.ovirt.engine.core.domains.ManageDomainsResult { try { utilityConfiguration = new org.ovirt.engine.core.domains.ManageDomainsConfiguration ( args.get ( org.ovirt.engine.core.domains.ManageDomainsArguments.ARG_CONFIG_FILE ) ) ; } catch ( org.apache.commons.configuration.ConfigurationException e ) { throw new org.ovirt.engine.core.domains.ManageDomainsResult ( ManageDomainsResultEnum.FAILED_READING_CONFIGURATION , e.getMessage ( ) ) ; } try { daoImpl = new org.ovirt.engine.core.domains.ManageDomainsDAOImpl ( ) ; } catch ( java.sql.SQLException e ) { throw new org.ovirt.engine.core.domains.ManageDomainsResult ( "Please verify the following:\n1. Your database credentials are valid.\n2. The database machine is accessible.\n3. The database service is running" , ManageDomainsResultEnum.DB_EXCEPTION , e.getMessage ( ) ) ; } }
Source:
public void testGetEntityNameByIdAndTypeForQuota ( ) { org.ovirt.engine.core.common.businessentities.Quota quota = dbFacade.getQuotaDao ( ) . getById ( org.ovirt.engine.core.dao.DbFacadeDaoTest.QUOTA_ID ) ; org.junit.Assert.assertNotNull ( quota ) ; java.lang.String name = quota.getQuotaName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.QUOTA_ID , VdcObjectType.Quota ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForQuota ( ) { org.ovirt.engine.core.common.businessentities.Quota quota = dbFacade.getQuotaDao ( ) . getById ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.QUOTA_ID ) ; org.junit.Assert.assertNotNull ( quota ) ; java.lang.String name = quota.getQuotaName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.QUOTA_ID , VdcObjectType.Quota ) ) ) ; }
Source:
private static java.lang.reflect.Field getAccessibleQueryTypeField ( ) { for ( java.lang.reflect.Field f : org.ovirt.engine.core.bll.QueriesCommandBase.class . getDeclaredFields ( ) ) { if ( f.getName ( ) . equals ( "queryType" ) ) { f.setAccessible ( true ) ; return f ; } } junit.framework.Assert.fail ( "Can't find the type field" ) ; return null ; }

Target:
private static java.lang.reflect.Field getAccessibleQueryTypeField ( ) { for ( java.lang.reflect.Field f : org.ovirt.engine.core.bll.QueriesCommandBase.class . getDeclaredFields ( ) ) { if ( f.getName ( ) . equals ( "queryType" ) ) { f.setAccessible ( true ) ; return f ; } } org.junit.Assert.fail ( "Can't find the type field" ) ; return null ; }
Source:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public boolean isImagesExists ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , org.ovirt.engine.core.compat.Guid storagePoolId ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage fromIrs = isImageExist ( storagePoolId , image ) ; if ( fromIrs == null ) { return false ; } } return true ; }

Target:
public static boolean isImagesExists ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , org.ovirt.engine.core.compat.Guid storagePoolId ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage fromIrs = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isImageExist ( storagePoolId , image ) ; if ( fromIrs == null ) { return false ; } } return true ; }
Source:
private static void verifyModelWithIso ( org.ovirt.engine.api.model.Cdrom model , java.lang.String isoPath ) { assertEquals ( Guid.Empty.toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSetVm ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID.toString ( ) , model.getVm ( ) . getId ( ) ) ; assertTrue ( model.isSetFile ( ) ) ; assertEquals ( isoPath , model.getFile ( ) . getId ( ) ) ; }

Target:
private static void verifyModelWithIso ( org.ovirt.engine.api.model.Cdrom model , java.lang.String isoPath ) { org.junit.Assert.assertEquals ( Guid.Empty.toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertTrue ( model.isSetVm ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID.toString ( ) , model.getVm ( ) . getId ( ) ) ; org.junit.Assert.assertTrue ( model.isSetFile ( ) ) ; org.junit.Assert.assertEquals ( isoPath , model.getFile ( ) . getId ( ) ) ; }
Source:
private void initiateLockEndAction ( ) { if ( ( context.getLock ( ) ) == null ) { org.ovirt.engine.core.bll.LockIdNameAttribute annotation = getClass ( ) . getAnnotation ( org.ovirt.engine.core.bll.LockIdNameAttribute.class ) ; if ( ( annotation != null ) && ( ! ( annotation.isReleaseAtEndOfExecute ( ) ) ) ) { context.withLock ( buildLock ( ) ) ; } } }

Target:
private void initiateLockEndAction ( ) { if ( ( context.getLock ( ) ) == null ) { org.ovirt.engine.core.common.action.LockProperties lockProperties = getLockProperties ( ) ; if ( Scope.Command.equals ( lockProperties.getScope ( ) ) ) { context.withLock ( buildLock ( ) ) ; } } }
Source:
public java.lang.String getNetworkNames ( ) { if ( ( org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getParameters ( ) . getNetworkAttachments ( ) . size ( ) ) == 0 ) { org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getParameters ( ) . setNetworkNames ( StringUtils.EMPTY ) ; } else if ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getParameters ( ) . getNetworkNames ( ) ) ) { updateModifiedNetworksNames ( ) ; } return org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getParameters ( ) . getNetworkNames ( ) ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getParameters ( ) . getNetworkNames ( ) ) ) { return org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.PERSIST_SETUP_NETWORK_ON_HOST_FINISHED : org.ovirt.engine.core.common.AuditLogType.PERSIST_SETUP_NETWORK_ON_HOST_FAILED ; } else { return org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.PERSIST_NETWORK_ON_HOST_FINISHED : org.ovirt.engine.core.common.AuditLogType.PERSIST_NETWORK_ON_HOST_FAILED ; } }
Source:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { 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.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }
Source:
private void printUPNToResponse ( javax.servlet.http.HttpServletResponse response , java.lang.String upn ) { try { response.getWriter ( ) . print ( upn ) ; } catch ( java.io.IOException e ) { org.ovirt.engine.core.services.GetSessionUser.log.error ( "IO Exception while writing user name: " , e ) ; } }

Target:
private void printUPNToResponse ( javax.servlet.http.HttpServletResponse response , java.lang.String upn ) { try { response.getWriter ( ) . print ( upn ) ; } catch ( java.io.IOException e ) { org.ovirt.engine.core.services.GetSessionUser.log.error ( "Exception while writing user name: {}" , e.getMessage ( ) ) ; org.ovirt.engine.core.services.GetSessionUser.log.debug ( "Exception" , e ) ; } }
Source:
protected void executeCommand ( ) { registerRollbackHandler ( new org.ovirt.engine.core.bll.AddMacPoolCommand.CustomTransactionCompletionListener ( ) ) ; getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; macPoolPerCluster.createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }

Target:
protected void executeCommand ( ) { registerRollbackHandler ( new org.ovirt.engine.core.bll.AddMacPoolCommand.CustomTransactionCompletionListener ( ) ) ; getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; macPoolDao.save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; macPoolPerCluster.createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
public void removeMemoryFromActiveSnapshot ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_MEMORY_VOLUME , snapshot.getMemoryVolume ( ) ) ; dao.removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_VM_ID2 ) ; snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.Assert.assertEquals ( StringUtils.EMPTY , snapshot.getMemoryVolume ( ) ) ; }

Target:
public void removeMemoryFromActiveSnapshot ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_MEMORY_DUMP_DISK_ID , snapshot.getMemoryDiskId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_MEMORY_CONF_DISK_ID , snapshot.getMetadataDiskId ( ) ) ; dao.removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_VM_ID2 ) ; snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.Assert.assertNull ( snapshot.getMemoryDiskId ( ) ) ; org.junit.Assert.assertNull ( snapshot.getMetadataDiskId ( ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid getUpServerId ( ) { if ( ( brick ) == null ) { return getUpServerId ( clusterId ) ; } org.ovirt.engine.core.common.businessentities.VDS brickServer = org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getVdsDao ( ) . get ( brick.getServerId ( ) ) ; if ( ( brickServer.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return brickServer.getId ( ) ; } return super . getUpServerId ( clusterId ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getUpServerId ( ) { if ( ( brick ) == null ) { return getRandomUpServerId ( clusterId ) ; } org.ovirt.engine.core.common.businessentities.VDS brickServer = org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getVdsDao ( ) . get ( brick.getServerId ( ) ) ; if ( ( brickServer.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return brickServer.getId ( ) ; } return super . getRandomUpServerId ( clusterId ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.aaa.RemoveUserCommand.getParameters ( ) . getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getAllDirectPermissionsForAdElement ( id ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParameters ( permission ) ; tempVar.setShouldBeLogged ( false ) ; runInternalActionWithTasksContext ( VdcActionType.RemovePermission , tempVar ) ; } org.ovirt.engine.core.bll.aaa.RemoveUserCommand.getDbUserDao ( ) . remove ( id ) ; org.ovirt.engine.core.bll.aaa.RemoveUserCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.aaa.RemoveUserCommand.getParameters ( ) . getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : permissionDao.getAllDirectPermissionsForAdElement ( id ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParameters ( permission ) ; tempVar.setShouldBeLogged ( false ) ; runInternalActionWithTasksContext ( VdcActionType.RemovePermission , tempVar ) ; } org.ovirt.engine.core.bll.aaa.RemoveUserCommand.getDbUserDao ( ) . remove ( id ) ; org.ovirt.engine.core.bll.aaa.RemoveUserCommand.setSucceeded ( true ) ; }
Source:
public void updateNetworkDevice ( ) { org.ovirt.engine.core.common.businessentities.HostDeviceId netDeviceId = new org.ovirt.engine.core.common.businessentities.HostDeviceId ( FixturesTool.NETWORK_HOST_DEVICE_HOST_ID , FixturesTool.NETWORK_HOST_DEVICE_NAME ) ; org.ovirt.engine.core.common.businessentities.HostDevice before = dao.get ( netDeviceId ) ; before.setNetworkInterfaceName ( ( ( before.getNetworkInterfaceName ( ) ) + "new" ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.HostDevice after = dao.get ( netDeviceId ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.HostDevice getNetworkDevice ( ) { org.ovirt.engine.core.common.businessentities.HostDeviceId netDeviceId = new org.ovirt.engine.core.common.businessentities.HostDeviceId ( FixturesTool.NETWORK_HOST_DEVICE_HOST_ID , FixturesTool.NETWORK_HOST_DEVICE_NAME ) ; return dao.get ( netDeviceId ) ; }
Source:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } final java.util.List < java.lang.String > vmsNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; final java.util.List < java.lang.String > removedNetworksList = new java.util.ArrayList < > ( removedNetworks ) ; org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator detachNetworkUsedByVmValidator = new org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator ( vmsNames , removedNetworksList ) ; return detachNetworkUsedByVmValidator.validate ( ) ; }

Target:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( java.lang.String removedNetworkName ) { final java.util.List < java.lang.String > removedNetworkNames = java.util.Collections.singletonList ( removedNetworkName ) ; final java.util.List < java.lang.String > vmsNames = findActiveVmsUsingNetwork.findNamesOfActiveVmsUsingNetworks ( host.getId ( ) , removedNetworkNames ) ; org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator detachNetworkUsedByVmValidator = new org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator ( vmsNames , removedNetworkNames ) ; return detachNetworkUsedByVmValidator.validate ( ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkQosValidator validator = new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( getNetworkQoS ( ) ) ; return ( ( ( ( ( validateParameters ( ) ) && ( validate ( validator.qosExists ( ) ) ) ) && ( validate ( validator.consistentDataCenter ( ) ) ) ) && ( validate ( validator.allValuesPresent ( ) ) ) ) && ( validate ( validator.peakConsistentWithAverage ( ) ) ) ) && ( validate ( validator.nameNotChangedOrNotTaken ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { return ( super . canDoAction ( ) ) && ( validate ( getQosValidator ( getQos ( ) ) . peakConsistentWithAverage ( ) ) ) ; }
Source:
private boolean validateNics ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { org.ovirt.engine.core.bll.validator.VmNicValidator nicValidator = new org.ovirt.engine.core.bll.validator.VmNicValidator ( iface , clusterCompatibilityVersion ) ; if ( ( ! ( validate ( nicValidator.emptyNetworkValid ( ) ) ) ) || ( ! ( validate ( nicValidator.linkedCorrectly ( ) ) ) ) ) { return false ; } } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( org.ovirt.engine.core.bll.ChangeVMClusterCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( ! ( org.ovirt.engine.core.bll.ChangeVMClusterCommand.isInternalExecution ( ) ) ) && ( ! ( org.ovirt.engine.core.utils.ObjectIdentityChecker.CanUpdateField ( org.ovirt.engine.core.bll.ChangeVMClusterCommand.getVm ( ) , "vdsGroupId" , org.ovirt.engine.core.bll.ChangeVMClusterCommand.getVm ( ) . getStatus ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.VM_STATUS_NOT_VALID_FOR_UPDATE ) ; return false ; } org.ovirt.engine.core.bll.ChangeVmClusterValidator validator = new org.ovirt.engine.core.bll.ChangeVmClusterValidator ( this , org.ovirt.engine.core.bll.ChangeVMClusterCommand.getParameters ( ) . getClusterId ( ) ) ; return validator.validate ( ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.GraphicsType deriveGraphicsType ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos ) { if ( graphicsInfos != null ) { if ( graphicsInfos.containsKey ( GraphicsType.SPICE ) ) { return org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ; } if ( graphicsInfos.containsKey ( GraphicsType.VNC ) ) { return org.ovirt.engine.core.common.businessentities.GraphicsType.VNC ; } } return null ; }

Target:
public static org.ovirt.engine.api.model.GraphicsType deriveGraphicsType ( java.util.Map < org.ovirt.engine.api.model.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos ) { if ( graphicsInfos != null ) { if ( graphicsInfos.containsKey ( org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.GraphicsType ) ) { return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.GraphicsType ; } if ( graphicsInfos.containsKey ( org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.GraphicsType ) ) { return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.GraphicsType ; } } return null ; }
Source:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }