auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetBackingGraphicsType ( ) { org.junit.Assert.assertEquals ( makeSet ( ) , GraphicsTypes.NONE.getBackingGraphicsTypes ( ) ) ; org.junit.Assert.assertEquals ( makeSet ( GraphicsType.SPICE ) , GraphicsTypes.SPICE.getBackingGraphicsTypes ( ) ) ; org.junit.Assert.assertEquals ( makeSet ( GraphicsType.VNC ) , GraphicsTypes.VNC.getBackingGraphicsTypes ( ) ) ; org.junit.Assert.assertEquals ( makeSet ( GraphicsType.SPICE , GraphicsType.VNC ) , GraphicsTypes.SPICE_AND_VNC.getBackingGraphicsTypes ( ) ) ; }

Target:
public void testGetBackingGraphicsType ( ) { org.junit.jupiter.api.Assertions.assertEquals ( makeSet ( ) , GraphicsTypes.NONE.getBackingGraphicsTypes ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( makeSet ( GraphicsType.SPICE ) , GraphicsTypes.SPICE.getBackingGraphicsTypes ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( makeSet ( GraphicsType.VNC ) , GraphicsTypes.VNC.getBackingGraphicsTypes ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( makeSet ( GraphicsType.SPICE , GraphicsType.VNC ) , GraphicsTypes.SPICE_AND_VNC.getBackingGraphicsTypes ( ) ) ; }
Source:
private void mockExecutor ( org.ovirt.engine.core.common.businessentities.FenceAgent agent , boolean success ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ( ) ; returnValue.setSucceeded ( success ) ; returnValue.setFenceAgentUsed ( agent ) ; org.mockito.Mockito.when ( executor.fence ( org.mockito.Matchers.eq ( FenceActionType.START ) , org.mockito.Matchers.eq ( agent ) ) ) . thenReturn ( returnValue ) ; }

Target:
private void mockExecutor ( boolean success ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result ; if ( success ) { result = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.ON ) ; } else { result = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ; } org.mockito.Mockito.doReturn ( result ) . when ( executor ) . fence ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.class ) ) ; }
Source:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "3.1" ) ) ; command.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDao.get ( Guid.Empty ) ) . thenReturn ( vds ) ; }

Target:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "3.1" ) ) ; command.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.when ( vdsDao.get ( Guid.Empty ) ) . thenReturn ( vds ) ; }
Source:
protected java.util.List < Q > getBackendCollection ( org.ovirt.engine.core.common.queries.QueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , org.ovirt.engine.core.common.interfaces.SearchType searchType ) { java.util.List < Q > filteredList = getBackendCollection ( entityType , query , queryParams ) ; java.lang.String search = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , QueryHelper.CONSTRAINT_PARAMETER ) ; if ( search != null ) { java.util.List < Q > searchList = getBackendCollection ( searchType ) ; return safeIntersection ( searchList , filteredList ) ; } else { return filteredList ; } }

Target:
protected java.util.List < Q > getBackendCollection ( org.ovirt.engine.core.common.queries.QueryType query , org.ovirt.engine.core.common.queries.QueryParametersBase queryParams , org.ovirt.engine.core.common.interfaces.SearchType searchType ) { java.util.List < Q > filteredList = getBackendCollection ( entityType , query , queryParams ) ; java.lang.String search = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , QueryHelper.CONSTRAINT_PARAMETER ) ; if ( search != null ) { java.util.List < Q > searchList = getBackendCollection ( searchType ) ; return safeIntersection ( searchList , filteredList ) ; } else { return filteredList ; } }
Source:
private boolean refreshIsoDomainFileForStoragePool ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.FileTypeExtension fileTypeExt ) { boolean refreshSucceeded = false ; boolean updateFromVDSMSucceeded = true ; if ( fileTypeExt == ( org.ovirt.engine.core.common.businessentities.FileTypeExtension.ISO ) ) { updateFromVDSMSucceeded = updateIsoListFromVDSM ( storagePoolId , storageDomainId ) ; } else if ( fileTypeExt == ( org.ovirt.engine.core.common.businessentities.FileTypeExtension.Floppy ) ) { updateFromVDSMSucceeded = ( updateFloppyListFromVDSM ( storagePoolId , storageDomainId ) ) && updateFromVDSMSucceeded ; } if ( updateFromVDSMSucceeded ) { refreshSucceeded = true ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.debugFormat ( "Refresh succeeded for file type {0} at storage domain id {1} in storage pool id {2}." , fileTypeExt.name ( ) , storageDomainId , storagePoolId ) ; } return refreshSucceeded ; }

Target:
private boolean refreshIsoDomainFileForStoragePool ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.ImageType imageType ) { boolean refreshSucceeded = false ; boolean updateFromVDSMSucceeded = true ; if ( imageType == ( org.ovirt.engine.core.common.businessentities.ImageType.ISO ) ) { updateFromVDSMSucceeded = updateIsoListFromVDSM ( storagePoolId , storageDomainId ) ; } else if ( imageType == ( org.ovirt.engine.core.common.businessentities.ImageType.Floppy ) ) { updateFromVDSMSucceeded = ( updateFloppyListFromVDSM ( storagePoolId , storageDomainId ) ) && updateFromVDSMSucceeded ; } if ( updateFromVDSMSucceeded ) { refreshSucceeded = true ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.debugFormat ( "Refresh succeeded for file type {0} at storage domain id {1} in storage pool id {2}." , imageType.name ( ) , storageDomainId , storagePoolId ) ; } return refreshSucceeded ; }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.sampletimekeepingjob_3_2.SampleTimeKeepingJob.row4Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_SampleTimeKeepingJob ) { try { int length = 0 ; this . time = readString ( dis ) ; this . message = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeString ( this . var_name , dos ) ; writeString ( this . var_value , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setNetworkId ( network.getId ( ) ) ; network.getCluster ( ) . setClusterId ( cluster.getCluster ( ) . getId ( ) ) ; performAction ( VdcActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }

Target:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setNetworkId ( network.getId ( ) ) ; network.getCluster ( ) . setClusterId ( cluster.getCluster ( ) . getId ( ) ) ; performAction ( ActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }
Source:
public void invalidDefaultManagementNetworkAttachement ( ) { newDefaultManagementNetworkFound ( ) ; final org.ovirt.engine.core.common.errors.VdcBllMessages expected = org.ovirt.engine.core.common.errors.VdcBllMessages.Unassigned ; org.mockito.Mockito.when ( networkClusterValidator.managementNetworkChange ( ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( expected ) ) ; createCommandWithDefaultVdsGroup ( ) ; oldGroupIsDetachedDefault ( ) ; setupCpu ( ) ; canDoActionFailedWithReason ( expected ) ; }

Target:
public void invalidDefaultManagementNetworkAttachement ( ) { newDefaultManagementNetworkFound ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage expected = org.ovirt.engine.core.common.errors.EngineMessage.Unassigned ; org.mockito.Mockito.when ( networkClusterValidator.managementNetworkChange ( ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( expected ) ) ; createCommandWithDefaultVdsGroup ( ) ; oldGroupIsDetachedDefault ( ) ; setupCpu ( ) ; canDoActionFailedWithReason ( expected ) ; }
Source:
protected void onCommonModelChange ( ) { super . onCommonModelChange ( ) ; org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( handleItemsChangedEvent ( ) ) { updateData ( ) ; } } } ) ; }

Target:
protected void onCommonModelChange ( ) { super . onCommonModelChange ( ) ; org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( handleItemsChangedEvent ( ) ) { updateData ( ) ; } } } ) ; }
Source:
public void testQueryForStatus ( ) { getQuery ( ) . executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > expected = getMockGeoRepSessions ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > actual = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertEquals ( actual , expected ) ; }

Target:
public void testQueryForStatus ( ) { getQuery ( ) . executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > expected = getMockGeoRepSessions ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > actual = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( actual , expected ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( "IsChangable" . equals ( propName ) ) { if ( disk.getDiskStorageType ( ) . getIsChangable ( ) ) { enableWidget ( diskTypePanel ) ; } else { disableWidget ( diskTypePanel ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( "IsChangable" . equals ( propName ) ) { if ( ( disk.getDiskStorageType ( ) . getIsChangable ( ) ) && ( disk.isEditEnabled ( ) ) ) { enableWidget ( diskTypePanel ) ; } else { disableWidget ( diskTypePanel ) ; } } }
Source:
public void testCopyBySdName ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUpGetEntityExpectations ( ( "Storage: name=" + ( NAMES [ 2 ] ) ) , SearchType.StorageDomain , getStorageDomainEntity ( 0 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.MoveOrCopyDisk , org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters.class , new java.lang.String [ ] { "ImageId" , "SourceDomainId" , "StorageDomainId" , "Operation" } , new java.lang.Object [ ] { GUIDS [ 1 ] , org.ovirt.engine.core.compat.Guid.Empty , GUIDS [ 3 ] , org.ovirt.engine.core.common.businessentities.ImageOperation.Copy } ) ) ; verifyActionResponse ( resource.copy ( setUpCopyParams ( true ) ) ) ; }

Target:
public void testCopyBySdNameWithoutFilter ( ) throws java.lang.Exception { testCopyBySdName ( false ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isRunOnlyIfAllValidationPass , boolean waitForResult ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > list = new java.util.ArrayList < > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllValidationPass , waitForResult , null ) ; } }

Target:
public java.util.List < org.ovirt.engine.core.common.action.ActionReturnValue > runMultipleActions ( org.ovirt.engine.core.common.action.ActionType actionType , java.util.List < org.ovirt.engine.core.common.action.ActionParametersBase > parameters , boolean isRunOnlyIfAllValidationPass ) { return runMultipleActions ( actionType , parameters , isRunOnlyIfAllValidationPass , false ) ; }
Source:
protected void init ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setVdsGroupId ( parameters.getVdsGroupId ( ) ) ; setVm ( parameters.getVm ( ) ) ; }

Target:
protected void init ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setVdsGroupId ( parameters.getVdsGroupId ( ) ) ; setVm ( parameters.getVm ( ) ) ; initEffectiveCompatibilityVersion ( ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; }

Target:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue RunAutoQuery ( org.ovirt.engine.core.common.queries.VdcQueryType actionType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase parameters ) { return runInternalQuery ( actionType , parameters ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( parameters.getActionType ( ) , parameters ) ; command.insertAsyncTaskPlaceHolders ( ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }
Source:
public static void GetVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected boolean validateQuota ( ) { getParameters ( ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Disk dit : getVm ( ) . getDiskMap ( ) . values ( ) ) { ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( dit ) ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; } return true ; }

Target:
protected void MoveOrCopyAllImageGroups ( ) { MoveOrCopyAllImageGroups ( getVm ( ) . getId ( ) , org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , false , false ) ) ; }
Source:
private boolean isDiskLocked ( org.ovirt.engine.core.common.businessentities.Disk disk ) { return ( ( disk != null ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) ) && ( ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) ; }

Target:
private boolean isDiskLocked ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { return ( ( disk != null ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) ) && ( ( ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) . getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.LOCKED ) ) ; }
Source:
public void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > validateCustomProperties ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromParams ) { return org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.getInstance ( ) . validateVMProperties ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroupDAO ( ) . get ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getvds_group_id ( ) ) . getcompatibility_version ( ) , vmStaticFromParams ) ; }

Target:
protected void addPermissionSubjectForCustomProperties ( java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList ) { org.ovirt.engine.core.common.businessentities.VmStatic vmFromParams = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) ; if ( ( vmFromParams != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vmFromParams.getCustomProperties ( ) ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } }
Source:
private void mockVmWithDisk ( org.ovirt.engine.core.compat.Guid storageId ) { org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( storageId ) ) ) ; mockVm ( ) . getDiskMap ( ) . put ( image.getId ( ) , image ) ; }

Target:
private void mockVmWithDisk ( org.ovirt.engine.core.compat.Guid storageId ) { org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( storageId ) ) ) ; mockVm ( ) . getDiskMap ( ) . put ( image.getId ( ) , image ) ; }
Source:
public void init ( ) throws org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult { try { utilityConfiguration = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsConfiguration ( ( ( java.lang.String ) ( args.get ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_CONFIG_FILE ) ) ) . replace ( "@ENGINE_ETC@" , org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomains.ENGINE_ETC ) ) ; } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( ManageDomainsResultEnum.FAILED_READING_CONFIGURATION , e.getMessage ( ) ) ; } try { daoImpl = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsDAOImpl ( ) ; } catch ( java.sql.SQLException e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( "Please verify the following:\n1. Your database credentials are valid.\n2. The database machine is accessible.\n3. The database service is running" , ManageDomainsResultEnum.DB_EXCEPTION , e.getMessage ( ) ) ; } }

Target:
public void init ( ) throws org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult { try { utilityConfiguration = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsConfiguration ( ( ( java.lang.String ) ( args.get ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_CONFIG_FILE ) ) ) ) ; } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( ManageDomainsResultEnum.FAILED_READING_CONFIGURATION , e.getMessage ( ) ) ; } try { daoImpl = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsDAOImpl ( ) ; } catch ( java.sql.SQLException e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( "Please verify the following:\n1. Your database credentials are valid.\n2. The database machine is accessible.\n3. The database service is running" , ManageDomainsResultEnum.DB_EXCEPTION , e.getMessage ( ) ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateNetworkExclusiveOnNics ( ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypesMap = createNicNameToNetworkTypesMap ( ) ; java.util.List < java.lang.String > violatedNics = findViolatedNics ( nicNameToNetworkTypesMap ) ; if ( violatedNics.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , violatedNics ) ; } }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateNetworkExclusiveOnNics ( ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypesMap = createNicNameToNetworkTypesMap ( ) ; java.util.List < java.lang.String > violatedNics = findViolatedNics ( nicNameToNetworkTypesMap ) ; if ( violatedNics.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , violatedNics ) ; } }
Source:
private void doTestBadAddNic ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.AddVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.VM_ID } , valid , success ) ) ; org.ovirt.engine.api.model.Nic model = org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddNic ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.AddVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.VM_ID } , valid , success ) ) ; org.ovirt.engine.api.model.Nic model = org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setNetworkStaticDetailsStyle ( ( ( ( model.getNetworkBootProtocolList ( ) . getSelectedItem ( ) ) != null ) && ( ( model.getNetworkBootProtocolList ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setNetworkStaticDetailsStyle ( ( ( ( model.getIpv4BootProtocolList ( ) . getSelectedItem ( ) ) != null ) && ( ( model.getIpv4BootProtocolList ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.STATIC_IP ) ) ) ) ; }
Source:
public static void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public int compareTo ( ovirt_engine_dwh.configurationsync_3_2.ConfigurationSync.after_tJDBCInput_33Struct other ) { int returnValue = - 1 ; return returnValue ; }

Target:
public int compareTo ( ovirt_engine_dwh.configurationsync_3_2.ConfigurationSync.insert_new_dc_storage_connectionStruct other ) { int returnValue = - 1 ; returnValue = checkNullsAndCompare ( this . storage_domain_id , other.storage_domain_id ) ; if ( returnValue != 0 ) { return returnValue ; } returnValue = checkNullsAndCompare ( this . datacenter_id , other.datacenter_id ) ; if ( returnValue != 0 ) { return returnValue ; } returnValue = checkNullsAndCompare ( this . attach_date , other.attach_date ) ; if ( returnValue != 0 ) { return returnValue ; } return returnValue ; }
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmDeviceUtils ( ) . setVmDevices ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) , true ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }

Target:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmDeviceUtils ( ) . setVmDevices ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; vmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) , true ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.ArchitectureType > aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData importData = importModel.getDiskImportData ( disk.getId ( ) ) ; if ( importData == null ) { return "" ; } return new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.VolumeType > ( ) . render ( org.ovirt.engine.core.common.businessentities.VolumeType.forValue ( importData.getSelectedVolumeType ( ) . getValue ( ) ) ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.storage.DiskImage disk , java.lang.String value ) { java.lang.String storageDomainName = value.substring ( 0 , value.lastIndexOf ( " (" ) ) ; importModel.getDiskImportData ( disk.getId ( ) ) . setSelectedStorageDomainString ( storageDomainName ) ; diskTable.asEditor ( ) . edit ( importModel.getImportDiskListModel ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachmentWithIpConfiguration ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol bootProtocol , java.lang.String address , java.lang.String netmask ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryAddress = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryAddress.setAddress ( address ) ; primaryAddress.setNetmask ( netmask ) ; primaryAddress.setBootProtocol ( bootProtocol ) ; ipConfiguration.getIPv4Addresses ( ) . add ( primaryAddress ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( ipConfiguration ) ; return attachment ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachmentWithIpConfiguration ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol bootProtocol , java.lang.String address , java.lang.String netmask ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryAddress = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryAddress.setAddress ( address ) ; primaryAddress.setNetmask ( netmask ) ; primaryAddress.setBootProtocol ( bootProtocol ) ; ipConfiguration.getIPv4Addresses ( ) . add ( primaryAddress ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( ipConfiguration ) ; return attachment ; }
Source:
public void hostNameNotUsed ( ) { org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > emptyList ( ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostNameNotUsed ( ) { org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > emptyList ( ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc getStorageConnectionsList ( java.lang.String spUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getStorageConnectionsList ( spUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionResume ( java.lang.String volumeName , java.lang.String slaveHostName , java.lang.String slaveVolumeName , java.lang.String userName , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepSessionResume ( volumeName , slaveHostName , slaveVolumeName , userName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private boolean isVncSelected ( ) { boolean isVnc = false ; if ( ( getDisplayProtocol ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.DisplayType displayType = getDisplayProtocol ( ) . getSelectedItem ( ) . getEntity ( ) ; isVnc = displayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.vnc ) ; } return isVnc ; }

Target:
protected java.lang.String getIconToShow ( java.lang.String currentOsDefaultIcon ) { if ( ( getIcon ( ) . getEntity ( ) ) == null ) { return currentOsDefaultIcon ; } return getIcon ( ) . getEntity ( ) . isCustom ( ) ? getIcon ( ) . getEntity ( ) . getIcon ( ) : currentOsDefaultIcon ; }
Source:
public void testGuestFQDN ( ) { org.ovirt.engine.api.restapi.types.VM vm = new org.ovirt.engine.api.restapi.types.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setVmFQDN ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.Vm map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertNotNull ( map.getFqdn ( ) ) ; assertEquals ( "localhost.localdomain" , map.getFqdn ( ) ) ; }

Target:
public void testGuestFQDN ( ) { org.ovirt.engine.api.restapi.types.VM vm = new org.ovirt.engine.api.restapi.types.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setFqdn ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.Vm map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertNotNull ( map.getFqdn ( ) ) ; assertEquals ( "localhost.localdomain" , map.getFqdn ( ) ) ; }
Source:
protected boolean updateBrickServerName ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick , boolean addCanDoActionMessage ) { org.ovirt.engine.core.common.businessentities.VdsStatic server = getVdsStaticDao ( ) . get ( brick.getServerId ( ) ) ; if ( ( server == null ) || ( ! ( server.getvds_group_id ( ) . equals ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) ) ) ) ) { if ( addCanDoActionMessage ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INVALID_BRICK_SERVER_ID ) ; } return false ; } brick.setServerName ( server.gethost_name ( ) ) ; return true ; }

Target:
protected boolean updateBrickServerName ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick , boolean addCanDoActionMessage ) { org.ovirt.engine.core.common.businessentities.VdsStatic server = getVdsStaticDao ( ) . get ( brick.getServerId ( ) ) ; if ( ( server == null ) || ( ! ( server.getVdsGroupId ( ) . equals ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) ) ) ) ) { if ( addCanDoActionMessage ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INVALID_BRICK_SERVER_ID ) ; } return false ; } brick.setServerName ( server.getHostName ( ) ) ; return true ; }