auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void initTable ( ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . enableColumnResizing ( ) ; addTypeColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addUserColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAuthzColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addNameSpaceColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRoleColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addCreationDateColum ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAddPermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRemovePermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; }

Target:
private void addNameSpaceColumn ( ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > namespaceColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Permission object ) { return object.getNamespace ( ) ; } } ; namespaceColumn.makeSortable ( ) ; org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( namespaceColumn , org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants.namespace ( ) , "150px" ) ; }
Source:
public void test32BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupCompatibilityVersion ( Version.v3_3 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_32_BIT ) + 1 ) ) ; mockOsRepository ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }

Target:
public void test32BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v3_3 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_32_BIT ) + 1 ) ) ; mockOsRepository ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeWithRebalanceTask ) ) ; prepareMocks ( cmd ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . endStepJob ( ) ; org.mockito.Mockito.verify ( cmd ) . clearVolumeTaskAndReleaseLock ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeWithRebalanceTask ) ) ; prepareMocks ( cmd ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . endStepJob ( ) ; org.mockito.Mockito.verify ( cmd ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP ) ; }
Source:
protected java.util.Set < java.lang.String > getClusterForVolumes ( java.util.Collection < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > eligibleVolumes ) { java.util.Set < java.lang.String > clusters = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity currentVolume : eligibleVolumes ) { clusters.add ( currentVolume.getVdsGroupName ( ) ) ; } return clusters ; }

Target:
protected java.util.Set < java.lang.String > getClusterForVolumes ( java.util.Collection < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > eligibleVolumes ) { java.util.Set < java.lang.String > clusters = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity currentVolume : eligibleVolumes ) { clusters.add ( currentVolume.getClusterName ( ) ) ; } return clusters ; }
Source:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
private static java.util.Map < java.lang.String , java.lang.Object > getUsbControllerSpecParams ( java.lang.String model , int controllerNumber , int index ) { java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( VdsProperties.Model , ( model + controllerNumber ) ) ; specParams.put ( VdsProperties.Index , java.lang.Integer.toString ( index ) ) ; return specParams ; }

Target:
private static java.util.Map < java.lang.String , java.lang.Object > createUsbControllerSpecParams ( java.lang.String model , int index ) { final java.util.HashMap < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( VdsProperties.Model , model ) ; specParams.put ( VdsProperties.Index , java.lang.Integer.toString ( index ) ) ; return specParams ; }
Source:
public void testGetForceFalse ( ) throws java.lang.Exception { testGetWithForce ( false , setUpBasicUriExpectations ( ) , true ) ; }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { org.ovirt.engine.core.compat.Guid returnValue = org.ovirt.engine.core.compat.Guid.Empty ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = getStorageDomain ( poolId , type ) ; if ( domain != null ) { returnValue = domain.getId ( ) ; } return returnValue ; }

Target:
private org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.compat.Guid returnValue = org.ovirt.engine.core.compat.Guid.Empty ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = getStorageDomain ( poolId , type , status ) ; if ( domain != null ) { returnValue = domain.getId ( ) ; } return returnValue ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc createVG ( java.lang.String sdUUID , java.lang.String [ ] deviceList ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "LVMVolumeGroup.create" ) . withParameter ( "name" , sdUUID ) . withParameter ( "devlist" , new java.util.ArrayList < > ( java.util.Arrays.asList ( deviceList ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc getHostJobs ( java.lang.String jobType , java.util.List < java.lang.String > jobIds ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getJobs" ) . withOptionalParameter ( "job_type" , jobType ) . withOptionalParameterAsList ( "job_ids" , jobIds ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "jobs" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc ( response ) ; }
Source:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.FenceAgent createFenceAgent ( org.ovirt.engine.core.compat.Guid id , java.lang.String ip , java.lang.String type , java.lang.String user , java.lang.String password , int port , java.lang.String options , int order ) { org.ovirt.engine.core.common.businessentities.FenceAgent agent = new org.ovirt.engine.core.common.businessentities.FenceAgent ( ) ; agent.setId ( id ) ; agent.setIp ( ip ) ; agent.setType ( type ) ; agent.setUser ( user ) ; agent.setPassword ( password ) ; agent.setPort ( port ) ; agent.setOptions ( options ) ; agent.setOrder ( order ) ; return agent ; }

Target:
private org.ovirt.engine.core.common.businessentities.pm.FenceAgent createFenceAgent ( org.ovirt.engine.core.compat.Guid id , java.lang.String ip , java.lang.String type , java.lang.String user , java.lang.String password , int port , java.lang.String options , int order ) { org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent = new org.ovirt.engine.core.common.businessentities.pm.FenceAgent ( ) ; agent.setId ( id ) ; agent.setIp ( ip ) ; agent.setType ( type ) ; agent.setUser ( user ) ; agent.setPassword ( password ) ; agent.setPort ( port ) ; agent.setOptions ( options ) ; agent.setOrder ( order ) ; return agent ; }
Source:
public static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient createStompClient ( java.lang.String hostname , int port , int connectionTimeout , int clientTimeout , int connectionRetry , int heartbeat , boolean isSecure , java.lang.String protocol ) { return org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createClient ( hostname , port , connectionTimeout , clientTimeout , connectionRetry , heartbeat , isSecure , ReactorType.STOMP , protocol ) ; }

Target:
public static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient createStompClient ( java.lang.String hostname , int port , int connectionTimeout , int clientTimeout , int connectionRetry , int heartbeat , boolean isSecure , java.lang.String protocol , java.lang.String requestQueue , java.lang.String responseQueue ) { org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy connectionPolicy = new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompClientPolicy ( connectionTimeout , connectionRetry , heartbeat , java.io.IOException.class , requestQueue , responseQueue ) ; org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy clientPolicy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( clientTimeout , connectionRetry , heartbeat , java.io.IOException.class ) ; return org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createClient ( hostname , port , connectionPolicy , clientPolicy , isSecure , ReactorType.STOMP , protocol ) ; }
Source:
public static org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getIdColumn ( 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.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return object.getId ( ) . toString ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Disk > getIdColumn ( 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.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return object.getId ( ) . toString ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
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:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public 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 void getGlusterVolumeGeoRepRecommendationViolations ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId , org.ovirt.engine.core.compat.Guid slaveVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return returnValue == null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ) ( returnValue ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNonEligibilityReasonsOfVolumeForGeoRepSession , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeGeoRepEligibilityParameters ( masterVolumeId , slaveVolumeId ) , aQuery ) ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static void getClusterServerMemoryOverCommit ( 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 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAffinityGroupsByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpAffinityGroups ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAffinityGroupsByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpAffinityGroups ( ) , failure ) ; }
Source:
public void start ( ) { org.ovirt.engine.ui.uicommonweb.models.GridTimer.logger.fine ( ( ( "GridTimer[" + ( name ) ) + "].start()" ) ) ; active = true ; scheduleRepeating ( getRefreshRate ( ) ) ; com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( this , getValue ( ) ) ; }

Target:
public void setRefreshRate ( int interval ) { if ( ( getRefreshRate ( ) ) == interval ) { return ; } reset ( ) ; org.ovirt.engine.ui.uicommonweb.models.GridTimer.logger.fine ( ( ( ( "GridTimer[" + ( name ) ) + "]: Refresh Rate set to: " ) + interval ) ) ; normalInterval = interval ; com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( this , getRefreshRate ( ) ) ; }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static void getRpmVersion ( 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.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void testGetCascadingResourceMissingResourcesFile ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "04-test4.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme4 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 2 ) ; org.junit.Assert.assertTrue ( "Theme 4 should load" , theme4.load ( ) ) ; org.junit.Assert.assertNull ( "getCascadingResource not handling missing resources.properties gracefully" , theme4.getCascadingResource ( "this_file_is_missing_anyway" ) ) ; }

Target:
public void testGetCascadingResourceMissingResourcesFile ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "04-test4.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme4 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 2 ) ; org.junit.jupiter.api.Assertions.assertTrue ( theme4.load ( ) , "Theme 4 should load" ) ; org.junit.jupiter.api.Assertions.assertNull ( theme4.getCascadingResource ( "this_file_is_missing_anyway" ) , "getCascadingResource not handling missing resources.properties gracefully" ) ; }
Source:
private void addUpdatedVm ( ) { org.ovirt.engine.core.common.action.VdcActionType action = ( ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getParameters ( ) . getVmPoolId ( ) ) == null ) ? org.ovirt.engine.core.common.action.VdcActionType.AddVm : org.ovirt.engine.core.common.action.VdcActionType.AddVmAndAttachToPool ; runInternalAction ( action , buildAddVmParameters ( action ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getContext ( ) , org.ovirt.engine.core.bll.UpdateVmVersionCommand.getLock ( ) ) ) ; }

Target:
private void addUpdatedVm ( ) { runInternalAction ( VdcActionType.AddVm , buildAddVmParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getContext ( ) , org.ovirt.engine.core.bll.UpdateVmVersionCommand.getLock ( ) ) ) ; }
Source:
public boolean flush ( ) { if ( validate ( ) ) { diskModel.flush ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getDiskModel ( ) . getDisk ( ) ) ) . setVolumeFormat ( getVolumeFormat ( ) . getSelectedItem ( ) ) ; return true ; } return false ; }

Target:
public boolean flush ( ) { if ( validate ( ) ) { diskModel.flush ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getDiskModel ( ) . getDisk ( ) ) ) . setVolumeFormat ( getVolumeFormat ( ) . getSelectedItem ( ) ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getDiskModel ( ) . getDisk ( ) ) ) . setActualSizeInBytes ( getImageSize ( ) ) ; return true ; } return false ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.Map < java.lang.String , java.lang.String > timeZones = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel.cachedTimeZones.put ( timeZoneType , timeZones ) ; org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel.mapListModels ( timeZoneType , timeZones ) ; postUpdateTimeZones.run ( ) ; }

Target:
public java.lang.String getDisplayValue ( ) { if ( isDefault ( ) ) { final java.lang.String defaultTimeZoneKey = ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( timeZoneType.getDefaultTimeZoneConfigurationKey ( ) ) ) ) ; if ( ! ( timeZoneType.getTimeZoneList ( ) . containsKey ( defaultTimeZoneKey ) ) ) { timeZoneKey = timeZoneType.getUltimateFallback ( ) ; } return timeZoneType.getTimeZoneList ( ) . get ( defaultTimeZoneKey ) ; } else { return timeZoneType.getTimeZoneList ( ) . get ( timeZoneKey ) ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.provider.ProviderValidator validator = new org.ovirt.engine.core.bll.provider.ProviderValidator ( getProvider ( ) ) ; org.ovirt.engine.core.common.businessentities.Provider oldProvider = org.ovirt.engine.core.bll.provider.UpdateProviderCommand.getDbFacade ( ) . getNetworkProviderDao ( ) . get ( getProvider ( ) . getId ( ) ) ; return ( nameKept ( oldProvider ) ) || ( validate ( validator.nameAvailable ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.Provider getOldProvider ( ) { if ( ( oldProvider ) == null ) { oldProvider = getProviderDao ( ) . get ( getProvider ( ) . getId ( ) ) ; } return oldProvider ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidateModifiedBondSlaves ( bond , null , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , false , VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }

Target:
public void testValidModifiedBondsWhenAllOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( "bond1" ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , ValidationResult.VALID , ValidationResult.VALID ) ; }
Source:
public void testGetQuotaByExistingName ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quotaGeneralToSpecific = dao.getQuotaByQuotaName ( "Quota General" ) ; org.junit.Assert.assertEquals ( dao.getById ( FixturesTool.QUOTA_GENERAL ) . getQuotaName ( ) . equals ( quotaGeneralToSpecific.getQuotaName ( ) ) , true ) ; org.junit.Assert.assertEquals ( dao.getById ( FixturesTool.QUOTA_GENERAL ) . getId ( ) . equals ( quotaGeneralToSpecific.getId ( ) ) , true ) ; }

Target:
public void testGetQuotaByExistingName ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quotaGeneralToSpecific = dao.getQuotaByQuotaName ( "Quota General" , FixturesTool.STORAGE_POOL_NFS ) ; org.junit.Assert.assertEquals ( dao.getById ( FixturesTool.QUOTA_GENERAL ) . getQuotaName ( ) . equals ( quotaGeneralToSpecific.getQuotaName ( ) ) , true ) ; org.junit.Assert.assertEquals ( dao.getById ( FixturesTool.QUOTA_GENERAL ) . getId ( ) . equals ( quotaGeneralToSpecific.getId ( ) ) , true ) ; }
Source:
public void cancel ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . unsubscribe ( ) ; cancelConfirmation ( ) ; setGuideContext ( null ) ; setWindow ( null ) ; updateActionAvailability ( ) ; }

Target:
protected int getMaxClonedNameLength ( java.lang.Object object ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getVm ( ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isWindowsOsType ( vm.getOs ( ) ) ? org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmNameLengthWin ( ) : org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmNameLengthNonWin ( ) ; }
Source:
public void fillReportedConfigurations ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments , org.ovirt.engine.core.compat.Guid hostId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allInterfacesForHost = interfaceDao.getAllInterfacesForVds ( hostId ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networkDao.getAllForCluster ( vdsDao.get ( hostId ) . getClusterId ( ) ) ) ; fillReportedConfigurations ( allInterfacesForHost , networkMap , networkAttachments ) ; }

Target:
public void fillReportedConfigurations ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allInterfacesForHost , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap , java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = clusterDao.get ( clusterId ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkNameToNicMap = nicsByNetworkId ( allInterfacesForHost ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { fillReportedConfigurations ( networkNameToNicMap , networkMap , networkAttachment , cluster ) ; } }
Source:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVmForFail ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void moveShareableDisk ( ) { initializeCommand ( ImageOperation.Move ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.users.VdcUser loggedUser = loginModel.getLoggedUser ( ) ; java.lang.String loginPassword = ( ( java.lang.String ) ( loginModel.getPassword ( ) . getEntity ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( loggedUser ) ; org.ovirt.engine.ui.frontend.Frontend.setLoginPassword ( loginPassword ) ; beforeUiCommonInitEvent ( loginModel ) ; org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.fire ( eventBus ) ; user.onUserLogin ( loggedUser ) ; loginModel.getPassword ( ) . setEntity ( null ) ; }

Target:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.businessentities.DbUser loggedUser = loginModel.getLoggedUser ( ) ; java.lang.String loginPassword = ( ( java.lang.String ) ( loginModel.getPassword ( ) . getEntity ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.initLoggedInUser ( loggedUser , loginPassword ) ; beforeUiCommonInitEvent ( loginModel ) ; org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.fire ( eventBus ) ; user.onUserLogin ( loggedUser ) ; loginModel.getPassword ( ) . setEntity ( null ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getAdGroupDao ( ) ) ; newAdGroup = new org.ovirt.engine.core.common.businessentities.ad_groups ( ) ; newAdGroup.setid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; newAdGroup.setdomain ( "domain" ) ; newAdGroup.setname ( "name" ) ; newAdGroup.setstatus ( AdRefStatus.Active ) ; existingAdGroup = dao.get ( new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getAdGroupDao ( ) ) ; newAdGroup = new org.ovirt.engine.core.common.businessentities.LdapGroup ( ) ; newAdGroup.setid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; newAdGroup.setdomain ( "domain" ) ; newAdGroup.setname ( "name" ) ; newAdGroup.setstatus ( LdapRefStatus.Active ) ; existingAdGroup = dao.get ( new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ) ; }
Source:
public org.ovirt.engine.core.common.action.CreateOvfVolumeForStorageDomainCommandParameters createCreateOvfVolumeForStorageDomainParams ( ) { org.ovirt.engine.core.common.action.CreateOvfVolumeForStorageDomainCommandParameters parameters = new org.ovirt.engine.core.common.action.CreateOvfVolumeForStorageDomainCommandParameters ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSkipDomainChecks ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . isSkipDomainChecks ( ) ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) ) ; parameters.setShouldBeEndedByParent ( false ) ; return parameters ; }

Target:
public org.ovirt.engine.core.common.action.CreateOvfVolumeForStorageDomainCommandParameters createCreateOvfVolumeForStorageDomainParams ( ) { org.ovirt.engine.core.common.action.CreateOvfVolumeForStorageDomainCommandParameters parameters = new org.ovirt.engine.core.common.action.CreateOvfVolumeForStorageDomainCommandParameters ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSkipDomainChecks ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . isSkipDomainChecks ( ) ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) ) ; parameters.setEndProcedure ( EndProcedure.COMMAND_MANAGED ) ; return parameters ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( "TYPE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmPoolType.class ) ; } else if ( "ARCHITECTURE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ; } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.PoolConditionFieldAutoCompleter.TYPE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmPoolType.class ) ; } else if ( org.ovirt.engine.core.searchbackend.PoolConditionFieldAutoCompleter.ARCHITECTURE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ; } return retval ; }
Source:
public 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 void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
public void testNoChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.GetChangedFields ( jedi1 , jedi2 ) ; assertTrue ( "Should be no changes" , ( ( changes.size ( ) ) == 0 ) ) ; }

Target:
public void testNoChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.GetChangedFields ( jedi1 , jedi2 ) ; org.junit.Assert.assertTrue ( "Should be no changes" , ( ( changes.size ( ) ) == 0 ) ) ; }
Source:
protected void initProfiles ( ) { java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > existingProfiles = getProfiles ( ) . getItems ( ) ; if ( existingProfiles == null ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > profiles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > ( ) ; profiles.add ( createDefaultProfile ( ) ) ; getProfiles ( ) . setItems ( profiles ) ; } else { for ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profile : existingProfiles ) { profile.updateDc ( getSelectedDc ( ) . getcompatibility_version ( ) , false , getSelectedDc ( ) . getId ( ) , null ) ; } } }

Target:
protected void initProfiles ( ) { java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > existingProfiles = getProfiles ( ) . getItems ( ) ; if ( existingProfiles == null ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > profiles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > ( ) ; profiles.add ( getDefaultProfile ( ) ) ; getProfiles ( ) . setItems ( profiles ) ; } else { for ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profile : existingProfiles ) { profile.updateDc ( getSelectedDc ( ) . getcompatibility_version ( ) , false , getSelectedDc ( ) . getId ( ) , null ) ; } } }
Source:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterRebalanceStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRebalanceStatus , parameters , aQuery ) ; }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.UserProfile profile ) { getCallsHandler ( ) . executeModification ( "UpdateUserProfile" , createIdParameterMapper ( profile.getId ( ) ) . addValue ( "user_id" , profile.getUserId ( ) ) . addValue ( "ssh_public_key" , profile.getSshPublicKey ( ) ) . addValue ( "user_portal_vm_auto_login" , profile.isUserPortalVmLoginAutomatically ( ) ) ) ; }

Target:
public void update ( org.ovirt.engine.core.common.businessentities.UserProfile profile ) { getCallsHandler ( ) . executeModification ( "UpdateUserProfile" , createIdParameterMapper ( profile.getId ( ) ) . addValue ( "user_id" , profile.getUserId ( ) ) . addValue ( "ssh_public_key_id" , profile.getSshPublicKeyId ( ) ) . addValue ( "ssh_public_key" , profile.getSshPublicKey ( ) ) . addValue ( "user_portal_vm_auto_login" , profile.isUserPortalVmLoginAutomatically ( ) ) ) ; }
Source:
public void isCpuPinningValidWithoutPinnedHost ( ) { org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > test = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > ( org.ovirt.engine.core.compat.Guid.Empty ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setNumOfSockets ( 6 ) ; vmStatic.setCpuPerSocket ( 2 ) ; vmStatic.setDedicatedVmForVdsList ( new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ) ; org.junit.Assert.assertFalse ( test.isCpuPinningValid ( "0#0" , vmStatic ) ) ; org.junit.Assert.assertFalse ( test.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_WITH_UNDEFINED_HOST ) ) ; }

Target:
public void isCpuPinningValidWithoutPinnedHost ( ) { org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > test = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > ( org.ovirt.engine.core.compat.Guid.Empty ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setNumOfSockets ( 6 ) ; vmStatic.setCpuPerSocket ( 2 ) ; vmStatic.setDedicatedVmForVdsList ( new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ) ; org.junit.Assert.assertFalse ( test.isCpuPinningValid ( "0#0" , vmStatic ) ) ; org.junit.Assert.assertFalse ( test.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_WITH_UNDEFINED_HOST ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = true ; if ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) . equals ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } if ( org.ovirt.engine.core.bll.TagsDirector.getInstance ( ) . IsTagDescestorOfTag ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) , org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } return returnValue ; }

Target:
protected boolean canDoAction ( ) { boolean returnValue = true ; if ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) . equals ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } if ( org.ovirt.engine.core.bll.TagsDirector.getInstance ( ) . isTagDescestorOfTag ( org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getTagId ( ) , org.ovirt.engine.core.bll.MoveTagCommand.getParameters ( ) . getNewParentId ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.TAGS_SPECIFIED_TAG_CANNOT_BE_THE_PARENT_OF_ITSELF ) ; returnValue = false ; } return returnValue ; }