auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void insufficientDiskSpaceWithCollapse ( ) { final org.ovirt.engine.core.bll.exportimport.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > command = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateImages ( org.mockito.Matchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.mockito.Mockito.when ( command.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollectionOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void insufficientDiskSpaceWithCollapse ( ) { setupDiskSpaceTest ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.Matchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.mockito.Mockito.when ( cmd.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollectionOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > objL = new java.util.ArrayList < java.lang.Object > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_pool > Cast ( getSelectedItems ( ) ) ) { objL.add ( a.getId ( ) ) ; } return objL.toArray ( new java.lang.Object [ ] { } ) ; } }

Target:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > objL = new java.util.ArrayList < java.lang.Object > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StoragePool > Cast ( getSelectedItems ( ) ) ) { objL.add ( a.getId ( ) ) ; } return objL.toArray ( new java.lang.Object [ ] { } ) ; } }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getCinderVolumeTypes ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getCinderVolumeTypes ( ) , failure ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel innerGeneralModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel ) ( model ) ) ; java.util.Map < java.lang.String , java.lang.String > serverMap = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( result ) ) ; if ( ! ( serverMap.isEmpty ( ) ) ) { innerGeneralModel.setHasNewGlusterHostsAlert ( true ) ; innerGeneralModel.setHasAnyAlert ( true ) ; } else { setHasNewGlusterHostsAlert ( false ) ; setHasAnyAlert ( false ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel innerGeneralModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel ) ( model ) ) ; java.util.Map < java.lang.String , java.lang.String > serverMap = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( result ) ) ; if ( ! ( serverMap.isEmpty ( ) ) ) { innerGeneralModel.setHasNewGlusterHostsAlert ( true ) ; innerGeneralModel.setHasAnyAlert ( true ) ; } else { setHasNewGlusterHostsAlert ( false ) ; setHasAnyAlert ( false ) ; } }
Source:
private void updateStorageTypeForDisk ( org.ovirt.engine.api.model.Disk disk , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.api.model.StorageDomain storageDomain = getStorageDomainById ( storageDomainId ) ; if ( storageDomain != null ) { disk.setStorageType ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( storageDomain.getStorageDomainType ( ) ) . value ( ) ) ; } }

Target:
private void updateStorageTypeForDisk ( org.ovirt.engine.api.model.Disk disk , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.api.model.StorageDomain storageDomain = getStorageDomainById ( storageDomainId ) ; if ( storageDomain != null ) { disk.setStorageType ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( storageDomain.getStorageDomainType ( ) ) ) ; } }
Source:
private void setBondOptions ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface entity , org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel bondDialogModel ) { org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > BondPair = ( ( org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > ) ( bondDialogModel.getBondingOptions ( ) . getSelectedItem ( ) ) ) ; java.lang.String key = BondPair.getKey ( ) ; entity.setBondOptions ( ( ( java.lang.String ) ( "custom" . equals ( key ) ? BondPair.getValue ( ) . getEntity ( ) : key ) ) ) ; }

Target:
private void setBondOptions ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity , org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel bondDialogModel ) { org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > BondPair = ( ( org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > ) ( bondDialogModel.getBondingOptions ( ) . getSelectedItem ( ) ) ) ; java.lang.String key = BondPair.getKey ( ) ; entity.setBondOptions ( ( ( java.lang.String ) ( "custom" . equals ( key ) ? BondPair.getValue ( ) . getEntity ( ) : key ) ) ) ; }
Source:
protected boolean isEditEnabled ( ) { return ( ( ( ( getIsFloating ( ) ) || ( getIsNew ( ) ) ) || ( getVm ( ) . isDown ( ) ) ) || ( ! ( getDisk ( ) . getPlugged ( ) ) ) ) && ( getIsChangable ( ) ) ; }

Target:
public boolean isEditEnabled ( ) { return ( ( ( ( getIsFloating ( ) ) || ( getIsNew ( ) ) ) || ( getVm ( ) . isDown ( ) ) ) || ( ! ( getDisk ( ) . getPlugged ( ) ) ) ) && ( getIsChangable ( ) ) ; }
Source:
private void initExternalProviderList ( ) { startProgress ( null ) ; org.ovirt.engine.ui.frontend.AsyncQuery getProvidersQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getProvidersQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; getExternalProviders ( ) . setItems ( providers ) ; selectExternalProvider ( ) ; stopProgress ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getAllNetworkProviders ( getProvidersQuery ) ; }

