auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCompleteWhenUnsetIdAndName ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter.NicNameAndNicIdAccessors withoutNameOrIdSet = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter.NicNameAndNicIdAccessors.class ) ; completer.complete ( withoutNameOrIdSet ) ; org.mockito.Mockito.verify ( withoutNameOrIdSet , org.mockito.Mockito.never ( ) ) . setName ( org.mockito.ArgumentMatchers.anyString ( ) ) ; org.mockito.Mockito.verify ( withoutNameOrIdSet , org.mockito.Mockito.never ( ) ) . setId ( org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void testCompleteWhenUnsetIdAndName ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter.NicNameAndNicIdAccessors withoutNameOrIdSet = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter.NicNameAndNicIdAccessors.class ) ; completer.complete ( withoutNameOrIdSet ) ; org.mockito.Mockito.verify ( withoutNameOrIdSet , org.mockito.Mockito.never ( ) ) . setName ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( withoutNameOrIdSet , org.mockito.Mockito.never ( ) ) . setId ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected void completeImageData ( org.ovirt.engine.core.common.businessentities.DiskImage fromIRS ) { getDestinationDiskImage ( ) . setCreationDate ( fromIRS.getCreationDate ( ) ) ; getDestinationDiskImage ( ) . setLastModifiedDate ( fromIRS.getLastModifiedDate ( ) ) ; getDestinationDiskImage ( ) . setLastModified ( getDestinationDiskImage ( ) . getLastModifiedDate ( ) ) ; org.ovirt.engine.core.common.businessentities.DiskImageDynamic destinationDiskDynamic = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDynamicDAO ( ) . get ( getDestinationDiskImage ( ) . getImageId ( ) ) ; if ( destinationDiskDynamic != null ) { destinationDiskDynamic.setactual_size ( fromIRS.getActualSizeFromDiskImage ( ) ) ; org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDynamicDAO ( ) . update ( destinationDiskDynamic ) ; } }

Target:
protected void completeImageData ( org.ovirt.engine.core.common.businessentities.DiskImage fromIRS ) { getDestinationDiskImage ( ) . setCreationDate ( fromIRS.getCreationDate ( ) ) ; getDestinationDiskImage ( ) . setLastModifiedDate ( fromIRS.getLastModifiedDate ( ) ) ; getDestinationDiskImage ( ) . setLastModified ( getDestinationDiskImage ( ) . getLastModifiedDate ( ) ) ; org.ovirt.engine.core.common.businessentities.DiskImageDynamic destinationDiskDynamic = getDiskImageDynamicDAO ( ) . get ( getDestinationDiskImage ( ) . getImageId ( ) ) ; if ( destinationDiskDynamic != null ) { destinationDiskDynamic.setactual_size ( fromIRS.getActualSizeFromDiskImage ( ) ) ; getDiskImageDynamicDAO ( ) . update ( destinationDiskDynamic ) ; } }
Source:
private int getResourceType ( org.ovirt.engine.core.compat.backendcompat.XmlNode node , org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.lang.String resource ) { if ( ( ( node.SelectSingleNode ( resource , _xmlNS ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.SelectSingleNode ( resource , _xmlNS ) . InnerText ) ) ) ) { return java.lang.Integer.valueOf ( node.SelectSingleNode ( resource , _xmlNS ) . InnerText ) ; } return - 1 ; }

Target:
private int getResourceType ( org.ovirt.engine.core.compat.backendcompat.XmlNode node , java.lang.String resource ) { if ( ( ( node.SelectSingleNode ( resource , _xmlNS ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.SelectSingleNode ( resource , _xmlNS ) . InnerText ) ) ) ) { return java.lang.Integer.valueOf ( node.SelectSingleNode ( resource , _xmlNS ) . InnerText ) ; } return - 1 ; }
Source:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = getStorageDomain ( ) . getSelectedItem ( ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; updateWipeAfterDelete ( selectedStorage.getStorageType ( ) ) ; } updateQuota ( getDataCenter ( ) . getSelectedItem ( ) ) ; }

