auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , getTaskType ( ) , commandStatus ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }

Target:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.bll.context.CommandContext cmdContext , boolean enableCallback ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.common.businessentities.CommandEntity commandEntity = buildCommandEntity ( getParentParameters ( parentCommand ) . getCommandId ( ) , enableCallback ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.persistCommand ( commandEntity , cmdContext ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
private void verifyAsyncActionStartedAndCompleted ( ) { verifyAsyncActionStarted ( ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.atLeastOnce ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState ) ) ; }

Target:
private void verifyAsyncActionStartedAndFailed ( ) { verifyAsyncActionStarted ( ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.never ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState , true , true ) ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.atLeastOnce ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState , true , false ) ) ; }
Source:
protected java.security.MessageDigest getMd5Digest ( final javax.servlet.http.HttpServletRequest request ) throws java.security.NoSuchAlgorithmException { java.security.MessageDigest digest = createMd5Digest ( ) ; for ( org.ovirt.engine.ui.frontend.server.gwt.GwtDynamicHostPageServlet.MD5Attributes attribute : org.ovirt.engine.ui.frontend.server.gwt.GwtDynamicHostPageServlet.MD5Attributes.values ( ) ) { if ( ( request.getAttribute ( attribute.getKey ( ) ) ) != null ) { digest.update ( request.getAttribute ( attribute.getKey ( ) ) . toString ( ) . getBytes ( ) ) ; } } return digest ; }

Target:
protected java.security.MessageDigest getMd5Digest ( final javax.servlet.http.HttpServletRequest request ) throws java.io.UnsupportedEncodingException , java.security.NoSuchAlgorithmException { java.security.MessageDigest digest = createMd5Digest ( ) ; for ( org.ovirt.engine.ui.frontend.server.gwt.GwtDynamicHostPageServlet.MD5Attributes attribute : org.ovirt.engine.ui.frontend.server.gwt.GwtDynamicHostPageServlet.MD5Attributes.values ( ) ) { if ( ( request.getAttribute ( attribute.getKey ( ) ) ) != null ) { digest.update ( request.getAttribute ( attribute.getKey ( ) ) . toString ( ) . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; } } return digest ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Quota quota ) { if ( ( quota.getQuotaEnforcementType ( ) ) == null ) { return getApplicationResources ( ) . iconDisable ( ) ; } switch ( quota.getQuotaEnforcementType ( ) ) { case HARD_ENFORCEMENT : return getApplicationResources ( ) . iconEnforce ( ) ; case SOFT_ENFORCEMENT : return getApplicationResources ( ) . iconAudit ( ) ; case DISABLED : return getApplicationResources ( ) . iconDisable ( ) ; default : return getApplicationResources ( ) . iconDisable ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Quota quota ) { if ( ( quota.getQuotaEnforcementType ( ) ) == null ) { return getApplicationResources ( ) . iconDisable ( ) ; } setEnumTitle ( quota.getQuotaEnforcementType ( ) ) ; switch ( quota.getQuotaEnforcementType ( ) ) { case HARD_ENFORCEMENT : return getApplicationResources ( ) . iconEnforce ( ) ; case SOFT_ENFORCEMENT : return getApplicationResources ( ) . iconAudit ( ) ; case DISABLED : return getApplicationResources ( ) . iconDisable ( ) ; default : return getApplicationResources ( ) . iconDisable ( ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.Snapshot getActiveSnapshot ( ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) return snapshot ; } org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "VM '{}' doesn't have active snapshot in export domain" , getVmId ( ) ) ; return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Snapshot getActiveSnapshot ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = org.ovirt.engine.core.bll.VmHandler.getActiveSnapshot ( getVm ( ) ) ; if ( activeSnapshot == null ) { org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "VM '{}' doesn't have active snapshot in export domain" , getVmId ( ) ) ; } return activeSnapshot ; }
Source:
private java.lang.String getManagementOptions ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementOptions = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( _vds.getpm_type ( ) , _vds.getpm_options ( ) ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( _vds.getPmSecondaryType ( ) , _vds.getPmSecondaryOptions ( ) ) ; } return managementOptions ; }

