auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }
Source:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalAction ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( disk , containerID ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcRetValue.getFault ( ) . getError ( ) , "ImportVmCommand::MoveOrCopyAllImageGroups: Failed to copy disk!" ) ; } getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }

Target:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalAction ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( disk , containerID ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.ImportVmCommand.getExecutionContext ( ) ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcRetValue.getFault ( ) . getError ( ) , "ImportVmCommand::MoveOrCopyAllImageGroups: Failed to copy disk!" ) ; } getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }
Source:
public boolean isValid ( org.ovirt.engine.core.common.businessentities.VmBase value , javax.validation.ConstraintValidatorContext context ) { if ( ( value.getTimeZone ( ) ) == null ) { return true ; } org.ovirt.engine.core.common.TimeZoneType timeZoneType = ( osRepository.isWindows ( value.getOsId ( ) ) ) ? org.ovirt.engine.core.common.TimeZoneType.WINDOWS_TIMEZONE : org.ovirt.engine.core.common.TimeZoneType.GENERAL_TIMEZONE ; return timeZoneType.getTimeZoneList ( ) . containsKey ( value.getTimeZone ( ) ) ; }

Target:
public boolean isValid ( org.ovirt.engine.core.common.businessentities.VmBase value , javax.validation.ConstraintValidatorContext context ) { if ( ( ( value.getTimeZone ( ) ) == null ) || ( "" . equals ( value.getTimeZone ( ) . trim ( ) ) ) ) { return true ; } org.ovirt.engine.core.common.TimeZoneType timeZoneType = ( osRepository.isWindows ( value.getOsId ( ) ) ) ? org.ovirt.engine.core.common.TimeZoneType.WINDOWS_TIMEZONE : org.ovirt.engine.core.common.TimeZoneType.GENERAL_TIMEZONE ; return timeZoneType.getTimeZoneList ( ) . containsKey ( value.getTimeZone ( ) ) ; }
Source:
public void testChangeCaseDisplay ( ) { org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter ( ) ; org.junit.Assert.assertEquals ( "hello" , "Hello" , comp.changeCaseDisplay ( "hello" ) ) ; org.junit.Assert.assertEquals ( "Hello" , "Hello" , comp.changeCaseDisplay ( "Hello" ) ) ; org.junit.Assert.assertEquals ( "HELLO" , "Hello" , comp.changeCaseDisplay ( "HELLO" ) ) ; }

Target:
public void testChangeCaseDisplay ( ) { org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter ( ) ; org.junit.Assert.assertEquals ( "hello" , "Hello" , comp.changeCaseDisplay ( "hello" ) ) ; org.junit.Assert.assertEquals ( "Hello" , "Hello" , comp.changeCaseDisplay ( "Hello" ) ) ; org.junit.Assert.assertEquals ( "HELLO" , "Hello" , comp.changeCaseDisplay ( "HELLO" ) ) ; org.junit.Assert.assertEquals ( "helLO" , "Hello" , comp.changeCaseDisplay ( "helLO" ) ) ; }
Source:
public void getVmGuestAgentInterfacesByVmId ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getConfiguredVmHostDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmHostDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void testGetBadGuid ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpQueryExpectations ( new java.lang.String [ ] { "cpu.burnout" , "cpu.meltdown" , "cpu.vapourized" } , false ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetBadGuid ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpQueryExpectations ( new java.lang.String [ ] { "cpu.burnout" , "cpu.meltdown" , "cpu.vapourized" } , false ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private T getValueFromElement ( com.google.gwt.dom.client.Element target ) { com.google.gwt.dom.client.TableCellElement tableCell = findNearestParentCell ( target ) ; if ( tableCell != null ) { com.google.gwt.dom.client.Element trElem = tableCell.getParentElement ( ) ; com.google.gwt.dom.client.TableRowElement tr = com.google.gwt.dom.client.TableRowElement.as ( trElem ) ; int row = tr.getSectionRowIndex ( ) ; return table.getVisibleItem ( row ) ; } else { return null ; } }

Target:
private T getValueFromElement ( com.google.gwt.dom.client.Element target ) { com.google.gwt.dom.client.TableCellElement tableCell = findNearestParentCell ( target ) ; if ( tableCell != null ) { com.google.gwt.dom.client.Element trElem = tableCell.getParentElement ( ) ; com.google.gwt.dom.client.TableRowElement tr = com.google.gwt.dom.client.TableRowElement.as ( trElem ) ; int row = tr.getSectionRowIndex ( ) ; return ( table.getVisibleItemCount ( ) ) > 0 ? table.getVisibleItem ( row ) : null ; } else { return null ; } }
Source:
private org.ovirt.engine.core.dao.VdsGroupDAO mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDAO mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDAO.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; value.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.VdsGroupDao mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDao.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; value.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }
Source:
public void setUsePatternFly ( final boolean use ) { this . usePatternFly = use ; if ( use ) { setContentWidgetStyleName ( PatternflyConstants.FORM_CONTROL ) ; addLabelStyleName ( "label col-sm-2 col-md-2 control-label" ) ; addContentWidgetContainerStyleName ( "col-sm-10 col-md-10" ) ; wrapperPanel.getElement ( ) . addClassName ( PatternflyConstants.FORM_GROUP ) ; wrapperPanel.getElement ( ) . removeClassName ( style.wrapper ( ) ) ; contentWidgetContainer.asWidget ( ) . removeStyleName ( style.contentWidget ( ) ) ; } }

Target:
protected void updateLabelElementId ( java.lang.String elementId ) { label.setFor ( elementId ) ; }
Source:
protected void populateNamespaces ( ) { if ( ( namespacesMap ) != null ) { getNamespace ( ) . setItems ( namespacesMap.get ( ( ( org.ovirt.engine.core.aaa.ProfileEntry ) ( getProfile ( ) . getSelectedItem ( ) ) ) . getAuthz ( ) ) ) ; } }

Target:
private java.util.List < java.lang.String > getAuthzNamespaces ( ) { org.ovirt.engine.core.aaa.ProfileEntry profileEntry = ( ( org.ovirt.engine.core.aaa.ProfileEntry ) ( getProfile ( ) . getSelectedItem ( ) ) ) ; return profileEntry != null ? namespacesMap.get ( profileEntry.getAuthz ( ) ) : java.util.Collections.< java.lang.String > emptyList ( ) ; }
Source:
public void canDoActionFailsOnCompatVersion ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CommitRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , getBricks ( volumeWithRemoveBricksTask ) ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.UNSUPPORTED_VERSION ) . when ( vdsGroup ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }

Target:
public void validateFailsOnCompatVersion ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CommitRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , getBricks ( volumeWithRemoveBricksTask ) ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.UNSUPPORTED_VERSION ) . when ( vdsGroup ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Provider > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( returnValue == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.filterProvidersByProvidedType ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) , providedEntity ) ) ; java.util.Collections.sort ( providers , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return providers ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Provider > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( returnValue == null ) { return new java.util.ArrayList < > ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.filterProvidersByProvidedType ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) , providedEntity ) ) ; java.util.Collections.sort ( providers , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return providers ; }
Source:
public static 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 < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( 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 < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; 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 ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeParameterListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeEventListModel ( ) ) ; setDetailModels ( list ) ; }

Target:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeParameterListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeEventListModel ( ) ) ; setDetailModels ( list ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ) ( target ) ) ; behavior.postInitTemplate ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValue ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValue ) ) ; behavior.postInitTemplate ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterTemplatesByArchitecture ( templates , dataCenterWithCluster.getCluster ( ) . getArchitecture ( ) ) ) ; }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
private void setUpGetBallooningExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , true ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }
Source:
public java.util.ArrayList < java.lang.String > GetSupportedOptions ( java.lang.String agent ) { java.util.ArrayList < java.lang.String > agentOptions = new java.util.ArrayList < java.lang.String > ( ) ; if ( org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingOptionMapping.containsKey ( agent ) ) { java.util.HashMap < java.lang.String , java.lang.String > options = org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingOptionMapping.get ( agent ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > pair : options.entrySet ( ) ) { agentOptions.add ( pair.getKey ( ) ) ; } } else { org.ovirt.engine.core.utils.pm.VdsFencingOptions.log.errorFormat ( org.ovirt.engine.core.utils.pm.VdsFencingOptions.AGENT_ERROR , agent ) ; } return agentOptions ; }

Target:
public java.util.ArrayList < java.lang.String > GetSupportedOptions ( java.lang.String agent ) { java.util.ArrayList < java.lang.String > agentOptions = new java.util.ArrayList < java.lang.String > ( ) ; if ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionMapping.containsKey ( agent ) ) { java.util.HashMap < java.lang.String , java.lang.String > options = org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionMapping.get ( agent ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > pair : options.entrySet ( ) ) { agentOptions.add ( pair.getKey ( ) ) ; } } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.errorFormat ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } return agentOptions ; }
Source:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getAsyncTaskFromDb ( org.ovirt.engine.core.compat.Guid asyncTaskId ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( asyncTask != null ) { map ( coco.getCommandEntity ( asyncTask.getCommandId ( ) ) , asyncTask ) ; } return asyncTask ; }

Target:
public org.ovirt.engine.core.common.businessentities.AsyncTask getAsyncTaskFromDb ( org.ovirt.engine.core.compat.Guid asyncTaskId ) { org.ovirt.engine.core.common.businessentities.AsyncTask asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( asyncTask != null ) { asyncTask.setRootCmdEntity ( getCommandEntity ( asyncTask.getRootCommandId ( ) ) ) ; asyncTask.setChildCmdEntity ( getCommandEntity ( asyncTask.getCommandId ( ) ) ) ; } return asyncTask ; }
Source:
public void testExecuteCommandFailsWithServerIdForRestart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_RESTART ) ) ) ; setUpMockUpForStart ( ) ; mockBackend ( false , VdcBllErrors.GlusterServiceManageFailed , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.never ( ) ) . update ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_RESTART_FAILED ) ; }

Target:
public void testExecuteCommandFailsWithServerIdForRestart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_RESTART ) ) ) ; setUpMockUpForStart ( ) ; mockBackend ( false , VdcBllErrors.GlusterServiceManageFailed , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.never ( ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_RESTART_FAILED ) ; }
Source:
protected org.ovirt.engine.api.model.Disk postPopulate ( org.ovirt.engine.api.model.Disk model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) . value ( ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskInterface.class ) . value ( ) ) ; model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ) ; model.setLunStorage ( null ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Disk postPopulate ( org.ovirt.engine.api.model.Disk model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) . value ( ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskInterface.class ) . value ( ) ) ; model.setSgio ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ScsiGenericIO.class ) . value ( ) ) ; model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ) ; model.setLunStorage ( null ) ; return model ; }
Source:
public void commit ( ) { if ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.isEmpty ( this . transactionId ) ) { throw new java.lang.IllegalStateException ( "No running transaction" ) ; } this . transport.send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . commit ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_TRANSACTION , this . transactionId ) . build ( ) , key ) ; this . transactionId = null ; }

Target:
public void commit ( ) { try ( org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper wrapper = new org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper ( this . lock ) ) { if ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.isEmpty ( this . transactionId ) ) { throw new java.lang.IllegalStateException ( "No running transaction" ) ; } this . transport.send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . commit ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_TRANSACTION , this . transactionId ) . build ( ) , key ) ; this . transactionId = null ; } }
Source:
private org.ovirt.engine.api.model.API addSystemVersion ( org.ovirt.engine.api.model.API api ) { api.setProductInfo ( new org.ovirt.engine.api.model.ProductInfo ( ) ) ; api.getProductInfo ( ) . setName ( "oVirt Engine" ) ; api.getProductInfo ( ) . setVendor ( "ovirt.org" ) ; api.getProductInfo ( ) . setVersion ( org.ovirt.engine.api.restapi.util.VersionHelper.parseVersion ( getConfigurationValueDefault ( java.lang.String.class , ConfigurationValues.VdcVersion ) ) ) ; return api ; }

Target:
private org.ovirt.engine.api.model.API addSystemVersion ( org.ovirt.engine.api.model.API api ) { java.lang.String productVersion = getConfigurationValueDefault ( java.lang.String.class , ConfigurationValues.ProductRPMVersion ) ; api.setProductInfo ( new org.ovirt.engine.api.model.ProductInfo ( ) ) ; api.getProductInfo ( ) . setName ( "oVirt Engine" ) ; api.getProductInfo ( ) . setVendor ( "ovirt.org" ) ; api.getProductInfo ( ) . setFullVersion ( productVersion ) ; api.getProductInfo ( ) . setVersion ( org.ovirt.engine.api.restapi.util.VersionHelper.parseVersion ( getConfigurationValueDefault ( java.lang.String.class , ConfigurationValues.VdcVersion ) ) ) ; return api ; }
Source:
public void lowThresholdStorageSpace ( ) { setupDiskSpaceTest ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.mockito.Mockito.when ( cmd.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.ArgumentMatchers.anyCollectionOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void lowThresholdStorageSpace ( ) { setupDiskSpaceTest ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.mockito.Mockito.when ( cmd.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.ArgumentMatchers.anyCollection ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String slaveUser = getSlaveUserName ( ) . getEntity ( ) ; getSlaveUserGroupName ( ) . setIsChangable ( ( ( slaveUser != null ) && ( ! ( slaveUser.equalsIgnoreCase ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . rootUser ( ) ) ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String slaveUser = getSlaveUserName ( ) . getEntity ( ) ; getSlaveUserGroupName ( ) . setIsChangeable ( ( ( slaveUser != null ) && ( ! ( slaveUser.equalsIgnoreCase ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . rootUser ( ) ) ) ) ) ) ; }
Source:
private void logDeviceInformation ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct device ) { java.lang.String message = "Received a {0} Device without an address when processing VM {1} devices, skipping device" ; java.lang.String deviceType = org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.getDeviceType ( device ) ; if ( shouldLogDeviceDetails ( deviceType ) ) { java.util.Map < java.lang.String , java.lang.Object > deviceInfo = device.getInnerMap ( ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( ( message + ": {2}" ) , org.apache.commons.lang.StringUtils.defaultIfEmpty ( deviceType , StringUtils.EMPTY ) , vmId , deviceInfo.toString ( ) ) ; } else { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( message , org.apache.commons.lang.StringUtils.defaultIfEmpty ( deviceType , StringUtils.EMPTY ) , vmId ) ; } }

Target:
private void logDeviceInformation ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct device ) { java.lang.String message = "Received a {0} Device without an address when processing VM {1} devices, skipping device" ; java.lang.String deviceType = org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.getDeviceType ( device ) ; if ( shouldLogDeviceDetails ( deviceType ) ) { java.util.Map < java.lang.String , java.lang.Object > deviceInfo = device.getInnerMap ( ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( ( message + ": {2}" ) , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId , deviceInfo ) ; } else { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( message , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId ) ; } }
Source:
private static org.ovirt.engine.core.compat.NGuid parent ( org.ovirt.engine.api.model.Tag model , org.ovirt.engine.core.compat.NGuid current ) { if ( ( ( model.isSetParent ( ) ) && ( model.getParent ( ) . isSetTag ( ) ) ) && ( model.getParent ( ) . getTag ( ) . isSetId ( ) ) ) { return org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( model.getParent ( ) . getTag ( ) . getId ( ) ) ; } else { return current == null ? org.ovirt.engine.core.compat.NGuid.Empty : current ; } }

Target:
private static org.ovirt.engine.core.compat.Guid parent ( org.ovirt.engine.api.model.Tag model , org.ovirt.engine.core.compat.Guid current ) { if ( ( ( model.isSetParent ( ) ) && ( model.getParent ( ) . isSetTag ( ) ) ) && ( model.getParent ( ) . getTag ( ) . isSetId ( ) ) ) { return org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( model.getParent ( ) . getTag ( ) . getId ( ) ) ; } else { return current == null ? org.ovirt.engine.core.compat.Guid.Empty : current ; } }
Source:
public void setUpAndExecute ( org.ovirt.engine.core.config.EngineConfigCLIParser parser ) throws java.lang.Exception { org.ovirt.engine.core.config.EngineConfig.log.debug ( ( "Arguments have been parsed: " + ( parser.engineConfigMapToString ( ) ) ) ) ; org.ovirt.engine.core.config.validation.ConfigActionType actionType = parser.getConfigAction ( ) ; actionType.validate ( parser.getEngineConfigMap ( ) ) ; setEngineConfigLogic ( new org.ovirt.engine.core.config.EngineConfigLogic ( parser ) ) ; engineConfigLogic.execute ( ) ; }

Target:
public void setUpAndExecute ( org.ovirt.engine.core.config.EngineConfigCLIParser parser ) throws java.lang.Exception { org.ovirt.engine.core.config.EngineConfig.log.debug ( "Arguments have been parsed: {}" , parser.engineConfigMapToString ( ) ) ; org.ovirt.engine.core.config.validation.ConfigActionType actionType = parser.getConfigAction ( ) ; actionType.validate ( parser.getEngineConfigMap ( ) ) ; setEngineConfigLogic ( new org.ovirt.engine.core.config.EngineConfigLogic ( parser ) ) ; engineConfigLogic.execute ( ) ; }
Source:
protected void initPoolUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUser ( ) ; if ( ( user != null ) && ( ( user.getId ( ) ) == null ) ) { user.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUserDao ( ) . save ( user ) ; } }

Target:
protected org.ovirt.engine.core.common.businessentities.aaa.DbUser getDbUser ( ) { if ( ( dbUser ) == null ) { dbUser = org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUserDao ( ) . get ( getAdUserId ( ) ) ; } return dbUser ; }
Source:
public static void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public static void isSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String 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.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public static boolean hasConstraint ( javax.ws.rs.core.UriInfo uriInfo , java.lang.String constraint ) { return org.ovirt.engine.api.common.util.QueryHelper.hasConstraint ( uriInfo.getQueryParameters ( ) , constraint ) ; }

Target:
public static java.lang.String getConstraint ( javax.ws.rs.core.HttpHeaders headers , javax.ws.rs.core.UriInfo ui , java.lang.String defaultQuery , java.lang.Class < ? > clz , boolean typePrefix ) { java.lang.String prefix = ( typePrefix ) ? org.ovirt.engine.api.common.util.QueryHelper.RETURN_TYPES.get ( clz ) : "" ; java.lang.String search = org.ovirt.engine.api.common.util.ParametersHelper.getParameter ( headers , ui , org.ovirt.engine.api.common.util.QueryHelper.CONSTRAINT_PARAMETER ) ; if ( search != null ) { return prefix + search ; } if ( defaultQuery != null ) { return prefix + defaultQuery ; } return null ; }
Source:
public void getEngineTimeStamp ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetEngineTimestamp , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void testQueryForInvalidVolumeId ( ) { org.mockito.Mockito.doReturn ( Guid.Empty ) . when ( getQueryParameters ( ) ) . getVolumeId ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( volumeDao ) . getById ( Guid.Empty ) ; getQuery ( ) . executeQueryCommand ( ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( getQuery ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( VdcBllMessages.GLUSTER_VOLUME_ID_INVALID.toString ( ) , returnValue.getExceptionString ( ) ) ; }

Target:
public void testQueryForInvalidVolumeId ( ) { org.mockito.Mockito.doReturn ( Guid.Empty ) . when ( getQueryParameters ( ) ) . getVolumeId ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( volumeDao ) . getById ( Guid.Empty ) ; getQuery ( ) . executeQueryCommand ( ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( getQuery ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( EngineMessage.GLUSTER_VOLUME_ID_INVALID.toString ( ) , returnValue.getExceptionString ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getTemplate ( ) . setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmTemplate [ ] { template } ) ) ) ; model.getTemplate ( ) . setSelectedItem ( template ) ; model.getTemplate ( ) . setIsChangable ( false ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getTemplate ( ) . setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmTemplate [ ] { template } ) ) ) ; model.getTemplate ( ) . setSelectedItem ( template ) ; model.getTemplate ( ) . setIsChangable ( false ) ; PostInitTemplate ( ) ; }
Source:
private static boolean isDiskOrInterface ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { return ( ( vmDevice.getDevice ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) && ( vmDevice.getType ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) ) || ( ( vmDevice.getDevice ( ) . equals ( VmDeviceType.BRIDGE.getName ( ) ) ) && ( vmDevice.getType ( ) . equals ( VmDeviceType.INTERFACE.getName ( ) ) ) ) ; }

Target:
private static boolean isDiskOrInterface ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { return ( ( vmDevice.getDevice ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) && ( ( vmDevice.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK ) ) ) || ( ( vmDevice.getDevice ( ) . equals ( VmDeviceType.BRIDGE.getName ( ) ) ) && ( ( vmDevice.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.INTERFACE ) ) ) ; }
Source:
public java.lang.Object runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getStoragePool ( ) ) ; getStoragePool ( ) . setStatus ( StoragePoolStatus.Maintenance ) ; getStoragePoolDAO ( ) . updateStatus ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getStatus ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getStoragePool ( ) ) ; getStoragePool ( ) . setStatus ( StoragePoolStatus.Maintenance ) ; getStoragePoolDao ( ) . updateStatus ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getStatus ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
private void setAndInvokeClient ( ) { vncImpl.setVncHost ( getHost ( ) ) ; vncImpl.setVncPort ( getPort ( ) ) ; vncImpl.setTicket ( getOtp64 ( ) ) ; vncImpl.setTitle ( getTitle ( ) ) ; vncImpl.setTicketValiditySeconds ( org.ovirt.engine.ui.uicommonweb.models.vms.TICKET_VALIDITY_SECONDS ) ; vncImpl.invokeClient ( ) ; }

Target:
private void setAndInvokeClient ( ) { vncImpl.setVncHost ( getHost ( ) ) ; vncImpl.setVncPort ( getPort ( ) ) ; vncImpl.setTicket ( getOtp64 ( ) ) ; vncImpl.setTitle ( getClientTitle ( ) ) ; vncImpl.setToggleFullscreenHotKey ( getToggleFullScreenKeys ( ) ) ; vncImpl.setReleaseCursorHotKey ( getReleaseCursorKeys ( ) ) ; vncImpl.setTicketValiditySeconds ( org.ovirt.engine.ui.uicommonweb.models.vms.TICKET_VALIDITY_SECONDS ) ; vncImpl.invokeClient ( ) ; }
Source:
public void InitDisks ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disks = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : vm.getDiskList ( ) ) { disks.add ( org.ovirt.engine.ui.uicommonweb.Linq.diskToModel ( diskImage ) ) ; } getModel ( ) . setDisks ( disks ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeFormatAvailable ( true ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeFormatChangable ( true ) ; UpdateIsDisksAvailable ( ) ; }

Target:
public void initDisks ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disks = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : vm.getDiskList ( ) ) { disks.add ( org.ovirt.engine.ui.uicommonweb.Linq.diskToModel ( diskImage ) ) ; } getModel ( ) . setDisks ( disks ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeFormatAvailable ( true ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeFormatChangable ( true ) ; updateIsDisksAvailable ( ) ; }
Source:
protected void init ( ) { initGeneralForm ( ) ; initDisksTable ( ) ; initNicsTable ( ) ; initAppsTable ( ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( generalView.asWidget ( ) ) , constants.generalLabel ( ) ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( disksTable ) , constants.disksLabel ( ) ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( nicsTable ) , constants.nicsLabel ( ) ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( appsTable ) , constants.applicationsLabel ( ) ) ; }

Target:
protected void init ( ) { initGeneralForm ( ) ; initDisksTable ( ) ; initNicsTable ( ) ; initAppsTable ( ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( generalView.asWidget ( ) ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.RegisterVmInfoPanel.constants.generalLabel ( ) ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( disksTable ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.RegisterVmInfoPanel.constants.disksLabel ( ) ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( nicsTable ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.RegisterVmInfoPanel.constants.nicsLabel ( ) ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( appsTable ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.RegisterVmInfoPanel.constants.applicationsLabel ( ) ) ; }