Target:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = getStorageDomain ( ) . getSelectedItem ( ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; } updateQuota ( getDataCenter ( ) . getSelectedItem ( ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , setUpFiles ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , setUpFiles ( ) , failure ) ; }
Source:
public void nameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }

Target:
public void nameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }
Source:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaCluster ( getClusterGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; control.replay ( ) ; org.ovirt.engine.api.model.QuotaClusterLimits clusterLimits = collection.list ( ) ; assertClusterLimitsFound ( clusterLimits , 1 ) ; org.ovirt.engine.api.model.QuotaClusterLimit clusterLimit = clusterLimits.getQuotaClusterLimits ( ) . get ( 0 ) ; assertEquals ( 20 , clusterLimit.getVcpuLimit ( ) . intValue ( ) ) ; }

Target:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaCluster ( getClusterGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; org.ovirt.engine.api.model.QuotaClusterLimits clusterLimits = collection.list ( ) ; assertClusterLimitsFound ( clusterLimits , 1 ) ; org.ovirt.engine.api.model.QuotaClusterLimit clusterLimit = clusterLimits.getQuotaClusterLimits ( ) . get ( 0 ) ; assertEquals ( 20 , clusterLimit.getVcpuLimit ( ) . intValue ( ) ) ; }
Source:
public static < P extends org.ovirt.engine.core.common.action.VdcActionParametersBase > boolean hasConstructor ( org.ovirt.engine.core.common.action.VdcActionType action , P parameters , org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { return ( org.ovirt.engine.core.utils.ReflectionUtils.findConstructor ( org.ovirt.engine.core.bll.CommandsFactory.getCommandClass ( action.name ( ) ) , parameters.getClass ( ) , cmdContext.getClass ( ) ) ) != null ; }

Target:
private static < P extends org.ovirt.engine.core.common.action.VdcActionParametersBase > boolean hasConstructor ( org.ovirt.engine.core.common.action.VdcActionType action , P parameters , org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { return ( org.ovirt.engine.core.utils.ReflectionUtils.findConstructor ( org.ovirt.engine.core.bll.CommandsFactory.getCommandClass ( action.name ( ) ) , parameters.getClass ( ) , cmdContext.getClass ( ) ) ) != null ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CancelMigrate , new org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getRunOnVds ( ) . getValue ( ) , org.ovirt.engine.core.bll.CancelMigrateVmCommand.getParameters ( ) . getVmId ( ) ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CancelMigrate , new org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getRunOnVds ( ) , org.ovirt.engine.core.bll.CancelMigrateVmCommand.getParameters ( ) . getVmId ( ) ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }
Source:
private static void failureEventHandler ( java.lang.Throwable caught ) { java.lang.String errorMessage ; if ( caught instanceof com.google.gwt.user.client.rpc.StatusCodeException ) { errorMessage = ( ( org.ovirt.engine.ui.frontend.Frontend.getConstants ( ) . requestToServerFailedWithCode ( ) ) + ": " ) + ( ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( caught ) ) . getStatusCode ( ) ) ; } else { errorMessage = ( ( org.ovirt.engine.ui.frontend.Frontend.getConstants ( ) . requestToServerFailed ( ) ) + ": " ) + ( caught.getLocalizedMessage ( ) ) ; } org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( errorMessage ) ; }

Target:
private void failureEventHandler ( final java.lang.Throwable caught ) { java.lang.String errorMessage ; if ( caught instanceof com.google.gwt.user.client.rpc.StatusCodeException ) { errorMessage = ( ( getConstants ( ) . requestToServerFailedWithCode ( ) ) + ": " ) + ( ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( caught ) ) . getStatusCode ( ) ) ; } else { errorMessage = ( ( getConstants ( ) . requestToServerFailed ( ) ) + ": " ) + ( caught.getLocalizedMessage ( ) ) ; } failureEventHandler ( errorMessage ) ; }
Source:
private void initiateResumeUpload ( ) { startProgress ( null ) ; setProgressStr ( "Resuming upload" ) ; final org.ovirt.engine.core.common.action.TransferImageStatusParameters parameters = new org.ovirt.engine.core.common.action.TransferImageStatusParameters ( ) ; parameters.setDiskId ( getDiskModel ( ) . getDisk ( ) . getId ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.TransferImageStatus , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { initiateResumeUploadCheckStatus ( result ) ; } } , this ) ; }

Target:
private void initiateResumeUpload ( ) { startProgress ( null ) ; final org.ovirt.engine.core.common.action.TransferImageStatusParameters parameters = new org.ovirt.engine.core.common.action.TransferImageStatusParameters ( ) ; parameters.setDiskId ( getDiskModel ( ) . getDisk ( ) . getId ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.TransferImageStatus , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { initiateResumeUploadCheckStatus ( result ) ; } } , this ) ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageByImageId ( parameters.getImageId ( ) ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCurrentUser ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageByImageId ( parameters.getImageId ( ) ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCurrentUser ( ) ) ) ; }
Source:
private void newVm ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) != null ) { return ; } java.util.List < org.ovirt.engine.ui.uicommonweb.UICommand > commands = new java.util.ArrayList < > ( ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( "OnSave" , this ) ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , this ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ( ) , this ) ; setupNewVmModel ( model , VmType.Server , getSystemTreeSelectedItem ( ) , commands ) ; model.initForemanProviders ( null ) ; }

Target:
private void newVm ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) != null ) { return ; } java.util.List < org.ovirt.engine.ui.uicommonweb.UICommand > commands = new java.util.ArrayList < > ( ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( "OnSave" , this ) ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , this ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ( ) , this ) ; setupNewVmModel ( model , VmType.Server , getSystemTreeSelectedItem ( ) , commands ) ; }
Source:
private void mockStoragePoolDao ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { org.ovirt.engine.core.dao.StoragePoolDao storagePoolDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDaoMock ) ; org.mockito.Mockito.when ( storagePoolDaoMock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; }

