auphong2707/dl4se-code-review-dataset huggingface dataset:
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.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
protected int getNeededDiskSize ( org.ovirt.engine.core.compat.Guid domainId ) { return ( org.ovirt.engine.core.bll.AddVmCommand.getBlockSparseInitSizeInGb ( ) ) * ( storageToDisksMap.get ( domainId ) . size ( ) ) ; }

Target:
protected boolean validateSpaceRequirements ( ) { for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > sdImageEntry : storageToDisksMap.entrySet ( ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain destStorageDomain = destStorages.get ( sdImageEntry.getKey ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = sdImageEntry.getValue ( ) ; org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = createStorageDomainValidator ( destStorageDomain ) ; if ( ( ! ( validateDomainsThreshold ( storageDomainValidator ) ) ) || ( ! ( validateFreeSpace ( storageDomainValidator , disksList ) ) ) ) { return false ; } } return true ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkLabelsByNetworkId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { BackendNetworkLabelsResourceTest.networkId } , java.util.Arrays.asList ( getEntity ( 0 ) ) ) ; } }

Target:
private void setUpEntityQueryExpectations ( java.util.List < ? super org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel > result ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkLabelsByNetworkId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.NETWORK_ID } , result ) ; }
Source:
private void addDiskPermissions ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Permissions perms = new org.ovirt.engine.core.common.businessentities.Permissions ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) . getId ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; } }

Target:
private void addDiskPermissions ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Permissions perms = new org.ovirt.engine.core.common.businessentities.Permissions ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) . getId ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; } }
Source:
public void testUpdateSnapshotStatusByName ( ) { dao.updateSnapshotStatusByName ( existingSnapshot.getVolumeId ( ) , existingSnapshot.getSnapshotName ( ) , GlusterSnapshotStatus.DEACTIVATED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = dao.getById ( existingSnapshot.getSnapshotId ( ) ) ; org.junit.Assert.assertNotNull ( snapshot ) ; org.junit.Assert.assertFalse ( snapshot.equals ( existingSnapshot ) ) ; existingSnapshot.setStatus ( GlusterSnapshotStatus.DEACTIVATED ) ; org.junit.Assert.assertEquals ( existingSnapshot , snapshot ) ; }

Target:
public void testUpdateSnapshotStatusByName ( ) { dao.updateSnapshotStatusByName ( existingSnapshot.getVolumeId ( ) , existingSnapshot.getSnapshotName ( ) , GlusterSnapshotStatus.DEACTIVATED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = dao.getById ( existingSnapshot.getSnapshotId ( ) ) ; org.junit.Assert.assertNotNull ( snapshot ) ; org.junit.Assert.assertNotEquals ( snapshot , existingSnapshot ) ; existingSnapshot.setStatus ( GlusterSnapshotStatus.DEACTIVATED ) ; org.junit.Assert.assertEquals ( existingSnapshot , snapshot ) ; }
Source:
public void testNetworkIpAddressWasSameAsHostnameAndChangedWhenIfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.STATIC_IP , null , null ) ; attachment.setNicName ( "nicName" ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , null ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = java.util.Collections.emptyMap ( ) ; org.junit.Assert.assertThat ( validator.networkIpAddressWasSameAsHostnameAndChanged ( nics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsDhcp ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Cluster cluster ) { validateParameters ( cluster , "name" , "dataCenter.name|id" ) ; org.ovirt.engine.core.common.businessentities.storage_pool pool = org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.getStoragePool ( cluster , this ) ; org.ovirt.engine.core.common.businessentities.VDSGroup entity = map ( cluster , map ( pool ) ) ; return performCreation ( VdcActionType.AddVdsGroup , new org.ovirt.engine.core.common.action.VdsGroupOperationParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Cluster cluster ) { validateParameters ( cluster , "name" , "dataCenter.name|id" ) ; validateEnums ( org.ovirt.engine.api.model.Cluster.class , cluster ) ; org.ovirt.engine.core.common.businessentities.storage_pool pool = org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.getStoragePool ( cluster , this ) ; org.ovirt.engine.core.common.businessentities.VDSGroup entity = map ( cluster , map ( pool ) ) ; return performCreation ( VdcActionType.AddVdsGroup , new org.ovirt.engine.core.common.action.VdsGroupOperationParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters.class ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Group model , int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbGroup entity = getEntity ( index ) ; org.junit.Assert.assertEquals ( entity.getId ( ) . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( entity.getName ( ) , model.getName ( ) ) ; org.junit.Assert.assertNotNull ( model.getDomain ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.encode ( entity.getDomain ( ) ) , model.getDomain ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Group model , int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbGroup entity = getEntity ( index ) ; org.junit.jupiter.api.Assertions.assertEquals ( entity.getId ( ) . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( entity.getName ( ) , model.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( model.getDomain ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.encode ( entity.getDomain ( ) ) , model.getDomain ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster cloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setId ( instance.getId ( ) ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; obj.setMigration ( instance.isMigration ( ) ) ; return obj ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster cloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setId ( instance.getId ( ) ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; obj.setMigration ( instance.isMigration ( ) ) ; obj.setGluster ( instance.isGluster ( ) ) ; return obj ; }
Source:
public void testExecuteQuery ( ) { java.lang.String sessionID = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSessionId ( ) ) . thenReturn ( sessionID ) ; org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . setUser ( sessionID , getUser ( ) ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( "Wrong user returned from query" , getUser ( ) , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testExecuteQuery ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSessionId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetUserBySessionIdQueryTest.sessionID ) ; org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . setUser ( org.ovirt.engine.core.bll.GetUserBySessionIdQueryTest.sessionID , getUser ( ) ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( "Wrong user returned from query" , getUser ( ) , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
private void rebalance ( ) { if ( ( getSelectedItems ( ) ) == null ) { return ; } java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRebalanceParameters ( volume.getId ( ) , false , false ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.StartRebalanceGlusterVolume , list ) ; }

Target:
private void startRebalance ( ) { if ( ( getSelectedItems ( ) ) == null ) { return ; } java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRebalanceParameters ( volume.getId ( ) , false , false ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.StartRebalanceGlusterVolume , list ) ; }
Source:
private void checkVmName ( boolean isImportAsNewEntity , java.lang.String name ) { org.ovirt.engine.core.common.action.ImportVmParameters parameters = createParameters ( ) ; parameters.getVm ( ) . setvm_name ( name ) ; parameters.setImportAsNewEntity ( isImportAsNewEntity ) ; org.ovirt.engine.core.bll.ImportVmCommand command = new org.ovirt.engine.core.bll.ImportVmCommand ( parameters ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.action.ImportVmParameters > > validate = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) . validate ( parameters , command.getValidationGroups ( ) . toArray ( new java.lang.Class < ? > [ 0 ] ) ) ; org.junit.Assert.assertEquals ( validate.isEmpty ( ) , ( ! isImportAsNewEntity ) ) ; }

Target:
private void checkVmName ( boolean isImportAsNewEntity , java.lang.String name ) { org.ovirt.engine.core.common.action.ImportVmParameters parameters = createParameters ( ) ; parameters.getVm ( ) . setVmName ( name ) ; parameters.setImportAsNewEntity ( isImportAsNewEntity ) ; org.ovirt.engine.core.bll.ImportVmCommand command = new org.ovirt.engine.core.bll.ImportVmCommand ( parameters ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.action.ImportVmParameters > > validate = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) . validate ( parameters , command.getValidationGroups ( ) . toArray ( new java.lang.Class < ? > [ 0 ] ) ) ; org.junit.Assert.assertEquals ( validate.isEmpty ( ) , ( ! isImportAsNewEntity ) ) ; }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( ! ( hasSnappableDisks ( vm ) ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( vm.getImages ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }
Source:
public void testGetAllNetworkSearch ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Network" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.Network ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( networkResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testGetAllNetworkSearch ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Network" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.Network ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( networkResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookStatusChangeParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . addServerHookInDb ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE_FAILED ) ; }
Source:
public void failGetSpiceOnVncVm ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; org.ovirt.engine.core.common.businessentities.VM mockVm = mockVm ( GraphicsType.VNC ) ; org.mockito.Mockito.doReturn ( mockVm ) . when ( getQuery ( ) ) . getCachedVm ( ) ; getQuery ( ) . validateInputs ( ) ; org.junit.Assert.assertFalse ( getQuery ( ) . getQueryReturnValue ( ) . getSucceeded ( ) ) ; }

Target:
public void failGetSpiceOnVncVm ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; org.ovirt.engine.core.common.businessentities.VM mockVm = mockVm ( GraphicsType.VNC ) ; org.mockito.Mockito.doReturn ( mockVm ) . when ( getQuery ( ) ) . getCachedVm ( ) ; getQuery ( ) . validateInputs ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( getQuery ( ) . getQueryReturnValue ( ) . getSucceeded ( ) ) ; }
Source:
public void canDoActionWrongDiskImageTypeVm ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initVmDiskImage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_NOT_TEMPLATE_DISK.toString ( ) ) ) ; }

Target:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( ImageOperation.Move ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult dataCenterVersionMismatch ( ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_GROUP_CANNOT_ADD_COMPATIBILITY_VERSION_WITH_LOWER_STORAGE_POOL ) . when ( ( ( dataCenter != null ) && ( ( dataCenter.getCompatibilityVersion ( ) . compareTo ( cluster.getCompatibilityVersion ( ) ) ) > 0 ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult dataCenterVersionMismatch ( ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_GROUP_CANNOT_ADD_COMPATIBILITY_VERSION_WITH_LOWER_STORAGE_POOL ) . when ( ( ( dataCenter != null ) && ( cluster.supportsVirtService ( ) ? ( dataCenter.getCompatibilityVersion ( ) . compareTo ( cluster.getCompatibilityVersion ( ) ) ) > 0 : false ) ) ) ; }
Source:
public void run ( ) { try { backend.RunAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.Logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.LogoutUserParameters ( user.getUserId ( ) ) ) ) ; } sh.clean ( ) ; } }

Target:
public void run ( ) { setCorrelationId ( params ) ; try { backend.RunAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.Logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.LogoutUserParameters ( user.getUserId ( ) ) ) ) ; } sh.clean ( ) ; } }
Source:
public void testGetEntityNameByIdAndTypeForBookmark ( ) { org.ovirt.engine.core.common.businessentities.bookmarks bookmark = dbFacade.getBookmarkDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.BOOKMARK_ID ) ; org.junit.Assert.assertNotNull ( bookmark ) ; java.lang.String name = bookmark.getbookmark_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.BOOKMARK_ID , VdcObjectType.Bookmarks ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForBookmark ( ) { org.ovirt.engine.core.common.businessentities.Bookmark bookmark = dbFacade.getBookmarkDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.BOOKMARK_ID ) ; org.junit.Assert.assertNotNull ( bookmark ) ; java.lang.String name = bookmark.getbookmark_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.BOOKMARK_ID , VdcObjectType.Bookmarks ) ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = super . canDoAction ( ) ; if ( returnValue && ( VmTemplateHandler.BlankVmTemplateId.equals ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getVmtGuid ( ) ) ) ) { returnValue = false ; addCanDoActionMessage ( VdcBllMessages.VM_POOL_CANNOT_CREATE_FROM_BLANK_TEMPLATE ) ; } return returnValue ; }

Target:
protected boolean canDoAction ( ) { boolean returnValue = super . canDoAction ( ) ; if ( returnValue && ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID.equals ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getVmtGuid ( ) ) ) ) { returnValue = false ; addCanDoActionMessage ( VdcBllMessages.VM_POOL_CANNOT_CREATE_FROM_BLANK_TEMPLATE ) ; } return returnValue ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterSwiftServices ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ) ( returnValue ) ) ) ; updateActionAvailability ( ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
public void search ( ) { if ( ( getEntity ( ) ) != null ) { super . search ( ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( java.lang.Object object ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData importVmData = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) ; if ( ( ! ( importVmData.getClone ( ) . getEntity ( ) ) ) && ( ( importVmData.getError ( ) ) != null ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.resources.errorImage ( ) ; } if ( ( importVmData.getWarning ( ) ) != null ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.resources.alertImage ( ) ; } return null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( java.lang.Object object ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData importVmData = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) ; if ( ( ( importVmData.getError ( ) ) != null ) || ( importVmData.isNameExistsInTheSystem ( ) ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.resources.errorImage ( ) ; } if ( ( importVmData.getWarning ( ) ) != null ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.resources.alertImage ( ) ; } return null ; }
Source:
protected org.ovirt.engine.core.common.businessentities.ad_groups getAdGroup ( ) { if ( ( ( mGroup ) == null ) && ( ! ( getGroupId ( ) . equals ( Guid.Empty ) ) ) ) { mGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDAO ( ) . get ( getGroupId ( ) ) ; } return mGroup ; }

Target:
protected org.ovirt.engine.core.common.businessentities.ad_groups getAdGroup ( ) { if ( ( ( mGroup ) == null ) && ( ! ( getGroupId ( ) . equals ( Guid.Empty ) ) ) ) { mGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDao ( ) . get ( getGroupId ( ) ) ; } return mGroup ; }
Source:
public java.lang.String toString ( ) { return ( ( ( ( ( ( ( "(status = " + ( getStatus ( ) ) ) + ", result = " ) + ( getResult ( ) ) ) + ", exception = " ) + ( getException ( ) ) ) + ", msg = " ) + ( getMessage ( ) ) ) + ")" ; }

Target:
public java.lang.String toString ( ) { return ( ( ( ( ( ( ( "(status = " + ( getStatus ( ) ) ) + ", result = " ) + ( getResult ( ) ) ) + ", exception = " ) + ( getException ( ) ) ) + ", message = " ) + ( getMessage ( ) ) ) + ")" ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec ) { return setVmTicket ( vmId , otp64 , sec , "" , new java.util.HashMap < > ( ) ) ; }

Target:
private void waitUntilCheck ( java.util.function.Predicate < org.ovirt.vdsm.jsonrpc.client.JsonRpcClient > check , java.lang.String formatBefore , java.lang.String formatAfter ) throws java.lang.InterruptedException { java.lang.String hostname = client.getHostname ( ) ; org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.debug ( formatBefore , hostname ) ; int retries = 50 ; while ( check.test ( this . client ) ) { if ( retries == 0 ) { throw new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( ( ( "Unable to reconnect to " + hostname ) + " after policy reset" ) ) ; } retries -- ; java.util.concurrent.TimeUnit.MILLISECONDS.sleep ( 200 ) ; } org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.debug ( formatAfter , hostname ) ; }
Source:
public java.lang.Void runInTransaction ( ) { addVmImagesAndSnapshots ( ) ; updateSnapshotsFromExport ( ) ; moveOrCopyAllImageGroups ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVm ( ) . getStaticData ( ) , getParameters ( ) . isImportAsNewEntity ( ) ) ; org.ovirt.engine.core.bll.VmHandler.LockVm ( getVm ( ) . getId ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { getParameters ( ) . setVm ( getVm ( ) ) ; setVmId ( getVm ( ) . getId ( ) ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { addVmImagesAndSnapshots ( ) ; updateSnapshotsFromExport ( ) ; moveOrCopyAllImageGroups ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVm ( ) . getStaticData ( ) , getParameters ( ) . isImportAsNewEntity ( ) ) ; org.ovirt.engine.core.bll.VmHandler.lockVm ( getVm ( ) . getId ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { getParameters ( ) . setVm ( getVm ( ) ) ; setVmId ( getVm ( ) . getId ( ) ) ; } return null ; }
Source:
private static void mapQosTypeToModel ( org.ovirt.engine.core.common.businessentities.qos.QosBase entity , org.ovirt.engine.api.model.QoS model ) { switch ( entity.getQosType ( ) ) { case STORAGE : org.ovirt.engine.api.restapi.types.QosMapper.mapStorageQosToModel ( entity , model ) ; break ; case CPU : org.ovirt.engine.api.restapi.types.QosMapper.mapCpuQosToModel ( entity , model ) ; break ; case NETWORK : org.ovirt.engine.api.restapi.types.QosMapper.mapNetworkQosToModel ( entity , model ) ; break ; default : throw new java.lang.IllegalArgumentException ( "Unsupported QoS type" ) ; } }

Target:
private static void mapQosTypeToModel ( org.ovirt.engine.core.common.businessentities.qos.QosBase entity , org.ovirt.engine.api.model.QoS model ) { switch ( entity.getQosType ( ) ) { case STORAGE : org.ovirt.engine.api.restapi.types.QosMapper.mapStorageQosToModel ( entity , model ) ; break ; case CPU : org.ovirt.engine.api.restapi.types.QosMapper.mapCpuQosToModel ( entity , model ) ; break ; case NETWORK : org.ovirt.engine.api.restapi.types.QosMapper.mapNetworkQosToModel ( entity , model ) ; break ; case HOSTNETWORK : org.ovirt.engine.api.restapi.types.QosMapper.mapHostNetworkQosToModel ( entity , model ) ; break ; default : throw new java.lang.IllegalArgumentException ( "Unsupported QoS type" ) ; } }
Source:
public void testHasPeersFalse ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.utils.gluster.GlusterUtilTest.OUTPUT_XML_NO_PEERS ) . when ( glusterUtil ) . executePeerStatusCommand ( client ) ; org.junit.Assert.assertTrue ( glusterUtil.getPeers ( client ) . isEmpty ( ) ) ; }

Target:
public void testHasPeersFalse ( ) { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.any ( java.util.Set.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.OUTPUT_XML_NO_PEERS ) . when ( glusterUtil ) . executePeerStatusCommand ( client ) ; org.junit.Assert.assertTrue ( glusterUtil.getPeers ( client ) . isEmpty ( ) ) ; }
Source:
public void onSuccess ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > resultObject ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from runMultipleQueries!" ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , resultObject ) ; callback.executed ( f ) ; org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; raiseQueryCompleteEvent ( queryTypeList , state ) ; }

Target:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.lang.Throwable caught ) { try { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleQueries: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { fireAsyncOperationCompleteEvent ( state ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.StoragePool createDefaultStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createBasicPool ( ) ; pool.setIsLocal ( true ) ; pool.setcompatibility_version ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; return pool ; }

Target:
private void addDefaultClusterToPool ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup defaultCluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; defaultCluster.setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; defaultCluster.setId ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.DEFAULT_VDS_GROUP_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = new java.util.ArrayList < > ( ) ; clusters.add ( defaultCluster ) ; org.mockito.Mockito.when ( vdsGroupDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( clusters ) ; }
Source:
protected boolean canDoAction ( ) { boolean result = true ; if ( ( ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) ) == null ) || ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) . getOrigin ( ) . equalsIgnoreCase ( org.ovirt.engine.core.bll.AddExternalEventCommand.OVIRT ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; result = false ; } if ( ! result ) { addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__ADD ) ; addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__EXTERNAL_EVENT ) ; } return result ; }

Target:
protected boolean canDoAction ( ) { boolean result = true ; if ( ( ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) ) == null ) || ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) . getOrigin ( ) . equalsIgnoreCase ( org.ovirt.engine.core.bll.AddExternalEventCommand.OVIRT ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; result = false ; } if ( ! result ) { addCanDoActionMessage ( EngineMessage.VAR__ACTION__ADD ) ; addCanDoActionMessage ( EngineMessage.VAR__TYPE__EXTERNAL_EVENT ) ; } return result ; }
Source:
public void testGetStorageConnectionNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetStorageConnectionNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void handleError ( ) { if ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getSpmStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) { log.infoFormat ( "Fence failed on vds {0} which is spm of pool {1} - moving pool to non operational" , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.SetStoragePoolStatus , new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational , org.ovirt.engine.core.common.AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM ) ) ; } log.errorFormat ( "Failed to run Fence script on vds:{0}." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) ) ; org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.AlertIfPowerManagementOperationSkipped ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.RESTART , null ) ; }

Target:
protected void handleError ( ) { if ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getSpmStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) { log.info ( "Fence failed on vds '{}' which is spm of pool '{}' - moving pool to non operational" , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.SetStoragePoolStatus , new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational , org.ovirt.engine.core.common.AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM ) ) ; } log.error ( "Failed to run Fence script on vds '{}'." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) ) ; org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.AlertIfPowerManagementOperationSkipped ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.RESTART , null ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( getGlusterHostAddress ( ) . getEntity ( ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( getGlusterHostAddress ( ) . getEntity ( ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.Boolean entity = getAllowOverbooking ( ) . getEntity ( ) ; if ( entity ) { getOptimizeForUtilization ( ) . setEntity ( true ) ; } getOptimizeForSpeed ( ) . setIsChangable ( ( ! entity ) ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel iface ) { org.ovirt.engine.ui.common.widget.uicommon.popup.networkinterface.NetworkInterfacePopupWidget.Driver.driver.edit ( iface ) ; enableManualMacCheckbox.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { iface.getMAC ( ) . setIsChangable ( enableManualMacCheckbox.getValue ( ) ) ; } } ) ; hideMacWhenNotEnabled ( iface ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { boolean isCardStatusChangable = iface.getPlugged ( ) . getIsChangable ( ) ; pluggedEditor.setEnabled ( isCardStatusChangable ) ; unpluggedEditor.setEnabled ( isCardStatusChangable ) ; boolean isCardStatusAvailable = iface.getPlugged ( ) . getIsAvailable ( ) ; cardStatusSelectionPanel.setVisible ( isCardStatusAvailable ) ; }
Source:
public static void cancelRecoveryJob ( org.ovirt.engine.core.compat.Guid vdsId ) { java.lang.String jobId = org.ovirt.engine.core.vdsbroker.VdsManager.recoveringJobIdMap.remove ( vdsId ) ; if ( jobId != null ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "Cancelling the recovery from crash timer for VDS {0} because vds started initializing" , vdsId ) ; try { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( jobId ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "Failed deleting job {0} at cancelRecoveryJob" , jobId ) ; } } }

Target:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( vds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Failed to refresh VDS, network error, continuing, vds='{}'({}): {}" , vds.getName ( ) , vds.getId ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warn ( "Failed to refresh VDS, network error, continuing, vds='{}'({}): {}" , vds.getName ( ) , vds.getId ( ) , e.getMessage ( ) ) ; } org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Exception" , e ) ; }
Source:
protected boolean hostToRunExist ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVds ( ) ) != null ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVds ( ) ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; return false ; } } return true ; }

Target:
protected org.ovirt.engine.core.compat.Guid getSmallIconId ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) ) != null ) { return org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getSmallIconId ( ) ; } return null ; }
Source:
public static org.ovirt.engine.core.common.businessentities.UsbPolicy getUsbPolicyOnCreate ( org.ovirt.engine.api.model.Usb usb , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { if ( ( ( usb == null ) || ( ! ( usb.isSetEnabled ( ) ) ) ) || ( ! ( usb.isEnabled ( ) ) ) ) { return org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED ; } else { org.ovirt.engine.api.model.UsbType usbType = org.ovirt.engine.api.restapi.types.VmMapper.getUsbType ( usb ) ; if ( usbType == null ) { return org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyAccordingToClusterVersion ( vdsGroup ) ; } else { return org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyAccordingToUsbType ( usbType ) ; } } }

Target:
public static org.ovirt.engine.core.common.businessentities.UsbPolicy getUsbPolicyOnCreate ( org.ovirt.engine.api.model.Usb usb , org.ovirt.engine.core.compat.Version vdsGroupVersion ) { if ( ( ( usb == null ) || ( ! ( usb.isSetEnabled ( ) ) ) ) || ( ! ( usb.isEnabled ( ) ) ) ) { return org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED ; } else { org.ovirt.engine.api.model.UsbType usbType = org.ovirt.engine.api.restapi.types.VmMapper.getUsbType ( usb ) ; if ( usbType == null ) { return org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyAccordingToClusterVersion ( vdsGroupVersion ) ; } else { return org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyAccordingToUsbType ( usbType ) ; } } }
Source:
private void createDummyPolicyUnit ( ) { dummyPolicyUnit = new org.ovirt.engine.core.common.scheduling.PolicyUnit ( ) ; dummyPolicyUnit.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dummyPolicyUnit.setName ( "Dummy policy unit" ) ; }

Target:
private void createDummyPolicyUnit ( ) { dummyPolicyUnit = new org.ovirt.engine.core.common.scheduling.PolicyUnit ( ) ; dummyPolicyUnit.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dummyPolicyUnit.setName ( "Dummy policy unit" ) ; dummyPolicyUnit.setPolicyUnitType ( PolicyUnitType.Filter ) ; dummyPolicyUnit.setParameterRegExMap ( new java.util.LinkedHashMap < java.lang.String , java.lang.String > ( ) ) ; }
Source:
protected void buildVmSoundDevices ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmSoundDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.SOUND ) ; if ( ! ( vmSoundDevices.isEmpty ( ) ) ) { createInfo.put ( VdsProperties.soundDevice , osRepository.getSoundDevice ( vm.getStaticData ( ) . getOsId ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ; } }

Target:
protected void buildVmSoundDevices ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmSoundDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.SOUND ) ; if ( ! ( vmSoundDevices.isEmpty ( ) ) ) { createInfo.put ( VdsProperties.soundDevice , osRepository.getSoundDevice ( vm.getStaticData ( ) . getOsId ( ) , vm.getClusterCompatibilityVersion ( ) ) ) ; } }
Source:
public void clear ( ) { vmPanel.clear ( ) ; }

Target:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.Widget content ) { if ( slot == ( org.ovirt.engine.ui.userportal.section.main.presenter.tab.basic.MainTabBasicListPresenterWidget.TYPE_VmListContent ) ) { vmPanel.clear ( ) ; if ( content != null ) { vmPanel.add ( content ) ; } } else { super . setInSlot ( slot , content ) ; } }