auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void dump ( org.ovirt.engine.api.extensions.ExtMap map , java.lang.String indent ) { if ( map != null ) { org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "{}--- Begin GroupRecord ---" , indent ) ; org.ovirt.engine.exttool.aaa.AAAServiceImpl.Dump.dumpRecord ( map , java.util.Arrays.asList ( Authz.GroupRecord.GROUPS ) , "GroupRecord" , indent ) ; for ( org.ovirt.engine.api.extensions.ExtMap group : map.get ( Authz.GroupRecord.GROUPS , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { dump ( group , ( indent + " " ) ) ; } org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "{}--- End GroupRecord ---" , indent ) ; } }

Target:
public void dump ( org.ovirt.engine.exttool.aaa.AAAServiceImpl module , org.ovirt.engine.api.extensions.ExtMap map , java.lang.String indent ) { if ( map != null ) { org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "{}--- Begin GroupRecord ---" , indent ) ; org.ovirt.engine.exttool.aaa.AAAServiceImpl.Dump.dumpRecord ( module , map , java.util.Arrays.asList ( Authz.GroupRecord.GROUPS ) , "GroupRecord" , indent ) ; for ( org.ovirt.engine.api.extensions.ExtMap group : map.get ( Authz.GroupRecord.GROUPS , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { dump ( module , group , ( indent + " " ) ) ; } org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "{}--- End GroupRecord ---" , indent ) ; } }
Source:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network_cluster > clustersFromDB = dbFacade.getNetworkClusterDAO ( ) . getAllForCluster ( cluster ) ; org.ovirt.engine.core.common.businessentities.network_cluster clusterFromDB = clustersFromDB.get ( 0 ) ; org.junit.Assert.assertNotNull ( clusterFromDB ) ; new_net.setCluster ( clusterFromDB ) ; new_net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; dao.save ( new_net ) ; org.ovirt.engine.core.common.businessentities.Network result = dao.getByName ( new_net.getname ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_net , result ) ; }

Target:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network_cluster > clustersFromDB = dbFacade.getNetworkClusterDao ( ) . getAllForCluster ( cluster ) ; org.ovirt.engine.core.common.businessentities.network_cluster clusterFromDB = clustersFromDB.get ( 0 ) ; org.junit.Assert.assertNotNull ( clusterFromDB ) ; new_net.setCluster ( clusterFromDB ) ; new_net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; dao.save ( new_net ) ; org.ovirt.engine.core.common.businessentities.Network result = dao.getByName ( new_net.getname ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_net , result ) ; }
Source:
private javax.ws.rs.core.Response addSAN ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.storage_domain_static entity , org.ovirt.engine.core.compat.Guid hostId ) { boolean overrideLuns = ( model.getStorage ( ) . isSetOverrideLuns ( ) ) ? model.getStorage ( ) . isOverrideLuns ( ) : false ; return performCreation ( VdcActionType.AddSANStorageDomain , getSanAddParams ( entity , hostId , getLunIds ( model.getStorage ( ) , storageType , hostId ) , overrideLuns ) , ID_RESOLVER ) ; }

Target:
private javax.ws.rs.core.Response addSAN ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainStatic entity , org.ovirt.engine.core.compat.Guid hostId ) { boolean overrideLuns = ( model.getStorage ( ) . isSetOverrideLuns ( ) ) ? model.getStorage ( ) . isOverrideLuns ( ) : false ; return performCreate ( VdcActionType.AddSANStorageDomain , getSanAddParams ( entity , hostId , getLunIds ( model.getStorage ( ) , storageType , hostId ) , overrideLuns ) , ID_RESOLVER ) ; }
Source:
private void clearAsyncTasksWithOutVdsmId ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getAsyncTaskIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = org.ovirt.engine.core.bll.CommandBase.getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( NGuid.Empty.equals ( task.getVdsmTaskId ( ) ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.failTaskWithoutVdsmId ( task ) ; } } }