Target:
private void mockStoragePoolDao ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { org.mockito.Mockito.when ( storagePoolDaoMock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; }
Source:
private void bindConsoles ( ) { bind ( org.ovirt.engine.ui.uicommonweb.models.vms.INoVnc.class ) . to ( org.ovirt.engine.ui.common.uicommon.NoVncImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IVncNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.VncNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpiceHtml5.class ) . to ( org.ovirt.engine.ui.common.uicommon.SpiceHtml5Impl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpiceNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.SpiceNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpicePlugin.class ) . to ( org.ovirt.engine.ui.common.uicommon.SpicePluginImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IRdpNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.RdpNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IRdpPlugin.class ) . to ( org.ovirt.engine.ui.common.uicommon.RdpPluginImpl.class ) ; }

Target:
private void bindConsoles ( ) { bind ( org.ovirt.engine.ui.uicommonweb.models.vms.INoVnc.class ) . to ( org.ovirt.engine.ui.common.uicommon.NoVncImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IVncNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.VncNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpiceHtml5.class ) . to ( org.ovirt.engine.ui.common.uicommon.SpiceHtml5Impl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpiceNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.SpiceNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IRdpNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.RdpNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IRdpPlugin.class ) . to ( org.ovirt.engine.ui.common.uicommon.RdpPluginImpl.class ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "Message" . equals ( propertyName ) ) { getView ( ) . setMessageLabel ( model.getMessage ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "Message" . equals ( propertyName ) ) { getView ( ) . setMessageLabel ( model.getMessage ( ) ) ; } }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult Validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = super . Validate ( value ) ; if ( ! ( result.getSuccess ( ) ) ) { result.getReasons ( ) . add ( getSuffixCauseToClonedNameCollisionMessage ( ( ( java.lang.String ) ( value ) ) ) ) ; } return result ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = super . validate ( value ) ; if ( ! ( result.getSuccess ( ) ) ) { result.getReasons ( ) . add ( getSuffixCauseToClonedNameCollisionMessage ( ( ( java.lang.String ) ( value ) ) ) ) ; } return result ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { org.ovirt.engine.core.common.businessentities.VM vm = queryReturnValue.getReturnValue ( ) ; updateVms ( java.util.Collections.singletonList ( vm ) ) ; } else { setError ( messages.failedToLoadOva ( getOvaPath ( ) . getEntity ( ) ) ) ; } stopProgress ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { if ( returnValue.getSucceeded ( ) ) { org.ovirt.engine.core.common.businessentities.VM vm = returnValue.getReturnValue ( ) ; updateVms ( java.util.Collections.singletonList ( vm ) ) ; } else { setError ( messages.failedToLoadOva ( getOvaPath ( ) . getEntity ( ) ) ) ; } stopProgress ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.filterNetworkProviders ( ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; }
Source:
protected void initialize ( com.google.gwt.user.client.ui.UIObject decoratedWidget , com.google.gwt.user.client.ui.Image attachedSeparatedImage , org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.BaseStyle style ) { this . decoratedWidget = decoratedWidget ; this . attachedSeparatedImage = attachedSeparatedImage ; this . tooltip.setWidget ( attachedSeparatedImage ) ; this . tooltip.reconfigure ( ) ; this . style = style ; setAttached ( true ) ; setDetachableIconVisible ( false ) ; }

Target:
protected void initialize ( com.google.gwt.user.client.ui.UIObject decoratedWidget , com.google.gwt.user.client.ui.Image attachedSeparatedImage , org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.BaseStyle style ) { this . decoratedWidget = decoratedWidget ; this . attachedSeparatedImage = attachedSeparatedImage ; this . tooltip.setWidget ( attachedSeparatedImage ) ; this . style = style ; setAttached ( true ) ; setDetachableIconVisible ( false ) ; }
Source:
private void removeDiskImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , true , false ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { image.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.RemoveVmFromImportExportCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) ; image.setStoragePoolId ( org.ovirt.engine.core.bll.RemoveVmFromImportExportCommand.getParameters ( ) . getStoragePoolId ( ) ) ; } removeVmImages ( images ) ; }

Target:
private void removeDiskImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , true , false ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { image.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( getParameters ( ) . getStorageDomainId ( ) ) ) ) ; image.setStoragePoolId ( getParameters ( ) . getStoragePoolId ( ) ) ; } removeVmImages ( images ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterVolume model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTE.name ( ) . toLowerCase ( ) , model.getVolumeType ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterVolume model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTE , model.getVolumeType ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
void addReportedDevices ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { java.util.List < org.ovirt.engine.api.model.ReportedDevice > devices = getDevices ( entity.getVmId ( ) . getValue ( ) , entity.getMacAddress ( ) ) ; if ( ! ( devices.isEmpty ( ) ) ) { org.ovirt.engine.api.model.ReportedDevices reportedDevices = new org.ovirt.engine.api.model.ReportedDevices ( ) ; reportedDevices.getReportedDevices ( ) . addAll ( devices ) ; model.setReportedDevices ( reportedDevices ) ; } }

Target:
void addReportedDevices ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { java.util.List < org.ovirt.engine.api.model.ReportedDevice > devices = getDevices ( entity.getVmId ( ) , entity.getMacAddress ( ) ) ; if ( ! ( devices.isEmpty ( ) ) ) { org.ovirt.engine.api.model.ReportedDevices reportedDevices = new org.ovirt.engine.api.model.ReportedDevices ( ) ; reportedDevices.getReportedDevices ( ) . addAll ( devices ) ; model.setReportedDevices ( reportedDevices ) ; } }
Source:
public void attestationServerNotConfiguredProperly ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , StringUtils.EMPTY ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( clusterDao , dataCenterDao , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_CANNOT_SET_TRUSTED_ATTESTATION_SERVER_NOT_CONFIGURED ) ) ; }

Target:
public void attestationServerNotConfiguredProperly ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , StringUtils.EMPTY ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_CANNOT_SET_TRUSTED_ATTESTATION_SERVER_NOT_CONFIGURED ) ) ; }
Source:
protected org.ovirt.engine.api.model.StorageDomain deprecatedPopulate ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.api.model.StorageDomain entity ) { if ( StorageDomainSharedStatus.Unattached.equals ( entity.getStorageDomainSharedStatus ( ) ) ) { model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( StorageDomainStatus.UNATTACHED ) ) ; } else { model.setStatus ( null ) ; } return super . deprecatedPopulate ( model , entity ) ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain deprecatedPopulate ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.api.model.StorageDomain entity ) { if ( StorageDomainSharedStatus.Unattached.equals ( entity.getStorageDomainSharedStatus ( ) ) ) { model.setStatus ( StorageDomainStatus.UNATTACHED ) ; } else { model.setStatus ( null ) ; } return super . deprecatedPopulate ( model , entity ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel object ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.GlusterStorageView.Driver.driver.edit ( object ) ; pathExampleLabel.setVisible ( ( ( object.getPath ( ) . getIsAvailable ( ) ) && ( object.getPath ( ) . getIsChangable ( ) ) ) ) ; StyleTextBoxEditor ( pathEditor , object.getPath ( ) ) ; StyleTextBoxEditor ( vfsTypeEditor , object.getVfsType ( ) ) ; StyleTextBoxEditor ( mountOptionsEditor , object.getMountOptions ( ) ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel object ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.GlusterStorageView.Driver.driver.edit ( object ) ; pathExampleLabel.setVisible ( ( ( object.getPath ( ) . getIsAvailable ( ) ) && ( object.getPath ( ) . getIsChangable ( ) ) ) ) ; }
Source:
public void shouldHaveNotingToMigrate ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.never ( ) ) . migrateVM ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void shouldHaveNotingToMigrate ( ) { org.mockito.Mockito.verify ( arem , org.mockito.Mockito.never ( ) ) . migrateVM ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters params = new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( ) ; params.setFilterOutExistingHosts ( filterOutExistingHosts ) ; params.setProviderId ( providerId ) ; params.setSearchFilter ( searchFilter ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , params , aQuery ) ; }

Target:
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 > ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object loadedCluster ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster newItem = new org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( loadedDataCenter ) ) , ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( loadedCluster ) ) ) ; unitModel.getDataCenterWithClustersList ( ) . setItems ( java.util.Arrays.asList ( newItem ) ) ; unitModel.getDataCenterWithClustersList ( ) . setSelectedItem ( newItem ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.Cluster loadedCluster ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster newItem = new org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ( loadedDataCenter , loadedCluster ) ; unitModel.getDataCenterWithClustersList ( ) . setItems ( java.util.Arrays.asList ( newItem ) ) ; unitModel.getDataCenterWithClustersList ( ) . setSelectedItem ( newItem ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( created ) == null ? 0 : created.hashCode ( ) ) ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( created ) == null ? 0 : created.hashCode ( ) ) ; return result ; }
Source:
private void fillVolumeInformation ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage ancestor = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImageDao ( ) . getAncestor ( org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; if ( ancestor == null ) { log.warn ( "Can't find ancestor of Disk with ID '{}', using original disk for volume info." , org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; ancestor = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) ; } disk.setvolumeFormat ( ancestor.getVolumeFormat ( ) ) ; disk.setVolumeType ( ancestor.getVolumeType ( ) ) ; }

Target:
private void fillVolumeInformation ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage ancestor = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImageDao ( ) . getAncestor ( org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; disk.setvolumeFormat ( ancestor.getVolumeFormat ( ) ) ; disk.setVolumeType ( ancestor.getVolumeType ( ) ) ; }
Source:
private void afterUpdate ( ) { boolean newSizeUnderCurrentConsumption = org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . isStorageQuotaExceeded ( getQuota ( ) . getId ( ) ) ; if ( newSizeUnderCurrentConsumption ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.AddCustomValue ( "QuotaName" , getQuotaName ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.QUOTA_STORAGE_RESIZE_LOWER_THEN_CONSUMPTION ) ; } }

