auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void verifyModel ( org.ovirt.engine.api.model.StorageConnection model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionsResourceTest.STORAGE_TYPES_MAPPED [ index ] . toString ( ) . toLowerCase ( ) , model.getType ( ) . value ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.StorageConnection model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionsResourceTest.STORAGE_TYPES_MAPPED [ index ] . toString ( ) . toLowerCase ( ) , model.getType ( ) . value ( ) ) ; verifyLinks ( model ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }
Source:
public static java.lang.String toSingular ( java.lang.String plural ) { java.lang.String singular = org.ovirt.engine.sdk.codegen.utils.StringUtils.SINGULAR_EXCEPTIONS.get ( plural ) ; if ( singular == null ) { if ( ( ( plural.length ( ) ) >= 1 ) && ( plural.endsWith ( "s" ) ) ) { singular = plural.substring ( 0 , ( ( plural.length ( ) ) - 1 ) ) ; } else { singular = plural ; } } return singular ; }

Target:
public static java.lang.String concatenateValues ( java.util.Map < java.lang.String , java.lang.String > map ) { java.util.List < java.lang.String > keys = new java.util.ArrayList < > ( map.keySet ( ) ) ; java.util.Collections.sort ( keys ) ; java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; keys.forEach ( ( key ) -> buffer.append ( map.get ( key ) ) ) ; return buffer.toString ( ) ; }
Source:
public static org.ovirt.engine.api.model.StorageDomainType map ( org.ovirt.engine.api.model.StorageDomainType storageDomainType , org.ovirt.engine.api.model.StorageDomainType template ) { switch ( storageDomainType ) { case DATA : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageDomainType ; case ISO : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageDomainType ; case EXPORT : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageDomainType ; case IMAGE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageDomainType ; case VOLUME : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageDomainType ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.StorageDomainType map ( org.ovirt.engine.api.model.StorageDomainType storageDomainType , org.ovirt.engine.api.model.StorageDomainType template ) { switch ( storageDomainType ) { case Master : return org.ovirt.engine.api.model.StorageDomainType.DATA ; case Data : return org.ovirt.engine.api.model.StorageDomainType.DATA ; case ISO : return org.ovirt.engine.api.model.StorageDomainType.ISO ; case ImportExport : return org.ovirt.engine.api.model.StorageDomainType.EXPORT ; case Image : return org.ovirt.engine.api.model.StorageDomainType.IMAGE ; case Volume : return org.ovirt.engine.api.model.StorageDomainType.VOLUME ; case Unknown : default : return null ; } }
Source:
protected final boolean failCanDoAction ( org.ovirt.engine.core.dal.VdcBllMessages message ) { addCanDoActionMessage ( message ) ; return false ; }

Target:
private org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler getBackendCommandObjectsHandler ( ) { try { javax.naming.InitialContext ctx = new javax.naming.InitialContext ( ) ; return ( ( org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler ) ( ctx.lookup ( org.ovirt.engine.core.bll.CommandBase.BACKEND_COMMAND_OBJECTS_HANDLER_JNDI_NAME ) ) ) ; } catch ( javax.naming.NamingException e ) { log.error ( ( "Getting backend command objects handler failed" + ( e.getMessage ( ) ) ) ) ; log.debug ( "" , e ) ; return null ; } }
Source:
public void setEntity ( java.lang.Object value ) { super . setEntity ( ( value == null ? null : ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( value ) ) . getTemplate ( ) ) ) ; }

Target:
private void setDetailList ( final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel vmGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateImportInterfaceListModel templateImportInterfaceListModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.HasEntity > list = new java.util.ArrayList < > ( ) ; list.add ( vmGeneralModel ) ; list.add ( templateImportInterfaceListModel ) ; list.add ( templateImportDiskListModel ) ; setDetailModels ( list ) ; }
Source:
protected org.ovirt.engine.api.model.Permit postPopulate ( org.ovirt.engine.api.model.Permit from ) { org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup = org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.core.common.businessentities.ActionGroup.class ) ; from.setId ( java.lang.Integer.toString ( actionGroup.getId ( ) ) ) ; org.ovirt.engine.api.model.PermitType permitType = org.ovirt.engine.api.restapi.types.PermitMapper.map ( actionGroup , ( ( org.ovirt.engine.api.model.PermitType ) ( null ) ) ) ; from.setName ( permitType.value ( ) ) ; from.setAdministrative ( ( ( permitType.getRole ( ) ) == ( org.ovirt.engine.api.model.RoleType.ADMIN ) ) ) ; return from ; }