Target:
private void initExternalProviderList ( ) { startProgress ( null ) ; org.ovirt.engine.ui.frontend.AsyncQuery getProvidersQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getProvidersQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; getExternalProviders ( ) . setItems ( providers ) ; selectExternalProvider ( ) ; stopProgress ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllNetworkProviders ( getProvidersQuery ) ; }
Source:
public static java.util.List < java.lang.String > filterNonVmNetworkNames ( java.util.List < org.ovirt.engine.core.common.businessentities.network > networks , java.util.Set < java.lang.String > networkNames ) { java.util.List < java.lang.String > list = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network net : networks ) { if ( ( ! ( net.isVmNetwork ( ) ) ) && ( networkNames.contains ( net.getName ( ) ) ) ) { list.add ( net.getName ( ) ) ; } } return list ; }

Target:
public static java.util.List < java.lang.String > filterNonVmNetworkNames ( java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks , java.util.Set < java.lang.String > networkNames ) { java.util.List < java.lang.String > list = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : networks ) { if ( ( ! ( net.isVmNetwork ( ) ) ) && ( networkNames.contains ( net.getName ( ) ) ) ) { list.add ( net.getName ( ) ) ; } } return list ; }
Source:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( bckndCmdParams.getVdsId ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.SetNetworkStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }

Target:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( bckndCmdParams.getVdsId ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.SetNetworkStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > notFilteredProfiles = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > filteredProfiles = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile : notFilteredProfiles ) { filteredProfiles.add ( profile ) ; } org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( filteredProfiles ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ) ( returnValue ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; model.setDataCentersAndClusters ( model , java.util.Arrays.asList ( dataCenter ) , clusters , vm.getVdsGroupId ( ) . getValue ( ) ) ; initTemplate ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; model.setDataCentersAndClusters ( model , java.util.Arrays.asList ( dataCenter ) , clusters , vm.getVdsGroupId ( ) ) ; initTemplate ( ) ; }
Source:
public void auditNetworkCompliance ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbIfaces , final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworksByName = org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( clusterNetworks ) ; final java.util.Collection < org.ovirt.engine.core.common.businessentities.network.Network > dbHostNetworks = findNetworksOnInterfaces ( dbIfaces , clusterNetworksByName ) ; logChangedDisplayNetwork ( host , dbHostNetworks , dbIfaces ) ; logUnsynchronizedNetworks ( host , clusterNetworksByName ) ; }

Target:
private void auditNetworkCompliance ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbIfaces , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks ) { final java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworksByName = org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( clusterNetworks ) ; final java.util.Collection < org.ovirt.engine.core.common.businessentities.network.Network > dbHostNetworks = findNetworksOnInterfaces ( dbIfaces , clusterNetworksByName ) ; logChangedDisplayNetwork ( host , dbHostNetworks , dbIfaces ) ; logUnsynchronizedNetworks ( host , clusterNetworksByName ) ; }
Source:
public void testAdd ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetConsoleExpectations ( 0 , 0 , 0 ) ; setUpGetSoundcardExpectations ( 0 ) ; setUpGetBallooningExpectations ( 0 , 0 ) ; setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVm ( GUIDS [ 1 ] ) ) ; super . testAdd ( ) ; }

Target:
public void testAdd ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetConsoleExpectations ( 0 , 0 , 1 ) ; setUpGetSoundcardExpectations ( 1 ) ; setUpGetBallooningExpectations ( 0 , 0 ) ; setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVm ( GUIDS [ 1 ] ) ) ; super . testAdd ( ) ; }
Source:
protected void mockVmDevice ( boolean plugged ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setIsPlugged ( plugged ) ; org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( command ) . getVmDeviceDao ( ) ; org.powermock.api.mockito.PowerMockito.when ( vmDeviceDAO.get ( org.mockito.Mockito.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }

Target:
protected void mockVmDevice ( boolean plugged ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setIsPlugged ( plugged ) ; org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.when ( vmDeviceDAO.get ( org.mockito.Mockito.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }
Source:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , ovfEntityData.getStorageDomainId ( ) ) ; } else if ( ! ( vmDisksToAttach.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , attemptToAttachDisksToImportedVm ( vmDisksToAttach ) ) ; } } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getId ( ) ) ; }

Target:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; } else if ( ! ( vmDisksToAttach.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , attemptToAttachDisksToImportedVm ( vmDisksToAttach ) ) ; } } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getId ( ) ) ; }
Source:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_BASIC_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.userportal.section.DefaultMainSectionExtendedPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_EXTENDED_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.userportal.ApplicationConstants.class , org.ovirt.engine.ui.userportal.ApplicationMessages.class , org.ovirt.engine.ui.userportal.ApplicationResources.class , org.ovirt.engine.ui.userportal.ApplicationTemplates.class ) ; bind ( org.ovirt.engine.ui.userportal.ApplicationResourcesWithLookup.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.section.main.view.tab.basic.MainTabBasicListItemMessages.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_BASIC_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.userportal.section.DefaultMainSectionExtendedPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_EXTENDED_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.userportal.ApplicationConstants.class , org.ovirt.engine.ui.userportal.ApplicationMessages.class , org.ovirt.engine.ui.userportal.ApplicationResources.class , org.ovirt.engine.ui.userportal.ApplicationTemplates.class ) ; bind ( org.ovirt.engine.ui.userportal.ApplicationResourcesWithLookup.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public void getMaxNumOfVmCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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 ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmCpus ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getMaxNumOfVmCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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 ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmCpus ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void validateDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void validateDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }
Source:
public java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > getOsArchitectures ( ) { java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > osArchitectures = new java.util.HashMap < > ( ) ; for ( int osId : getOsIds ( ) ) { java.lang.String architecture = getValueByVersion ( idToUnameLookup.get ( osId ) , "cpuArchitecture" , null ) ; if ( architecture != null ) { osArchitectures.put ( osId , org.ovirt.engine.core.common.businessentities.ArchitectureType.valueOf ( architecture ) ) ; } } return osArchitectures ; }

Target:
public java.util.Map < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > getOsArchitectures ( ) { java.util.Map < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > osArchitectures = new java.util.HashMap < > ( ) ; for ( int osId : getOsIds ( ) ) { java.lang.String architecture = getValueByVersion ( idToUnameLookup.get ( osId ) , "cpuArchitecture" , null ) ; if ( architecture != null ) { osArchitectures.put ( osId , org.ovirt.engine.core.common.businessentities.ArchitectureType.valueOf ( architecture ) ) ; } } return osArchitectures ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.UserProfile profile = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.lang.Boolean connectAutomatically = ( profile == null ) ? java.lang.Boolean.TRUE : profile.isUserPortalVmLoginAutomatically ( ) ; if ( connectAutomatically ) { handleConnectAutomatically ( ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { org.ovirt.engine.core.common.businessentities.UserProfile profile = returnValue.getReturnValue ( ) ; java.lang.Boolean connectAutomatically = ( profile == null ) ? java.lang.Boolean.TRUE : profile.isUserPortalVmLoginAutomatically ( ) ; if ( connectAutomatically ) { handleConnectAutomatically ( ) ; } }
Source:
public java.lang.Object runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getStoragePool ( ) , getStoragePool ( ) . getStatus ( ) ) ; getStoragePool ( ) . setStatus ( StoragePoolStatus.Maintenance ) ; getStoragePoolDAO ( ) . updateStatus ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getStatus ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getStoragePool ( ) ) ; getStoragePool ( ) . setStatus ( StoragePoolStatus.Maintenance ) ; getStoragePoolDAO ( ) . updateStatus ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getStatus ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void encodeDecodeWithNonAsciiDiskDescription ( ) throws java.lang.Exception { disk.setDiskAlias ( "DiskAlias" ) ; disk.setDiskDescription ( "áéíñ" ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( "DiskAlias" ) , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskDescriptionJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( "áéíñ" ) ) , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateEncodingJsonEntry ( 2 ) ) ; org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.assertDiskDescriptionDecoding ( disk ) ; }

Target:
public void encodeDecodeWithNonAsciiDiskDescription ( ) throws java.lang.Exception { disk.setDiskAlias ( "DiskAlias" ) ; disk.setDiskDescription ( "áéíñ" ) ; assertDiskDescriptionMap ( disk , generateDiskAliasJsonEntry ( "DiskAlias" ) , generateDiskDescriptionJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( "áéíñ" ) ) , generateEncodingJsonEntry ( 2 ) ) ; assertDiskDescriptionDecoding ( disk ) ; }
Source:
private boolean handleQueryError ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue , org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel model ) { model.setMessage ( null ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { model.setMessage ( org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getAppErrorsTranslator ( ) . translateErrorTextSingle ( returnValue.getExceptionString ( ) ) ) ; getSearchInProgress ( ) . setEntity ( false ) ; return true ; } return false ; }

Target:
private boolean handleQueryError ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { setMessage ( null ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { setMessage ( org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getAppErrorsTranslator ( ) . translateErrorTextSingle ( returnValue.getExceptionString ( ) ) ) ; getSearchInProgress ( ) . setEntity ( false ) ; return true ; } return false ; }
Source:
private void initStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; }

Target:
private void initStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; }
Source:
private void addClusterDetails ( org.ovirt.engine.core.compat.Guid vdsGroupID , java.util.List < java.lang.String > clustersWithRunningVms ) { if ( ( vdsGroupID != null ) && ( ! ( vdsGroupID.equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . getWithRunningVms ( vdsGroupID ) ; if ( vdsGroup != null ) { clustersWithRunningVms.add ( vdsGroup.getname ( ) ) ; } } }

Target:
private void addClusterDetails ( org.ovirt.engine.core.compat.Guid vdsGroupID , java.util.List < java.lang.String > clustersWithRunningVms ) { if ( ( vdsGroupID != null ) && ( ! ( vdsGroupID.equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . getWithRunningVms ( vdsGroupID ) ; if ( vdsGroup != null ) { clustersWithRunningVms.add ( vdsGroup.getName ( ) ) ; } } }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { boolean isOk = behavior.isNumOfSocketsCorrect ( java.lang.Integer.parseInt ( getTotalCPUCores ( ) . getEntity ( ) . toString ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult res = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; res.setSuccess ( isOk ) ; res.setReasons ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . incorrectVCPUNumber ( ) ) ) ; return res ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { boolean isOk = behavior.isNumOfSocketsCorrect ( java.lang.Integer.parseInt ( getTotalCPUCores ( ) . getEntity ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult res = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; res.setSuccess ( isOk ) ; res.setReasons ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . incorrectVCPUNumber ( ) ) ) ; return res ; }
Source:
public java.lang.String render ( org.ovirt.engine.core.compat.Version version ) { java.lang.String formattedVersion ; if ( version instanceof org.ovirt.engine.core.compat.RpmVersion ) { formattedVersion = ( ( org.ovirt.engine.core.compat.RpmVersion ) ( version ) ) . getRpmName ( ) ; } else { formattedVersion = org.ovirt.engine.ui.uicommonweb.Extensions.GetFriendlyVersion ( version ) . toString ( ) ; } return new org.ovirt.engine.ui.common.widget.renderer.EmptyValueRenderer < java.lang.String > ( org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.instance ( ) . getApplicationConstants ( ) . unAvailablePropertyLabel ( ) ) . render ( formattedVersion ) ; }

Target:
public java.lang.String render ( org.ovirt.engine.core.compat.RpmVersion version ) { java.lang.String formattedVersion ; formattedVersion = version.getRpmName ( ) ; return new org.ovirt.engine.ui.common.widget.renderer.EmptyValueRenderer < java.lang.String > ( org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.instance ( ) . getApplicationConstants ( ) . unAvailablePropertyLabel ( ) ) . render ( formattedVersion ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfileDao ( ) . save ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.addPermissionsOnVnicProfile ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getCurrentUser ( ) . getUserId ( ) , org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getParameters ( ) . isPublicUse ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfileDao ( ) . save ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.addPermissionsOnVnicProfile ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getCurrentUser ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getParameters ( ) . isPublicUse ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.setSucceeded ( true ) ; }
Source:
public void serviceFound ( org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync foundService ) { foundService.logOff ( ( ( org.ovirt.engine.core.common.businessentities.aaa.DbUser ) ( userObject ) ) , new com.google.gwt.user.client.rpc.AsyncCallback < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { xsrfRequestBuilder.setXsrfToken ( null ) ; callback.onSuccess ( result ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { xsrfRequestBuilder.setXsrfToken ( null ) ; callback.onFailure ( caught ) ; } } ) ; }

Target:
public void serviceFound ( org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync foundService ) { foundService.logOff ( new com.google.gwt.user.client.rpc.AsyncCallback < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { xsrfRequestBuilder.setXsrfToken ( null ) ; callback.onSuccess ( result ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { xsrfRequestBuilder.setXsrfToken ( null ) ; callback.onFailure ( caught ) ; } } ) ; }
Source:
public void nGuidGuidCtor ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 , gu ) ; }

Target:
public void nGuidGuidCtor ( ) { b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 , gu ) ; }
Source:
private static void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disksList ) { disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } org.ovirt.engine.core.bll.memory.MemoryStorageHandler.updateDiskVolumeType ( storageDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; }

Target:
private void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disksList ) { disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } updateDiskVolumeType ( storageDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.Disk findBoot ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = disk.getDiskVmElementForVm ( getVm ( ) . getId ( ) ) ; if ( ( dve != null ) && ( dve.isBoot ( ) ) ) { return disk ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.Disk findBoot ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks , org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = disk.getDiskVmElementForVm ( vm.getId ( ) ) ; if ( ( dve != null ) && ( dve.isBoot ( ) ) ) { return disk ; } } return null ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( ) { java.lang.String tooltip = null ; if ( ( ( ! ( getModel ( ) . isVmDown ( ) ) ) && ( getModel ( ) . isHotPlugAvailable ( ) ) ) && ( ! ( getModel ( ) . getIsDiskHotPlugSupported ( ) ) ) ) { tooltip = org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ; } else { tooltip = this . getText ( ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( tooltip ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( ) { com.google.gwt.safehtml.shared.SafeHtml tooltip = null ; if ( ( ( ! ( getModel ( ) . isVmDown ( ) ) ) && ( getModel ( ) . isHotPlugAvailable ( ) ) ) && ( ! ( getModel ( ) . getIsDiskHotPlugSupported ( ) ) ) ) { tooltip = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ) ; } return tooltip ; }
Source:
public void checkExecuteCommandWithEmptyVdsId ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doNothing ( ) . when ( storageServerConnectionDao ) . remove ( NFSConnection.geIid ( ) ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.never ( ) ) . disconnectStorage ( ) ; }

Target:
public void checkExecuteCommandWithEmptyVdsId ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doNothing ( ) . when ( storageServerConnectionDao ) . remove ( NFSConnection.getId ( ) ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.never ( ) ) . disconnectStorage ( ) ; }
Source:
public org.ovirt.engine.api.model.Capabilities list ( ) { org.ovirt.engine.api.model.Capabilities caps = new org.ovirt.engine.api.model.Capabilities ( ) ; for ( org.ovirt.engine.api.model.Version v : getSupportedClusterLevels ( ) ) { caps.getVersions ( ) . add ( generateVersionCaps ( v ) ) ; } caps.setPermits ( getPermits ( ) ) ; caps.setSchedulingPolicies ( getSchedulingPolicies ( ) ) ; return caps ; }

Target:
public org.ovirt.engine.api.model.Capabilities list ( ) { org.ovirt.engine.api.model.Capabilities caps = new org.ovirt.engine.api.model.Capabilities ( ) ; for ( org.ovirt.engine.api.model.Version v : getSupportedClusterLevels ( ) ) { caps.getVersions ( ) . add ( generateVersionCaps ( v ) ) ; } return caps ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getCopyCommand ( ) ) ) { copy ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } else if ( command == ( getChangeQuotaCommand ( ) ) ) { changeQuota ( ) ; } else if ( command.getName ( ) . equals ( "onChangeQuota" ) ) { onChangeQuota ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getCopyCommand ( ) ) ) { copy ( ) ; } else if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } else if ( command == ( getChangeQuotaCommand ( ) ) ) { changeQuota ( ) ; } else if ( command.getName ( ) . equals ( "onChangeQuota" ) ) { onChangeQuota ( ) ; } }
Source:
protected boolean validateImagesAndVMStates ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , hasImages ( ) , hasImages ( ) , hasImages ( ) , hasImages ( ) , true , true , true , true , null ) ; }

