auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; log.info ( "Disk has been successfully deleted from Cinder. ID: {}" , getDiskId ( ) ) ; if ( getCommand ( ) . getParameters ( ) . getShouldBeLogged ( ) ) { new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( getCommand ( ) , AuditLogType.USER_FINISHED_REMOVE_DISK ) ; } getCommand ( ) . removeDiskFromDb ( ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; log.error ( "Failed deleting volume/snapshot from Cinder. ID: {}" , getDiskId ( ) ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateInterfaceListModel vmInterfaceListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateInterfaceListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > network_list = ( returnValue != null ) ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ) ( returnValue ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ( ) ; vmInterfaceListModel.PostGetClusterNetworkList_Edit ( network_list ) ; }

Target:
private void Edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntityStronglyTyped ( ) , cluster.getcompatibility_version ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
public void executeQueryCommand ( ) { clusterId = org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getParameters ( ) . getClusterId ( ) ; volume = org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getGlusterVolumeDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getParameters ( ) . getVolumeId ( ) ) ; if ( ( volume ) == null ) { throw new java.lang.RuntimeException ( EngineMessage.GLUSTER_VOLUME_ID_INVALID.toString ( ) ) ; } if ( ( clusterId ) == null ) { clusterId = volume.getClusterId ( ) ; } org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getQueryReturnValue ( ) . setReturnValue ( fetchTaskStatusDetails ( ) ) ; }

Target:
public void executeQueryCommand ( ) { clusterId = org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getParameters ( ) . getClusterId ( ) ; volume = glusterVolumeDao.getById ( org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getParameters ( ) . getVolumeId ( ) ) ; if ( ( volume ) == null ) { throw new java.lang.RuntimeException ( EngineMessage.GLUSTER_VOLUME_ID_INVALID.toString ( ) ) ; } if ( ( clusterId ) == null ) { clusterId = volume.getClusterId ( ) ; } org.ovirt.engine.core.bll.gluster.GlusterAsyncTaskStatusQueryBase.getQueryReturnValue ( ) . setReturnValue ( fetchTaskStatusDetails ( ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < java.lang.Integer > nums = new java.util.ArrayList < java.lang.Integer > ( ) ; if ( source != null ) { java.lang.Iterable numEnumerable = ( ( java.lang.Iterable ) ( source ) ) ; java.util.Iterator numIterator = numEnumerable.iterator ( ) ; while ( numIterator.hasNext ( ) ) { nums.add ( java.lang.Integer.parseInt ( numIterator.next ( ) . toString ( ) ) ) ; } } return nums ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < java.lang.Integer > nums = new java.util.ArrayList < > ( ) ; if ( source != null ) { java.lang.Iterable numEnumerable = ( ( java.lang.Iterable ) ( source ) ) ; java.util.Iterator numIterator = numEnumerable.iterator ( ) ; while ( numIterator.hasNext ( ) ) { nums.add ( java.lang.Integer.parseInt ( numIterator.next ( ) . toString ( ) ) ) ; } } return nums ; }
Source:
public void testGeneralTimeZones ( ) { java.util.Map < java.lang.String , java.lang.String > map = org.ovirt.engine.core.common.TimeZoneTypeTest.general.getTimeZoneList ( ) ; org.junit.Assert.assertNotNull ( map ) ; org.junit.Assert.assertFalse ( ( ( map.get ( "Asia/Riyadh78" ) ) != null ) ) ; org.junit.Assert.assertEquals ( map.get ( "Asia/Jerusalem" ) , "(GMT+02:00) Israel Standard Time" ) ; }

Target:
public void testGeneralTimeZones ( ) { java.util.Map < java.lang.String , java.lang.String > map = org.ovirt.engine.core.common.TimeZoneTypeTest.general.getTimeZoneList ( ) ; org.junit.Assert.assertNotNull ( map ) ; org.junit.Assert.assertNull ( map.get ( "Asia/Riyadh78" ) ) ; org.junit.Assert.assertEquals ( "(GMT+02:00) Israel Standard Time" , map.get ( "Asia/Jerusalem" ) ) ; }
Source:
private org.ovirt.engine.api.model.Network getNewNetwork ( org.ovirt.engine.api.model.HostNIC nic ) { org.ovirt.engine.api.model.Network newNetwork = null ; if ( nic.isSetNetwork ( ) ) { newNetwork = map ( nic.getNetwork ( ) , parent.lookupClusterNetwork ( nic.getNetwork ( ) ) ) ; } return newNetwork ; }

Target:
private org.ovirt.engine.api.model.Network getNewNetwork ( org.ovirt.engine.api.model.HostNic nic ) { org.ovirt.engine.api.model.Network newNetwork = null ; if ( nic.isSetNetwork ( ) ) { newNetwork = map ( nic.getNetwork ( ) , parent.lookupClusterNetwork ( nic.getNetwork ( ) ) ) ; } return newNetwork ; }
Source:
public static void getRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void failedStatusWithSpecifiedFenceAgent ( ) { mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.getFenceAgentStatus ( createFenceAgent ( 1 ) ) ; org.junit.Assert.assertEquals ( Status.ERROR , result.getStatus ( ) ) ; org.junit.Assert.assertEquals ( PowerStatus.UNKNOWN , result.getPowerStatus ( ) ) ; }

Target:
public void failedStatusWithSpecifiedFenceAgent ( ) { mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.getFenceAgentStatus ( createFenceAgent ( 1 ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( Status.ERROR , result.getStatus ( ) ) ; org.junit.Assert.assertEquals ( PowerStatus.UNKNOWN , result.getPowerStatus ( ) ) ; }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }

Target:
public void getAllErrata ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForSystem , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testConflictedUpdate ( ) { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 1 , false ) ; model.setId ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_ID.toString ( ) ) ; try { resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 1 , false ) ; model.setId ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_ID.toString ( ) ) ; try { resource.update ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "id" , getId ( ) ) . append ( "networkId" , getNetworkId ( ) ) . append ( "networkName" , getNetworkName ( ) ) . append ( "nicId" , getNicId ( ) ) . append ( "nicName" , getNicName ( ) ) . append ( "ipConfiguration" , getIpConfiguration ( ) ) . append ( "properties" , getProperties ( ) ) . append ( "overrideConfiguration" , isOverrideConfiguration ( ) ) . build ( ) ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "id" , getId ( ) ) . append ( "networkId" , getNetworkId ( ) ) . append ( "networkName" , getNetworkName ( ) ) . append ( "nicId" , getNicId ( ) ) . append ( "nicName" , getNicName ( ) ) . append ( "ipConfiguration" , getIpConfiguration ( ) ) . append ( "dnsResolverConfiguration" , getDnsResolverConfiguration ( ) ) . append ( "properties" , getProperties ( ) ) . append ( "overrideConfiguration" , isOverrideConfiguration ( ) ) . build ( ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosCommitmendMissingBondSpeed ( java.lang.String bondOptions ) { return qosCommitmentBondSetup ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED , null , bondOptions ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
public void executeCommandWhenFailed ( ) { setUpMocksForAdd ( ) ; mockBackend ( false , EngineError.GlusterHookAddFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . removeGlusterServerHook ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ADD_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { setUpMocksForAdd ( ) ; mockBackend ( false , EngineError.GlusterHookAddFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . removeGlusterServerHook ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( AuditLogType.GLUSTER_HOOK_ADD_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnitToUpdate = dao.get ( FixturesTool.POLICY_UNIT_MIGRATION ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.LinkedHashMap < > ( ) ; map.put ( "A" , "B" ) ; policyUnitToUpdate.setParameterRegExMap ( map ) ; policyUnitToUpdate.setDescription ( "dummy description" ) ; dao.update ( policyUnitToUpdate ) ; org.ovirt.engine.core.common.scheduling.PolicyUnit result = dao.get ( policyUnitToUpdate.getId ( ) ) ; org.junit.Assert.assertEquals ( result , policyUnitToUpdate ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnitToUpdate = dao.get ( FixturesTool.POLICY_UNIT_MIGRATION ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.LinkedHashMap < > ( ) ; map.put ( "A" , "B" ) ; policyUnitToUpdate.setParameterRegExMap ( map ) ; policyUnitToUpdate.setDescription ( "dummy description" ) ; dao.update ( policyUnitToUpdate ) ; org.ovirt.engine.core.common.scheduling.PolicyUnit result = dao.get ( policyUnitToUpdate.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( result , policyUnitToUpdate ) ; }
Source:
public static void addPermission ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.bll.PredefinedRoles role , org.ovirt.engine.core.common.VdcObjectType objectType ) { org.ovirt.engine.core.common.businessentities.Permissions perms = new org.ovirt.engine.core.common.businessentities.Permissions ( ) ; perms.setad_element_id ( userId ) ; perms.setObjectType ( objectType ) ; perms.setObjectId ( entityId ) ; perms.setrole_id ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
public static void addPermission ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.bll.PredefinedRoles role , org.ovirt.engine.core.common.VdcObjectType objectType ) { org.ovirt.engine.core.common.businessentities.Permissions perms = new org.ovirt.engine.core.common.businessentities.Permissions ( ) ; perms.setAdElementId ( userId ) ; perms.setObjectType ( objectType ) ; perms.setObjectId ( entityId ) ; perms.setRoleId ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getSelectableModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > cast ( getModel ( ) . getStorageModels ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > filterredItems = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : items ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.Model ) ( model ) ) . getIsSelectable ( ) ) { filterredItems.add ( model ) ; } } return filterredItems ; }

Target:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getSelectableModels ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > storageItems ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > filteredItems = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : storageItems ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.Model ) ( model ) ) . getIsSelectable ( ) ) { filteredItems.add ( model ) ; } } return filteredItems ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > runHostListMethod ( org.apache.commons.httpclient.HttpMethod httpMethod ) { try { runHttpMethod ( httpClient , httpMethod ) ; org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostWrapper [ ] hosts = objectMapper.readValue ( httpMethod.getResponseBody ( ) , org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostWrapper [ ] . class ) ; return map ( java.util.Arrays.asList ( hosts ) ) ; } catch ( java.io.IOException e ) { handleException ( e ) ; } return null ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > runHostListMethod ( org.apache.commons.httpclient.HttpMethod httpMethod ) { try { runHttpMethod ( httpClient , httpMethod ) ; org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostWrapper fhw = objectMapper.readValue ( httpMethod.getResponseBody ( ) , org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostWrapper.class ) ; return mapHosts ( java.util.Arrays.asList ( fhw.getResults ( ) ) ) ; } catch ( java.lang.Exception e ) { return null ; } }
Source:
public void hostAttachedToLocalStorageWithoutDataCenter ( ) { org.mockito.Mockito.when ( storagePoolDao.getForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getStoragePoolDao ( ) ) . thenReturn ( storagePoolDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.validateSingleHostAttachedToLocalStorage ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostAttachedToLocalStorageWithoutDataCenter ( ) { org.mockito.Mockito.when ( storagePoolDao.getForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getStoragePoolDao ( ) ) . thenReturn ( storagePoolDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.validateSingleHostAttachedToLocalStorage ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testAddIncompleteParametersNoName ( ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "id|name" ) ; } }

Target:
public void testAddIncompleteParametersNoName ( ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "Network" , "add" , "id|name" ) ; }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( ! ( bondDialogModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; setBondOptions ( entity , bondDialogModel ) ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( ! ( bondDialogModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; setBondOptions ( entity , bondDialogModel ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = ( ( org.ovirt.engine.core.common.businessentities.network.Bond ) ( entity ) ) ; addBondToUpdateList ( bond ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.AuthzUtils.getIdsBatches ( extension , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipals ( extension , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , true ) ) ; } return results ; }

Target:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipals ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , groupsResolving , groupsResolvingRecursive ) ) ; } return results ; }
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static void getVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }
Source:
private java.util.List < java.util.List < T > > createListOfLists ( java.util.Collection < T > items ) { java.util.List < java.util.List < T > > acceptableItems = new java.util.ArrayList < > ( ) ; for ( T item : items ) { acceptableItems.add ( java.util.Arrays.asList ( item ) ) ; } return acceptableItems ; }

Target:
private java.util.List < java.util.List < T > > createListOfLists ( java.util.Collection < T > items ) { return items.stream ( ) . map ( java.util.Arrays :: asList ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig getHostNicVfsConfigToAdd ( org.ovirt.engine.core.common.businessentities.HostDevice device ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = networkDeviceHelper.getNicByPciDevice ( device , fetchedMap.values ( ) ) ; if ( nic == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig hostNicVfsConfig = new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( ) ; hostNicVfsConfig.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; hostNicVfsConfig.setNicId ( nic.getId ( ) ) ; hostNicVfsConfig.setAllNetworksAllowed ( true ) ; return hostNicVfsConfig ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig createHostNicVfsConfigToAddIfNotExist ( org.ovirt.engine.core.common.businessentities.HostDevice device ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = networkDeviceHelper.getNicByPciDevice ( device , fetchedMap.values ( ) ) ; if ( nic == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig existingHostNicVfsConfig = hostNicVfsConfigDao.getByNicId ( nic.getId ( ) ) ; if ( existingHostNicVfsConfig != null ) { return null ; } return new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nic.getId ( ) , true ) ; }
Source:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( getVds ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }

Target:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.CollectHostNetworkDataVdsCommandParameters ( getVds ( ) , getInterfaces ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveQuota , org.ovirt.engine.core.common.action.QuotaCRUDParameters.class , new java.lang.String [ ] { "QuotaId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendQuotaResourceTest.QUOTA_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveQuota , org.ovirt.engine.core.common.action.IdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendQuotaResourceTest.QUOTA_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotCreate ( volumeName , snapshotName , description , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterSnapshotDelete ( java.lang.String snapshotName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterSnapshotDelete ( snapshotName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void assertValidationWorks ( int nameLength , int numOfVms , boolean expected ) { org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation object = new org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation ( nameOfLength ( nameLength ) , numOfVms , 3 ) ; org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation spy = org.mockito.Mockito.spy ( object ) ; org.junit.Assert.assertThat ( spy.validate ( null ) . getSuccess ( ) , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expected ) ) ) ; }

Target:
private void assertValidationWorks ( int nameLength , int numOfVms , boolean expected ) { org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation object = new org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation ( nameOfLength ( nameLength ) , numOfVms , 3 ) ; org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation spy = org.mockito.Mockito.spy ( object ) ; org.hamcrest.MatcherAssert.assertThat ( spy.validate ( null ) . getSuccess ( ) , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expected ) ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportNetworkData importNetworkData = importModel.getNetworkImportData ( iface.getName ( ) ) ; java.util.List < java.lang.String > networkNames = importNetworkData.getNetworkNames ( ) ; ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkNames ) ; if ( networkNames.isEmpty ( ) ) { return "" ; } java.lang.String selectedNetworkName = importNetworkData.getSelectedNetworkName ( ) ; return selectedNetworkName != null ? selectedNetworkName : networkNames.get ( 0 ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView network : importModel.getNetworkProfiles ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }
Source:
private org.ovirt.engine.core.bll.RemoveQuotaCommand createCommand ( ) { org.ovirt.engine.core.common.action.QuotaCRUDParameters param = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( ) ; param.setQuotaId ( generalGuidQuota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveQuotaCommand ( param , null ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( command ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; org.mockito.Mockito.doReturn ( quotaManager ) . when ( command ) . getQuotaManager ( ) ; return command ; }

Target:
public void testExecuteCommand ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.RemoveQuotaCommand removeQuotaCommand = createCommand ( generalGuidQuota ) ; removeQuotaCommand.executeCommand ( ) ; org.junit.Assert.assertTrue ( removeQuotaCommand.getSucceeded ( ) ) ; }
Source:
public org.ovirt.engine.core.compat.Guid getStorageDomainIdForVmMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList ) { if ( ( cachedStorageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , memoryDisksList ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }

Target:
public org.ovirt.engine.core.compat.Guid getStorageDomainIdForVmMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList ) { if ( ( cachedStorageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , memoryDisksList , getDisksList ( ) ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmDevice createVMDevice ( org.ovirt.engine.core.compat.Guid vmID , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vmID ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 1 , null , true , true , true , "" , null , disk.getVmSnapshotId ( ) , null ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmDevice createVMDevice ( org.ovirt.engine.core.compat.Guid vmID , org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vmID ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 1 , null , true , true , true , "" , null , disk.getVmSnapshotId ( ) , null ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Snapshot generateNewEntity ( ) { return new org.ovirt.engine.core.common.businessentities.Snapshot ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.class ) , org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_VM_ID , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 200000 ) , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.class ) , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 1000 ) , new java.util.Date ( ) , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 200000 ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Snapshot generateNewEntity ( ) { return new org.ovirt.engine.core.common.businessentities.Snapshot ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.class ) , org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_VM_ID , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 200000 ) , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.class ) , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 1000 ) , new java.util.Date ( ) , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 200000 ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filterByArchitecture ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters , org.ovirt.engine.core.common.businessentities.ArchitectureType targetArchitecture ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.getArchitecture ( ) . equals ( targetArchitecture ) ) { filteredClusters.add ( cluster ) ; } } return filteredClusters ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > filterByArchitecture ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters , org.ovirt.engine.core.common.businessentities.ArchitectureType targetArchitecture ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > filteredClusters = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : clusters ) { if ( cluster.getArchitecture ( ) . equals ( targetArchitecture ) ) { filteredClusters.add ( cluster ) ; } } return filteredClusters ; }
Source:
public java.lang.Void call ( ) { com.woorea.openstack.cinder.model.VolumeForUpdate volumeForUpdate = new com.woorea.openstack.cinder.model.VolumeForUpdate ( ) ; volumeForUpdate.setName ( cinderDisk.getDiskAlias ( ) ) ; volumeForUpdate.setDescription ( cinderDisk.getDiskDescription ( ) ) ; proxy.updateVolume ( cinderDisk.getImageId ( ) . toString ( ) , volumeForUpdate ) ; return null ; }

Target:
public java.lang.Void updateDisk ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( ( ) -> { com.woorea.openstack.cinder.model.VolumeForUpdate volumeForUpdate = new com.woorea.openstack.cinder.model.VolumeForUpdate ( ) ; volumeForUpdate.setName ( cinderDisk.getDiskAlias ( ) ) ; volumeForUpdate.setDescription ( cinderDisk.getDiskDescription ( ) ) ; proxy.updateVolume ( cinderDisk.getImageId ( ) . toString ( ) , volumeForUpdate ) ; return null ; } ) ; }
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 ) { if ( ( disk.getVm ( ) ) == null ) { return ; } boolean isVirtioScsiEnabled = java.lang.Boolean.TRUE.equals ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ; org.ovirt.engine.core.compat.Version clusterVersion = disk.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ; interfaceInfoIcon.setVisible ( ( ( ( clusterVersion.compareTo ( Version.v3_3 ) ) >= 0 ) && ( ! isVirtioScsiEnabled ) ) ) ; }

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 ) { if ( ( disk.getVm ( ) ) == null ) { return ; } boolean isVirtioScsiEnabled = java.lang.Boolean.TRUE.equals ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ; org.ovirt.engine.core.compat.Version clusterVersion = disk.getVm ( ) . getCompatibilityVersion ( ) ; interfaceInfoIcon.setVisible ( ( ( ( clusterVersion.compareTo ( Version.v3_3 ) ) >= 0 ) && ( ! isVirtioScsiEnabled ) ) ) ; }
Source:
private void processFence ( ) { org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( getVds ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Status ) ; if ( ( getVds ( ) . getpm_enabled ( ) ) && ( executor.findProxyHost ( ) ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = executor.fence ( ) ; fenceSucceeded = returnValue.getSucceeded ( ) ; fenceStatusReturnValue = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) ; vdsProxyFound = true ; } }

Target:
private void refreshHostDeviceList ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.hostDevicePassthrough ( getVds ( ) . getVdsGroupCompatibilityVersion ( ) ) ) { try { runInternalAction ( VdcActionType.RefreshHostDevices , new org.ovirt.engine.core.common.action.VdsActionParameters ( getVdsId ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.error ( "Could not refresh host devices for host '{}'" , getVds ( ) . getName ( ) ) ; } } }
Source:
protected java.lang.String getColumnWidthKey ( com.google.gwt.user.cellview.client.Column < T , ? > column ) { if ( columnResizePersistenceEnabled ) { return ( ( ( ( org.ovirt.engine.ui.common.widget.table.resize.ColumnResizeCellTable.GRID_COLUMN_WIDTH_PREFIX ) + "_" ) + ( gridController.getId ( ) ) ) + "_" ) + ( getColumnIndex ( column ) ) ; } return null ; }

Target:
protected java.lang.String getGridElementId ( ) { return gridController.getId ( ) ; }
Source:
public java.lang.String getHeaderHtml ( ) { if ( ( getDefaultImage ( ) ) == null ) { return org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn.CONSTANTS.empty ( ) ; } return org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn.TEMPLATES.imageWithTitle ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( getDefaultImage ( ) ) . getHTML ( ) ) , getDefaultTitle ( ) ) . asString ( ) ; }

Target:
public java.lang.String getHeaderHtml ( ) { if ( ( getDefaultImage ( ) ) == null ) { return org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn.constants.empty ( ) ; } return org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn.templates.imageWithTitle ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( getDefaultImage ( ) ) . getHTML ( ) ) , getDefaultTitle ( ) ) . asString ( ) ; }
Source:
private static void assertContainsBlankTemplate ( org.ovirt.engine.api.model.SpecialObjects objs ) { for ( org.ovirt.engine.api.model.Link link : objs.getLinks ( ) ) { if ( ( link.getHref ( ) . equals ( org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.BLANK_TEMPLATE_HREF ) ) && ( link.getRel ( ) . equals ( org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.BLANK_TEMPLATE_REL ) ) ) { return ; } } org.junit.Assert.fail ( ) ; }

Target:
private static void assertContainsBlankTemplate ( org.ovirt.engine.api.model.SpecialObjects objs ) { org.junit.Assert.assertNotNull ( objs.getBlankTemplate ( ) ) ; org.junit.Assert.assertEquals ( objs.getBlankTemplate ( ) . getHref ( ) , org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.BLANK_TEMPLATE_HREF ) ; }