auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > networksByName ( java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks ) { if ( ! ( networks.isEmpty ( ) ) ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > byName = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : networks ) { byName.put ( net.getname ( ) , net ) ; } return byName ; } else { return java.util.Collections.emptyMap ( ) ; } }

Target:
public static java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > networksByName ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { if ( ! ( networks.isEmpty ( ) ) ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > byName = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : networks ) { byName.put ( net.getname ( ) , net ) ; } return byName ; } else { return java.util.Collections.emptyMap ( ) ; } }
Source:
private com.google.gwt.safehtml.shared.SafeHtml getRenderedValue ( com.google.gwt.safehtml.shared.SafeHtml value ) { java.lang.String result = value.asString ( ) ; if ( ( ( maxTextLength ) > 0 ) && ( ( result.length ( ) ) > ( maxTextLength ) ) ) { result = result.substring ( 0 , java.lang.Math.max ( ( ( maxTextLength ) - ( org.ovirt.engine.ui.common.widget.table.cell.TextCell.ELLIPSE.length ( ) ) ) , 0 ) ) ; result = result + ( org.ovirt.engine.ui.common.widget.table.cell.TextCell.ELLIPSE ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( result ) ; }

Target:
private java.lang.String getRenderedValue ( java.lang.String value ) { java.lang.String result = value ; if ( ( ( maxTextLength ) > 0 ) && ( ( result.length ( ) ) > ( maxTextLength ) ) ) { result = result.substring ( 0 , java.lang.Math.max ( ( ( maxTextLength ) - ( org.ovirt.engine.ui.common.widget.table.cell.TextCell.ELLIPSE.length ( ) ) ) , 0 ) ) ; result = result + ( org.ovirt.engine.ui.common.widget.table.cell.TextCell.ELLIPSE ) ; } return result ; }
Source:
private java.util.Map < java.lang.String , java.lang.Class < ? > > addExceptions ( java.util.Map < java.lang.String , java.lang.Class < ? > > map ) { map.put ( "brick" , org.ovirt.engine.sdk.entities.GlusterBrick.class ) ; map.put ( "bricks" , org.ovirt.engine.sdk.entities.GlusterBricks.class ) ; map.put ( "hostnic" , org.ovirt.engine.sdk.entities.HostNIC.class ) ; map.put ( "hostnics" , org.ovirt.engine.sdk.entities.HostNics.class ) ; map.put ( "reporteddevice" , org.ovirt.engine.sdk.entities.Device.class ) ; return map ; }

Target:
private java.util.Map < java.lang.String , java.lang.Class < ? > > addExceptions ( java.util.Map < java.lang.String , java.lang.Class < ? > > map ) { map.put ( "brick" , org.ovirt.engine.sdk.entities.GlusterBrick.class ) ; map.put ( "bricks" , org.ovirt.engine.sdk.entities.GlusterBricks.class ) ; map.put ( "hostnic" , org.ovirt.engine.sdk.entities.HostNIC.class ) ; map.put ( "hostnics" , org.ovirt.engine.sdk.entities.HostNics.class ) ; return map ; }
Source:
protected boolean parentHasCallback ( ) { if ( ( getParameters ( ) . getParentCommand ( ) ) != ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { org.ovirt.engine.core.common.businessentities.CommandEntity commandEntity = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( getParameters ( ) . getParentParameters ( ) . getCommandId ( ) ) ; return ( commandEntity != null ) && ( commandEntity.isCallbackEnabled ( ) ) ; } return false ; }

Target:
protected boolean parentHasCallback ( ) { if ( ( ( getParameters ( ) . getParentCommand ( ) ) != ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) && ( ( getParameters ( ) . getParentParameters ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.CommandEntity commandEntity = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( getParameters ( ) . getParentParameters ( ) . getCommandId ( ) ) ; return ( commandEntity != null ) && ( commandEntity.isCallbackEnabled ( ) ) ; } return false ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name , boolean isHostedEngine ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = createDataStorageDomain ( status , name , HE_SD_ID ) ; domain.setHostedEngineStorage ( isHostedEngine ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( domain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return domain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name , boolean isHostedEngine ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = createDataStorageDomain ( status , name , HE_SD_ID ) ; domain.setHostedEngineStorage ( isHostedEngine ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( domain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return domain ; }
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.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }
Source:
private void executeFenceVdsManuallyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.pm.RestartVdsCommand.getContext ( ) ) ; }

Target:
private void executeFenceVdsManuallyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( true ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.pm.RestartVdsCommand.getContext ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName , java.lang.String snapshotName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue ; if ( snapshotName == null ) { xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( "" , volumeName ) ; } else { xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( snapshotName , volumeName ) ; } org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , volumeName , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( "" , volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , 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 canDoActionFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void canDoActionFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getRevertVDSParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( getEnclosingCommand ( ) . getParameters ( ) . getStoragePoolId ( ) . getValue ( ) , getEnclosingCommand ( ) . getParameters ( ) . getTargetStorageDomainId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . get ( getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) ) . isWipeAfterDelete ( ) , getEnclosingCommand ( ) . getParameters ( ) . getForceDelete ( ) , null ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getRevertVDSParameters ( ) { return null ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > getSortedDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskImages = new java.util.ArrayList ( vm.getDiskMap ( ) . values ( ) ) ; java.util.Collections.sort ( diskImages , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; java.util.Collections.sort ( diskImages , java.util.Collections.reverseOrder ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilderBase.DiskImageByBootAndSnapshotComparator ( ) ) ) ; return diskImages ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > getSortedDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskImages = new java.util.ArrayList ( vm.getDiskMap ( ) . values ( ) ) ; java.util.Collections.sort ( diskImages , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; java.util.Collections.sort ( diskImages , java.util.Collections.reverseOrder ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilderBase.DiskImageByBootAndSnapshotComparator ( vm.getId ( ) ) ) ) ; return diskImages ; }
Source:
private void createCommand ( ) { cmd.init ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDao ( ) ; }

Target:
private void createCommand ( ) { cmd.init ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDao ( ) ; }
Source:
private void UpdateQuotaAvailability ( ) { getQuota ( ) . setIsAvailable ( ( ( quotaEnforcementType ) != ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) ) ; if ( ( disks ) != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel : disks ) { diskModel.getQuota ( ) . setIsAvailable ( ( ( quotaEnforcementType ) != ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) ) ; } } }

Target:
private void UpdateQuotaAvailability ( ) { if ( ( disks ) != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel : disks ) { diskModel.getQuota ( ) . setIsAvailable ( ( ( quotaEnforcementType ) != ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) ) ; } } }
Source:
public void diskSnapshotsCanBePreviewed ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( activeSnapshot ) ; org.junit.Assert.assertThat ( validator.canDiskSnapshotsBePreviewed ( activeSnapshot.getId ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void diskSnapshotsCanBePreviewed ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( activeSnapshot ) ; org.junit.Assert.assertThat ( validator.canDiskSnapshotsBePreviewed ( activeSnapshot.getId ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.DataCenter deprecatedPopulate ( org.ovirt.engine.api.model.DataCenter model , org.ovirt.engine.core.common.businessentities.storage_pool entity ) { org.ovirt.engine.core.common.queries.GetAvailableStoragePoolVersionsParameters parameters = new org.ovirt.engine.core.common.queries.GetAvailableStoragePoolVersionsParameters ( ) ; parameters.setStoragePoolId ( new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) ; model.setSupportedVersions ( getMapper ( java.util.List.class , org.ovirt.engine.api.model.SupportedVersions.class ) . map ( getEntity ( java.util.ArrayList.class , VdcQueryType.GetAvailableStoragePoolVersions , parameters , model.getId ( ) ) , null ) ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.DataCenter deprecatedPopulate ( org.ovirt.engine.api.model.DataCenter model , org.ovirt.engine.core.common.businessentities.StoragePool entity ) { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) ; model.setSupportedVersions ( getMapper ( java.util.List.class , org.ovirt.engine.api.model.SupportedVersions.class ) . map ( getEntity ( java.util.ArrayList.class , VdcQueryType.GetAvailableStoragePoolVersions , parameters , model.getId ( ) ) , null ) ) ; return model ; }
Source:
private void doProviderSearch ( ) { org.ovirt.engine.ui.frontend.AsyncQuery providersQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; providersQuery.setModel ( this ) ; providersQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setProviders ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllProviders ( providersQuery ) ; }

Target:
private void doProviderSearch ( ) { org.ovirt.engine.ui.frontend.AsyncQuery providersQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; providersQuery.setModel ( this ) ; providersQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setProviders ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllProviders ( providersQuery , false ) ; }
Source:
public static java.util.Collection < java.lang.Object [ ] > data ( ) { org.ovirt.engine.core.common.queries.ConfigurationValues [ ] allValues = org.ovirt.engine.core.common.queries.ConfigurationValues.values ( ) ; int numValues = allValues.length ; java.lang.Object [ ] [ ] params = new java.lang.Object [ numValues ] [ 1 ] ; for ( int i = 0 ; i < numValues ; ++ i ) { params [ i ] [ 0 ] = allValues [ i ] ; } return java.util.Arrays.asList ( params ) ; }

Target:
public static java.lang.Object [ ] data ( ) { return org.ovirt.engine.core.common.queries.ConfigurationValues.values ( ) ; }
Source:
public boolean validate ( ) { int nameLength = ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isWindowsOsType ( vm.getOs ( ) ) ) ? org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxVmNameLengthWin ( ) : org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxVmNameLengthNonWin ( ) ; getCloneName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( nameLength ) , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) } ) ; return getCloneName ( ) . getIsValid ( ) ; }

Target:
public boolean validate ( ) { int nameLength = ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isWindowsOsType ( vm.getOs ( ) ) ) ? org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmNameLengthWin ( ) : org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmNameLengthNonWin ( ) ; getCloneName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( nameLength ) , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) } ) ; return getCloneName ( ) . getIsValid ( ) ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model1 ) ) ; searchableListModel.setItems ( disks ) ; }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; setItems ( disks ) ; }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public 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:
private static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.< java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > > get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { if ( ! ( accumulator.containsKey ( group.< java.lang.String > get ( GroupRecord.ID ) ) ) ) { accumulator.put ( group.get ( GroupRecord.ID ) , group ) ; org.ovirt.engine.core.bll.aaa.DirectoryUtils.flatGroups ( group , GroupRecord.GROUPS , accumulator ) ; } } }

