auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getStorageDomainsByDisks ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks , boolean isFillStorageTodDiskMap ) { java.util.Set < org.ovirt.engine.core.compat.Guid > domainsList = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; if ( disks != null ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { domainsList.addAll ( disk.getStorageIds ( ) ) ; if ( isFillStorageTodDiskMap ) { for ( org.ovirt.engine.core.compat.Guid storageDomainId : disk.getStorageIds ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( storageDomainId , disk , storageToDisksMap ) ; } } } } return domainsList ; }

Target:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getStorageDomainsByDisks ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks , boolean isFillStorageTodDiskMap ) { java.util.Set < org.ovirt.engine.core.compat.Guid > domainsList = new java.util.HashSet < > ( ) ; if ( disks != null ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { domainsList.addAll ( disk.getStorageIds ( ) ) ; if ( isFillStorageTodDiskMap ) { for ( org.ovirt.engine.core.compat.Guid storageDomainId : disk.getStorageIds ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( storageDomainId , disk , storageToDisksMap ) ; } } } } return domainsList ; }
Source:
public boolean hasSpaceForSnapthosts ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < java.lang.String > message ) { java.lang.Integer minSnapshotSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.InitStorageSparseSizeInGB ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.storage_domains , java.lang.Integer > e : mapStorageDomainsToNumOfDisks ( vm ) . entrySet ( ) ) { if ( ! ( destinationHasSpace ( e.getKey ( ) , ( minSnapshotSize * ( e.getValue ( ) ) ) , message ) ) ) { return false ; } } return true ; }

Target:
public boolean hasSpaceForSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < java.lang.String > message ) { java.lang.Integer minSnapshotSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.InitStorageSparseSizeInGB ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.storage_domains , java.lang.Integer > e : mapStorageDomainsToNumOfDisks ( vm ) . entrySet ( ) ) { if ( ! ( destinationHasSpace ( e.getKey ( ) , ( minSnapshotSize * ( e.getValue ( ) ) ) , message ) ) ) { return false ; } } return true ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , canDo , 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 { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testVmsRule ( ) { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( true ) ; model.setPositive ( false ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.NEGATIVE , entity.getVmAffinityRule ( ) ) ; org.junit.Assert.assertTrue ( entity.isVmEnforcing ( ) ) ; org.junit.Assert.assertTrue ( entity.isVmAffinityEnabled ( ) ) ; }

Target:
public void testVmsRule ( ) { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( true ) ; model.setPositive ( false ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.jupiter.api.Assertions.assertEquals ( EntityAffinityRule.NEGATIVE , entity.getVmAffinityRule ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( entity.isVmEnforcing ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( entity.isVmAffinityEnabled ( ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return disk.getDiskAlias ( ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isShareable ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmDiskAttachPopupWidget.constants.shareable ( ) ) ; } return null ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > > aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.SortListByNameConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" ) ; storageDevice.setCanCreateBrick ( false ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( storageDevice ) , getStorageDevice ( "sda" ) , org.ovirt.engine.core.common.businessentities.CacheModeType.writethrough , 10 ) ) . when ( cmd ) . getParameters ( ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" ) ; storageDevice.setCanCreateBrick ( false ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( storageDevice ) , getStorageDevice ( "sda" ) , org.ovirt.engine.core.common.businessentities.CacheModeType.writethrough , 10 ) ) . when ( cmd ) . getParameters ( ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; }
Source:
public org.ovirt.engine.sdk.entities.Action setupnetworks ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + "setupnetworks" ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class ) ; }

Target:
public org.ovirt.engine.sdk.entities.Action setupnetworks ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + "setupnetworks" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }
Source:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetTagExpectations ( true ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachVdsFromTag , org.ovirt.engine.core.common.action.AttachEntityToTagParameters.class , new java.lang.String [ ] { "TagId" , "EntitiesId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostTagResourceTest.TAG_ID , asList ( org.ovirt.engine.api.restapi.resource.BackendHostTagResourceTest.HOST_ID ) } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetTagExpectations ( true ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachVdsFromTag , org.ovirt.engine.core.common.action.AttachEntityToTagParameters.class , new java.lang.String [ ] { "TagId" , "EntitiesId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostTagResourceTest.TAG_ID , asList ( org.ovirt.engine.api.restapi.resource.BackendHostTagResourceTest.HOST_ID ) } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testResolveCopy ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateGlusterHook , org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters.class , new java.lang.String [ ] { "HookId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.hookId } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setResolutionType ( "copy" ) ; verifyActionResponse ( resource.resolve ( action ) ) ; }

Target:
public void testResolveCopy ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.UpdateGlusterHook , org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters.class , new java.lang.String [ ] { "HookId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.hookId } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setResolutionType ( "copy" ) ; verifyActionResponse ( resource.resolve ( action ) ) ; }
Source:
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 ) ; }

Target:
public static void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.irsbroker.ExtendStorageDomainVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case DeviceNotFound : org.ovirt.engine.core.vdsbroker.irsbroker.ExtendStorageDomainVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . ProceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.irsbroker.ExtendStorageDomainVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case DeviceNotFound : org.ovirt.engine.core.vdsbroker.irsbroker.ExtendStorageDomainVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . proceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.Disk > doFilter ( java.util.List < org.ovirt.engine.core.common.businessentities.Disk > diskList , int osId , org.ovirt.engine.core.compat.Version clusterVersion ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > filteredDiskList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : diskList ) { if ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( osId , clusterVersion , disk.getDiskInterface ( ) ) ) { filteredDiskList.add ( disk ) ; } } return filteredDiskList ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > doFilter ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskList , int osId , org.ovirt.engine.core.compat.Version clusterVersion ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > filteredDiskList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : diskList ) { if ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( osId , clusterVersion , disk.getDiskInterface ( ) ) ) { filteredDiskList.add ( disk ) ; } } return filteredDiskList ; }
Source:
protected void executeCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > rngDevices = getRngDevices ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.VmDeviceId > idsToRemove = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice dev : rngDevices ) { idsToRemove.add ( dev.getId ( ) ) ; } getDbFacade ( ) . getVmDeviceDao ( ) . removeAll ( idsToRemove ) ; setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > rngDevices = getRngDevices ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.VmDeviceId > idsToRemove = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice dev : rngDevices ) { idsToRemove.add ( dev.getId ( ) ) ; } vmDeviceDao.removeAll ( idsToRemove ) ; setSucceeded ( true ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > getModeSpecificEventNotificationTypeList ( ) { java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > subList = new java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > ( ) ; for ( org.ovirt.engine.core.common.EventNotificationEntity entity : org.ovirt.engine.ui.uicommonweb.DataProvider.GetEventNotificationTypeList ( ) ) { if ( ( ( entity.getAvailableInModes ( ) ) & ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.UI_MODE.getValue ( ) ) ) > 0 ) { subList.add ( entity ) ; } } return subList ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > getModeSpecificEventNotificationTypeList ( ) { java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > subList = new java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > ( ) ; for ( org.ovirt.engine.core.common.EventNotificationEntity entity : org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetEventNotificationTypeList ( ) ) { if ( ( ( entity.getAvailableInModes ( ) ) & ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.UI_MODE.getValue ( ) ) ) > 0 ) { subList.add ( entity ) ; } } return subList ; }
Source:
public < T > T createLockingInstance ( T instance , java.lang.Class < T > interfaceClass ) { java.util.Objects.requireNonNull ( instance ) ; return ( ( T ) ( java.lang.reflect.Proxy.newProxyInstance ( interfaceClass.getClassLoader ( ) , new java.lang.Class < ? > [ ] { interfaceClass } , new org.ovirt.engine.core.utils.lock.LockedObjectFactory.LockingInvocationHandler ( instance , new java.util.concurrent.locks.ReentrantReadWriteLock ( ) ) ) ) ) ; }

Target:
public < T > T createLockingInstance ( T instance , java.lang.Class < T > interfaceClass , java.util.concurrent.locks.ReentrantReadWriteLock lock ) { java.util.Objects.requireNonNull ( instance ) ; return ( ( T ) ( java.lang.reflect.Proxy.newProxyInstance ( interfaceClass.getClassLoader ( ) , new java.lang.Class < ? > [ ] { interfaceClass } , new org.ovirt.engine.core.utils.lock.LockedObjectFactory.LockingInvocationHandler ( instance , lock ) ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { setItems ( ( ( java.util.Collection < T > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onRefreshActiveModel ( org.ovirt.engine.ui.frontend.communication.RefreshActiveModelEvent event ) { if ( ( getTimer ( ) . isActive ( ) ) || ( refreshOnInactiveTimer ( ) ) ) { if ( handleRefreshActiveModel ( event ) ) { syncSearch ( ) ; } if ( event.isDoFastForward ( ) ) { getTimer ( ) . fastForward ( ) ; } } }
Source:
public static void removeTaskFromDbByTaskId ( org.ovirt.engine.core.compat.Guid taskId ) { try { if ( ( org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.callRemoveTaskFromDbByTaskId ( taskId ) ) != 0 ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.infoFormat ( "Removed task {0} from DataBase" , taskId ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.error ( java.lang.String.format ( "Removing task %1$s from DataBase threw an exception." , taskId ) , e ) ; } }

Target:
public static void removeTaskFromDbByTaskId ( org.ovirt.engine.core.compat.Guid taskId ) { try { if ( ( org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.callRemoveTaskFromDbByTaskId ( taskId ) ) != 0 ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.info ( "Removed task '{}' from DataBase" , taskId ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.error ( "Removing task '{}' from DataBase threw an exception: {}" , taskId , e.getMessage ( ) ) ; org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.debug ( "Exception" , e ) ; } }
Source:
public static boolean isPublicKeyValid ( java.lang.String publicKey ) { java.lang.String [ ] words = publicKey.split ( "\\s+" , 3 ) ; if ( ( words.length ) < 2 ) { return false ; } if ( ! ( words [ 0 ] . matches ( "^[\\p{Alpha}\\p{Digit}-]*$" ) ) ) { return false ; } if ( ! ( org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.isBase64 ( words [ 1 ] . getBytes ( ) ) ) ) { return false ; } return true ; }

Target:
public static boolean isPublicKeyValid ( java.lang.String publicKey ) { java.lang.String [ ] words = publicKey.split ( "\\s+" , 3 ) ; if ( ( words.length ) < 2 ) { return false ; } if ( ! ( words [ 0 ] . matches ( "^[\\p{Alpha}\\p{Digit}-]*$" ) ) ) { return false ; } if ( ! ( org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.isBase64 ( words [ 1 ] . getBytes ( java.nio.charset.Charset.forName ( "UTF-8" ) ) ) ) ) { return false ; } return true ; }
Source:
public static boolean isCommandAllowed ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.action.VdcActionType actionType ) { return ! ( ( ( vm.isHostedEngine ( ) ) && ( ! ( org.ovirt.engine.core.common.validation.VmActionByVmOriginTypeValidator.COMMANDS_ALLOWED_ON_HOSTED_ENGINE.contains ( actionType ) ) ) ) || ( ( vm.isExternalVm ( ) ) && ( ! ( org.ovirt.engine.core.common.validation.VmActionByVmOriginTypeValidator.COMMANDS_ALLOWED_ON_EXTERNAL_VMS.contains ( actionType ) ) ) ) ) ; }

Target:
public static boolean isCommandAllowed ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.action.ActionType actionType ) { return ! ( ( ( vm.isHostedEngine ( ) ) && ( ! ( org.ovirt.engine.core.common.validation.VmActionByVmOriginTypeValidator.COMMANDS_ALLOWED_ON_HOSTED_ENGINE.contains ( actionType ) ) ) ) || ( ( vm.isExternalVm ( ) ) && ( ! ( org.ovirt.engine.core.common.validation.VmActionByVmOriginTypeValidator.COMMANDS_ALLOWED_ON_EXTERNAL_VMS.contains ( actionType ) ) ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; final org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; host.setDynamicData ( vdsDynamic ) ; bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( mockNetworkExclusivenessValidatorResolver.resolveNetworkExclusivenessValidator ( ) ) . thenReturn ( mockNetworkExclusivenessValidator ) ; org.mockito.Mockito.when ( mockNetworkAttachmentIpConfigurationValidator.validateNetworkAttachmentIpConfiguration ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( ValidationResult.VALID ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; final org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; host.setDynamicData ( vdsDynamic ) ; bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( mockNetworkExclusivenessValidatorResolver.resolveNetworkExclusivenessValidator ( ) ) . thenReturn ( mockNetworkExclusivenessValidator ) ; org.mockito.Mockito.when ( mockNetworkAttachmentIpConfigurationValidator.validateNetworkAttachmentIpConfiguration ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( ValidationResult.VALID ) ; }
Source:
private java.lang.String getRootCollectionName ( java.lang.String period ) { java.lang.String collection = org.ovirt.engine.sdk.codegen.utils.StringUtils.toUpperCase ( org.ovirt.engine.sdk.codegen.utils.StringUtils.toPlural ( period ) ) ; java.lang.String collectionCandidate = getPublicCollection ( org.ovirt.engine.sdk.codegen.utils.StringUtils.toPlural ( period ) , false ) ; if ( collectionCandidate != null ) { collection = collectionCandidate ; } return collection ; }

Target:
private java.lang.String getRootCollectionName ( java.lang.String period , java.lang.String [ ] periods , int i ) { java.lang.String collection = org.ovirt.engine.sdk.codegen.utils.StringUtils.toUpperCase ( org.ovirt.engine.sdk.codegen.utils.StringUtils.toPlural ( period ) ) ; java.lang.String collectionCandidate = getPublicCollection ( org.ovirt.engine.sdk.codegen.utils.StringUtils.toPlural ( period ) , periods , i , false ) ; if ( collectionCandidate != null ) { collection = collectionCandidate ; } return collection ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Bookmark model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ index ] , model.getValue ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Bookmark model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ index ] , model.getValue ( ) ) ; verifyLinks ( model ) ; }
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 setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setExternalId ( new byte [ 0 ] ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( "groups" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setExternalId ( new org.ovirt.engine.core.common.utils.ExternalId ( new byte [ 0 ] ) ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( "groups" ) ; }
Source:
private boolean selectionContextChanged ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.DisplayType vmDisplay = ( vm.isRunningOrPaused ( ) ) ? vm.getDisplayType ( ) : vm.getDefaultDisplayType ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext newContext = new org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext ( vm.getVmOs ( ) , vmDisplay ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel selectedConsole = resolveUserSelectedConsoleModel ( vm.getId ( ) ) ; if ( selectedConsole == null ) { return true ; } return ! ( newContext.equals ( selectedConsole.getSelectionContext ( ) ) ) ; }

Target:
private boolean selectionContextChanged ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.DisplayType vmDisplay = ( vm.isRunningOrPaused ( ) ) ? vm.getDisplayType ( ) : vm.getDefaultDisplayType ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext newContext = new org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext ( vm.getVmOsId ( ) , vmDisplay ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel selectedConsole = resolveUserSelectedConsoleModel ( vm.getId ( ) ) ; if ( selectedConsole == null ) { return true ; } return ! ( newContext.equals ( selectedConsole.getSelectionContext ( ) ) ) ; }
Source:
private void applyModeCustomizations ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.getUiMode ( ) ) == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) { spmTab.setVisible ( false ) ; powerManagementTab.setVisible ( false ) ; consoleTab.setVisible ( false ) ; } }

Target:
private void applyModeCustomizations ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.getUiMode ( ) ) == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) { spmTab.setVisible ( false ) ; powerManagementTab.setVisible ( false ) ; consoleTab.setVisible ( false ) ; networkProviderTab.setVisible ( false ) ; } }
Source:
public static boolean isAnyStorageDomainIsMatserAndActive ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > sdl ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : sdl ) { if ( ( ( ( a.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) && ( ( a.getStatus ( ) ) != null ) ) && ( ( a.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return true ; } } return false ; }

Target:
public static boolean isAnyStorageDomainIsMasterAndActive ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > sdl ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : sdl ) { if ( ( ( ( a.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) && ( ( a.getStatus ( ) ) != null ) ) && ( ( a.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return true ; } } return false ; }
Source:
private static java.lang.String getFieldName ( org.ovirt.engine.core.common.businessentities.StorageServerConnections paramConnection ) { java.lang.String fieldName ; if ( paramConnection.getstorage_type ( ) . equals ( StorageType.ISCSI ) ) { fieldName = "address" ; } else if ( paramConnection.getstorage_type ( ) . isFileDomain ( ) ) { fieldName = "path" ; } else { fieldName = "connection" ; } return fieldName ; }

Target:
private static java.lang.String getFieldName ( org.ovirt.engine.core.common.businessentities.StorageServerConnections paramConnection ) { java.lang.String fieldName ; if ( paramConnection.getStorageType ( ) . equals ( StorageType.ISCSI ) ) { fieldName = "address" ; } else if ( paramConnection.getStorageType ( ) . isFileDomain ( ) ) { fieldName = "path" ; } else { fieldName = "connection" ; } return fieldName ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > mapHosts ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost > foremanHosts ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList ( foremanHosts.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost host : foremanHosts ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsName ( host.getName ( ) ) ; vds.setHostName ( host.getName ( ) ) ; hosts.add ( vds ) ; } return hosts ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > mapHosts ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost > foremanHosts ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList ( foremanHosts.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost foremanHost : foremanHosts ) { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setVdsName ( foremanHost.getName ( ) ) ; host.setHostName ( foremanHost.getName ( ) ) ; hosts.add ( host ) ; } return hosts ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( boolean active ) { org.ovirt.engine.core.common.businessentities.DiskImage di = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; di.setActive ( true ) ; di.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setParentId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setImageStatus ( ImageStatus.OK ) ; return di ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( boolean active ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage di = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; di.setActive ( true ) ; di.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setParentId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setImageStatus ( ImageStatus.OK ) ; return di ; }
Source:
public static void GetLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( org.ovirt.engine.core.compat.StringFormat.format ( "hosts: datacenter=%1$s" , dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , sp , aQuery ) ; }

Target:
public static void GetLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , sp , aQuery ) ; }
Source:
public java.lang.Void runInTransaction ( ) { addVmStatic ( ) ; addVmDynamic ( ) ; addVmNetwork ( ) ; addVmStatistics ( ) ; addActiveSnapshot ( ) ; addVmPermission ( ) ; addVmInit ( ) ; addVmRngDevice ( ) ; addGraphicsDevice ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { addVmStatic ( ) ; addVmDynamic ( ) ; addVmNetwork ( ) ; addVmNumaNodes ( ) ; addVmStatistics ( ) ; addActiveSnapshot ( ) ; addVmPermission ( ) ; addVmInit ( ) ; addVmRngDevice ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void canDoActionDiskIsOvfStore ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; command.getImage ( ) . setOvfStore ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED ) ; }

Target:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
private boolean validateLabelChanges ( java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel mockSrc = new org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ( this ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel mockDst = new org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ( this ) ; mockSrc.setEntity ( new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ) ; mockDst.setEntity ( new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ) ; mockDst.setItems ( new java.util.ArrayList ( potentialNetworks ) ) ; boolean valid = ! ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperationFactory.operationFor ( mockSrc , mockDst ) . isNullOperation ( ) ) ; if ( ! valid ) { candidateOperation ( mockSrc , mockDst , true ) ; } return valid ; }

Target:
private void commitLabelChanges ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > srcIfaces , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface dstIface ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.moveLabels ( srcIfaces , dstIface ) ; }
Source:
public void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void 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 < ? > ) ( source ) ) . isEmpty ( ) ) ; } 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 canDoActionVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { createParameters ( ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToVmsThatAreNotDown ( org.mockito.Matchers.anyBoolean ( ) , org.mockito.Matchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }

Target:
public void canDoActionVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToVmsThatAreNotDown ( org.mockito.Matchers.anyBoolean ( ) , org.mockito.Matchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }
Source:
public void mapVmWatchdog ( ) { org.ovirt.engine.core.common.businessentities.VmWatchdog entity = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; entity.setAction ( VmWatchdogAction.RESET ) ; entity.setModel ( VmWatchdogType.i6300esb ) ; entity.setId ( Guid.Empty ) ; org.ovirt.engine.api.model.Watchdog model = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( entity , null ) ; org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( model.getAction ( ) , "reset" ) ; org.junit.Assert.assertEquals ( model.getModel ( ) , "i6300esb" ) ; }

Target:
public void mapVmWatchdog ( ) { org.ovirt.engine.core.common.businessentities.VmWatchdog entity = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; entity.setAction ( VmWatchdogAction.RESET ) ; entity.setModel ( VmWatchdogType.i6300esb ) ; entity.setId ( Guid.Empty ) ; org.ovirt.engine.api.model.Watchdog model = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( entity , null ) ; org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( model.getAction ( ) , WatchdogAction.RESET ) ; org.junit.Assert.assertEquals ( model.getModel ( ) , WatchdogModel.I6300ESB ) ; }
Source:
static java.lang.String resolveMessage ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { java.lang.String returnValue = message ; if ( logable != null ) { java.util.Map < java.lang.String , java.lang.String > map = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getAvalableValues ( logable ) ; returnValue = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( message , map ) ; } return returnValue ; }

Target:
static java.lang.String resolveMessage ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { java.lang.String returnValue = message ; if ( logable != null ) { java.util.Map < java.lang.String , java.lang.String > map = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getAvailableValues ( logable ) ; returnValue = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( message , map ) ; } return returnValue ; }
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 getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }