auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void writeCleanup ( ) { com.google.gwt.core.ext.typeinfo.JClassType editorType = model.getEditorType ( ) ; logger.log ( Type.DEBUG , ( "Starting to write cleanup impl. for editor " + ( editorType.getQualifiedSourceName ( ) ) ) ) ; sw.println ( ) ; sw.println ( "@Override" ) ; sw.println ( "public void cleanup() {" ) ; sw.indent ( ) ; sw.println ( "if (getObject() != null) {" ) ; sw.indent ( ) ; if ( model.getProxyType ( ) . isAssignableTo ( hasCleanupType ) ) { sw.println ( "getObject().cleanup();" ) ; } for ( com.google.gwt.editor.rebind.model.EditorData editorData : model.getEditorData ( ) ) { if ( editorData.getPropertyOwnerType ( ) . isAssignableTo ( hasCleanupType ) ) { sw.println ( java.lang.String.format ( "getObject()%s.cleanup();" , editorData.getBeanOwnerExpression ( ) ) ) ; } } sw.outdent ( ) ; sw.println ( "}" ) ; for ( com.google.gwt.core.ext.typeinfo.JField field : editorType.getFields ( ) ) { com.google.gwt.core.ext.typeinfo.JClassType fieldClassType = field.getType ( ) . isClassOrInterface ( ) ; if ( ( ( fieldClassType != null ) && ( fieldClassType.isAssignableTo ( hasCleanupType ) ) ) && ( ! ( field.getType ( ) . isClassOrInterface ( ) . isAssignableTo ( baseModelType ) ) ) ) { java.lang.String fieldName = field.getName ( ) ; sw.println ( java.lang.String.format ( "if (getEditor().%s != null) {" , fieldName ) ) ; sw.indent ( ) ; sw.println ( java.lang.String.format ( "getEditor().%s.cleanup();" , fieldName ) ) ; sw.outdent ( ) ; sw.println ( "}" ) ; } } sw.outdent ( ) ; sw.println ( "}" ) ; }

Target:
private void writeCleanup ( ) { logger.log ( Type.DEBUG , ( "Starting to write cleanup impl. for editor " + ( model.getEditorType ( ) . getQualifiedSourceName ( ) ) ) ) ; sw.println ( ) ; sw.println ( "@Override" ) ; sw.println ( "public void cleanup() {" ) ; sw.indent ( ) ; java.util.Set < java.lang.String > modelExpressions = getModelCleanupExpressions ( ) ; if ( ! ( modelExpressions.isEmpty ( ) ) ) { sw.println ( "if (getObject() != null) {" ) ; sw.indent ( ) ; for ( java.lang.String expr : modelExpressions ) { sw.println ( java.lang.String.format ( "%s.cleanup();" , expr ) ) ; } sw.outdent ( ) ; sw.println ( "}" ) ; } java.util.Set < java.lang.String > editorFieldExpressions = getEditorFieldCleanupExpressions ( ) ; for ( java.lang.String expr : editorFieldExpressions ) { sw.println ( java.lang.String.format ( "if (%s != null) {" , expr ) ) ; sw.indent ( ) ; sw.println ( java.lang.String.format ( "%s.cleanup();" , expr ) ) ; sw.outdent ( ) ; sw.println ( "}" ) ; } sw.outdent ( ) ; sw.println ( "}" ) ; }
Source:
public void hasMultipleClustersForLocalDC ( ) { org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) , new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) ; org.mockito.Mockito.when ( clusterDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( clusters ) ; cmd.getStoragePool ( ) . setIsLocal ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.CLUSTER_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE ) ; }

Target:
public void hasMultipleClustersForLocalDC ( ) { org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) , new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) ; org.mockito.Mockito.when ( clusterDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( clusters ) ; cmd.getStoragePool ( ) . setIsLocal ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.CLUSTER_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; this . existingNetworkAttachments = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ) ( returnValue2 ) ) ; queryVfsConfig ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; allNics = returnValue.getReturnValue ( ) ; queryNetworkAttachments ( ) ; }
Source:
public void testUpdateAvailableUpdates ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic before = dao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.Assert.assertFalse ( before.isUpdateAvailable ( ) ) ; before.setUpdateAvailable ( true ) ; dao.updateUpdateAvailable ( before.getId ( ) , before.isUpdateAvailable ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic after = dao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.Assert.assertEquals ( before.isUpdateAvailable ( ) , after.isUpdateAvailable ( ) ) ; }