Target:
private void clearAsyncTasksWithOutVdsmId ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = org.ovirt.engine.core.bll.CommandBase.getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( task.getVdsmTaskId ( ) ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.failTaskWithoutVdsmId ( task ) ; } } }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc createVG ( java.lang.String sdUUID , java.lang.String [ ] deviceList ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.createVG ( sdUUID , deviceList ) ; org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( 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 isolateVolume ( java.lang.String sdUUID , java.lang.String srcImageID , java.lang.String dstImageID , java.lang.String volumeID ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.isolateVolume ( sdUUID , srcImageID , dstImageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }
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 getClusterFeaturesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void testDoGetExistingFile ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getPathInfo ( ) ) . thenReturn ( "/org/ovirt/engine/core/branding/BrandingServletTest.class" ) ; org.mockito.Mockito.when ( mockFile.getAbsolutePath ( ) ) . thenReturn ( this . getClass ( ) . getClassLoader ( ) . getResource ( "." ) . toURI ( ) . getPath ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . setHeader ( org.mockito.Matchers.eq ( "ETag" ) , org.mockito.Matchers.anyString ( ) ) ; }

Target:
public void testDoGetExistingFile ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getPathInfo ( ) ) . thenReturn ( "/org/ovirt/engine/core/branding/BrandingServletTest.class" ) ; org.mockito.Mockito.when ( mockFile.getAbsolutePath ( ) ) . thenReturn ( this . getClass ( ) . getClassLoader ( ) . getResource ( "." ) . toURI ( ) . getPath ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . setHeader ( org.mockito.ArgumentMatchers.eq ( "ETag" ) , org.mockito.ArgumentMatchers.anyString ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.storage_pool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; if ( pool != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getStorageDomainList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }
Source:
public static < TSource > TSource firstOrDefault ( java.lang.Iterable < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < ? super TSource > predicate ) { if ( source != null ) { for ( TSource item : source ) { if ( predicate.match ( item ) ) { return item ; } } } return null ; }

Target:
public static < TSource > TSource firstOrNull ( java.lang.Iterable < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < ? super TSource > predicate ) { if ( source != null ) { for ( TSource item : source ) { if ( predicate.match ( item ) ) { return item ; } } } return null ; }
Source:
public void addConstraint ( org.ovirt.api.metamodel.concepts.Constraint constraint ) { constraints.add ( constraint ) ; }

Target:
public java.util.List < org.ovirt.api.metamodel.concepts.Constraint > getConstraints ( ) { java.util.List < org.ovirt.api.metamodel.concepts.Constraint > result = new java.util.ArrayList ( constraints ) ; if ( ( base ) != null ) { result.addAll ( base.getConstraints ( ) ) ; } result.sort ( java.util.Comparator.comparing ( Constraint :: getName ) ) ; return result ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidateModifiedBondSlaves ( bond , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) , new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , false , VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ; }

Target:
public void testValidModifiedBondsWhenAllOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( "bond1" ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , ValidationResult.VALID , ValidationResult.VALID ) ; }
Source:
public void testSave ( ) { dao.save ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) ) ; org.junit.Assert.assertTrue ( result.equals ( dummyPolicy ) ) ; dao.remove ( dummyPolicy.getId ( ) ) ; }

Target:
public void testSave ( ) { dao.save ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.Assert.assertTrue ( result.equals ( dummyPolicy ) ) ; dao.remove ( dummyPolicy.getId ( ) ) ; }
Source:
private static void clusterVersionIsSupported ( ) { org.powermock.api.mockito.PowerMockito.mockStatic ( org.ovirt.engine.core.bll.utils.VersionSupport.class ) ; org.powermock.api.mockito.PowerMockito.when ( org.ovirt.engine.core.bll.utils.VersionSupport.checkVersionSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( true ) ; org.powermock.api.mockito.PowerMockito.when ( org.ovirt.engine.core.bll.utils.VersionSupport.checkClusterVersionSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) . thenReturn ( true ) ; }

Target:
private void cpuFlagsNotMissing ( ) { org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . missingServerCpuFlags ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addDiskDevice ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , java.lang.Boolean isPlugged , java.lang.Boolean isReadOnly , java.lang.String address , boolean isUsingScsiReservation ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , isPlugged , isReadOnly , address , null , isUsingScsiReservation ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmDevice addDiskDevice ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId ) { return addDiskDevice ( vmId , deviceId , true , false , "" , false ) ; }
Source:
private void initOsRepository ( ) { OsInfoPreferencesLoader.INSTANCE.init ( java.nio.file.FileSystems.getDefault ( ) . getPath ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getEtcDir ( ) . getAbsolutePath ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.OsRepositoryConfDir ) ) ) ; OsRepositoryImpl.INSTANCE.init ( OsInfoPreferencesLoader.INSTANCE.getPreferences ( ) ) ; org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.utils.OsRepositoryImpl.INSTANCE ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; dbFacade.populateDwhOsInfo ( osRepository.getOsNames ( ) ) ; }

Target:
private void initOsRepository ( ) { OsInfoPreferencesLoader.INSTANCE.init ( java.nio.file.FileSystems.getDefault ( ) . getPath ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getEtcDir ( ) . getAbsolutePath ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.OsRepositoryConfDir ) ) ) ; OsRepositoryImpl.INSTANCE.init ( OsInfoPreferencesLoader.INSTANCE.getPreferences ( ) ) ; org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.utils.OsRepositoryImpl.INSTANCE ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; dbFacade.populateDwhOsInfo ( osRepository.getOsNames ( ) ) ; }
Source:
public static void getStorageDomainList ( 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 ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void getTemplateListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , getAsyncTask ( taskId , asyncTaskCreationInfo , parentCommand ) ) ; p.setEntityInfo ( getParameters ( ) . getEntityInfo ( ) ) ; return createTask ( internalGetTaskType ( ) , p ) ; }

Target:
public org.ovirt.engine.core.bll.tasks.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return org.ovirt.engine.core.bll.tasks.TaskManagerUtil.concreteCreateTask ( taskId , this , asyncTaskCreationInfo , parentCommand ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void verifyModel ( R model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendResourceTest.verifyLinks ( model ) ; }

Target:
protected void verifyModel ( R model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendResourceTest.verifyLinks ( model ) ; }
Source:
public void vdsGroupWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }

Target:
public void vdsGroupWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult vmDuringInitialization ( org.ovirt.engine.core.common.businessentities.VM vm ) { boolean isVmDuringInit = ( ( java.lang.Boolean ) ( getBackend ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.IsVmDuringInitiating , new org.ovirt.engine.core.common.vdscommands.IsVmDuringInitiatingVDSCommandParameters ( vm.getId ( ) ) ) . getReturnValue ( ) ) ) . booleanValue ( ) ; if ( ( ( vm.isRunning ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.NotResponding ) ) ) || isVmDuringInit ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult vmDuringInitialization ( org.ovirt.engine.core.common.businessentities.VM vm ) { boolean isVmDuringInit = isVmDuringInitiating ( vm ) ; if ( ( ( vm.isRunning ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.NotResponding ) ) ) || isVmDuringInit ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void executeCallbacks ( boolean success , org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState , java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > callbacks , boolean waitForResult ) { java.util.Collections.shuffle ( callbacks ) ; for ( org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback callback : callbacks ) { assertNotAllDone ( flowState ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; result.setCanDoAction ( ( waitForResult ? true : success ) ) ; result.setSucceeded ( ( waitForResult ? success : false ) ) ; callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( ACTION_TYPE , null , java.util.Collections.singletonList ( result ) ) ) ; } }

Target:
private void executeCallbacks ( boolean success , org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState , java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > callbacks , boolean waitForResult ) { java.util.Collections.shuffle ( callbacks ) ; for ( org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback callback : callbacks ) { assertNotAllDone ( flowState ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; result.setValid ( ( waitForResult ? true : success ) ) ; result.setSucceeded ( ( waitForResult ? success : false ) ) ; callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( ACTION_TYPE , null , java.util.Collections.singletonList ( result ) ) ) ; } }
Source:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public void testFailInterfaceCanUpdateReadOnly ( ) { initializeCommand ( new org.ovirt.engine.core.common.action.UpdateVmDiskParameters ( vmId , createDiskImage ( ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . updateReadOnlyRequested ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ) . when ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( ) ; org.junit.Assert.assertFalse ( command.validateCanUpdateReadOnly ( diskValidator ) ) ; }

Target:
public void testFailInterfaceCanUpdateReadOnly ( ) { initializeCommand ( new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( vmId , createDiskImage ( ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . updateReadOnlyRequested ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ) . when ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( ) ; org.junit.Assert.assertFalse ( command.validateCanUpdateReadOnly ( diskValidator ) ) ; }
Source:
private void recalculateImageDerivedFields ( ) { if ( getImageSourceLocalEnabled ( ) . getEntity ( ) ) { autoSelectImageType ( getImagePath ( ) . getEntity ( ) ) ; } else { autoSelectImageType ( getImageUri ( ) . getEntity ( ) ) ; } }

Target:
private void updateVolumeType ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = getDiskModel ( ) . getStorageDomain ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType = getDiskModel ( ) . getVolumeType ( ) . getSelectedItem ( ) ; if ( storageDomain != null ) { getVolumeFormat ( ) . setItems ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDiskVolumeFormat ( volumeType , storageDomain.getStorageType ( ) ) ) ) ) ; } }
Source:
private int getRowIndexByObject ( T object ) { for ( int row = 0 ; row < ( dataDisplay.getRowCount ( ) ) ; row ++ ) { if ( dataDisplay.getVisibleItems ( ) . get ( row ) . equals ( object ) ) { return row ; } } return - 1 ; }

Target:
private java.util.List < T > visibleItemsAsList ( ) { java.util.List < T > result = new java.util.ArrayList < > ( ) ; dataDisplay.getVisibleItems ( ) . iterator ( ) . forEachRemaining ( result :: add ) ; return result ; }
Source:
public void setActiveVms ( java.lang.Integer value ) { if ( ( ( activeVms ) == null ) && ( value == null ) ) { return ; } if ( ( ( activeVms ) == null ) || ( ! ( activeVms.equals ( value ) ) ) ) { activeVms = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "ActiveVms" ) ) ; } }

Target:
public void setSpmPriorityValue ( java.lang.Integer spmPriorityValue ) { if ( ( ( this . spmPriorityValue ) == null ) || ( ! ( this . spmPriorityValue.equals ( spmPriorityValue ) ) ) ) { this . spmPriorityValue = spmPriorityValue ; if ( ( ( spmMaxPriorityValue ) == null ) || ( ( spmDefaultPriorityValue ) == null ) ) { retrieveMaxSpmPriority ( ) ; } else { updateSpmPriority ( ) ; } } }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper createHelper ( org.ovirt.engine.core.common.action.SetupNetworksParameters params ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( vds.getId ( ) ) . thenReturn ( Guid.Empty ) ; return createHelper ( params , vds ) ; }

Target:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper createHelper ( org.ovirt.engine.core.common.action.SetupNetworksParameters params ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( vds.getId ( ) ) . thenReturn ( Guid.Empty ) ; org.mockito.Mockito.when ( vds.getVdsGroupCompatibilityVersion ( ) ) . thenReturn ( Version.v3_3 ) ; return createHelper ( params , vds ) ; }
Source:
private org.ovirt.engine.core.common.action.ActionParametersBase createUpgradeParameters ( org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters parameters ) { org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters upgradeParams = new org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters ( parameters.getVdsId ( ) ) ; upgradeParams.setSessionId ( parameters.getSessionId ( ) ) ; upgradeParams.setCorrelationId ( parameters.getCorrelationId ( ) ) ; upgradeParams.setInitialStatus ( parameters.getInitialStatus ( ) ) ; upgradeParams.setoVirtIsoFile ( parameters.getoVirtIsoFile ( ) ) ; upgradeParams.setParentCommand ( ActionType.UpgradeHost ) ; upgradeParams.setParentParameters ( parameters ) ; return upgradeParams ; }

Target:
private org.ovirt.engine.core.common.action.ActionParametersBase createUpgradeParameters ( org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters parameters ) { org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters upgradeParams = new org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters ( parameters.getVdsId ( ) ) ; upgradeParams.setSessionId ( parameters.getSessionId ( ) ) ; upgradeParams.setCorrelationId ( parameters.getCorrelationId ( ) ) ; upgradeParams.setInitialStatus ( parameters.getInitialStatus ( ) ) ; upgradeParams.setoVirtIsoFile ( parameters.getoVirtIsoFile ( ) ) ; upgradeParams.setParentCommand ( ActionType.UpgradeHost ) ; upgradeParams.setParentParameters ( parameters ) ; upgradeParams.setReboot ( parameters.isReboot ( ) ) ; return upgradeParams ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.CinderDisk cloneDiskForSnapshot ( ) { org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDependentVolume = getDisk ( ) ; initCinderDependentVolume ( cinderDependentVolume ) ; java.lang.String snapshotId = org.ovirt.engine.core.bll.storage.CreateCinderSnapshotCommand.getCinderBroker ( ) . createSnapshot ( cinderDependentVolume ) ; org.ovirt.engine.core.compat.Guid destinationImageId = org.ovirt.engine.core.compat.Guid.createGuidFromString ( snapshotId ) ; org.ovirt.engine.core.bll.storage.CreateCinderSnapshotCommand.getParameters ( ) . setDestinationImageId ( destinationImageId ) ; cinderDependentVolume.setImageId ( destinationImageId ) ; return cinderDependentVolume ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.CinderDisk cloneDiskForSnapshot ( ) { org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDependentVolume = getDisk ( ) ; initCinderDependentVolume ( cinderDependentVolume ) ; java.lang.String snapshotId = org.ovirt.engine.core.bll.storage.CreateCinderSnapshotCommand.getCinderBroker ( ) . createSnapshot ( cinderDependentVolume , org.ovirt.engine.core.bll.storage.CreateCinderSnapshotCommand.getParameters ( ) . getDescription ( ) ) ; org.ovirt.engine.core.compat.Guid destinationImageId = org.ovirt.engine.core.compat.Guid.createGuidFromString ( snapshotId ) ; org.ovirt.engine.core.bll.storage.CreateCinderSnapshotCommand.getParameters ( ) . setDestinationImageId ( destinationImageId ) ; cinderDependentVolume.setImageId ( destinationImageId ) ; return cinderDependentVolume ; }
Source:
public void mixedClusterServicesNotSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , false ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ) ; }

Target:
public void mixedClusterServicesNotSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , false ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ) ; }
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.StorageDomain > ( ) ; } 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.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.compat.Guid eval ( org.ovirt.engine.core.common.businessentities.storage.Disk a ) { return a.getId ( ) ; }

Target:
public java.lang.String buildMetadataDictionaryForVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > > metaDictionary , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allVmImages ) { java.lang.String vmMeta = generateVmMetadata ( vm , allVmImages ) ; metaDictionary.put ( vm.getId ( ) , new org.ovirt.engine.core.compat.KeyValuePairCompat ( vmMeta , vm.getDiskMap ( ) . values ( ) . stream ( ) . map ( BaseDisk :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ) ; return vmMeta ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.Boolean entity = ( ( java.lang.Boolean ) ( getAllowOverbooking ( ) . getEntity ( ) ) ) ; if ( entity ) { getOptimizeForUtilization ( ) . setEntity ( true ) ; } getOptimizeForSpeed ( ) . setIsChangable ( ( ! entity ) ) ; }
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.storage_server_connections ) ( 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 GetDataCentersByStorageDomain ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }
Source:
protected void initVmForFail ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDAO ( ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; mockGetVmsListForDisk ( ) ; }

Target:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( ImageOperation.Move ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }
Source:
public static void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getDataCenterById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > buildResponse ( org.ovirt.engine.core.sso.utils.SSOSession ssoSession , java.lang.String password ) { java.util.Map < java.lang.String , java.lang.Object > payload = new java.util.HashMap < > ( ) ; payload.put ( SSOConstants.JSON_ACTIVE , ssoSession.isActive ( ) ) ; payload.put ( SSOConstants.JSON_TOKEN_TYPE , "bearer" ) ; payload.put ( SSOConstants.JSON_CLIENT_ID , ssoSession.getClientId ( ) ) ; payload.put ( SSOConstants.JSON_USER_ID , java.lang.String.format ( "%s@%s" , ssoSession.getUserId ( ) , ssoSession.getProfile ( ) ) ) ; payload.put ( SSOConstants.JSON_SCOPE , ( org.apache.commons.lang.StringUtils.isEmpty ( ssoSession.getScope ( ) ) ? "" : ssoSession.getScope ( ) ) ) ; payload.put ( SSOConstants.JSON_EXPIRES_IN , ssoSession.getValidTo ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > ovirt = new java.util.HashMap < > ( ) ; ovirt.put ( "version" , SSOConstants.OVIRT_SSO_VERSION ) ; ovirt.put ( "principal_id" , ssoSession.getPrincipalRecord ( ) . get ( Authz.PrincipalRecord.ID ) ) ; ovirt.put ( "email" , ssoSession.getPrincipalRecord ( ) . get ( Authz.PrincipalRecord.EMAIL ) ) ; ovirt.put ( "group_ids" , ssoSession.getPrincipalRecord ( ) . < java.util.List > get ( Authz.PrincipalRecord.GROUPS , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) ; if ( password != null ) { ovirt.put ( "password" , password ) ; } payload.put ( "ovirt" , ovirt ) ; return payload ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > buildResponse ( org.ovirt.engine.core.sso.utils.SSOSession ssoSession , java.lang.String password ) { java.util.Map < java.lang.String , java.lang.Object > payload = new java.util.HashMap < > ( ) ; payload.put ( SSOConstants.JSON_ACTIVE , ssoSession.isActive ( ) ) ; payload.put ( SSOConstants.JSON_TOKEN_TYPE , "bearer" ) ; payload.put ( SSOConstants.JSON_CLIENT_ID , ssoSession.getClientId ( ) ) ; payload.put ( SSOConstants.JSON_USER_ID , java.lang.String.format ( "%s@%s" , ssoSession.getUserId ( ) , ssoSession.getProfile ( ) ) ) ; payload.put ( SSOConstants.JSON_SCOPE , ( org.apache.commons.lang.StringUtils.isEmpty ( ssoSession.getScope ( ) ) ? "" : ssoSession.getScope ( ) ) ) ; payload.put ( SSOConstants.JSON_EXPIRES_IN , ssoSession.getValidTo ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > ovirt = new java.util.HashMap < > ( ) ; ovirt.put ( "version" , SSOConstants.OVIRT_SSO_VERSION ) ; ovirt.put ( "principal_id" , ssoSession.getPrincipalRecord ( ) . get ( Authz.PrincipalRecord.ID ) ) ; ovirt.put ( "email" , ssoSession.getPrincipalRecord ( ) . get ( Authz.PrincipalRecord.EMAIL ) ) ; ovirt.put ( "group_ids" , ssoSession.getPrincipalRecord ( ) . < java.util.List > get ( Authz.PrincipalRecord.GROUPS , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) ; if ( password != null ) { ovirt.put ( "password" , password ) ; } ovirt.put ( "capability_credentials_change" , ssoContext.getSsoProfilesSupportingPasswdChange ( ) . contains ( ssoSession.getProfile ( ) ) ) ; payload.put ( "ovirt" , ovirt ) ; return payload ; }
Source:
private void AddDaysOfWeek ( ) { java.lang.String day ; int dayIndex = 3 ; for ( int i = - 2 ; i > ( - 8 ) ; i -- ) { day = org.ovirt.engine.core.compat.DateTime.getNow ( ) . AddDays ( i ) . getDayOfWeek ( ) . toString ( ) ; mEnumValues.put ( day , dayIndex ) ; mVerbs.add ( day ) ; dayIndex ++ ; } }

Target:
private void AddDaysOfWeek ( ) { java.lang.String day ; int dayIndex = 3 ; for ( int i = - 2 ; i > ( - 8 ) ; i -- ) { day = org.ovirt.engine.core.compat.DateTime.getNow ( ) . addDays ( i ) . getDayOfWeek ( ) . toString ( ) ; mEnumValues.put ( day , dayIndex ) ; mVerbs.add ( day ) ; dayIndex ++ ; } }