Target:
protected void afterUpdate ( ) { boolean newSizeUnderCurrentConsumption = org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . isStorageQuotaExceeded ( getQuota ( ) . getId ( ) ) ; if ( newSizeUnderCurrentConsumption ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.AddCustomValue ( "QuotaName" , getQuotaName ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.QUOTA_STORAGE_RESIZE_LOWER_THEN_CONSUMPTION ) ; } }
Source:
public static void initDiskHotpluggableInterfacesMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.diskHotpluggableInterfacesMap = ( ( java.util.Map < org.ovirt.engine.core.common.utils.Pair < java.lang.Integer , org.ovirt.engine.core.compat.Version > , java.util.Set < java.lang.String > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDiskHotpluggableInterfacesMap ) , callback ) ; }

Target:
public static void initDiskHotpluggableInterfacesMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.diskHotpluggableInterfacesMap = ( ( java.util.Map < org.ovirt.engine.core.common.utils.Pair < java.lang.Integer , org.ovirt.engine.core.compat.Version > , java.util.Set < java.lang.String > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDiskHotpluggableInterfacesMap ) , callback ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE_FAILED ) ; }
Source:
public void canDoActionFailedVMHasNotDisk ( ) throws java.lang.Exception { initializeCommand ( ) ; mockVmStatusUp ( ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.powermock.api.mockito.PowerMockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionFailedVMHasNotDisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }
Source:
public static void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }

Target:
public void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; localModel.stopProgress ( ) ; setConfirmWindow ( null ) ; showRebalanceStatus ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; localModel.stopProgress ( ) ; setConfirmWindow ( null ) ; if ( result.getReturnValue ( ) . getSucceeded ( ) ) { showRebalanceStatus ( ) ; } }
Source:
public void syncWithBackend ( ) { super . syncWithBackend ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { onGetClusterList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( ReturnValue ) ) ) ; } } ) , getSelectedDc ( ) . getId ( ) ) ; }

Target:
public void syncWithBackend ( ) { super . syncWithBackend ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { onGetClusterList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( ReturnValue ) ) ) ; } } ) , getSelectedDc ( ) . getId ( ) ) ; }
Source:
protected boolean performImagesChecks ( org.ovirt.engine.core.common.businessentities.VM vm ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( vm , org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , vm.getStoragePoolId ( ) , getStorageDomainId ( ) . getValue ( ) , false , true , false , false , true , false , true , java.util.Collections.< org.ovirt.engine.core.common.businessentities.Disk > emptyList ( ) ) ; }

Target:
protected boolean performImagesChecks ( org.ovirt.engine.core.common.businessentities.VM vm ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( vm , org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , vm.getStoragePoolId ( ) , getStorageDomainId ( ) . getValue ( ) , false , true , false , false , false , false , true , java.util.Collections.< org.ovirt.engine.core.common.businessentities.Disk > emptyList ( ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( map , map.getstatus ( ) ) ; map.setstatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; if ( ( getStorageDomain ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { calcStoragePoolStatusByDomainsStatus ( ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { map.setstatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; if ( ( getStorageDomain ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { calcStoragePoolStatusByDomainsStatus ( ) ; } return null ; }
Source:
private void performStoragePoolInitOps ( org.ovirt.engine.core.common.businessentities.storage_pool pool ) { executedUpdatedMetadataForStoragePool.put ( pool.getId ( ) , new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > > ( ) ) ; executedRemovedIds.put ( pool.getId ( ) , new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ) ; executedUpdatedOvfGenerationIdsInDb.put ( pool.getId ( ) , new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.lang.Long > ( ) ) ; }

Target:
private void performStoragePoolInitOps ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { executedUpdatedMetadataForStoragePool.put ( pool.getId ( ) , new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > > ( ) ) ; executedRemovedIds.put ( pool.getId ( ) , new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ) ; executedUpdatedOvfGenerationIdsInDb.put ( pool.getId ( ) , new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.lang.Long > ( ) ) ; }
Source:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }