auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = diskDao.get ( org.ovirt.engine.core.bll.storage.repoimage.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) ) { diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; } } return diskImage ; }

Target:
private boolean validateDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = diskDao.get ( org.ovirt.engine.core.bll.storage.repoimage.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ! ( validate ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) . validateUnsupportedDiskStorageType ( DiskStorageType.LUN , DiskStorageType.CINDER ) ) ) ) ) { return false ; } if ( ( getDiskImage ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; } return true ; }
Source:
public boolean hasSpiceSupport ( int osId , org.ovirt.engine.core.compat.Version version ) { java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > osDisplayTypes = getDisplayTypes ( osId , version ) ; return osDisplayTypes == null ? false : osDisplayTypes.contains ( DisplayType.qxl ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { final java.util.Map < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > returnMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; if ( ( returnMap.get ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DEFAULT_OS_ID ) ) == null ) { throw new java.lang.RuntimeException ( "Engine did not provide icon IDs of default OS." ) ; } osIdToDefaultIconIdMap = java.util.Collections.unmodifiableMap ( returnMap ) ; initializeLargeToSmallIconMap ( ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > DisksToDiskModelList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = new org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ( ) ; diskModel.setDisk ( disk ) ; diskModels.add ( diskModel ) ; } return diskModels ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disksToDiskModelList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = new org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ( ) ; diskModel.setDisk ( disk ) ; diskModels.add ( diskModel ) ; } return diskModels ; }
Source:
public org.ovirt.engine.core.aaa.DirectoryUser findUser ( org.ovirt.engine.core.common.utils.ExternalId id ) { java.lang.String name = null ; try { name = new java.lang.String ( id.getBytes ( ) , "UTF-8" ) ; } catch ( java.io.UnsupportedEncodingException e ) { return null ; } return new org.ovirt.engine.core.aaa.DirectoryUser ( this . getName ( ) , id , name ) ; }

Target:
public org.ovirt.engine.core.aaa.DirectoryUser findUser ( org.ovirt.engine.core.common.utils.ExternalId id ) { java.lang.String name = null ; try { name = new java.lang.String ( id.getBytes ( ) , "UTF-8" ) ; } catch ( java.io.UnsupportedEncodingException e ) { return null ; } return new org.ovirt.engine.core.aaa.DirectoryUser ( getProfileName ( ) , id , name ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { org.mockito.MockitoAnnotations.initMocks ( this ) ; jobRepository = new org.ovirt.engine.core.bll.job.JobRepositoryImpl ( jobDao , jobSubjectEntityDao , stepDao ) ; job = createJob ( ) ; mockDaos ( job ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.job.JobRepositoryTest.ejbRule.mockResource ( ContainerManagedResourceType.TRANSACTION_MANAGER , new org.ovirt.engine.core.bll.utils.TransactionManagerMock ( ) ) ; org.mockito.MockitoAnnotations.initMocks ( this ) ; jobRepository = new org.ovirt.engine.core.bll.job.JobRepositoryImpl ( jobDao , jobSubjectEntityDao , stepDao ) ; job = createJob ( ) ; mockDaos ( job ) ; }
Source:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.gettime_zone ( ) ) ) { vm.settime_zone ( TimeZoneInfo.Local.getId ( ) ) ; } switch ( vm.getStaticData ( ) . getos ( ) ) { case WindowsXP : case Windows2003 : case Windows2003x64 : timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.gettime_zone ( ) ) ; break ; case Windows2008 : default : timeZone = vm.gettime_zone ( ) ; break ; } return timeZone ; }

Target:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) { vm.setTimeZone ( TimeZoneInfo.Local.getId ( ) ) ; } switch ( vm.getStaticData ( ) . getos ( ) ) { case WindowsXP : case Windows2003 : case Windows2003x64 : timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.getTimeZone ( ) ) ; break ; case Windows2008 : default : timeZone = vm.getTimeZone ( ) ; break ; } return timeZone ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.Network networkA ) { return createNetworkAttachment ( networkA , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.Network networkA , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachment ( networkA , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; attachment.setNicId ( nic.getId ( ) ) ; attachment.setNicName ( nic.getName ( ) ) ; return attachment ; }
Source:
protected void executeCommand ( ) { AddCustomValue ( "InterfaceType" , org.ovirt.engine.core.common.businessentities.VmInterfaceType.forValue ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) . getType ( ) ) . getInterfaceTranslation ( ) . toString ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . update ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) ) ; org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { AddCustomValue ( "InterfaceType" , org.ovirt.engine.core.common.businessentities.VmInterfaceType.forValue ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) . getType ( ) ) . getDescription ( ) . toString ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . update ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) ) ; org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue fence ( org.ovirt.engine.core.common.businessentities.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent ) { boolean withRetries = action != ( org.ovirt.engine.core.common.businessentities.FenceActionType.Status ) ; org.ovirt.engine.core.common.businessentities.VDS proxyHost = proxyLocator.findProxyHost ( withRetries ) ; if ( proxyHost == null ) { return proxyNotFound ( ) ; } else { return fence ( action , agent , proxyHost ) ; } }

Target:
public org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue fence ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent ) { boolean withRetries = action != ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.STATUS ) ; org.ovirt.engine.core.common.businessentities.VDS proxyHost = proxyLocator.findProxyHost ( withRetries ) ; if ( proxyHost == null ) { return proxyNotFound ( ) ; } else { return fence ( action , agent , proxyHost ) ; } }
Source:
public static void getTimeZoneList ( 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 ) { if ( source == null ) { return new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setWindowsOS ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( aQuery.getModel ( ) ) ) . getModel ( ) . getIsWindowsOS ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTimeZones , params , aQuery ) ; }

Target:
public static void getTimeZoneList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { 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.HashMap < java.lang.String , java.lang.String > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTimeZones , params , aQuery ) ; }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getStorageDomainListByTemplate ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void onRunOnce ( ) { startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RunVmOnce , createRunVmOnceParams ( ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; commandTarget.executeCommand ( runOnceCommand ) ; } } , this ) ; }

Target:
protected void onRunOnce ( ) { startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RunVmOnce , createRunVmOnceParams ( ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; commandTarget.executeCommand ( runOnceCommand ) ; } } , this ) ; }
Source:
public void removeGlusterServerHook ( org.ovirt.engine.core.compat.Guid id ) { getCallsHandler ( ) . executeModification ( "DeleteGlusterHookByGuid" , createGlusterHookIdParams ( id ) ) ; }

Target:
public void updateGlusterServerHook ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverHook ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterServerHook" , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , serverHook.getHookId ( ) ) . addValue ( "server_id" , serverHook.getServerId ( ) ) . addValue ( "hook_status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( serverHook.getStatus ( ) ) ) . addValue ( "content_type" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( serverHook.getContentType ( ) ) ) . addValue ( "checksum" , serverHook.getChecksum ( ) ) ) ; }
Source:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public com.google.gwt.event.dom.client.HasClickHandlers addShutdownButton ( ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( constants.shutdownVm ( ) , resources.stopIcon ( ) , resources.stopDisabledIcon ( ) , style.shutdownButtonAdditionalStyle ( ) ) ; this . shutdownButton = button ; addButtonToPanel ( button ) ; return button ; }

Target:
public com.google.gwt.event.dom.client.HasClickHandlers addShutdownButton ( ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( org.ovirt.engine.ui.userportal.section.main.view.tab.basic.MainTabBasicListItemView.constants.shutdownVm ( ) , org.ovirt.engine.ui.userportal.section.main.view.tab.basic.MainTabBasicListItemView.resources.stopIcon ( ) , org.ovirt.engine.ui.userportal.section.main.view.tab.basic.MainTabBasicListItemView.resources.stopDisabledIcon ( ) , style.shutdownButtonAdditionalStyle ( ) ) ; this . shutdownButton = button ; addButtonToPanel ( button ) ; return button ; }
Source:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }

Target:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePool getStoragePool ( ) { if ( ( ( ( storagePool ) == null ) && ( ( getStoragePoolId ( ) ) != null ) ) && ( ! ( Guid.Empty.equals ( getStoragePoolId ( ) ) ) ) ) { storagePool = getStoragePoolDao ( ) . get ( getStoragePoolId ( ) ) ; } return storagePool ; }

Target:
public org.ovirt.engine.core.common.businessentities.StoragePool getStoragePool ( ) { if ( ( ( ( storagePool ) == null ) && ( ( getStoragePoolId ( ) ) != null ) ) && ( ! ( Guid.Empty.equals ( getStoragePoolId ( ) ) ) ) ) { storagePool = storagePoolDao.get ( getStoragePoolId ( ) ) ; } return storagePool ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterBrick model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBrickResourceTest.serverId.toString ( ) , model.getServerId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBrickResourceTest.brickDir , model.getBrickDir ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterBrick model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBrickResourceTest.serverId.toString ( ) , model.getServerId ( ) ) ; assertEquals ( GlusterTestHelper.brickDir , model.getBrickDir ( ) ) ; verifyLinks ( model ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendWatchdogResourceTest.VM_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendWatchdogResourceTest.VM_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void getHostNumaTopologyByHostId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.VdsNumaNode > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsNumaNodesByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , asyncQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
public void taskEndSuccessfully ( ) { }

Target:
private void syncImageData ( ) { org.ovirt.engine.core.common.action.SyncImageGroupDataCommandParameters parameters = new org.ovirt.engine.core.common.action.SyncImageGroupDataCommandParameters ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getSourceStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getTargetStorageDomainId ( ) ) ; parameters.setEndProcedure ( EndProcedure.COMMAND_MANAGED ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) ) ; runInternalAction ( VdcActionType.SyncImageGroupData , parameters , createStepsContext ( StepEnum.SYNC_IMAGE_DATA ) ) ; }
Source:
private void setUpManagementNetworkExpectation ( ) throws java.lang.Exception { setUpPopulateExpectation ( ) ; final org.ovirt.engine.core.common.businessentities.network.Network mockNetwork = control.createMock ( org.ovirt.engine.core.common.businessentities.network.Network.class ) ; org.easymock.EasyMock.expect ( mockNetwork.getId ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.BackendClusterResourceTest.MANAGEMENT_NETWORK_ID ) ; setUpGetEntityExpectations ( VdcQueryType.GetManagementNetwork , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , mockNetwork ) ; }

Target:
private void setUpManagementNetworkExpectation ( ) throws java.lang.Exception { setUpPopulateExpectation ( ) ; final org.ovirt.engine.core.common.businessentities.network.Network mockNetwork = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.network.Network.class ) ; org.mockito.Mockito.when ( mockNetwork.getId ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.resource.BackendClusterResourceTest.MANAGEMENT_NETWORK_ID ) ; setUpGetEntityExpectations ( VdcQueryType.GetManagementNetwork , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , mockNetwork ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getGlusterVolume ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; volumeEntity.setId ( id ) ; volumeEntity.setName ( "test-vol" ) ; volumeEntity.addAccessProtocol ( AccessProtocol.GLUSTER ) ; volumeEntity.addTransportType ( TransportType.TCP ) ; volumeEntity.setVolumeType ( GlusterVolumeType.DISTRIBUTE ) ; return volumeEntity ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getGlusterVolume ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; volumeEntity.setId ( volumeId ) ; volumeEntity.setName ( "test-vol" ) ; volumeEntity.addAccessProtocol ( AccessProtocol.GLUSTER ) ; volumeEntity.addTransportType ( TransportType.TCP ) ; volumeEntity.setVolumeType ( GlusterVolumeType.DISTRIBUTE ) ; volumeEntity.setStatus ( ( volumeId.equals ( startedVolumeId ) ? org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus.UP : org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus.DOWN ) ) ; volumeEntity.setClusterId ( CLUSTER_ID ) ; return volumeEntity ; }
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 ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTask ; }

Target:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getAsyncTaskFromDb ( org.ovirt.engine.core.compat.Guid asyncTaskId ) { return coCoAsyncTaskHelper.getAsyncTaskFromDb ( asyncTaskId ) ; }
Source:
private void updateVmsOfInstanceType ( ) { if ( ! ( isInstanceType ( ) ) ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsToUpdate = org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmDAO ( ) . getVmsListByInstanceType ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsToUpdate ) { org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( vm ) ; params.setApplyChangesLater ( true ) ; runInternalAction ( VdcActionType.UpdateVm , params ) ; } }

Target:
private void updateVmsOfInstanceType ( ) { if ( ! ( isInstanceType ( ) ) ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsToUpdate = org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmDao ( ) . getVmsListByInstanceType ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsToUpdate ) { org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( vm ) ; params.setApplyChangesLater ( true ) ; runInternalAction ( VdcActionType.UpdateVm , params ) ; } }
Source:
public void deleteCompletedJobs ( final java.util.Date succeededJobs , final java.util.Date failedJobs ) { updateQuery ( getEntityManager ( ) . createNamedQuery ( "Job.deleteCompletedJobs" ) . setParameter ( "successEndTime" , succeededJobs ) . setParameter ( "failedEndTime" , failedJobs ) . setParameter ( "failStatus" , java.util.EnumSet.of ( JobExecutionStatus.FAILED , JobExecutionStatus.ABORTED , JobExecutionStatus.UNKNOWN ) ) . setParameter ( "successStatus" , JobExecutionStatus.FINISHED ) ) ; }

Target:
public void deleteCompletedJobs ( java.util.Date succeededJobs , java.util.Date failedJobs ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "succeeded_end_time" , succeededJobs ) . addValue ( "failed_end_time" , failedJobs ) ; getCallsHandler ( ) . executeModification ( "DeleteCompletedJobsOlderThanDate" , parameterSource ) ; }
Source:
protected void setUpWindowsGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( times , notFound , new org.ovirt.engine.api.model.VM ( ) { { setId ( GUIDS [ 0 ] ) ; setVmOs ( OsRepository.DEFAULT_X86_OS ) ; } } ) ; }

Target:
public void testRemoveForcedIncomplete ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( resource.remove ( new org.ovirt.engine.api.model.Action ( ) { { } } ) ) ; }
Source:
private void setUpGetBallooningExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , 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 void clusterServiceDefined ( ) { org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.clusterServiceDefined ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void glusterServiceNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . glusterFeatureEnabled ( ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.GLUSTER_NOT_SUPPORTED , "compatibilityVersion" , null ) ) ; }
Source:
public void endWithFailure ( ) { endRemoveSnapshotSingleDisk ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . get ( imageGroupId ) ; if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { updateImagesStatus ( ImageStatus.OK ) ; } enclosingCommand.preventRollback ( ) ; enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
public void endWithFailure ( ) { endRemoveSnapshotSingleDisk ( false ) ; org.ovirt.engine.core.common.businessentities.Disk disk = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . get ( imageGroupId ) ; if ( ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { updateImagesStatus ( ImageStatus.OK ) ; } enclosingCommand.preventRollback ( ) ; enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public static org.ovirt.engine.api.model.GlusterVolumeType map ( org.ovirt.engine.api.model.GlusterVolumeType glusterVolumeType , org.ovirt.engine.api.model.GlusterVolumeType template ) { switch ( glusterVolumeType ) { case DISTRIBUTE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType ; case REPLICATE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType ; case DISTRIBUTED_REPLICATE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType ; case STRIPE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType ; case DISTRIBUTED_STRIPE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType ; case STRIPED_REPLICATE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType ; case DISTRIBUTED_STRIPED_REPLICATE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType ; case DISPERSE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType ; case DISTRIBUTED_DISPERSE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.GlusterVolumeType map ( org.ovirt.engine.api.model.GlusterVolumeType glusterVolumeType , org.ovirt.engine.api.model.GlusterVolumeType template ) { switch ( glusterVolumeType ) { case DISTRIBUTE : return org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTE ; case REPLICATE : return org.ovirt.engine.api.model.GlusterVolumeType.REPLICATE ; case DISTRIBUTED_REPLICATE : return org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTED_REPLICATE ; case STRIPE : return org.ovirt.engine.api.model.GlusterVolumeType.STRIPE ; case DISTRIBUTED_STRIPE : return org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTED_STRIPE ; case STRIPED_REPLICATE : return org.ovirt.engine.api.model.GlusterVolumeType.STRIPED_REPLICATE ; case DISTRIBUTED_STRIPED_REPLICATE : return org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTED_STRIPED_REPLICATE ; case DISPERSE : return org.ovirt.engine.api.model.GlusterVolumeType.DISPERSE ; case DISTRIBUTED_DISPERSE : return org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTED_DISPERSE ; default : return null ; } }
Source:
protected void postSaveAction ( org.ovirt.engine.core.compat.Guid networkGuid , boolean succeeded ) { if ( succeeded ) { performProfilesActions ( networkGuid ) ; } stopProgress ( ) ; }

Target:
protected void postSaveAction ( org.ovirt.engine.core.compat.Guid networkGuid , boolean succeeded ) { if ( succeeded ) { if ( ( ( java.lang.Boolean ) ( getIsVmNetwork ( ) . getEntity ( ) ) ) ) { performProfilesActions ( networkGuid ) ; stopProgress ( ) ; } else { stopProgress ( ) ; cancel ( ) ; } } }
Source:
protected void postDataCentersLoaded ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters ) { if ( ! ( dataCenters.isEmpty ( ) ) ) { super . postDataCentersLoaded ( dataCenters ) ; } else { getModel ( ) . disableEditing ( ) ; } }

Target:
protected void postDataCentersLoaded ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters ) { if ( ! ( dataCenters.isEmpty ( ) ) ) { super . postDataCentersLoaded ( dataCenters ) ; } else { getModel ( ) . disableEditing ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . notAvailableWithNoUpDC ( ) ) ; } }
Source:
public void initialize ( ) { super . initialize ( ) ; org.ovirt.engine.ui.uicommonweb.UICommand onSaveCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) ; onSaveCommand.setTitle ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.ok ( ) ) ; onSaveCommand.setIsDefault ( true ) ; getCommands ( ) . add ( onSaveCommand ) ; getCommands ( ) . add ( getCancelCommand ( ) ) ; if ( ( getVm ( ) ) != null ) { updateBootableDiskAvailable ( ) ; } updateDatacenters ( ) ; }

Target:
public void initialize ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > currentDisks ) { commonInitialize ( ) ; updateBootableFrom ( ( currentDisks != null ? currentDisks : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ) ) ; }
Source:
public void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.Disk findBoot ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = disk.getDiskVmElementForVm ( getVm ( ) . getId ( ) ) ; if ( ( dve != null ) && ( dve.isBoot ( ) ) ) { return disk ; } } return null ; }

Target:
public java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > getAllCurrentDisksModels ( ) { if ( ( getItems ( ) ) == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImageLineModel line : getItems ( ) ) { if ( line.isGhost ( ) ) { continue ; } diskModels.add ( line.getDiskModel ( ) . getEntity ( ) ) ; } return diskModels ; }
Source:
public void close ( ) { try { writer.flush ( ) ; writer.close ( ) ; } catch ( javax.xml.stream.XMLStreamException e ) { throw new java.lang.RuntimeException ( "Failed to close xml writer" , e ) ; } }

