auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( ( permsList ) == null ) && ( ( getDisk ( ) ) != null ) ) { permsList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getDisk ( ) . getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_DISK ) ) ; } return permsList ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK_NO_DOMAIN : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK_NO_DOMAIN ; } else if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.CINDER ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_DISK_INITIATED : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; } return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } }
Source:
public static void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , 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 ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( 25 ) ; builder.append ( "refresh: " ) ; builder.append ( refresh ) ; builder.append ( ", filtered: " ) ; builder.append ( isFiltered ) ; return builder.toString ( ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return tsb.append ( "refresh" , refresh ) . append ( "filtered" , isFiltered ) ; }
Source:
protected void setObjectName ( java.lang.Object object , java.lang.String name , boolean isSuffix ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( object ) ) ; if ( isSuffix ) { template.setname ( ( ( template.getname ( ) ) + name ) ) ; } else { template.setname ( name ) ; } }

Target:
protected void setObjectName ( java.lang.Object object , java.lang.String name , boolean isSuffix ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( object ) ) . getTemplate ( ) ; if ( isSuffix ) { template.setname ( ( ( template.getname ( ) ) + name ) ) ; } else { template.setname ( name ) ; } }
Source:
public void getClusterById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.Cluster getCluster ( int index ) { org.ovirt.engine.api.restapi.resource.Cluster entity = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; return entity ; }

Target:
protected void setUpEntityQueryExpectations ( int times , boolean isDisplay , boolean isMigration , boolean isRequired , boolean isDefaultRoute ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( isDisplay , isMigration , isRequired , isDefaultRoute ) ) ; } }
Source:
public static java.util.List < java.lang.String > runAndAssertCanDoActionFailure ( org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { boolean canDoAction = command.canDoAction ( ) ; java.util.List < java.lang.String > canDoActionMessages = command.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertFalse ( "Command's canDoAction expected to fail, but succeeded" , canDoAction ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "canDoAction messages doesn''t contain expected message: {0}, messages are: {1}" , message.name ( ) , canDoActionMessages ) , canDoActionMessages.contains ( message.name ( ) ) ) ; return canDoActionMessages ; }

Target:
private static java.util.List < java.lang.String > assertCanDoActionMessages ( java.lang.String assertionMessage , org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { java.util.List < java.lang.String > canDoActionMessages = command.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "{0}canDoAction messages doesn''t contain expected message: {1}, messages are: {2}" , org.ovirt.engine.core.bll.CanDoActionTestUtils.optionalMessage ( assertionMessage ) , message.name ( ) , canDoActionMessages ) , canDoActionMessages.contains ( message.name ( ) ) ) ; return canDoActionMessages ; }
Source:
public void testExecuteQuery ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . isWindowsOS ( ) ) . thenReturn ( true ) ; getQuery ( ) . executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , java.lang.String > result = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; assertEquals ( "Wrong number of time zones" , SysprepHandler.timeZoneIndex.size ( ) , result.size ( ) ) ; }

Target:
public void testExecuteQuery ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getTimeZoneType ( ) ) . thenReturn ( TimeZoneType.WINDOWS_TIMEZONE ) ; getQuery ( ) . executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , java.lang.String > result = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( "Wrong number of time zones" , SysprepHandler.timeZoneIndex.size ( ) , result.size ( ) ) ; }
Source:
private void initParetResource ( org.ovirt.engine.api.restapi.resource.AbstractBackendGroupsResource resource , javax.ws.rs.core.UriInfo uriInfo ) { initResource ( resource ) ; resource.setUriInfo ( uriInfo ) ; }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void checkNoHost ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; parameters.setVdsId ( null ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VDS_EMPTY_NAME_OR_ID ) ; }

Target:
public void checkNoHost ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; parameters.setVdsId ( null ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void setSelectedProtocol ( org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol protocol , org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel item ) { consoleModelsCache.setSelectedProtocol ( protocol , item ) ; }

Target:
private boolean isConsoleCommandsExecutionAllowed ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VM > list = ( ( getSelectedItem ( ) ) == null ) ? null : getSelectedItems ( ) ; if ( list == null ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.VM vm : list ) { if ( consoleModelsCache.getVmConsolesForEntity ( vm ) . canConnectToConsole ( ) ) { return true ; } } return false ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult labeledValidBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( ! ( java.lang.Boolean.TRUE.equals ( iface.getBonded ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.IMPROPER_BOND_IS_LABELED ) . when ( ( ( getSlaveCount ( nics , 2 ) ) < 2 ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult labeledValidBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( ! ( java.lang.Boolean.TRUE.equals ( iface.getBonded ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.IMPROPER_BOND_IS_LABELED ) . when ( ( ( getSlaveCount ( nics , 2 ) ) < 2 ) ) ; }
Source:
public void testGetBaseNicUsingCache ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > cachedExistingInterfaces = java.util.Collections.singletonMap ( baseNic.getName ( ) , baseNic ) ; org.junit.Assert.assertThat ( calculateBaseNic.getBaseNic ( vlanNic , cachedExistingInterfaces ) , org.hamcrest.CoreMatchers.is ( baseNic ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( interfaceDao ) ; }

Target:
public void testGetBaseNicUsingCache ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > cachedExistingInterfaces = java.util.Collections.singletonMap ( baseNic.getName ( ) , baseNic ) ; org.hamcrest.MatcherAssert.assertThat ( calculateBaseNic.getBaseNic ( vlanNic , cachedExistingInterfaces ) , org.hamcrest.CoreMatchers.is ( baseNic ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( interfaceDao ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void canDoActionVmInPreview ( ) { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
protected boolean canDoAction ( ) { if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand.getVdsId ( ) ) ) { return failCanDoAction ( EngineMessage.VDS_INVALID_SERVER_ID ) ; } if ( ( org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand.getVds ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand.getVdsId ( ) ) ) { return failValidation ( EngineMessage.VDS_INVALID_SERVER_ID ) ; } if ( ( org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand.getVds ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; } return true ; }
Source:
public static java.lang.String resolveJobMessage ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.Map < java.lang.String , java.lang.String > values ) { java.lang.String jobMessage = org.ovirt.engine.core.dal.job.ExecutionMessageDirector.getInstance ( ) . getJobMessage ( actionType ) ; if ( jobMessage != null ) { return org.ovirt.engine.core.dal.job.ExecutionMessageDirector.auditLogDirector.resolveMessage ( jobMessage , values ) ; } else { return actionType.name ( ) ; } }

Target:
public static java.lang.String resolveJobMessage ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.Map < java.lang.String , java.lang.String > values ) { java.lang.String jobMessage = org.ovirt.engine.core.dal.job.ExecutionMessageDirector.getInstance ( ) . getJobMessage ( actionType ) ; if ( jobMessage != null ) { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageResolver.resolveMessage ( jobMessage , values ) ; } else { return actionType.name ( ) ; } }
Source:
public 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 getStorageDomainMaxNameLength ( 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 ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void fixBootProtocolOfMgmtNetworkIfNeeded ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address ipV4address = networkAttachment.getIpConfiguration ( ) . getPrimaryAddress ( ) ; if ( ( networkModel.isManagement ( ) ) && ( ( ( ipV4address.getBootProtocol ( ) ) == null ) || ( ( ipV4address.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ) { ipV4address.setBootProtocol ( NetworkBootProtocol.DHCP ) ; } }

Target:
private void fixBootProtocolOfMgmtNetworkIfNeeded ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address ipV4address = networkAttachment.getIpConfiguration ( ) . getIpv4PrimaryAddress ( ) ; if ( ( networkModel.isManagement ( ) ) && ( ( ( ipV4address.getBootProtocol ( ) ) == null ) || ( ( ipV4address.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ) { ipV4address.setBootProtocol ( NetworkBootProtocol.DHCP ) ; } }
Source:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setForce ( true ) ; verifyRemove ( resource.remove ( action ) ) ; }

Target:
public void testRemoveByStorageDomain ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendTemplateDiskResource.STORAGE_DOMAIN , GUIDS [ 0 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void tJDBCOutput_6_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.aggregationtohourly_3_4.AggregationToHourly.TalendException { end_Hash.put ( "tJDBCOutput_6" , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tJDBCInput_6_onSubJobError ( exception , errorComponent , globalMap ) ; }

Target:
public void tJDBCOutput_6_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.aggregationtohourly_3_4.AggregationToHourly.TalendException { end_Hash.put ( "tJDBCOutput_6" , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tRowGenerator_1_onSubJobError ( exception , errorComponent , globalMap ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateVmStatusUsingMatrix ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ! ( org.ovirt.engine.core.common.VdcActionUtils.canExecute ( java.util.Arrays.asList ( vm ) , org.ovirt.engine.core.common.businessentities.VM.class , actionType ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( vm.getStatus ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateVmStatusUsingMatrix ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ! ( org.ovirt.engine.core.common.VdcActionUtils.canExecute ( java.util.Arrays.asList ( vm ) , org.ovirt.engine.core.common.businessentities.VM.class , actionType ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( vm.getStatus ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { return org.ovirt.engine.core.bll.tasks.TaskManagerUtil.createTask ( this , asyncTaskCreationInfo , parentCommand , null , entityType , entityIds ) ; }

Target:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . CancelTasks ( getReturnValue ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }
Source:
private java.lang.String createRdpInvocationInfo ( ) { return new org.ovirt.engine.ui.common.view.popup.ConsolePopupView.KeyValueHtmlRowMaker ( constants.auto ( ) , constants.rdpInvokeAuto ( ) ) . append ( constants.nativeClient ( ) , constants.rdpInvokeNative ( ) ) . append ( constants.browserPlugin ( ) , constants.rdpInvokePlugin ( ) ) . toString ( ) ; }

Target:
public void setSpiceHtml5ImplEnabled ( boolean enabled , java.lang.String reason ) { spiceHtml5ImplRadioButton.setEnabled ( enabled ) ; if ( ! enabled ) { spiceHtml5ImplRadioButtonTooltip.setText ( reason ) ; } }
Source:
private void changeRawToCowIfSparseOnBlockDevice ( org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.DiskImage image ) { if ( ( ( ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.FCP ) ) || ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.ISCSI ) ) ) && ( ( image.getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ) ) ) && ( ( image.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { image.setvolumeFormat ( VolumeFormat.COW ) ; } }

Target:
private void changeRawToCowIfSparseOnBlockDevice ( org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.DiskImage image ) { if ( ( ( storageType.isBlockDomain ( ) ) && ( ( image.getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ) ) ) && ( ( image.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { image.setvolumeFormat ( VolumeFormat.COW ) ; } }
Source:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryPrincipals ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final org.ovirt.engine.api.extensions.ExtMap filter , boolean recursiveGroupsResolving ) { return org.ovirt.engine.core.aaa.AuthzUtils.populatePrincipals ( extension , Authz.InvokeCommands.QUERY_OPEN , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.PRINCIPAL ) . mput ( Authz.InvokeKeys.RESOLVE_GROUPS_RECURSIVE , recursiveGroupsResolving ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) ) ; }

Target:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryPrincipals ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { org.ovirt.engine.api.extensions.ExtMap inputMap = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.PRINCIPAL ) . mput ( Authz.InvokeKeys.QUERY_FLAGS , org.ovirt.engine.core.aaa.AuthzUtils.queryFlagValue ( groupsResolving , groupsResolvingRecursive ) ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) . mput ( Authz.InvokeKeys.NAMESPACE , namespace ) ; return org.ovirt.engine.core.aaa.AuthzUtils.populatePrincipals ( extension , namespace , inputMap ) ; }
Source:
private java.lang.String getConstraint ( java.lang.String providerType ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; buffer.append ( "Providers: type=" ) ; buffer.append ( providerType ) ; java.lang.String query = org.ovirt.engine.api.restapi.util.QueryHelper.getConstraint ( httpHeaders , uriInfo , null , modelType , false ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( query ) ) { buffer.append ( " AND (" ) ; buffer.append ( query ) ; buffer.append ( ")" ) ; } return buffer.toString ( ) ; }

Target:
private java.lang.String getConstraint ( java.lang.String providerType ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; buffer.append ( "Providers: type=" ) ; buffer.append ( providerType ) ; java.lang.String query = org.ovirt.engine.api.restapi.util.QueryHelper.getConstraint ( httpHeaders , uriInfo , null , modelType , false ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( query ) ) { buffer.append ( java.lang.String.format ( " AND %1$s" , query ) ) ; } return buffer.toString ( ) ; }
Source:
public void networkRemovedFromBond ( ) { java.lang.String networkName = "net" ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( networkName ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = createBondSlaves ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; bond.setNetworkName ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertBondModified ( helper , bond ) ; assertNoNetworksModified ( helper ) ; assertNetworkRemoved ( helper , networkName ) ; assertNoBondsRemoved ( helper ) ; }

Target:
public void bondWithNoNetowrkAttached ( ) { 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 > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; validateAndExpectNoViolations ( helper ) ; assertBondModified ( helper , bond ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel < java.lang.Void > source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getResetEmulatedMachineCommand ( ) ) ) { return defaultConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult networksAreAttachedToThisInterface ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > hostInterfaces , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworksWithLabel ) { java.util.List < java.lang.String > assignedNetworks = validateNetworksNotAssignedToIncorrectNics ( hostInterfaces , clusterNetworksWithLabel ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.LABELED_NETWORK_ATTACHED_TO_WRONG_INTERFACE , ( "$AssignedNetworks " + ( org.apache.commons.lang.StringUtils.join ( assignedNetworks , ", " ) ) ) ) . when ( ( ! ( assignedNetworks.isEmpty ( ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networksAreAttachedToThisInterface ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > hostInterfaces , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworksWithLabel ) { java.util.List < java.lang.String > assignedNetworks = validateNetworksNotAssignedToIncorrectNics ( hostInterfaces , clusterNetworksWithLabel ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.LABELED_NETWORK_ATTACHED_TO_WRONG_INTERFACE , org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_ASSIGNED_NETWORKS , assignedNetworks ) ) . when ( ( ! ( assignedNetworks.isEmpty ( ) ) ) ) ; }
Source:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnSave ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolModel model ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , vm.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.NameUnitToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CoreUnitToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsUnitToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.MigrationOptionsUnitToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.DedicatedVmForVdsUnitToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyUnitToVmBaseBuilder ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , vm , new org.ovirt.engine.ui.uicommonweb.builders.vm.VmSpecificUnitToVmBuilder ( ) ) ; return vm ; }

Target:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnSave ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolModel model ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , vm.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.NameUnitToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CoreUnitToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsUnitToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.MigrationOptionsUnitToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.DedicatedVmForVdsUnitToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyUnitToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CpuProfileUnitToVmBaseBuilder ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , vm , new org.ovirt.engine.ui.uicommonweb.builders.vm.VmSpecificUnitToVmBuilder ( ) ) ; return vm ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void addExternallyManagedVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > externalVmList ) { for ( org.ovirt.engine.core.common.businessentities.VmStatic currVm : externalVmList ) { org.ovirt.engine.core.common.action.AddVmParameters params = new org.ovirt.engine.core.common.action.AddVmParameters ( currVm ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.AddVmFromScratch , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.VdsEventListener.log.debug ( "Failed adding Externally managed VM '{}'" , currVm.getName ( ) ) ; } } }

Target:
public void addExternallyManagedVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > externalVmList ) { for ( org.ovirt.engine.core.common.businessentities.VmStatic currVm : externalVmList ) { org.ovirt.engine.core.common.action.AddVmParameters params = new org.ovirt.engine.core.common.action.AddVmParameters ( currVm ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = backend.runInternalAction ( VdcActionType.AddVmFromScratch , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.VdsEventListener.log.debug ( "Failed adding Externally managed VM '{}'" , currVm.getName ( ) ) ; } } }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpVersionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveStoragePool , org.ovirt.engine.core.common.action.StoragePoolParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpVersionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveStoragePool , org.ovirt.engine.core.common.action.StoragePoolParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void testAllByConnectionId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = dao.getAllByConnectionId ( new org.ovirt.engine.core.compat.Guid ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ) ; org.junit.Assert.assertEquals ( "Unexpected number of storage domains by connection id" , domains.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( "Wrong storage domain id for search by connection id" , domains.get ( 0 ) . getId ( ) , new org.ovirt.engine.core.compat.Guid ( "c2211b56-8869-41cd-84e1-78d7cb96f31d" ) ) ; }

Target:
public void testAllByConnectionId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = dao.getAllByConnectionId ( new org.ovirt.engine.core.compat.Guid ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ) ; org.junit.Assert.assertEquals ( "Unexpected number of storage domains by connection id" , domains.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( "Wrong storage domain id for search by connection id" , domains.get ( 0 ) . getId ( ) , FixturesTool.STORAGE_DOAMIN_NFS_MASTER ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS ) ; }

Target:
private boolean isNewAttachment ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { return networkAttachmentId == null ; }
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.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
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.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
private void assertGeneratesCorrect ( int maxNameLength , int poolNameLength , int expectedMaxNumOfVms ) { org.ovirt.engine.ui.uicommonweb.validation.ExistingPoolNameLengthValidation validation = new org.ovirt.engine.ui.uicommonweb.validation.ExistingPoolNameLengthValidation ( "" , 0 , org.ovirt.engine.core.common.osinfo.OsRepository.DEFAULT_X86_OS ) ; int res = validation.doGenerateMaxNumOfVms ( maxNameLength , poolNameLength ) ; org.junit.Assert.assertThat ( res , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expectedMaxNumOfVms ) ) ) ; }

Target:
private void assertGeneratesCorrect ( int maxNameLength , int poolNameLength , int expectedMaxNumOfVms ) { org.ovirt.engine.ui.uicommonweb.validation.ExistingPoolNameLengthValidation validation = new org.ovirt.engine.ui.uicommonweb.validation.ExistingPoolNameLengthValidation ( "" , 0 , org.ovirt.engine.core.common.osinfo.OsRepository.DEFAULT_X86_OS ) ; int res = validation.doGenerateMaxNumOfVms ( maxNameLength , poolNameLength ) ; org.hamcrest.MatcherAssert.assertThat ( res , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expectedMaxNumOfVms ) ) ) ; }
Source:
private void UpdateActionAvailability ( ) { java.util.List tempVar = getSelectedItems ( ) ; java.util.List selectedItems = ( tempVar != null ) ? tempVar : new java.util.ArrayList ( ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) == 1 ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) > 0 ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.List tempVar = getSelectedItems ( ) ; java.util.List selectedItems = ( tempVar != null ) ? tempVar : new java.util.ArrayList ( ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) == 1 ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) > 0 ) ) ; }