Target:
public void testUpdateAvailableUpdates ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic before = dao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.jupiter.api.Assertions.assertFalse ( before.isUpdateAvailable ( ) ) ; before.setUpdateAvailable ( true ) ; dao.updateUpdateAvailable ( before.getId ( ) , before.isUpdateAvailable ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic after = dao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.jupiter.api.Assertions.assertEquals ( before.isUpdateAvailable ( ) , after.isUpdateAvailable ( ) ) ; }
Source:
private boolean isStorageFormatCompatibleWithDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageFormatType storageFormat = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageFormat ( ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageType ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainFunction = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageDomainType ( ) ; if ( storageFormat == ( org.ovirt.engine.core.common.businessentities.StorageFormatType.V2 ) ) { return ( storageDomainFunction.isDataDomain ( ) ) && ( storageType.isBlockDomain ( ) ) ; } if ( storageFormat == ( org.ovirt.engine.core.common.businessentities.StorageFormatType.V3 ) ) { return storageDomainFunction.isDataDomain ( ) ; } return true ; }

Target:
public org.ovirt.engine.core.bll.validator.storage.StorageDomainToPoolRelationValidator getAttachDomainValidator ( ) { return new org.ovirt.engine.core.bll.validator.storage.StorageDomainToPoolRelationValidator ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) , getTargetStoragePool ( ) ) ; }
Source:
protected void completeImageData ( org.ovirt.engine.core.common.businessentities.DiskImage fromIRS ) { getDestinationDiskImage ( ) . setcreation_date ( fromIRS.getcreation_date ( ) ) ; getDestinationDiskImage ( ) . setlast_modified_date ( fromIRS.getlast_modified_date ( ) ) ; getDestinationDiskImage ( ) . setlastModified ( getDestinationDiskImage ( ) . getlast_modified_date ( ) ) ; org.ovirt.engine.core.common.businessentities.DiskImageDynamic destinationDiskDynamic = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDynamicDAO ( ) . get ( getDestinationDiskImage ( ) . getImageId ( ) ) ; if ( destinationDiskDynamic != null ) { destinationDiskDynamic.setactual_size ( fromIRS.getactual_size ( ) ) ; org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDynamicDAO ( ) . update ( destinationDiskDynamic ) ; } }

Target:
protected void completeImageData ( org.ovirt.engine.core.common.businessentities.DiskImage fromIRS ) { getDestinationDiskImage ( ) . setCreationDate ( fromIRS.getCreationDate ( ) ) ; getDestinationDiskImage ( ) . setLastModifiedDate ( fromIRS.getLastModifiedDate ( ) ) ; getDestinationDiskImage ( ) . setLastModified ( getDestinationDiskImage ( ) . getLastModifiedDate ( ) ) ; org.ovirt.engine.core.common.businessentities.DiskImageDynamic destinationDiskDynamic = getDiskImageDynamicDAO ( ) . get ( getDestinationDiskImage ( ) . getImageId ( ) ) ; if ( destinationDiskDynamic != null ) { destinationDiskDynamic.setactual_size ( fromIRS.getActualSizeFromDiskImage ( ) ) ; getDiskImageDynamicDAO ( ) . update ( destinationDiskDynamic ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.StorageDomainGuidListReturnForXmlRpc getImageDomainsList ( java.lang.String spUUID , java.lang.String imgUUID ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = irsServer.getImageDomainsList ( spUUID , imgUUID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StorageDomainGuidListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StorageDomainGuidListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc extendVolumeSize ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imageUUID , java.lang.String volumeUUID , java.lang.String newSize ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = irsServer.extendVolumeSize ( spUUID , sdUUID , imageUUID , volumeUUID , newSize ) ; org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }
Source:
public void testMigrateNoHost ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVm , org.ovirt.engine.core.common.action.MigrateVmParameters.class , new java.lang.String [ ] { "VmId" , "ForceMigrationForNonMigratableVm" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } ) ) ; verifyActionResponse ( resource.migrate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testMigrateNoHost ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.MigrateVm , org.ovirt.engine.core.common.action.MigrateVmParameters.class , new java.lang.String [ ] { "VmId" , "ForceMigrationForNonMigratableVm" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } ) ) ; verifyActionResponse ( resource.migrate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
protected void updateOldImageActive ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , boolean active ) { org.ovirt.engine.core.compat.Guid oldImageId = findImageForSameDrive ( snapshotType ) ; if ( oldImageId == null ) { log.errorFormat ( "Can't find image to update to active: {0}, snapshot type: {1}, original image id: {2}" , active , snapshotType , org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageId ( ) ) ; return ; } org.ovirt.engine.core.common.businessentities.DiskImage oldImage = org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( oldImageId ) ; oldImage.setactive ( active ) ; org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageDao ( ) . update ( oldImage.getImage ( ) ) ; }

Target:
protected void updateOldImageActive ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , boolean active ) { org.ovirt.engine.core.compat.Guid oldImageId = findImageForSameDrive ( snapshotType ) ; if ( oldImageId == null ) { log.errorFormat ( "Can't find image to update to active: {0}, snapshot type: {1}, original image id: {2}" , active , snapshotType , org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageId ( ) ) ; return ; } org.ovirt.engine.core.common.businessentities.DiskImage oldImage = org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( oldImageId ) ; oldImage.setActive ( active ) ; org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageDao ( ) . update ( oldImage.getImage ( ) ) ; }
Source:
public void testContainsBrick ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; bricks.add ( brick1 ) ; bricks.add ( brick2 ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , brick1 ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , brick2 ) ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , brick3 ) ) ; }

Target:
public void testContainsBrick ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; bricks.add ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick1 ) ; bricks.add ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick2 ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick1 ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick2 ) ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick3 ) ) ; }
Source:
public < T > void collect ( @ javax.enterprise.event.Observes javax.enterprise.inject.spi.ProcessBean < T > event ) { if ( ( event.getAnnotated ( ) . isAnnotationPresent ( org.ovirt.optimizer.util.Autoload.class ) ) && ( event.getAnnotated ( ) . isAnnotationPresent ( javax.enterprise.context.ApplicationScoped.class ) ) ) { autoloadBeanList.add ( event.getBean ( ) ) ; log.info ( java.lang.String.format ( "Adding %s to the list of beans to autostart." , event.getBean ( ) . getBeanClass ( ) . toString ( ) ) ) ; } }

Target:
public < T > void collect ( @ javax.enterprise.event.Observes javax.enterprise.inject.spi.ProcessBean < T > event ) { if ( ( event.getAnnotated ( ) . isAnnotationPresent ( org.ovirt.optimizer.cdi.Autoload.class ) ) && ( event.getAnnotated ( ) . isAnnotationPresent ( javax.enterprise.context.ApplicationScoped.class ) ) ) { autoloadBeanList.add ( event.getBean ( ) ) ; log.info ( java.lang.String.format ( "Adding %s to the list of beans to autostart." , event.getBean ( ) . getBeanClass ( ) . toString ( ) ) ) ; } }
Source:
private javax.ws.rs.core.Response cloneVmFromSnapshot ( org.ovirt.engine.core.common.businessentities.VmStatic staticVm , java.lang.String snapshotId , java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.compat.Guid sourceSnapshotId = asGuid ( snapshotId ) ; org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters params = new org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters ( staticVm , sourceSnapshotId ) ; params.setDiskInfoDestinationMap ( images ) ; params.setMakeCreatorExplicitOwner ( shouldMakeCreatorExplicitOwner ( ) ) ; return performCreation ( VdcActionType.AddVmFromSnapshot , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class ) ) ; }

Target:
private javax.ws.rs.core.Response cloneVmFromSnapshot ( org.ovirt.engine.core.common.businessentities.VmStatic staticVm , java.lang.String snapshotId , java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.compat.Guid sourceSnapshotId = asGuid ( snapshotId ) ; org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters params = new org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters ( staticVm , sourceSnapshotId ) ; params.setDiskInfoDestinationMap ( images ) ; params.setMakeCreatorExplicitOwner ( shouldMakeCreatorExplicitOwner ( ) ) ; return performCreate ( VdcActionType.AddVmFromSnapshot , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "IsHostTabVisible" . equals ( propName ) ) { hostPanel.setVisible ( object.getIsHostTabVisible ( ) ) ; } else if ( "IsCustomPropertiesSheetVisible" . equals ( propName ) ) { customPropertiesPanel.setVisible ( object.getIsCustomPropertiesSheetVisible ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( "IsHostTabVisible" . equals ( propName ) ) { hostPanel.setVisible ( object.getIsHostTabVisible ( ) ) ; } else if ( "IsCustomPropertiesSheetVisible" . equals ( propName ) ) { customPropertiesPanel.setVisible ( object.getIsCustomPropertiesSheetVisible ( ) ) ; } }
Source:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
public void put ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { commandMap.put ( cmdEntity.getId ( ) , cmdEntity ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; }

Target:
public void put ( final org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { commandMap.put ( cmdEntity.getId ( ) , cmdEntity ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; return null ; } } ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.Network networkA , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentA = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachmentA.setId ( id ) ; networkAttachmentA.setNetworkId ( networkA.getId ( ) ) ; return networkAttachmentA ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.Network networkA , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachment ( networkA , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; attachment.setNicId ( nic.getId ( ) ) ; attachment.setNicName ( nic.getName ( ) ) ; return attachment ; }
Source:
protected void initVmForFail ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDAO ( ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; mockGetVmsListForDisk ( ) ; }

Target:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }
Source:
protected void checkMaxMemoryOverCommitValue ( ) { if ( ( getVdsGroup ( ) . getmax_vds_memory_over_commit ( ) ) <= 0 ) { getVdsGroup ( ) . setmax_vds_memory_over_commit ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxVdsMemOverCommit ) ) ; } }

Target:
protected org.ovirt.engine.core.common.businessentities.ArchitectureType getArchitecture ( ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( getVdsGroup ( ) . getcpu_name ( ) ) ) { return org.ovirt.engine.core.bll.CpuFlagsManagerHandler.getArchitectureByCpuName ( getVdsGroup ( ) . getcpu_name ( ) , getVdsGroup ( ) . getcompatibility_version ( ) ) ; } else if ( ( getVdsGroup ( ) . getArchitecture ( ) ) == null ) { return org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ; } return getVdsGroup ( ) . getArchitecture ( ) ; }
Source:
public void testList ( ) throws java.lang.Exception { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsHooksById , org.ovirt.engine.core.common.queries.GetVdsHooksByIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; assertNotNull ( hooks.getHooks ( ) ) ; assertEquals ( hooks.getHooks ( ) . size ( ) , 4 ) ; }

Target:
public void testList ( ) throws java.lang.Exception { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsHooksById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; assertNotNull ( hooks.getHooks ( ) ) ; assertEquals ( hooks.getHooks ( ) . size ( ) , 4 ) ; }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void testCheckIfRoleIsReadOnlyFalse ( ) { getRole ( ) . setReadonly ( false ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; org.junit.Assert.assertFalse ( "Role should be read only" , getCommand ( ) . checkIfRoleIsReadOnly ( messages ) ) ; org.junit.Assert.assertTrue ( "Shouldn't be any canDoAction messages" , messages.isEmpty ( ) ) ; }

Target:
public void testCheckIfRoleIsReadOnlyFalse ( ) { getRole ( ) . setReadonly ( false ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; org.junit.Assert.assertFalse ( "Role should be read only" , getCommand ( ) . checkIfRoleIsReadOnly ( messages ) ) ; org.junit.Assert.assertTrue ( "Shouldn't be any validate messages" , messages.isEmpty ( ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ( obj ) ) ; return ( ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getId ( ) , entity.getId ( ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getGlusterServerUuid ( ) , entity.getGlusterServerUuid ( ) ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getKnownAddresses ( ) , entity.getKnownAddresses ( ) ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ( obj ) ) ; return ( ( java.util.Objects.equals ( getId ( ) , entity.getId ( ) ) ) && ( java.util.Objects.equals ( getGlusterServerUuid ( ) , entity.getGlusterServerUuid ( ) ) ) ) && ( java.util.Objects.equals ( getKnownAddresses ( ) , entity.getKnownAddresses ( ) ) ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , 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 { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getNonEmptyDiskList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage newDiskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; newDiskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ; diskList.add ( newDiskImage ) ; return diskList ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getNonEmptyDiskList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage newDiskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; newDiskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ; diskList.add ( newDiskImage ) ; return diskList ; }
Source:
public void qosValidCommitmentReportedNicSpeed ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmentNicSetup ( ( ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) / 2 ) , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
public void testNetworkIpAddressWasSameAsHostnameAndChangedWhenIpConfigurationIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , null ) . networkIpAddressWasSameAsHostnameAndChanged ( null ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNicExistsWhenNicNameIsNotNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNicId ( null ) ; attachment.setNicName ( "whatever" ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . nicExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private static void AddEventNotificationEntry ( org.ovirt.engine.core.common.EventNotificationEntity entity , org.ovirt.engine.core.common.AuditLogType auditLogType ) { java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > entry = org.ovirt.engine.core.common.VdcEventNotificationUtils.eventNotificationTypeMap.get ( entity ) ; if ( entry == null ) { entry = new java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > ( ) ; org.ovirt.engine.core.common.VdcEventNotificationUtils.eventNotificationTypeMap.put ( entity , entry ) ; } entry.add ( auditLogType ) ; }

Target:
private static void addEventNotificationEntry ( org.ovirt.engine.core.common.EventNotificationEntity entity , org.ovirt.engine.core.common.AuditLogType auditLogType ) { java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > entry = org.ovirt.engine.core.common.VdcEventNotificationUtils.eventNotificationTypeMap.get ( entity ) ; if ( entry == null ) { entry = new java.util.HashSet < > ( ) ; org.ovirt.engine.core.common.VdcEventNotificationUtils.eventNotificationTypeMap.put ( entity , entry ) ; } entry.add ( auditLogType ) ; }
Source:
public static void GetClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , "" , "" , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void GetRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters ( roleId ) , aQuery ) ; }
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.Label > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ) ( 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.Label > ( ) ; }

Target:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public boolean supportedForUnitVmModel ( org.ovirt.engine.core.common.queries.ConfigurationValues feature , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.compat.Version version = model.getCompatibilityVersion ( ) ; if ( version == null ) { return false ; } else { return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( feature , version.getValue ( ) ) ) ) ; } }

Target:
private void initMemoryHotUnplugSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { memoryHotUnplugSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetMemoryHotUnplugSupport ) , callback ) ; }
Source:
public static java.util.ArrayList < java.lang.String > GetHostTypeList ( boolean showPowerclient ) { java.util.ArrayList < java.lang.String > ret = new java.util.ArrayList < java.lang.String > ( ) ; for ( java.lang.String s : org.ovirt.engine.core.compat.EnumCompat.GetNames ( org.ovirt.engine.core.common.businessentities.VDSType.class ) ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( s , VDSType.PowerClient.toString ( ) ) ) { if ( showPowerclient ) { ret.add ( s ) ; } } else { ret.add ( s ) ; } } return ret ; }

Target:
public static java.util.ArrayList < java.lang.String > GetHostTypeList ( boolean showPowerclient ) { java.util.ArrayList < java.lang.String > ret = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSType vdsType : org.ovirt.engine.core.common.businessentities.VDSType.values ( ) ) { if ( ( org.ovirt.engine.core.common.businessentities.VDSType.PowerClient ) == vdsType ) { if ( showPowerclient ) { ret.add ( vdsType.name ( ) ) ; } } else { ret.add ( vdsType.name ( ) ) ; } } return ret ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage initDiskImage ( org.ovirt.engine.core.compat.Guid diskImageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( diskImageId ) ; diskImage.setStoragePoolId ( storagePoolId ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( srcStorageId ) ) ) ; org.mockito.Mockito.when ( diskImageDao.getAncestor ( diskImageId ) ) . thenReturn ( diskImage ) ; org.mockito.Mockito.when ( diskImageDao.get ( diskImageId ) ) . thenReturn ( diskImage ) ; return diskImage ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage initDiskImage ( org.ovirt.engine.core.compat.Guid diskImageGroupId , org.ovirt.engine.core.compat.Guid diskImageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( diskImageGroupId ) ; diskImage.getImage ( ) . setId ( diskImageId ) ; diskImage.setStoragePoolId ( storagePoolId ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( srcStorageId ) ) ) ; org.mockito.Mockito.when ( diskImageDao.getAncestor ( diskImageId ) ) . thenReturn ( diskImage ) ; org.mockito.Mockito.when ( diskImageDao.get ( diskImageId ) ) . thenReturn ( diskImage ) ; return diskImage ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Iterable < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qos = ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS selectedQos = getNetwork ( ) . getQos ( ) ; getQos ( ) . setItems ( qos ) ; getQos ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( qos , ( selectedQos == null ? null : selectedQos.getId ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Iterable < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qos = ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( returnValue ) ) ; getQos ( ) . setItems ( qos ) ; getQos ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( qos , getNetwork ( ) . getQosId ( ) ) ) ; }
Source:
public java.lang.String getJsonDiskDescription ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) throws java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > description = new java.util.TreeMap < > ( ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_ALIAS , disk.getDiskAlias ( ) ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_DESCRIPTION , ( ( disk.getDiskDescription ( ) ) != null ? disk.getDiskDescription ( ) : "" ) ) ; return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( description , false ) ; }

