auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > paramT1 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > paramT2 ) { int compareValue = paramT1.getSecond ( ) . getVdsGroupName ( ) . compareTo ( paramT2.getSecond ( ) . getVdsGroupName ( ) ) ; if ( compareValue != 0 ) { return compareValue ; } return paramT1.getSecond ( ) . getName ( ) . compareTo ( paramT2.getSecond ( ) . getName ( ) ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > paramT1 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > paramT2 ) { int compareValue = paramT1.getSecond ( ) . getClusterName ( ) . compareTo ( paramT2.getSecond ( ) . getClusterName ( ) ) ; if ( compareValue != 0 ) { return compareValue ; } return paramT1.getSecond ( ) . getName ( ) . compareTo ( paramT2.getSecond ( ) . getName ( ) ) ; }
Source:
protected boolean validateVdsCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; return vdsGroup == null ? failCanDoAction ( EngineMessage.VDS_CLUSTER_IS_NOT_VALID ) : ( vdsGroup.getArchitecture ( ) ) != ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getClusterArch ( ) ) ? failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_IMPORT_VM_ARCHITECTURE_NOT_SUPPORTED_BY_CLUSTER ) : true ; }

Target:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = org.ovirt.engine.core.bll.ImportVmCommandBase.getVmStaticDao ( ) . get ( getVm ( ) . getId ( ) ) ; return duplicateVm == null ? true : failValidation ( EngineMessage.VM_CANNOT_IMPORT_VM_EXISTS , java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveAdGroup , org.ovirt.engine.core.common.action.AdElementParametersBase.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveGroup , 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 void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionsUriExpectations ( ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.HostNic > nics = getCollection ( ) ; assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.HostNic > nics = getCollection ( ) ; assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.User user ) { validateParameters ( user , "userName" ) ; java.lang.String domain = getDomain ( user ) ; org.ovirt.engine.core.common.businessentities.AdUser adUser = getEntity ( org.ovirt.engine.core.common.businessentities.AdUser.class , SearchType.AdUser , getSearchPattern ( user.getUserName ( ) , domain ) ) ; org.ovirt.engine.core.common.action.AddUserParameters newUser = new org.ovirt.engine.core.common.action.AddUserParameters ( ) ; newUser.setVdcUser ( map ( adUser ) ) ; return performCreation ( VdcActionType.AddUser , newUser , new org.ovirt.engine.api.restapi.resource.BackendUsersResourceBase.UserIdResolver ( adUser.getUserId ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.User user ) { validateParameters ( user , "userName" ) ; java.lang.String domain = getDomain ( user ) ; org.ovirt.engine.core.common.businessentities.AdUser adUser = getEntity ( org.ovirt.engine.core.common.businessentities.AdUser.class , SearchType.AdUser , getSearchPattern ( user.getUserName ( ) , domain ) ) ; org.ovirt.engine.core.common.action.AddUserParameters newUser = new org.ovirt.engine.core.common.action.AddUserParameters ( ) ; newUser.setVdcUser ( map ( adUser ) ) ; return performCreation ( VdcActionType.AddUser , newUser , new org.ovirt.engine.api.restapi.resource.BackendUsersResourceBase.UserIdResolver ( adUser.getUserId ( ) ) , org.ovirt.engine.api.model.BaseResource.class ) ; }
Source:
private org.ovirt.engine.core.dao.VdsGroupDao mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDao.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; value.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.VdsGroupDao mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDao.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setCompatibilityVersion ( Version.v3_5 ) ; value.setEmulatedMachine ( "pc-1.0" ) ; value.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetVmDataByPoolIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDAO ( ) . getVmDataFromPoolByPoolGuid ( org.ovirt.engine.core.bll.GetVmDataByPoolIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetVmDataByPoolIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmDataByPoolIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetVmDataByPoolIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmDataFromPoolByPoolGuid ( org.ovirt.engine.core.bll.GetVmDataByPoolIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetVmDataByPoolIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmDataByPoolIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.Quota quota = getParameters ( ) . getQuota ( ) ; if ( quota.isDefault ( ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID ) ; return false ; } return ( ( validateQuotaNameIsUnique ( quota ) ) && ( validateQuotaStorageLimitation ( quota ) ) ) && ( validateQuotaClusterLimitation ( quota ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.Quota quota = getParameters ( ) . getQuota ( ) ; if ( quota.isDefault ( ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID ) ; return false ; } org.ovirt.engine.core.bll.validator.QuotaValidator quotaValidator = org.ovirt.engine.core.bll.validator.QuotaValidator.createInstance ( quota , false ) ; return ( validate ( quotaValidator.isValid ( ) ) ) && ( validateQuotaNameIsUnique ( quota ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > getSessions ( int count ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > sessions = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { sessions.add ( getSession ( ) ) ; } return sessions ; }

Target:
public void testRefreshStatus ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( true ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepStatusDetail ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }
Source:
public void testInvalidNetworkAttachmentIpConfiguration ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = initValidator ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = validator.getAttachmentsToConfigure ( ) . iterator ( ) . next ( ) ; java.util.Collection < java.lang.String > replacements = createReplacement ( networkAttachment ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_MISSING_IP_CONFIGURATION ; initMockNetworkAttachmentIpConfigurationValidator ( engineMessage , replacements ) ; org.junit.Assert.assertThat ( validator.validNewOrModifiedNetworkAttachments ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , replacements ) ) ; }

Target:
public void testInvalidNetworkAttachmentIpConfiguration ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = initValidator ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = validator.getAttachmentsToConfigure ( ) . iterator ( ) . next ( ) ; java.util.Collection < java.lang.String > replacements = createReplacement ( networkAttachment ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_MISSING_IP_CONFIGURATION ; initMockNetworkAttachmentIpConfigurationValidator ( engineMessage , replacements ) ; org.hamcrest.MatcherAssert.assertThat ( validator.validNewOrModifiedNetworkAttachments ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , replacements ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( selectedItemChangedEventDefinition ) ) && ( sender == ( getCluster ( ) ) ) ) { Cluster_SelectedItemChanged ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( selectedItemChangedEventDefinition ) ) && ( sender == ( getCluster ( ) ) ) ) { cluster_SelectedItemChanged ( ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getSnapshot ( ) ) == null ) { failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_DOES_NOT_EXIST , org.ovirt.engine.core.bll.gluster.GlusterVolumeSnapshotCommandBase.getParameters ( ) . getSnapshotName ( ) ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getSnapshot ( ) ) == null ) { failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_DOES_NOT_EXIST , org.ovirt.engine.core.bll.gluster.GlusterVolumeSnapshotCommandBase.getParameters ( ) . getSnapshotName ( ) ) ; } return true ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ) == null ) && ( ! ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImagesList ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ) == null ) && ( ! ( getSnapshotId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImages ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( getSnapshotId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ; }
Source:
public native boolean containsItem ( com.google.gwt.user.cellview.client.Column < T , ? > column ) ;

Target:
public void addItem ( com.google.gwt.user.cellview.client.Column < T , ? > column ) { if ( containsItem ( column ) ) { return ; } org.ovirt.engine.ui.common.widget.table.ColumnContextMenuItem < T > newItem = new org.ovirt.engine.ui.common.widget.table.ColumnContextMenuItem ( controller , column ) ; items.put ( column , newItem ) ; container.add ( newItem ) ; }
Source:
public org.ovirt.engine.core.common.job.Step addTaskStep ( org.ovirt.engine.core.bll.job.ExecutionContext context , org.ovirt.engine.core.common.job.StepEnum stepName , java.lang.String description ) { return org.ovirt.engine.core.bll.job.ExecutionHandler.getInstance ( ) . addTaskStep ( context , stepName , description ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase endAction ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task , org.ovirt.engine.core.bll.job.ExecutionContext context ) { org.ovirt.engine.core.common.businessentities.AsyncTasks dbAsyncTask = task.getParameters ( ) . getDbAsyncTask ( ) ; org.ovirt.engine.core.common.action.VdcActionType actionType = getEndActionType ( dbAsyncTask ) ; org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = dbAsyncTask.getActionParameters ( ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters ) ; command.setContext ( new org.ovirt.engine.core.bll.context.CommandContext ( context ) ) ; return new org.ovirt.engine.core.bll.tasks.DecoratedCommand ( command ) . endAction ( ) ; }
Source:
public void isConnWithSameDetailsExistNoConnections ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getconnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistNoConnections ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getConnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateAddProvider ( ) { org.ovirt.engine.core.common.businessentities.VmwareVmProviderProperties properties = this . provider.getAdditionalProperties ( ) ; org.ovirt.engine.core.compat.Guid proxyHostId = properties.getProxyHostId ( ) ; if ( proxyHostId != null ) { org.ovirt.engine.core.common.businessentities.VDS proxyHost = getVdsDao ( ) . get ( proxyHostId ) ; if ( proxyHost == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.VDS_DOES_NOT_EXIST ) ; } if ( ! ( proxyHost.getStoragePoolId ( ) . equals ( properties.getStoragePoolId ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_NOT_IN_DEST_STORAGE_POOL ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateAddProvider ( ) { org.ovirt.engine.core.common.businessentities.VmwareVmProviderProperties properties = this . provider.getAdditionalProperties ( ) ; org.ovirt.engine.core.compat.Guid proxyHostId = properties.getProxyHostId ( ) ; if ( proxyHostId != null ) { org.ovirt.engine.core.common.businessentities.VDS proxyHost = getVdsDao ( ) . get ( proxyHostId ) ; if ( proxyHost == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.VDS_DOES_NOT_EXIST ) ; } if ( ! ( proxyHost.getStoragePoolId ( ) . equals ( properties.getStoragePoolId ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VDS_NOT_IN_DEST_STORAGE_POOL ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 0 ) ; aQuery.asyncCallback.onSuccess ( 5 ) ; }
Source:
protected static java.util.List < java.lang.String > methodNames ( java.lang.Class < ? extends com.google.gwt.i18n.client.ConstantsWithLookup > constantsClass ) { java.util.List < java.lang.String > names = new java.util.LinkedList < > ( ) ; for ( java.lang.reflect.Method m : constantsClass.getMethods ( ) ) { if ( ( ( m.getParameterTypes ( ) . length ) == 0 ) && ( m.getReturnType ( ) . equals ( java.lang.String.class ) ) ) { names.add ( m.getName ( ) ) ; } } return names ; }

Target:
protected static java.util.List < java.lang.String > methodNames ( java.lang.Class < ? extends com.google.gwt.i18n.client.ConstantsWithLookup > constantsClass ) { return java.util.Arrays.stream ( constantsClass.getMethods ( ) ) . filter ( ( m ) -> ( ( m.getParameterTypes ( ) . length ) == 0 ) && ( m.getReturnType ( ) . equals ( java.lang.String.class ) ) ) . map ( java.lang.reflect.Method :: getName ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetImagesListParameters ( asGuid ( storageDomainId ) , org.ovirt.engine.core.common.businessentities.ImageFileType.ISO ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData.class , VdcQueryType.GetImagesList , queryParams ) ; java.util.List < java.lang.String > fileNames = new java.util.LinkedList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData file : files ) { fileNames.add ( file.getRepoFileName ( ) ) ; } return fileNames ; }

Target:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetImagesListParameters ( asGuid ( storageDomainId ) , org.ovirt.engine.core.common.businessentities.ImageFileType.ISO ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData.class , VdcQueryType.GetImagesList , queryParams ) ; java.util.List < java.lang.String > fileNames = new java.util.LinkedList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData file : files ) { fileNames.add ( file.getRepoImageId ( ) ) ; } return fileNames ; }
Source:
protected < P extends org.ovirt.engine.core.common.action.VdcActionParametersBase > P withRootCommandInfo ( P params , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.common.action.VdcActionType parentCommand = getParentCommandType ( actionType ) ; params.setParentParameters ( getParametersForTask ( parentCommand , getParameters ( ) ) ) ; params.setParentCommand ( parentCommand ) ; return params ; }

Target:
protected < P extends org.ovirt.engine.core.common.action.VdcActionParametersBase > P withRootCommandInfo ( P params , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.common.action.VdcActionType parentCommand = ( ( getParameters ( ) . getParentCommand ( ) ) != ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) ? getParameters ( ) . getParentCommand ( ) : actionType ; params.setParentParameters ( getParametersForTask ( parentCommand , getParameters ( ) ) ) ; params.setParentCommand ( parentCommand ) ; return params ; }
Source:
public java.lang.String getRelatedTableNameWithOutTags ( java.lang.String obj ) { if ( obj == null ) { return null ; } else if ( ( ( org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter.getEntitySearchInfo ( obj ) ) != null ) && ( ( org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter.getEntitySearchInfo ( obj ) . relatedTableNameWithOutTags ) != null ) ) { return org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter.getEntitySearchInfo ( obj ) . relatedTableNameWithOutTags ; } else { return getRelatedTableName ( obj ) ; } }

Target:
private java.lang.String getRelatedTableNameWithoutTags ( java.lang.String obj ) { if ( obj == null ) { return null ; } else if ( ( ( org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter.getEntitySearchInfo ( obj ) ) != null ) && ( ( org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter.getEntitySearchInfo ( obj ) . relatedTableNameWithOutTags ) != null ) ) { return org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter.getEntitySearchInfo ( obj ) . relatedTableNameWithOutTags ; } else { return getRelatedTableName ( obj ) ; } }
Source:
public static void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getoVirtISOsList ( 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.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public void buildVirtualSystem ( ) { _writer.WriteStartElement ( "Content" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "id" , "out" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.XSI_URI , "type" , ( ( OVF_PREFIX ) + ":VirtualSystem_Type" ) ) ; writeGeneralData ( ) ; WriteAppList ( ) ; WriteContentItems ( ) ; _writer.WriteEndElement ( ) ; }

Target:
public void buildVirtualSystem ( ) { _writer.WriteStartElement ( "Content" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "id" , "out" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.XSI_URI , "type" , ( ( OVF_PREFIX ) + ":VirtualSystem_Type" ) ) ; writeGeneralData ( ) ; writeAppList ( ) ; writeContentItems ( ) ; _writer.WriteEndElement ( ) ; }
Source:
public java.util.List < org.ovirt.engine.ui.common.widget.dialog.tab.DialogTab > getTabs ( ) { java.util.List < org.ovirt.engine.ui.common.widget.dialog.tab.DialogTab > tabs = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( tabContainer.getWidgetCount ( ) ) ; i ++ ) { com.google.gwt.user.client.ui.Widget tab = tabContainer.getWidget ( i ) ; if ( tab instanceof org.ovirt.engine.ui.common.widget.dialog.tab.DialogTab ) { tabs.add ( ( ( org.ovirt.engine.ui.common.widget.dialog.tab.DialogTab ) ( tab ) ) ) ; } } return tabs ; }

Target:
public java.util.List < org.ovirt.engine.ui.common.widget.dialog.tab.OvirtTabListItem > getTabs ( ) { java.util.List < org.ovirt.engine.ui.common.widget.dialog.tab.OvirtTabListItem > tabs = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( navTabs.getWidgetCount ( ) ) ; i ++ ) { com.google.gwt.user.client.ui.Widget tab = navTabs.getWidget ( i ) ; if ( tab instanceof org.ovirt.engine.ui.common.widget.dialog.tab.OvirtTabListItem ) { tabs.add ( ( ( org.ovirt.engine.ui.common.widget.dialog.tab.OvirtTabListItem ) ( tab ) ) ) ; } } return tabs ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmDevice createNetworkInterfaceDevice ( boolean plugged , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.VmDevice device = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; device.setType ( VmDeviceGeneralType.INTERFACE ) ; device.setDevice ( VmDeviceType.BRIDGE.getName ( ) ) ; device.setIsPlugged ( plugged ) ; device.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( id , null ) ) ; return device ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmDevice createNetworkInterfaceDevice ( boolean plugged , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.VmDevice device = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; device.setType ( VmDeviceGeneralType.INTERFACE ) ; device.setDevice ( VmDeviceType.BRIDGE.getName ( ) ) ; device.setPlugged ( plugged ) ; device.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( id , null ) ) ; return device ; }
Source:
private java.lang.String getDirectoryGroupSearchPattern ( java.lang.String groupname , java.lang.String domain ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.common.businessentities.aaa.DbGroup.class , false ) ; final java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( ResourceConstants.AAA_GROUPS_SEARCH_TEMPLATE , domain , "" ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "name=" + groupname : constraint ) ) ; return sb.toString ( ) ; }

Target:
private java.lang.String getDirectoryGroupSearchPattern ( java.lang.String groupname , java.lang.String domain ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( httpHeaders , uriInfo , org.ovirt.engine.core.common.businessentities.aaa.DbGroup.class , false ) ; final java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( ResourceConstants.AAA_GROUPS_SEARCH_TEMPLATE , domain , "" ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "name=" + groupname : constraint ) ) ; return sb.toString ( ) ; }
Source:
private void initListBoxEditors ( ) { dataCenterEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.StoragePool > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { return storagePool.getName ( ) ; } } ) ; clusterEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.VDSGroup > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { return vdsGroup.getName ( ) ; } } ) ; typeListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( ) ) ; }

Target:
private void initListBoxEditors ( ) { dataCenterEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ) ; clusterEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ) ; typeListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( ) ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.AsyncTasks task ) { save ( task , null , org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.EMPTY_GUIDS_ARRAY ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.AsyncTaskEntity mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.AsyncTaskEntity entity = new org.ovirt.engine.core.common.businessentities.AsyncTaskEntity ( ) ; entity.setEntityId ( getGuid ( rs , "entity_id" ) ) ; entity.setTaskId ( getGuid ( rs , "async_task_id" ) ) ; entity.setEntityType ( org.ovirt.engine.core.common.VdcObjectType.valueOf ( rs.getString ( "entity_type" ) ) ) ; return entity ; }
Source:
private org.ovirt.engine.core.bll.snapshots.SnapshotsValidator mockSnapshotValidator ( ) { org.ovirt.engine.core.bll.snapshots.SnapshotsValidator snapshotsValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsValidator.class ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; return snapshotsValidator ; }

Target:
private org.ovirt.engine.core.bll.snapshots.SnapshotsValidator mockSnapshotValidator ( ) { org.ovirt.engine.core.bll.snapshots.SnapshotsValidator snapshotsValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsValidator.class ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; return snapshotsValidator ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getUserDefinedProperties ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; getUserDefinedProperties ( version , vmStatic , map ) ; return map ; }

Target:
private void getVMProperties ( org.ovirt.engine.core.compat.Version version , java.util.Map < java.lang.String , java.lang.String > propertiesMap , java.lang.String vmPropertiesFieldValue ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vmPropertiesFieldValue ) ) { return ; } propertiesMap.putAll ( convertProperties ( vmPropertiesFieldValue , allVmProperties.get ( version ) ) ) ; }
Source:
protected org.ovirt.engine.api.model.Vm deprecatedPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; parent.addInlineDetails ( details , model ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } parent.setPayload ( model ) ; parent.setCertificateInfo ( model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Vm deprecatedPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; parent.addInlineDetails ( details , model ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setPayload ( this , model ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setCertificateInfo ( this , model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; return model ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getAllWithQuery ( java.lang.String query ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groups = jdbcTemplate.query ( query , org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.VdsGroupRowMapper.instance ) ; try { return getHostsAndVmsForClusters ( groups ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.log.error ( ( "Can't load host and vm count for cluster. Query is " + query ) , e ) ; } return groups ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getAllWithQuery ( java.lang.String query ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groups = jdbcTemplate.query ( query , org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.VdsGroupRowMapper.instance ) ; try { return getHostsAndVmsForClusters ( groups ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.log.error ( "Can't load host and vm count for cluster. Query is '{}'. Error: {}" , query , e.getMessage ( ) ) ; org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.log.debug ( "Excpetion" , e ) ; } return groups ; }
Source:
public void UpdateDetails ( org.ovirt.engine.core.common.businessentities.VM vm ) { getSelectedItemDefinedMemory ( ) . setEntity ( SizeParser ( vm.getVmMemSizeMb ( ) ) ) ; getSelectedItemNumOfCpuCores ( ) . setEntity ( ( ( ( ( ( ( ( vm.getNumOfCpus ( ) ) + " " ) + "(" ) + ( vm.getNumOfSockets ( ) ) ) + " Socket(s), " ) + ( vm.getCpuPerSocket ( ) ) ) + " Core(s) per Socket)" ) ) ; }

Target:
public void updateDetails ( org.ovirt.engine.core.common.businessentities.VM vm ) { getSelectedItemDefinedMemory ( ) . setEntity ( sizeParser ( vm.getVmMemSizeMb ( ) ) ) ; getSelectedItemNumOfCpuCores ( ) . setEntity ( ( ( ( ( ( ( ( vm.getNumOfCpus ( ) ) + " " ) + "(" ) + ( vm.getNumOfSockets ( ) ) ) + " Socket(s), " ) + ( vm.getCpuPerSocket ( ) ) ) + " Core(s) per Socket)" ) ) ; }
Source:
protected void updateDataProvider ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > items ) { if ( ! ( items.isEmpty ( ) ) ) { super . updateDataProvider ( items ) ; selectionModel.setSelected ( items.get ( 0 ) , true ) ; } }

Target:
public void setSelectedItems ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > items ) { getModel ( ) . setSelectedItem ( ( ( items.size ( ) ) > 0 ? items.get ( 0 ) : null ) ) ; if ( ( items.size ( ) ) > 0 ) { org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeSelectionChangeEvent.fire ( this , items.get ( 0 ) ) ; } }
Source:
public void testStderr ( ) throws java.lang.Throwable { try ( final java.io.InputStream start = new java.io.ByteArrayInputStream ( "start\n" . getBytes ( "UTF-8" ) ) ) { org.ovirt.engine.core.uutils.ssh.SSHDialogTest.Sink sink = new org.ovirt.engine.core.uutils.ssh.SSHDialogTest.Sink ( new java.lang.String [ ] { "start" , "text1" , "text2" } , new java.lang.String [ ] { "text1" , "text2" } ) ; sshDialog.connect ( ) ; sshDialog.authenticate ( ) ; sshDialog.executeCommand ( sink , "echo message >&2 && cat" , new java.io.InputStream [ ] { start } ) ; sink.exception ( ) ; } }

Target:
public void testWrongKeyPair ( ) throws java.lang.Exception { sshDialog.setKeyPair ( java.security.KeyPairGenerator.getInstance ( "RSA" ) . generateKeyPair ( ) ) ; sshDialog.connect ( ) ; org.junit.jupiter.api.Assertions.assertThrows ( javax.naming.AuthenticationException.class , sshDialog :: authenticate ) ; }
Source:
public java.util.List getClusterLevelsList ( ) { java.util.List resultList = lst ( ) ; resultList.add ( "3.0" ) ; resultList.add ( "3.1" ) ; resultList.add ( "3.2" ) ; resultList.add ( "3.3" ) ; resultList.add ( "3.4" ) ; resultList.add ( "3.5" ) ; resultList.add ( "3.6" ) ; resultList.add ( "4.0" ) ; resultList.add ( "4.1" ) ; return resultList ; }

Target:
public java.util.List getClusterLevelsList ( ) { java.util.List resultList = lst ( ) ; resultList.add ( "3.0" ) ; resultList.add ( "3.1" ) ; resultList.add ( "3.2" ) ; resultList.add ( "3.3" ) ; resultList.add ( "3.4" ) ; resultList.add ( "3.5" ) ; resultList.add ( "3.6" ) ; resultList.add ( "4.0" ) ; resultList.add ( "4.1" ) ; resultList.add ( "4.2" ) ; return resultList ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { onExternalProviderChanged ( ) ; }
Source:
public void refreshLightWeightData ( ) { log.debug ( "Refreshing Gluster Data [lightweight]" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = getClusterDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.supportsGlusterService ( ) ) { try { refreshClusterData ( cluster ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while refreshing Gluster lightweight data of cluster {0}!" , cluster.getName ( ) , e ) ; } } } }

Target:
public void refreshLightWeightData ( ) { log.debug ( "Refreshing Gluster Data [lightweight]" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = getClusterDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.supportsGlusterService ( ) ) { try { refreshClusterData ( cluster ) ; } catch ( java.lang.Exception e ) { log.error ( "Error while refreshing Gluster lightweight data of cluster '{}': {}" , cluster.getName ( ) , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } } } }
Source:
private void setupVmTemplateDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > expectedVmTemplate = java.util.Collections.singletonList ( vmTemplate ) ; org.ovirt.engine.core.dao.VmTemplateDAO vmTemplateDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmTemplateDAO.class ) ; org.mockito.Mockito.when ( vmTemplateDao.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVmTemplate ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmTemplateDao ( ) ) . thenReturn ( vmTemplateDao ) ; }

Target:
private void setupVmTemplateDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > expectedVmTemplate = java.util.Collections.singletonList ( vmTemplate ) ; org.ovirt.engine.core.dao.VmTemplateDao vmTemplateDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmTemplateDao.class ) ; org.mockito.Mockito.when ( vmTemplateDao.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVmTemplate ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmTemplateDao ( ) ) . thenReturn ( vmTemplateDao ) ; }
Source:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , failure ) ; }
Source:
public void getAAAProfilesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.convertAAAProfilesResult ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAAAProfilesEntriesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.StorageDomain map ( org.ovirt.engine.api.model.Storage model , org.ovirt.engine.api.restapi.types.StorageDomain template ) { org.ovirt.engine.api.restapi.types.StorageDomain entity = ( template != null ) ? template : new org.ovirt.engine.api.restapi.types.StorageDomain ( ) ; entity.setstorage ( model.getId ( ) ) ; if ( model.isSetType ( ) ) { org.ovirt.engine.api.model.StorageType storageType = org.ovirt.engine.api.model.StorageType.fromValue ( model.getType ( ) ) ; if ( storageType != null ) { entity.setstorage_type ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( storageType , null ) ) ; } } return entity ; }

Target:
public static org.ovirt.engine.core.common.businessentities.StorageDomain map ( org.ovirt.engine.api.model.Storage model , org.ovirt.engine.api.restapi.types.StorageDomain template ) { org.ovirt.engine.api.restapi.types.StorageDomain entity = ( template != null ) ? template : new org.ovirt.engine.api.restapi.types.StorageDomain ( ) ; entity.setStorage ( model.getId ( ) ) ; if ( model.isSetType ( ) ) { org.ovirt.engine.api.model.StorageType storageType = org.ovirt.engine.api.model.StorageType.fromValue ( model.getType ( ) ) ; if ( storageType != null ) { entity.setStorageType ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( storageType , null ) ) ; } } return entity ; }
Source:
private org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters buildRemoveMemoryVolumesParameters ( java.lang.String memoryState , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters parameters = new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryState , org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ; parameters.setRemoveOnlyIfNotUsedAtAll ( true ) ; return parameters ; }

Target:
private void removeMemoryVolumes ( ) { java.util.Set < java.lang.String > memoryStates = org.ovirt.engine.core.bll.memory.MemoryUtils.getMemoryVolumesFromSnapshots ( org.ovirt.engine.core.bll.RemoveVmCommand.getDbFacade ( ) . getSnapshotDao ( ) . getAll ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; for ( java.lang.String memoryState : memoryStates ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryState , org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.RemoveVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { log.errorFormat ( "Failed to remove memory volumes whie removing vm {0} (volumes: {1})" , org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) , memoryState ) ; } } }