Target:
protected org.ovirt.engine.api.model.Permit postPopulate ( org.ovirt.engine.api.model.Permit from ) { org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup = org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.core.common.businessentities.ActionGroup.class ) ; from.setId ( java.lang.Integer.toString ( actionGroup.getId ( ) ) ) ; org.ovirt.engine.api.model.PermitType permitType = org.ovirt.engine.api.restapi.types.PermitMapper.map ( actionGroup , ( ( org.ovirt.engine.api.model.PermitType ) ( null ) ) ) ; from.setName ( permitType.value ( ) ) ; from.setAdministrative ( actionGroup.getRoleType ( ) . toString ( ) . equals ( RoleType.ADMIN.toString ( ) ) ) ; return from ; }
Source:
public void isConnWithSameDetailsExistBlockDomains ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection1 = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; connections.add ( connection1 ) ; org.mockito.Mockito.when ( storageConnDao.getAllForConnection ( newISCSIConnection ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertTrue ( 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:
private void initialize ( ) { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; java.lang.Integer backupCheckPeriodInHours = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.BackupCheckPeriodInHours ) ; if ( backupCheckPeriodInHours > 0 ) { executor.scheduleWithFixedDelay ( this :: backupCheck , backupCheckPeriodInHours , backupCheckPeriodInHours , java.util.concurrent.TimeUnit.HOURS ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; } }

Target:
private void initialize ( ) { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; long backupCheckPeriodInHours = org.ovirt.engine.core.common.config.Config.< java.lang.Long > getValue ( ConfigValues.BackupCheckPeriodInHours ) ; if ( backupCheckPeriodInHours > 0 ) { executor.scheduleWithFixedDelay ( this :: backupCheck , backupCheckPeriodInHours , backupCheckPeriodInHours , java.util.concurrent.TimeUnit.HOURS ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; } }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( null ) ; callback.asyncCallback.onSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( null ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; } }
Source:
private void alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getTargetVdsID ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.Alert ( alert , logType ) ; }

Target:
protected void alertPowerManagementStatusFailed ( java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getTargetVdsID ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; auditLogDirector.log ( alert , AuditLogType.VDS_ALERT_FENCE_TEST_FAILED ) ; }
Source:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public static void getHostPublicKey ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { boolean succeeded = false ; try { succeeded = runVdsCommand ( VDSCommandType.SetMOMPolicyParameters , new org.ovirt.engine.core.common.vdscommands.MomPolicyVDSParameters ( getVds ( ) , getVdsGroup ( ) . isEnableBallooning ( ) ) ) . getSucceeded ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.errorFormat ( "Could not update MoM policy on host {0}" , getVdsName ( ) ) ; } getReturnValue ( ) . setSucceeded ( succeeded ) ; }

Target:
protected void executeCommand ( ) { boolean succeeded = false ; try { succeeded = runVdsCommand ( VDSCommandType.SetMOMPolicyParameters , new org.ovirt.engine.core.common.vdscommands.MomPolicyVDSParameters ( getVds ( ) , getVdsGroup ( ) . isEnableBallooning ( ) , getVdsGroup ( ) . isEnableKsm ( ) ) ) . getSucceeded ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.errorFormat ( "Could not update MoM policy on host {0}" , getVdsName ( ) ) ; } getReturnValue ( ) . setSucceeded ( succeeded ) ; }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.IVdsServer initializeVdsBroker ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.vdsbroker.VdsManager vdsmanager = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( vdsId ) ; if ( vdsmanager == null ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.RESOURCE_MANAGER_VDS_NOT_FOUND , java.lang.String.format ( "Vds with id: %1$s was not found" , vdsId ) ) ; } setVdsAndVdsStatic ( vdsmanager.getCopyVds ( ) ) ; return vdsmanager.getVdsProxy ( ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.IVdsServer initializeVdsBroker ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.vdsbroker.VdsManager vdsmanager = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( vdsId ) ; if ( vdsmanager == null ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.RESOURCE_MANAGER_VDS_NOT_FOUND , java.lang.String.format ( "Vds with id: %1$s was not found" , vdsId ) ) ; } setVdsAndVdsStatic ( vdsmanager.getCopyVds ( ) ) ; return vdsmanager.getVdsProxy ( ) ; }
Source:
private void initVirtResources ( ) { if ( InitializeStorage ( ) ) { processFencing ( ) ; processStoragePoolStatus ( ) ; } else { setNonOperational ( NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE ) ; } }

Target:
private boolean initVirtResources ( ) { if ( InitializeStorage ( ) ) { processFencing ( ) ; processStoragePoolStatus ( ) ; } else { java.util.Map < java.lang.String , java.lang.String > customLogValues = java.util.Collections.singletonMap ( "StoragePoolName" , org.ovirt.engine.core.bll.InitVdsOnUpCommand.getStoragePoolName ( ) ) ; setNonOperational ( NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE , customLogValues ) ; return false ; } return true ; }
Source:
public void testNotManagementNetworkNegative ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) . thenReturn ( false ) ; org.junit.Assert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotLinkedToExternalNetworkPositive ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkDao.getAllExternalNetworksLinkedToPhysicalNetwork ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.notLinkedToExternalNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getAllocationColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.VolumeType > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.VolumeType getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getVolumeType ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Disk > getAllocationColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.VolumeType > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.VolumeType getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getVolumeType ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
protected void updateDetailsAvailability ( ) { if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.DbUser adUser = ( ( org.ovirt.engine.core.common.businessentities.DbUser ) ( getSelectedItem ( ) ) ) ; userGroupListModel.setIsAvailable ( ( ! ( adUser.isGroup ( ) ) ) ) ; userEventNotifierListModel.setIsAvailable ( ( ! ( adUser.isGroup ( ) ) ) ) ; } }

Target:
protected void updateDetailsAvailability ( ) { if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser adUser = ( ( org.ovirt.engine.core.common.businessentities.aaa.DbUser ) ( getSelectedItem ( ) ) ) ; userGroupListModel.setIsAvailable ( ( ! ( adUser.isGroup ( ) ) ) ) ; userEventNotifierListModel.setIsAvailable ( ( ! ( adUser.isGroup ( ) ) ) ) ; } }
Source:
public static boolean bridgesReportByVdsm ( org.ovirt.engine.core.compat.Version version ) { return org.ovirt.engine.core.common.FeatureSupported.supportedInConfig ( ConfigValues.SupportBridgesReportByVDSM , version ) ; }

Target:
public static boolean supportedInConfig ( org.ovirt.engine.core.common.config.ConfigValues feature , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.ArchitectureType arch ) { java.util.Map < java.lang.String , java.lang.String > archOptions = org.ovirt.engine.core.common.config.Config.< java.util.Map > getValue ( feature , version.getValue ( ) ) ; java.lang.String value = archOptions.get ( arch.name ( ) ) ; if ( value == null ) { value = archOptions.get ( arch.getFamily ( ) . name ( ) ) ; } return java.lang.Boolean.parseBoolean ( value ) ; }
Source:
public void testBadGuidValidation ( ) { setUpGetEntityExpectations ( false ) ; org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; host.getCluster ( ) . setId ( "!!!" ) ; resource.update ( host ) ; }

Target:
public void testBadGuidValidation ( ) { setUpGetEntityExpectations ( false ) ; org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; host.getCluster ( ) . setId ( "!!!" ) ; org.junit.jupiter.api.Assertions.assertThrows ( org.ovirt.engine.api.restapi.utils.MalformedIdException.class , ( ) -> resource.update ( host ) ) ; }
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 ( VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID ) : ( vdsGroup.getArchitecture ( ) ) != ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getClusterArch ( ) ) ? failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_IMPORT_VM_ARCHITECTURE_NOT_SUPPORTED_BY_CLUSTER ) : true ; }

Target:
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 ( VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID ) : ( vdsGroup.getArchitecture ( ) ) != ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getClusterArch ( ) ) ? failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_IMPORT_VM_ARCHITECTURE_NOT_SUPPORTED_BY_CLUSTER ) : true ; }
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 getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
private static boolean isVnicProfilePermitted ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user , org.ovirt.engine.core.common.businessentities.network.VnicProfile profile , boolean portMirroringRequired ) { return ( portMirroringRequired == ( profile.isPortMirroring ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.getPermissionDao ( ) . getEntityPermissions ( user.getId ( ) , ActionGroup.CONFIGURE_VM_NETWORK , profile.getId ( ) , VdcObjectType.VnicProfile ) ) != null ) ; }

Target:
private org.ovirt.engine.core.bll.network.vm.BackwardCompatibilityVnicHelper getBackwardCompatibilityVnicHelper ( ) { return org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.network.vm.BackwardCompatibilityVnicHelper.class ) ; }
Source:
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 ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public void managementNetworkAttachmentInvalid ( ) throws java.lang.Exception { networkCluster.setRequired ( false ) ; org.junit.Assert.assertThat ( validator.managementNetworkAttachment ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTest.NETWORK_NAME ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_MANAGEMENT_NETWORK_REQUIRED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTest.NETWORK_NAME_REPLACEMENT ) ) ) ) ; }

Target:
public void managementNetworkAttachmentInvalid ( ) throws java.lang.Exception { org.mockito.Mockito.when ( networkCluster.isRequired ( ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; org.junit.Assert.assertThat ( validator.managementNetworkAttachment ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTest.NETWORK_NAME ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_MANAGEMENT_NETWORK_REQUIRED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTest.NETWORK_NAME_REPLACEMENT ) ) ) ) ; }
Source:
public void ResetIrs ( ) { setmCurrentIrsHost ( null ) ; setmIrsProxy ( null ) ; mCurrentVdsId = null ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( _storagePoolId ) ; if ( storagePool != null ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; } }

Target:
private void nullifyInternalProxies ( ) { if ( ( privatemIrsProxy ) != null ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcUtils.shutDownConnection ( ( ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsServerWrapper ) ( privatemIrsProxy ) ) . getHttpClient ( ) ) ; } setmCurrentIrsHost ( null ) ; privatemIrsProxy = null ; mCurrentVdsId = null ; }
Source:
public void canAddCloneVmFromSnapshotNoConfiguration ( ) { initializeMock ( ) ; cmd.getVm ( ) . setName ( "vm1" ) ; mockUninterestingMethods ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.Matchers.any ( ) ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommandTest.SOURCE_SNAPSHOT_ID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_HAS_NO_CONFIGURATION ) ; }

Target:
public void canAddCloneVmFromSnapshotNoConfiguration ( ) { initializeMock ( ) ; cmd.getVm ( ) . setName ( "vm1" ) ; mockUninterestingMethods ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommandTest.SOURCE_SNAPSHOT_ID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_HAS_NO_CONFIGURATION ) ; }
Source:
public void validateFails ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( "InvalidActionType" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; params.setClusterId ( null ) ; params.setServerId ( null ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateSucceedsWithStopActionType ( ) { cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
private void setUpGetSoundcardExpectations ( int ... idxs ) throws java.lang.Exception { for ( int i = 0 ; i < ( idxs.length ) ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetSoundDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ idxs [ i ] ] } , new java.util.ArrayList < > ( ) ) ; } }

Target:
protected void setUpGetNoPayloadExpectations ( int index , int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , null ) ; } }
Source:
private boolean validateNetworkExclusiveOnNic ( java.lang.String nicName , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > networksOnIface ) { if ( ( networksOnIface.size ( ) ) <= 1 ) { return true ; } org.apache.commons.collections.bag.HashBag networkTypes = new org.apache.commons.collections.bag.HashBag ( networksOnIface ) ; if ( ( ( networkTypes.contains ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.VM ) ) && ( ( networkTypes.size ( ) ) > 1 ) ) || ( ( networkTypes.contains ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.NON_VM ) ) && ( ( networkTypes.getCount ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.NON_VM ) ) > 1 ) ) ) { return false ; } return true ; }

Target:
private boolean validateNetworkExclusiveOnNic ( java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > networksOnIface ) { if ( ( networksOnIface.size ( ) ) <= 1 ) { return true ; } org.apache.commons.collections.Bag networkTypes = new org.apache.commons.collections.bag.HashBag ( networksOnIface ) ; if ( ( networkTypes.contains ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.VM ) ) || ( ( networkTypes.contains ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.NON_VM ) ) && ( ( networkTypes.getCount ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.NON_VM ) ) > 1 ) ) ) { return false ; } return true ; }
Source:
private void createDummyPolicyUnit ( ) { dummyPolicyUnit = new org.ovirt.engine.core.common.scheduling.PolicyUnit ( ) ; dummyPolicyUnit.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dummyPolicyUnit.setName ( "Dummy policy unit" ) ; dummyPolicyUnit.setPolicyUnitType ( PolicyUnitType.Filter ) ; dummyPolicyUnit.setParameterRegExMap ( new java.util.LinkedHashMap < java.lang.String , java.lang.String > ( ) ) ; }

Target:
private void createDummyPolicyUnit ( ) { dummyPolicyUnit = new org.ovirt.engine.core.common.scheduling.PolicyUnit ( ) ; dummyPolicyUnit.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dummyPolicyUnit.setName ( "Dummy policy unit" ) ; dummyPolicyUnit.setDescription ( "Description" ) ; dummyPolicyUnit.setPolicyUnitType ( PolicyUnitType.Filter ) ; dummyPolicyUnit.setParameterRegExMap ( new java.util.LinkedHashMap < java.lang.String , java.lang.String > ( ) ) ; }
Source:
protected void buildSysprepVmPayload ( java.lang.String strSysPrepContent ) { byte [ ] binarySysPrep = org.ovirt.engine.core.utils.StringUtils.charsetDecodeStringUTF8 ( strSysPrepContent ) ; createInfo.add ( VdsProperties.sysprepInf , binarySysPrep ) ; }