Target:
protected boolean validateImagesAndVMStates ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , hasImages ( ) , hasImages ( ) , hasImages ( ) , hasImages ( ) , true , false , true , true , null ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetPermissionsByAdElementId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpPermissions ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetPermissionsByAdElementId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpPermissions ( ) , failure ) ; control.replay ( ) ; }
Source:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( cmd ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getSingleBrickVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getMultiBrickVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getSingleBrickVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getMultiBrickVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.StorageDomain > list = ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( sender ) ) ; if ( ( list.getSelectedItem ( ) . getStorageType ( ) . isBlockDomain ( ) ) && ( containsKvmOrigin ( ) ) ) { setMessage ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExternalSourceModel.constants.kvmBlockDomainWraning ( ) ) ; } else { setMessage ( "" ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.StorageDomain > list = ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( sender ) ) ; if ( ( ( ( list.getSelectedItem ( ) ) != null ) && ( list.getSelectedItem ( ) . getStorageType ( ) . isBlockDomain ( ) ) ) && ( containsKvmOrigin ( ) ) ) { setMessage ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExternalSourceModel.constants.kvmBlockDomainWraning ( ) ) ; } else { setMessage ( "" ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > convert ( java.lang.Object source ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = getClusterByServiceList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) , supportsVirtService , supportsGlusterService ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < > ( ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > convert ( java.lang.Object source ) { if ( source == null ) { return new java.util.ArrayList < > ( ) ; } final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; }