Target:
public java.lang.String getStringXML ( ) { try { writer.writeEndElement ( ) ; writer.flush ( ) ; writer.close ( ) ; return stream.getBuffer ( ) . toString ( ) ; } catch ( javax.xml.stream.XMLStreamException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public void getGlusterSwiftServices ( 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.Map < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.MapConverter < > ( ) ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
public void testSaveWithEntities ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; dao.save ( newAsyncTask , VdcObjectType.Storage , storageId ) ; java.util.List < org.ovirt.engine.core.compat.Guid > asyncTasks = dao.getAsyncTaskIdsByEntity ( storageId ) ; org.junit.Assert.assertNotNull ( asyncTasks ) ; org.junit.Assert.assertEquals ( asyncTasks.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( asyncTasks.get ( 0 ) , newAsyncTask.gettask_id ( ) ) ; }

Target:
public void testSaveWithEntities ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; dao.save ( newAsyncTask , VdcObjectType.Storage , storageId ) ; java.util.List < org.ovirt.engine.core.compat.Guid > asyncTasks = dao.getAsyncTaskIdsByEntity ( storageId ) ; org.junit.Assert.assertNotNull ( asyncTasks ) ; org.junit.Assert.assertEquals ( asyncTasks.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( asyncTasks.get ( 0 ) , newAsyncTask.getTaskId ( ) ) ; }
Source:
private void _writeFile ( java.io.File file , java.lang.String content , boolean executable ) throws java.io.IOException { java.io.OutputStream os = null ; try { file.getParentFile ( ) . mkdirs ( ) ; os = new java.io.FileOutputStream ( file ) ; os.write ( content.getBytes ( "UTF-8" ) ) ; file.setExecutable ( executable ) ; } finally { if ( os != null ) { try { os.close ( ) ; } catch ( java.io.IOException e ) { } } } }

Target:
private void _writeFile ( java.io.File file , java.lang.String content , boolean executable ) throws java.io.IOException { java.io.File f = file.getParentFile ( ) ; if ( f == null ) { throw new java.io.IOException ( ( "File not found " + f ) ) ; } f.mkdirs ( ) ; try ( java.io.OutputStream os = new java.io.FileOutputStream ( file ) ) { os.write ( content.getBytes ( "UTF-8" ) ) ; file.setExecutable ( executable ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; dataCenterGuideModel.storageDomain.setstorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; dataCenterGuideModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
public static void getDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public static org.ovirt.engine.core.aaa.DirectoryGroup instantiate ( com.google.gwt.user.client.rpc.SerializationStreamReader reader ) throws com.google.gwt.user.client.rpc.SerializationException { org.ovirt.engine.core.aaa.Directory directory = org.ovirt.engine.core.aaa.DirectoryManager.getInstance ( ) . getDirectory ( reader.readString ( ) ) ; org.ovirt.engine.core.common.utils.ExternalId id = ( ( org.ovirt.engine.core.common.utils.ExternalId ) ( reader.readObject ( ) ) ) ; java.lang.String name = reader.readString ( ) ; return new org.ovirt.engine.core.aaa.DirectoryGroup ( directory , id , name ) ; }

Target:
public static org.ovirt.engine.core.aaa.DirectoryGroup instantiate ( com.google.gwt.user.client.rpc.SerializationStreamReader reader ) throws com.google.gwt.user.client.rpc.SerializationException { java.lang.String directoryName = reader.readString ( ) ; org.ovirt.engine.core.common.utils.ExternalId id = ( ( org.ovirt.engine.core.common.utils.ExternalId ) ( reader.readObject ( ) ) ) ; java.lang.String name = reader.readString ( ) ; return new org.ovirt.engine.core.aaa.DirectoryGroup ( directoryName , id , name ) ; }