Target:
private java.lang.String getManagementOptions ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementOptions = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( _vds.getPmType ( ) , _vds.getPmOptions ( ) ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( _vds.getPmSecondaryType ( ) , _vds.getPmSecondaryOptions ( ) ) ; } return managementOptions ; }
Source:
private org.ovirt.engine.core.common.businessentities.network mockExistingNetwork ( java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network network = new org.ovirt.engine.core.common.businessentities.network ( "" , "" , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , networkName , "" , "" , 0 , 100 , false , 0 , true ) ; org.mockito.Mockito.when ( networkDAO.getAllForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( network ) ) ; return network ; }

Target:
private void mockExistingNetworks ( org.ovirt.engine.core.common.businessentities.network ... networks ) { org.mockito.Mockito.when ( networkDAO.getAllForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Arrays.asList ( networks ) ) ; }
Source:
public void testUpdateCantDo ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; resource.setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { "" } , false , true , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" , 409 ) ; } }

Target:
public void testUpdateCantDo ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; resource.setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.ROOT_PASSWORD } , false , true , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" , 409 ) ; } }
Source:
protected org.ovirt.engine.core.dao.LunDAO getLunDao ( ) { return org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getDbFacade ( ) . getLunDao ( ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locks = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > ( ) ; locks.put ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getconnection ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE_CONNECTION , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; locks.put ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getid ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE_CONNECTION , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; return locks ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { if ( returnValue != null ) { java.util.Map < java.lang.String , java.lang.String > customPropertiesList = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getCustomPropertySheet ( ) . setKeyValueMap ( customPropertiesList ) ; getCustomPropertySheet ( ) . setIsChangable ( ( ! ( customPropertiesList.isEmpty ( ) ) ) ) ; initCustomProperties ( ) ; } stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { if ( returnValue != null ) { java.util.Map < java.lang.String , java.lang.String > customPropertiesList = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getCustomPropertySheet ( ) . setKeyValueMap ( customPropertiesList ) ; getCustomPropertySheet ( ) . setIsChangeable ( ( ! ( customPropertiesList.isEmpty ( ) ) ) ) ; initCustomProperties ( ) ; } stopProgress ( ) ; }
Source:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setCertificateInfo ( model ) ; setVmOvfConfiguration ( model , entity ) ; setRngDevice ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setSoundcard ( model ) ; setCertificateInfo ( model ) ; setVmOvfConfiguration ( model , entity ) ; setRngDevice ( model ) ; return model ; }
Source:
protected void verify ( org.ovirt.engine.api.model.Balance model , org.ovirt.engine.api.model.Balance transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( model.getSchedulingPolicyUnit ( ) . getId ( ) , transform.getSchedulingPolicyUnit ( ) . getId ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.Balance model , org.ovirt.engine.api.model.Balance transform ) { org.junit.jupiter.api.Assertions.assertNotNull ( transform ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getSchedulingPolicyUnit ( ) . getId ( ) , transform.getSchedulingPolicyUnit ( ) . getId ( ) ) ; }
Source:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Permit model , int index ) { assertEquals ( java.lang.Integer.toString ( ( index + 1 ) ) , model.getId ( ) ) ; org.ovirt.engine.api.model.PermitType permitType = org.ovirt.engine.api.restapi.types.PermitMapper.map ( org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( ( index + 1 ) ) , ( ( org.ovirt.engine.api.model.PermitType ) ( null ) ) ) ; assertEquals ( permitType.value ( ) , model.getName ( ) ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Permit model , int index ) { assertEquals ( java.lang.Integer.toString ( ( index + 1 ) ) , model.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup = org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( ( index + 1 ) ) ; assertEquals ( actionGroup.name ( ) . toLowerCase ( ) , model.getName ( ) ) ; }
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
public void qosCommitmentMissingBondSpeedMode6 ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmendMissingBondSpeed ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_MODE_6 ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
public void externalNetworkAttached ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; net.setProvidedBy ( new org.ovirt.engine.core.common.businessentities.network.ProviderNetwork ( ) ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( net.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_NETWORKS_CANNOT_BE_PROVISIONED ) ; }
Source:
public java.lang.Object lookupEntity ( java.lang.Object id ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { org.ovirt.engine.core.common.businessentities.VM vm = doGetEntity ( org.ovirt.engine.core.common.businessentities.VM.class , query , getQueryParams ( queryParamsClass , id ) , id.toString ( ) ) ; org.ovirt.engine.api.restapi.resource.Vm model = new org.ovirt.engine.api.restapi.resource.Vm ( ) ; model.setId ( vm.getId ( ) . toString ( ) ) ; return org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , model ) ; }

Target:
public java.lang.Object lookupEntity ( java.lang.Object id ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { org.ovirt.engine.core.common.businessentities.VM vm = doGetEntity ( org.ovirt.engine.core.common.businessentities.VM.class , query , getQueryParams ( queryParamsClass , id ) , id.toString ( ) ) ; org.ovirt.engine.api.restapi.resource.Vm model = new org.ovirt.engine.api.restapi.resource.Vm ( ) ; model.setId ( vm.getId ( ) . toString ( ) ) ; return org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( getUriInfo ( ) , model ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return createTask ( asyncTaskCreationInfo , parentCommand , null , null , org.ovirt.engine.core.bll.CommandBase.EMPTY_GUID_ARRAY ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }
Source:
private void processSingleClusterChanges ( org.ovirt.engine.core.common.action.ManageNetworkClustersParameters param ) { final org.ovirt.engine.core.bll.network.cluster.transformer.NetworkClustersToSetupNetworksParametersTransformer networkClustersToSetupNetworksParametersTransformer = networkClustersToSetupNetworksParametersTransformerFactory.createNetworkClustersToSetupNetworksParametersTransformer ( getContext ( ) ) ; final java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > setupNetworksParams = new java.util.ArrayList < > ( ) ; setupNetworksParams.addAll ( networkClustersToSetupNetworksParametersTransformer.transform ( param.getAttachments ( ) , param.getDetachments ( ) ) ) ; org.ovirt.engine.core.bll.network.NetworkParametersBuilder.updateParametersSequencing ( setupNetworksParams ) ; runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , setupNetworksParams ) ; }

Target:
private void processSingleClusterChanges ( org.ovirt.engine.core.common.action.ManageNetworkClustersParameters param ) { final org.ovirt.engine.core.bll.network.cluster.transformer.NetworkClustersToSetupNetworksParametersTransformer networkClustersToSetupNetworksParametersTransformer = networkClustersToSetupNetworksParametersTransformerFactory.createNetworkClustersToSetupNetworksParametersTransformer ( getContext ( ) ) ; final java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > setupNetworksParams = new java.util.ArrayList < > ( ) ; setupNetworksParams.addAll ( networkClustersToSetupNetworksParametersTransformer.transform ( param.getAttachments ( ) , param.getDetachments ( ) ) ) ; org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( setupNetworksParams ) ; runInternalMultipleActions ( VdcActionType.PersistentHostSetupNetworks , setupNetworksParams ) ; }
Source:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void getDataCenterList ( 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public int compare ( java.lang.Integer o1 , java.lang.Integer o2 ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o1 ) . compareTo ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o2 ) ) ; }

Target:
private static void initOsIds ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds = new java.util.ArrayList < java.lang.Integer > ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.keySet ( ) ) ; java.util.Collections.sort ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds , new java.util.Comparator < java.lang.Integer > ( ) { @ java.lang.Override public int compare ( java.lang.Integer o1 , java.lang.Integer o2 ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o1 ) . compareTo ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o2 ) ) ; } } ) ; }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain getHEStorageDomain ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.StoragePool storagePool , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = storageDomainDao.getForStoragePool ( storageDomainId , storagePool.getId ( ) ) ; if ( storageDomain != null ) { return storageDomain ; } org.ovirt.engine.core.common.action.StorageDomainManagementParameter importParams = new org.ovirt.engine.core.common.action.StorageDomainManagementParameter ( ) ; importParams.setStorageDomainId ( storageDomainId ) ; importParams.setVdsId ( vm.getRunOnVds ( ) ) ; return backend.runInternalAction ( VdcActionType.ImportHostedEngineStorageDomain , importParams ) . getActionReturnValue ( ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain getHEStorageDomain ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.StoragePool storagePool , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = storageDomainDao.getForStoragePool ( storageDomainId , storagePool.getId ( ) ) ; if ( storageDomain != null ) { return storageDomain ; } org.ovirt.engine.core.common.action.StorageDomainManagementParameter importParams = new org.ovirt.engine.core.common.action.StorageDomainManagementParameter ( ) ; importParams.setStorageDomainId ( storageDomainId ) ; importParams.setVdsId ( vm.getRunOnVds ( ) ) ; return backend.runInternalAction ( ActionType.ImportHostedEngineStorageDomain , importParams ) . getActionReturnValue ( ) ; }
Source:
protected boolean validateBonds ( java.util.Set < java.lang.String > bonds , java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > bondSlaves ) { boolean returnValue = true ; for ( java.lang.String bondName : bonds ) { if ( ( bondSlaves.containsKey ( bondName ) ) && ( ( bondSlaves.get ( bondName ) . size ( ) ) < 2 ) ) { returnValue = false ; violations.add ( VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; } } return returnValue ; }

Target:
private boolean validateBondSlavesCount ( ) { boolean returnValue = true ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > bondEntry : bonds.entrySet ( ) ) { if ( ( bondEntry.getValue ( ) . size ( ) ) < 2 ) { returnValue = false ; violations.add ( VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; } } return returnValue ; }
Source:
public static boolean isUserAuthenticated ( javax.servlet.http.HttpSession session ) { java.util.Map < java.lang.String , java.lang.Object > sessionData = org.ovirt.engine.core.sso.utils.SSOUtils.getSessionData ( session.getServletContext ( ) , session.getId ( ) ) ; return ( sessionData.get ( org.ovirt.engine.core.sso.utils.SSOUtils.SSO_PRINCIPAL_RECORD_ATTR_NAME ) ) != null ; }

Target:
public static org.ovirt.engine.core.sso.utils.SSOSession getSsoSession ( javax.servlet.http.HttpServletRequest request ) { org.ovirt.engine.core.sso.utils.SSOSession ssoSession = ( ( request.getSession ( false ) ) == null ) ? null : ( ( org.ovirt.engine.core.sso.utils.SSOSession ) ( request.getSession ( ) . getAttribute ( SSOConstants.OVIRT_SSO_SESSION ) ) ) ; if ( ssoSession == null ) { throw new org.ovirt.engine.core.sso.utils.OAuthException ( SSOConstants.ERR_CODE_INVALID_GRANT , "Session expired please try again." ) ; } return ssoSession ; }
Source:
public void networkInUseByVms ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VM vm = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ; org.mockito.Mockito.when ( vm.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.NAMEABLE_NAME ) ; networkNotUsedByVmsTest ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.failsWithNetworkInUse ( ) , java.util.Collections.singletonList ( vm ) ) ; }

Target:
public void networkInUseByOneVm ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VM vm = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ; org.mockito.Mockito.when ( vm.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.NAMEABLE_NAME ) ; networkNotUsedByVmsTest ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.failsWithOneNetworkInUse ( ) , java.util.Collections.singletonList ( vm ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult valuesConsistent ( ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = getQos ( ) ; if ( qos == null ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.lang.Integer outUpperlimit = qos.getOutAverageUpperlimit ( ) ; java.lang.Integer outRealtime = qos.getOutAverageRealtime ( ) ; return ( ( outUpperlimit != null ) && ( outRealtime != null ) ) && ( outUpperlimit < outRealtime ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_INCONSISTENT_VALUES ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult valuesConsistent ( ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = getQos ( ) ; if ( qos == null ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.lang.Integer outUpperlimit = qos.getOutAverageUpperlimit ( ) ; java.lang.Integer outRealtime = qos.getOutAverageRealtime ( ) ; return ( ( outUpperlimit != null ) && ( outRealtime != null ) ) && ( outUpperlimit < outRealtime ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_INCONSISTENT_VALUES ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static void GetCustomPropertiesList ( 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.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmCustomProperties , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void GetGlusterHosts ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress , java.lang.String rootPassword , java.lang.String fingerprint ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterServersQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterServersQueryParameters ( hostAddress , rootPassword ) ; parameters.setFingerprint ( fingerprint ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServers , parameters , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isDomainHasSpaceForRequest ( final long requestedSize , final boolean useThresHold ) { long size = ( useThresHold ) ? org.ovirt.engine.core.bll.validator.StorageDomainValidator.getLowDiskSpaceThreshold ( ) : 0L ; if ( ( ( storageDomain.getAvailableDiskSize ( ) ) != null ) && ( ( ( storageDomain.getAvailableDiskSize ( ) ) - requestedSize ) < size ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN , storageName ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isDomainHasSpaceForRequest ( final long requestedSize , final boolean useThresHold ) { long size = ( useThresHold ) ? org.ovirt.engine.core.bll.validator.StorageDomainValidator.getLowDiskSpaceThreshold ( ) : 0L ; if ( ( ( storageDomain.getAvailableDiskSize ( ) ) != null ) && ( ( ( storageDomain.getAvailableDiskSize ( ) ) - requestedSize ) < size ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN , storageName ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static void GetRedirectServletReportsPage ( 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.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void updateMaxNumOfVmCpus ( ) { java.lang.String version = getClusterCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfVmCpus ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.maxCpus = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.postUpdateNumOfSockets2 ( ) ; } } , getModel ( ) . getHash ( ) ) , version ) ; }

Target:
public void postUpdateNumOfSockets2 ( ) { java.lang.String version = getClusterCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfCPUsPerSocket ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxCpusPerSocket = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; } } ) , version ) ; }
Source:
public void setEnabled ( boolean enabled ) { contentWidget.setEnabled ( enabled ) ; if ( enabled ) { labelElement.replaceClassName ( style.labelDisabled ( ) , style.labelEnabled ( ) ) ; } else { labelElement.replaceClassName ( style.labelEnabled ( ) , style.labelDisabled ( ) ) ; } if ( ! ( keepTitleOnSetEnabled ) ) { updateWidgetTitle ( null ) ; } }

Target:
public void setEnabled ( boolean enabled ) { contentWidget.setEnabled ( enabled ) ; if ( enabled ) { getLabelElement ( ) . replaceClassName ( style.labelDisabled ( ) , style.labelEnabled ( ) ) ; } else { getLabelElement ( ) . replaceClassName ( style.labelEnabled ( ) , style.labelDisabled ( ) ) ; } if ( ! ( keepTitleOnSetEnabled ) ) { updateWidgetTitle ( null ) ; } }
Source:
protected void postSaveAction ( boolean succeeded ) { if ( succeeded ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qosItems = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( getQos ( ) . getItems ( ) ) ) ) ; qosItems.add ( 1 , networkQoS ) ; getQos ( ) . setItems ( qosItems ) ; getQos ( ) . setSelectedItem ( networkQoS ) ; } super . postSaveAction ( succeeded ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qos = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( returnValue ) ) ; getQos ( ) . setItems ( qos ) ; getQos ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( qos , getNetwork ( ) . getQosId ( ) ) ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpEntityQueryExpectations ( false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveMacPool , org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpEntityQueryExpectations ( false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveMacPool , org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; setTitle ( ( disk.isShareable ( ) ? constants.shareable ( ) : null ) ) ; return disk.isShareable ( ) ? resources.shareableDiskIcon ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; setTitle ( ( disk.isBoot ( ) ? constants.bootableDisk ( ) : null ) ) ; return disk.isBoot ( ) ? resources.bootableDiskIcon ( ) : null ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDSGroup createCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.CLUSTER_GUIDS [ 0 ] ) ; cluster.setname ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setcompatibility_version ( Version.v3_2 ) ; return cluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDSGroup createCluster ( int index ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setname ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setcompatibility_version ( Version.v3_2 ) ; return cluster ; }
Source:
public static synchronized java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > getWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmOsType type : org.ovirt.engine.core.common.businessentities.VmOsType.values ( ) ) { if ( type.isWindows ( ) ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes.add ( type ) ; } } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }

Target:
public static void initLinuxOsTypes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsIds = ( ( java.util.ArrayList < java.lang.Integer > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetLinuxOss ) , callback ) ; }
Source:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

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