Target:
public java.lang.String generateJsonDiskDescription ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) throws java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > description = new java.util.TreeMap < > ( ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_ALIAS , disk.getDiskAlias ( ) ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_DESCRIPTION , org.apache.commons.lang.StringUtils.defaultString ( disk.getDiskDescription ( ) ) ) ; return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( generateJsonDiskDescription ( description , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DESCRIPTION_FIELDS_PRIORITY ) , false ) ; }
Source:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveOrCopyParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } return doAction ( VdcActionType.ExportVmTemplate , params , action , PollingType.JOB ) ; }

Target:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveOrCopyParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } return doAction ( ActionType.ExportVmTemplate , params , action , PollingType.JOB ) ; }
Source:
protected void executeCallbacks ( boolean success , org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState , java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks ) { java.util.Collections.shuffle ( callbacks ) ; for ( org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback callback : callbacks ) { assertNotAllDone ( flowState ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; result.setCanDoAction ( true ) ; result.setSucceeded ( success ) ; callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( ACTION_TYPE , null , result ) ) ; } }

Target:
protected void executeCallbacks ( boolean success , org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState , java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks ) { java.util.Collections.shuffle ( callbacks ) ; for ( org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback callback : callbacks ) { assertNotAllDone ( flowState ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; result.setValid ( true ) ; result.setSucceeded ( success ) ; callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( ACTION_TYPE , null , result ) ) ; } }
Source:
private void massLabelsUpdate ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.util.Set < java.lang.String > labels ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList < > ( labels.size ( ) ) ; for ( java.lang.String label : labels ) { executions.add ( createLabelParametersMapper ( vfsConfigId , label ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "InsertvfsConfigLabel" , executions ) ; }

Target:
private void removeAllLabelsByVfsConfigId ( org.ovirt.engine.core.compat.Guid vfsConfigId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = createVfsConfigIdParameter ( vfsConfigId ) ; getCallsHandler ( ) . executeModification ( "DeleteAllVfsConfigLabels" , parameterSource ) ; }
Source:
public java.lang.String getXAuthToken ( ) { return ( getTokenProvider ( ) ) == null ? null : getTokenProvider ( ) . getToken ( ) ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getDownloadHeaders ( ) { java.util.HashMap < java.lang.String , java.lang.String > httpHeaders = new java.util.HashMap < > ( ) ; if ( ( getTokenProvider ( ) ) != null ) { httpHeaders.put ( "X-Auth-Token" , getTokenProvider ( ) . getToken ( ) ) ; } return httpHeaders ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.VDS o1 , org.ovirt.engine.core.common.businessentities.VDS o2 ) { int primary = ( o1.getvm_count ( ) ) - ( o2.getvm_count ( ) ) ; if ( primary != 0 ) return primary ; else { return new org.ovirt.engine.core.bll.VdsCpuVdsLoadBalancingAlgorithm.VdsCpuUsageComparator ( ) . compare ( o1 , o2 ) ; } }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.VDS o1 , org.ovirt.engine.core.common.businessentities.VDS o2 ) { int primary = ( o1.getVmCount ( ) ) - ( o2.getVmCount ( ) ) ; if ( primary != 0 ) return primary ; else { return new org.ovirt.engine.core.bll.VdsCpuVdsLoadBalancingAlgorithm.VdsCpuUsageComparator ( ) . compare ( o1 , o2 ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setTitle ( ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? getDefaultTitle ( ) : null ) ) ; return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.externalDiskIcon ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setTitle ( ( object.getReadOnly ( ) ? getDefaultTitle ( ) : null ) ) ; return object.getReadOnly ( ) ? getDefaultImage ( ) : null ; }