Target:
protected void buildSysprepVmPayload ( java.lang.String strSysPrepContent ) { byte [ ] binarySysPrep ; try { binarySysPrep = strSysPrepContent.getBytes ( org.ovirt.engine.core.vdsbroker.vdsbroker.VmOldInfoBuilder.UTF8_CHARSET_ENCODING ) ; } catch ( java.io.UnsupportedEncodingException e ) { throw new java.lang.RuntimeException ( "Unsupported charset while building VM sysprep" , e ) ; } createInfo.add ( VdsProperties.sysprepInf , binarySysPrep ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity slaveVolume ) { org.ovirt.engine.core.dao.VdsGroupDao vdsGroupDao = getVdsGroupDao ( ) ; org.ovirt.engine.core.compat.Version slaveCompatibilityVersion = vdsGroupDao.get ( slaveVolume.getClusterId ( ) ) . getCompatibilityVersion ( ) ; org.ovirt.engine.core.compat.Version masterCompatibilityVersion = vdsGroupDao.get ( masterVolume.getClusterId ( ) ) . getCompatibilityVersion ( ) ; return masterCompatibilityVersion.equals ( slaveCompatibilityVersion ) ; }

Target:
public boolean test ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity slaveVolume ) { org.ovirt.engine.core.dao.VdsGroupDao vdsGroupDao = getVdsGroupDao ( ) ; org.ovirt.engine.core.compat.Version slaveCompatibilityVersion = vdsGroupDao.get ( slaveVolume.getClusterId ( ) ) . getCompatibilityVersion ( ) ; org.ovirt.engine.core.compat.Version masterCompatibilityVersion = vdsGroupDao.get ( masterVolume.getClusterId ( ) ) . getCompatibilityVersion ( ) ; return masterCompatibilityVersion.equals ( slaveCompatibilityVersion ) ; }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void 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.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommandParameters params = new org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommandParameters ( getStoragePoolForVds ( ) . getId ( ) , org.ovirt.engine.core.bll.ForceSelectSPMCommand.getParameters ( ) . getPreferredSPMId ( ) ) ; runVdsCommand ( VDSCommandType.SpmStopOnIrs , params ) ; org.ovirt.engine.core.bll.ForceSelectSPMCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommandParameters params = new org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommandParameters ( getStoragePoolForVds ( ) . getId ( ) , org.ovirt.engine.core.bll.ForceSelectSPMCommand.getParameters ( ) . getPreferredSPMId ( ) ) ; if ( runVdsCommand ( VDSCommandType.SpmStopOnIrs , params ) . getSucceeded ( ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_FORCE_SELECTED_SPM ) ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_FORCE_SELECTED_SPM_STOP_FAILED ) ; } org.ovirt.engine.core.bll.ForceSelectSPMCommand.setSucceeded ( true ) ; }
Source:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static 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 setUp ( ) { quota = setUpQuota ( org.ovirt.engine.core.bll.UpdateQuotaCommandTest.QUOTA_ID ) ; org.mockito.Mockito.when ( quotaDao.getById ( org.ovirt.engine.core.bll.UpdateQuotaCommandTest.QUOTA_ID ) ) . thenReturn ( quota ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaFromCache ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . afterUpdate ( ) ; }

Target:
public void setUp ( ) { quota = setUpQuota ( org.ovirt.engine.core.bll.UpdateQuotaCommandTest.QUOTA_ID ) ; org.mockito.Mockito.when ( quotaDao.getById ( org.ovirt.engine.core.bll.UpdateQuotaCommandTest.QUOTA_ID ) ) . thenReturn ( quota ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaFromCache ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . afterUpdate ( ) ; command.init ( ) ; }
Source:
public void update ( int index , org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile , java.lang.String value ) { transitionHandler.handlePlaceTransition ( true ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile , java.lang.String value ) { java.util.Map < java.lang.String , java.lang.String > parameters = new java.util.HashMap < > ( ) ; parameters.put ( FragmentParams.NAME.getName ( ) , vnicProfile.getName ( ) ) ; parameters.put ( FragmentParams.NETWORK.getName ( ) , vnicProfile.getNetworkName ( ) ) ; parameters.put ( FragmentParams.DATACENTER.getName ( ) , vnicProfile.getDataCenterName ( ) ) ; getPlaceTransitionHandler ( ) . handlePlaceTransition ( WebAdminApplicationPlaces.vnicProfileVmSubTabPlace , parameters ) ; }
Source:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = createBondSlaves ( null ) . subList ( 0 , 1 ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }

Target:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.validateCoherentIdentification ( ( violatingEntityId == null ? null : violatingEntityId.toString ( ) ) , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( java.lang.String.valueOf ( violatingEntityId ) , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }
Source:
protected void init ( ) { super . init ( ) ; if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) { setStoragePoolId ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getStoragePoolId ( ) ) ; loadPayloadDevice ( ) ; needsHostDevices = hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; loadVmInit ( ) ; fetchVmDisksFromDb ( ) ; } }

Target:
protected void init ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) == null ) { return ; } super . init ( ) ; setStoragePoolId ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getStoragePoolId ( ) ) ; loadPayloadDevice ( ) ; needsHostDevices = hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; loadVmInit ( ) ; fetchVmDisksFromDb ( ) ; org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setBootSequence ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDefaultBootSequence ( ) ) ; org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setRunOnce ( false ) ; }
Source:
public void loadVmsFromExportDomain ( ) { clearProblem ( ) ; startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenters ( ) . getSelectedItem ( ) . getId ( ) , exportDomain.getEntity ( ) . getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateVms ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; } } ) ) ; }

Target:
public void loadVmsFromExportDomain ( ) { clearProblem ( ) ; startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenters ( ) . getSelectedItem ( ) . getId ( ) , exportDomain.getEntity ( ) . getId ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { updateVms ( returnValue.< java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; } } ) ) ; }