Target:
private void flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.< java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > > get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { if ( ! ( accumulator.containsKey ( group.< java.lang.String > get ( GroupRecord.ID ) ) ) ) { accumulator.put ( group.get ( GroupRecord.ID ) , group ) ; flatGroups ( group , GroupRecord.GROUPS , accumulator ) ; } } }
Source:
protected java.lang.Object runPublicQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( queryType , queryParams ) ; return result.getSucceeded ( ) ? result.getReturnValue ( ) : null ; }

Target:
protected java.lang.Object runPublicQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( queryType , queryParams ) ; return ( result != null ) && ( result.getSucceeded ( ) ) ? result.getReturnValue ( ) : null ; }
Source:
private boolean commitNewMac ( java.lang.String mac ) { availableMacs.remove ( mac ) ; addMacToMap ( allocatedMacs , mac ) ; if ( availableMacs.isEmpty ( ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.MAC_POOL_EMPTY ) ; return false ; } return true ; }

Target:
private boolean commitNewMac ( java.lang.String mac ) { availableMacs.remove ( mac ) ; allocatedMacs.put ( mac , 1 ) ; if ( availableMacs.isEmpty ( ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.MAC_POOL_EMPTY ) ; return false ; } return true ; }
Source:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.warnFormat ( logMessage ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( mCurrentVdsId ) ; logable.setStorageDomainId ( masterDomainId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.SYSTEM_MASTER_DOMAIN_NOT_IN_SYNC ) ; return org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . masterDomainNotOperational ( masterDomainId , storagePoolId ) ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.warnFormat ( logMessage ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( mCurrentVdsId ) ; logable.setStorageDomainId ( masterDomainId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.SYSTEM_MASTER_DOMAIN_NOT_IN_SYNC ) ; return org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . masterDomainNotOperational ( masterDomainId , storagePoolId , false ) ; }
Source:
public void initBalloonSupportMap ( ) { 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 ) { balloonSupportMap = ( ( java.util.Map < java.lang.Integer , java.util.Map < org.ovirt.engine.core.compat.Version , java.lang.Boolean > > ) ( ( ( 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.GetBalloonSupportMap ) , callback ) ; }

Target:
public void initBalloonSupportMap ( ) { 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 ) { balloonSupportMap = ( ( 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.GetBalloonSupportMap ) , callback ) ; }
Source:
public static boolean isTaskOfType ( org.ovirt.engine.core.common.businessentities.gluster.GlusterTaskSupport supportObj , org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType type ) { if ( ( ( supportObj.getAsyncTask ( ) ) != null ) && ( ( supportObj.getAsyncTask ( ) . getType ( ) ) == type ) ) { return true ; } return false ; }

Target:
public boolean isTaskOfType ( org.ovirt.engine.core.common.businessentities.gluster.GlusterTaskSupport supportObj , org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType type ) { if ( ( ( supportObj.getAsyncTask ( ) ) != null ) && ( ( supportObj.getAsyncTask ( ) . getType ( ) ) == type ) ) { return true ; } return false ; }
Source:
public java.lang.Boolean getValue ( org.ovirt.engine.core.common.businessentities.QuotaStorage object ) { if ( ( selectedStorageGuid.contains ( object.getStorageId ( ) ) ) || ( ( object.getStorageSizeGB ( ) ) != null ) ) { return true ; } return false ; }

Target:
public java.lang.Boolean getValue ( org.ovirt.engine.core.common.businessentities.QuotaStorage object ) { if ( ( selectedStorageGuid.contains ( object.getStorageId ( ) ) ) || ( ( object.getStorageSizeGB ( ) ) != null ) ) { if ( ! ( selectedStorageGuid.contains ( object.getStorageId ( ) ) ) ) { selectedStorageGuid.add ( object.getStorageId ( ) ) ; } return true ; } return false ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveUser , org.ovirt.engine.core.common.action.AdElementParametersBase.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveUser , org.ovirt.engine.core.common.action.AdElementParametersBase.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public org.ovirt.engine.api.model.Networks list ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities = getBackendCollection ( VdcQueryType.GetNetworksByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ) ; org.ovirt.engine.api.model.Networks networks = mapCollection ( entities ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }

Target:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks = mapCollection ( getNetworks ( ) ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails details = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ) ( result ) ) ; if ( ( details.getServiceInfo ( ) ) != null ) { setActualServiceList ( details.getServiceInfo ( ) ) ; } else { setActualServiceList ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ) ; } filterServices ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails details ) { if ( ( details.getServiceInfo ( ) ) != null ) { setActualServiceList ( details.getServiceInfo ( ) ) ; } else { setActualServiceList ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ) ; } filterServices ( ) ; }
Source:
private static void addAddress ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.util.Map < java.lang.String , java.lang.String > addressMap = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( vmDevice.getAddress ( ) ) ; if ( ( addressMap.size ( ) ) > 0 ) { struct.put ( VdsProperties.Address , addressMap ) ; } }

Target:
private static void addAddress ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.util.Map < java.lang.String , java.lang.String > addressMap = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( vmDevice.getAddress ( ) ) ; if ( ! ( addressMap.isEmpty ( ) ) ) { struct.put ( VdsProperties.Address , addressMap ) ; } }
Source:
public void validateFailsOnServerNotUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RemoveGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForRemove ( true , getHookEntity ( ) , VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP.toString ( ) ) ) ; }

Target:
public void validateFailsOnServerNotUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RemoveGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; setUpMocksForRemove ( true , getHookEntity ( ) , VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP.toString ( ) ) ) ; }
Source:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( getGlusterVolume ( ) . getVolumeType ( ) . isDispersedType ( ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_REMOVE_BRICK_FROM_DISPERSE_VOLUME_NOT_SUPPORTED ) ; } org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator brickValidator = new org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator ( ) ; return validate ( brickValidator.canRemoveBrick ( getParameters ( ) . getBricks ( ) , getGlusterVolume ( ) , getParameters ( ) . getReplicaCount ( ) , true ) ) ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( getGlusterVolume ( ) . getVolumeType ( ) . isDispersedType ( ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_REMOVE_BRICK_FROM_DISPERSE_VOLUME_NOT_SUPPORTED ) ; } return validate ( brickValidator.canRemoveBrick ( getParameters ( ) . getBricks ( ) , getGlusterVolume ( ) , getParameters ( ) . getReplicaCount ( ) , true ) ) ; }
Source:
public org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }

Target:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }
Source:
public boolean hasTaskCompleted ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask task ) { if ( ( ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.ABORTED ) == ( task.getStatus ( ) ) ) || ( ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.FINISHED ) == ( task.getStatus ( ) ) ) && ( ( task.getType ( ) ) != ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType.REMOVE_BRICK ) ) ) ) || ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.FAILED ) == ( task.getStatus ( ) ) ) ) { return true ; } return false ; }

Target:
public boolean hasTaskCompleted ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask task ) { return ( ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.ABORTED ) == ( task.getStatus ( ) ) ) || ( ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.FINISHED ) == ( task.getStatus ( ) ) ) && ( ( task.getType ( ) ) != ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType.REMOVE_BRICK ) ) ) ) || ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.FAILED ) == ( task.getStatus ( ) ) ) ; }
Source:
public static void getMaxNumOfVmSockets ( 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.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getMaxNumOfVmSockets ( 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.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 , 0 ) ) ; prepareMocks ( cmd ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . startSubStep ( ) ; org.mockito.Mockito.verify ( cmd ) . handleTaskReturn ( asyncTaskToBeReturned ) ; org.mockito.Mockito.verify ( cmd ) . updateBricksWithTaskID ( asyncTaskToBeReturned ) ; org.junit.Assert.assertEquals ( AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 ) ) ; prepareMocks ( cmd ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . startSubStep ( ) ; org.mockito.Mockito.verify ( cmd ) . handleTaskReturn ( asyncTaskToBeReturned ) ; org.mockito.Mockito.verify ( cmd ) . updateBricksWithTaskID ( asyncTaskToBeReturned ) ; org.junit.Assert.assertEquals ( AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void testDiscoverGeoRepDataWhenNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( true , 0 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . save ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }

Target:
public void testDiscoverGeoRepDataWhenNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( 0 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . save ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }
Source:
public void validateSpaceAndThreshold ( ) { org.junit.Assert.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void validateSpaceAndThreshold ( ) { org.junit.Assert.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Role > getAll ( ) { java.lang.Integer appMode = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ApplicationMode ) ; org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetAllFromRole" , org.ovirt.engine.core.dao.RoleDAODbFacadeImpl.RolesRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Role > getAll ( ) { java.lang.Integer appMode = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ApplicationMode ) ; org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetAllFromRole" , org.ovirt.engine.core.dao.RoleDAODbFacadeImpl.RolesRowMapper.instance , parameterSource ) ; }
Source:
public void testDoChangeWhenMacPoolsChanged ( ) throws java.lang.Exception { java.lang.String macToMigrate = "mac" ; org.ovirt.engine.core.common.businessentities.Cluster oldCluster = createCluster ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newCluster = createCluster ( ) ; initForMovingMacsBetweenClusters ( oldCluster , newCluster , macToMigrate ) ; underTest.moveMacsToAnotherMacPoolIfNeeded ( ) ; org.mockito.Mockito.verify ( moveMacs ) . migrateMacsToAnotherMacPool ( oldCluster.getMacPoolId ( ) , newCluster.getMacPoolId ( ) , java.util.Collections.singletonList ( macToMigrate ) , true , underTest.getContext ( ) ) ; }

Target:
public void testDoChangeWhenMacPoolsChanged ( ) throws java.lang.Exception { java.lang.String macToMigrate = "mac" ; org.ovirt.engine.core.common.businessentities.Cluster oldCluster = createCluster ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newCluster = createCluster ( ) ; initForMovingMacsBetweenClusters ( oldCluster , newCluster , macToMigrate ) ; underTest.moveMacsToAnotherMacPoolIfNeeded ( ) ; org.mockito.Mockito.verify ( moveMacs ) . migrateMacsToAnotherMacPool ( oldCluster.getMacPoolId ( ) , newCluster.getMacPoolId ( ) , java.util.Collections.singletonList ( macToMigrate ) , underTest.getContext ( ) ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

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