auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void hostNameNotChanged ( ) { java.lang.String name = generateRandomName ( ) ; org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( name ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( name ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostNameNotChanged ( ) { java.lang.String name = generateRandomName ( ) ; org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( name ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( name ) ; org.hamcrest.MatcherAssert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void GetWatchdogByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void persistCommandAssociatedEntities ( java.util.Collection < org.ovirt.engine.core.common.businessentities.CommandAssociatedEntity > cmdAssociatedEntities ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . insertCommandAssociatedEntities ( cmdAssociatedEntities ) ; }

Target:
public void persistCommandAssociatedEntities ( java.util.Collection < org.ovirt.engine.core.common.businessentities.CommandAssociatedEntity > cmdAssociatedEntities ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . insertCommandAssociatedEntities ( cmdAssociatedEntities ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
private boolean isCopyCommandAvailable ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.DiskImage > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { if ( ( disk.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.ImageStatus.OK ) ) { return false ; } } return true ; }

Target:
private boolean isCopyCommandAvailable ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { if ( ( disk.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) { return false ; } } return true ; }
Source:
protected boolean AddStorageDomainInIrs ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CreateStorageDomain , new org.ovirt.engine.core.common.vdscommands.CreateStorageDomainVDSCommandParameters ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) , getStorageArgs ( ) ) ) . getSucceeded ( ) ; }

Target:
protected boolean addStorageDomainInIrs ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CreateStorageDomain , new org.ovirt.engine.core.common.vdscommands.CreateStorageDomainVDSCommandParameters ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) , getStorageArgs ( ) ) ) . getSucceeded ( ) ; }
Source:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( _vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) { if ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds = {0} : {1}" , _vds.getId ( ) , _vds.getName ( ) ) ; } else { vdsMaintenanceTimeoutOccurred = _vdsManager.isTimeToRetryMaintenance ( ) ; } } }

Target:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( _vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) { if ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.info ( "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds '{}'({})" , _vds.getName ( ) , _vds.getId ( ) ) ; } else { vdsMaintenanceTimeoutOccurred = _vdsManager.isTimeToRetryMaintenance ( ) ; } } }
Source:
private void sendToDb ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryUnit discovery , boolean isUpdate , org.ovirt.engine.core.common.scheduling.PolicyUnitType type ) { org.ovirt.engine.core.common.scheduling.PolicyUnit policy = createFromDiscoveryUnit ( discovery , type ) ; if ( isUpdate ) { getPolicyUnitDao ( ) . update ( policy ) ; } else { policy.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getPolicyUnitDao ( ) . save ( policy ) ; } }

Target:
private void sendToDb ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryUnit discovery , org.ovirt.engine.core.compat.Guid policyUnitId , org.ovirt.engine.core.common.scheduling.PolicyUnitType type ) { org.ovirt.engine.core.common.scheduling.PolicyUnit policy = createFromDiscoveryUnit ( discovery , type ) ; if ( policyUnitId != null ) { policy.setId ( policyUnitId ) ; getPolicyUnitDao ( ) . update ( policy ) ; } else { policy.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getPolicyUnitDao ( ) . save ( policy ) ; } }
Source:
protected void endSuccessfully ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = org.ovirt.engine.core.bll.UpdateVmDiskCommand.getBackend ( ) . endAction ( VdcActionType.ExtendImageSize , createExtendImageSizeParameters ( ) ) ; if ( ret.getSucceeded ( ) ) { performDiskUpdate ( true ) ; } else { unlockImageInDb ( ) ; } org.ovirt.engine.core.bll.UpdateVmDiskCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; setSucceeded ( ret.getSucceeded ( ) ) ; }

Target:
private void extendDiskImageSize ( ) { lockImageInDb ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase ret = runInternalActionWithTasksContext ( VdcActionType.ExtendImageSize , createExtendImageSizeParameters ( ) ) ; if ( ret.getSucceeded ( ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( ret.getInternalVdsmTaskIdList ( ) ) ; } else { propagateInternalCommandFailure ( ret ) ; org.ovirt.engine.core.bll.UpdateVmDiskCommand.getReturnValue ( ) . setFault ( ret.getFault ( ) ) ; } setSucceeded ( ret.getSucceeded ( ) ) ; }
Source:
protected void baseTemplateSelectedItemChanged ( ) { }

Target:
protected void baseTemplateSelectedItemChanged ( ) { if ( ( ( getModel ( ) . getBaseTemplate ( ) . getSelectedItem ( ) ) != null ) && ( getModel ( ) . getIsSubTemplate ( ) . getEntity ( ) ) ) { getModel ( ) . getName ( ) . setEntity ( getModel ( ) . getBaseTemplate ( ) . getSelectedItem ( ) . getName ( ) ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.Cluster createClusterWithNoCpuName ( ) { org.ovirt.engine.core.common.businessentities.Cluster group = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DEFAULT_CLUSTER_ID ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.undefined ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.Cluster createClusterWithNoCpuName ( ) { org.ovirt.engine.core.common.businessentities.Cluster group = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DEFAULT_CLUSTER_ID ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.undefined ) ; group.setClusterPolicyId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return group ; }
Source:
public void updatePosixNonEmptyVFSType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; parameters.setStoragePoolId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . initializeVds ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void addPosixNonEmptyVFSType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; parameters.setStoragePoolId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isConnWithSameDetailsExists ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . initializeVds ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
protected boolean updateVmInSpm ( ) { return org.ovirt.engine.core.bll.VmCommand.updateVmInSpm ( getVm ( ) . getstorage_pool_id ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VM [ ] { getVm ( ) } ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ( ( getVm ( ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( getVm ( ) . getCustomProperties ( ) ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getVm ( ) . getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } return permissionList ; }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , org.ovirt.engine.core.common.businessentities.gluster.StorageDevice device , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( device.getCanCreateBrick ( ) ) { return ; } com.google.gwt.safehtml.shared.SafeHtml statusImageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( org.ovirt.engine.ui.webadmin.widget.table.column.StorageDeviceStatusCell.resources.lockImage ( ) ) . getHTML ( ) ) ; sb.append ( org.ovirt.engine.ui.webadmin.widget.table.column.StorageDeviceStatusCell.templates.statusTemplate ( statusImageHtml , id ) ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , org.ovirt.engine.core.common.businessentities.gluster.StorageDevice device , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( device.getCanCreateBrick ( ) ) { return ; } com.google.gwt.safehtml.shared.SafeHtml statusImageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( org.ovirt.engine.ui.webadmin.widget.table.column.StorageDeviceStatusCell.resources.lockImage ( ) ) . getHTML ( ) ) ; sb.append ( org.ovirt.engine.ui.webadmin.widget.table.column.StorageDeviceStatusCell.templates.statusTemplate ( statusImageHtml , id , "" ) ) ; }
Source:
public void testIsConnectionDoesNotExistForHostAndTargetFails ( ) { org.mockito.Mockito.when ( storageServerConnectionExtensionDao.getByHostIdAndTarget ( conn.getHostId ( ) , conn.getIqn ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension ( ) ) ; org.junit.Assert.assertEquals ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_ALREADY_EXISTS , validator.isConnectionDoesNotExistForHostAndTarget ( conn ) . getMessage ( ) ) ; }

Target:
public void testIsConnectionDoesNotExistForHostAndTargetFails ( ) { org.mockito.Mockito.when ( storageServerConnectionExtensionDao.getByHostIdAndTarget ( conn.getHostId ( ) , conn.getIqn ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension ( ) ) ; org.junit.Assert.assertThat ( validator.isConnectionDoesNotExistForHostAndTarget ( conn ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_ALREADY_EXISTS ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > getDisplayTypes ( int osId , org.ovirt.engine.core.compat.Version version ) { return displayTypes.get ( osId ) . get ( version ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > getDisplayTypes ( int osId , org.ovirt.engine.core.compat.Version version ) { java.util.Map < org.ovirt.engine.core.compat.Version , java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > > osDisplayTypes = displayTypes.get ( osId ) ; return osDisplayTypes == null ? null : osDisplayTypes.get ( version ) ; }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void diskImagesNoDerivedDisksOnStorageDomain ( ) { disk1.setVmEntityType ( VmEntityType.TEMPLATE ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageDomainIds = new java.util.ArrayList < > ( ) ; storageDomainIds.add ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disk2.setStorageIds ( storageDomainIds ) ; org.mockito.Mockito.when ( diskImageDao.getAllSnapshotsForParent ( disk1.getImageId ( ) ) ) . thenReturn ( java.util.Arrays.asList ( disk2 ) ) ; org.junit.Assert.assertThat ( validator.diskImagesHaveNoDerivedDisks ( Guid.Empty ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void diskImagesNoDerivedDisksOnStorageDomain ( ) { disk1.setVmEntityType ( VmEntityType.TEMPLATE ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageDomainIds = new java.util.ArrayList < > ( ) ; storageDomainIds.add ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disk2.setStorageIds ( storageDomainIds ) ; org.mockito.Mockito.when ( diskImageDao.getAllSnapshotsForParent ( disk1.getImageId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( disk2 ) ) ; org.junit.Assert.assertThat ( validator.diskImagesHaveNoDerivedDisks ( Guid.Empty ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void postConstruct ( ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getParameters ( ) . getInitialStatus ( ) ) == null ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getVds ( ) ) != null ) { org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getParameters ( ) . setInitialStatus ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getVds ( ) . getStatus ( ) ) ; } } }

Target:
protected void init ( ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getParameters ( ) . getInitialStatus ( ) ) == null ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getVds ( ) ) != null ) { org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getParameters ( ) . setInitialStatus ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getVds ( ) . getStatus ( ) ) ; } } }
Source:
public void notifyHostManagers ( org.ovirt.engine.core.compat.Guid hostId ) { if ( ( resourceManager ) == null ) { return ; } org.ovirt.engine.core.vdsbroker.VdsManager vdsManager = resourceManager.getVdsManager ( hostId ) ; int pendingCpus = org.ovirt.engine.core.bll.scheduling.pending.PendingCpuCores.collectForHost ( this , hostId ) ; int pendingMemory = org.ovirt.engine.core.bll.scheduling.pending.PendingMemory.collectForHost ( this , hostId ) ; vdsManager.updatePendingData ( pendingMemory , pendingCpus ) ; }

Target:
public void notifyHostManagers ( org.ovirt.engine.core.compat.Guid hostId ) { if ( ( resourceManager ) == null ) { return ; } org.ovirt.engine.core.vdsbroker.VdsManager vdsManager = resourceManager.getVdsManager ( hostId ) ; int pendingCpus = org.ovirt.engine.core.bll.scheduling.pending.PendingCpuCores.collectForHost ( this , hostId ) ; int pendingMemory = org.ovirt.engine.core.bll.scheduling.pending.PendingOvercommitMemory.collectForHost ( this , hostId ) ; vdsManager.updatePendingData ( pendingMemory , pendingCpus ) ; }
Source:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getVolumeInfo ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid newStorageDomainID , org.ovirt.engine.core.compat.Guid newImageGroupId , org.ovirt.engine.core.compat.Guid newImageId ) { if ( isDataCenterWithSpm ( ) ) { return ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( runVdsCommand ( VDSCommandType.GetImageInfo , new org.ovirt.engine.core.common.vdscommands.GetImageInfoVDSCommandParameters ( storagePoolId , newStorageDomainID , newImageGroupId , newImageId ) ) . getReturnValue ( ) ) ) ; } else { return ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.core.bll.storage.utils.VdsCommandsHelper.runVdsCommandWithFailover ( VDSCommandType.GetVolumeInfo , new org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters ( storagePoolId , newStorageDomainID , newImageGroupId , newImageId ) , storagePoolId , null ) . getReturnValue ( ) ) ) ; } }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getVolumeInfo ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid newStorageDomainID , org.ovirt.engine.core.compat.Guid newImageGroupId , org.ovirt.engine.core.compat.Guid newImageId ) { if ( isDataOperationsBySpm ( ) ) { return ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( runVdsCommand ( VDSCommandType.GetImageInfo , new org.ovirt.engine.core.common.vdscommands.GetImageInfoVDSCommandParameters ( storagePoolId , newStorageDomainID , newImageGroupId , newImageId ) ) . getReturnValue ( ) ) ) ; } else { return ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.core.bll.storage.utils.VdsCommandsHelper.runVdsCommandWithFailover ( VDSCommandType.GetVolumeInfo , new org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters ( storagePoolId , newStorageDomainID , newImageGroupId , newImageId ) , storagePoolId , null ) . getReturnValue ( ) ) ) ; } }
Source:
public static void updateVirtioScsiController ( org.ovirt.engine.core.compat.Guid vmId , java.lang.Boolean isVirtioScsiEnabled ) { if ( isVirtioScsiEnabled == null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > controllers = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.CONTROLLER , VmDeviceType.VIRTIOSCSI.getName ( ) ) ; if ( isVirtioScsiEnabled ) { if ( controllers.isEmpty ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addVirtioScsiController ( vmId ) ; } } else { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : controllers ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } }

Target:
public static void removeVmDevices ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , org.ovirt.engine.core.common.businessentities.gluster.StorageDevice device , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( device.getCanCreateBrick ( ) ) { return ; } com.google.gwt.resources.client.ImageResource statusImage = null ; java.lang.String tooltip ; statusImage = resources.lockImage ( ) ; tooltip = constants.deviceIsAlreadyUsed ( ) ; com.google.gwt.safehtml.shared.SafeHtml statusImageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( statusImage ) . getHTML ( ) ) ; sb.append ( templates.statusTemplate ( statusImageHtml , tooltip , id ) ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , org.ovirt.engine.core.common.businessentities.gluster.StorageDevice device , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( device.getCanCreateBrick ( ) ) { return ; } com.google.gwt.safehtml.shared.SafeHtml statusImageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( org.ovirt.engine.ui.webadmin.widget.table.column.StorageDeviceStatusCell.resources.lockImage ( ) ) . getHTML ( ) ) ; sb.append ( org.ovirt.engine.ui.webadmin.widget.table.column.StorageDeviceStatusCell.templates.statusTemplate ( statusImageHtml , org.ovirt.engine.ui.webadmin.widget.table.column.StorageDeviceStatusCell.constants.deviceIsAlreadyUsed ( ) , id ) ) ; }
Source:
public void diskInterfaceSupportedByOs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; initializeOsRepository ( vm.getOs ( ) , DiskInterface.VirtIO ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; org.junit.Assert.assertThat ( validator.isDiskInterfaceSupported ( vm , dve ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testDiskAttachedToAnyVM ( ) { org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToAnyVm ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }

Target:
private void setUpGetBallooningExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , true ) ; } }
Source:
public void testAllDomainsWithinThresholdAllOk ( ) { domain1.getStorageDynamicData ( ) . setAvailableDiskSize ( ( ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) + 1 ) ) ; domain2.getStorageDynamicData ( ) . setAvailableDiskSize ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; domain1.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; domain2.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; org.junit.Assert.assertTrue ( "Both domains should be within space threshold" , validator.allDomainsWithinThresholds ( ) . isValid ( ) ) ; }

Target:
public void testAllDomainsWithinThresholdAllOk ( ) { domain1.getStorageDynamicData ( ) . setAvailableDiskSize ( ( ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) + 1 ) ) ; domain2.getStorageDynamicData ( ) . setAvailableDiskSize ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; domain1.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; domain2.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; org.junit.jupiter.api.Assertions.assertTrue ( validator.allDomainsWithinThresholds ( ) . isValid ( ) , "Both domains should be within space threshold" ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.async_tasks task ) { org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.AsyncTaskParameterSource parameterSource = getTaskParameterSource ( task ) ; getCallsHandler ( ) . executeModification ( "Insertasync_tasks" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.async_tasks task , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.AsyncTaskParameterSource parameterSource = getTaskParameterSource ( task ) ; parameterSource.addValue ( "entity_type" , ( entityType != null ? entityType.toString ( ) : null ) ) ; parameterSource.addValue ( "entity_ids" , org.apache.commons.lang.StringUtils.join ( entityIds , "," ) ) ; getCallsHandler ( ) . executeModification ( "Insertasync_tasks" , parameterSource ) ; }
Source:
protected void PollVds ( org.ovirt.engine.core.compat.Guid vdsId ) { int retries = 10 ; while ( ( ( retries > 0 ) && ( ( retVal ) == null ) ) && ( ! ( editNetworkThreadFinish ) ) ) { retries -- ; try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( vdsId ) ) ; } catch ( java.lang.Exception e ) { } } }

Target:
protected void pollVds ( org.ovirt.engine.core.compat.Guid vdsId ) { int retries = 10 ; while ( ( ( retries > 0 ) && ( ( retVal ) == null ) ) && ( ! ( editNetworkThreadFinish ) ) ) { retries -- ; try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( vdsId ) ) ; } catch ( java.lang.Exception e ) { } } }
Source:
public void getAAAProfilesListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void canDoActionFailsOnServerNotUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForAdd ( VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnServerNotUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForAdd ( VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP.toString ( ) ) ) ; }
Source:
private java.lang.String getSubResourceName ( java.lang.String collectionName , java.lang.String parent ) { java.lang.String resource = org.ovirt.engine.sdk.codegen.utils.StringUtils.toSingular ( collectionName ) ; java.lang.String resourceCandidate = getPublicEntity ( org.ovirt.engine.sdk.codegen.utils.StringUtils.toSingular ( collectionName.replace ( parent , "" ) . toLowerCase ( ) ) , false ) ; if ( resourceCandidate != null ) { resource = parent + resourceCandidate ; } return resource ; }

Target:
private java.lang.String getSubResourceName ( java.lang.String collectionName , java.lang.String parent , java.lang.String [ ] periods , int i ) { java.lang.String resource = org.ovirt.engine.sdk.codegen.utils.StringUtils.toSingular ( collectionName ) ; java.lang.String resourceCandidate = getPublicEntity ( org.ovirt.engine.sdk.codegen.utils.StringUtils.toSingular ( collectionName.replace ( parent , "" ) . toLowerCase ( ) ) , periods , i , false ) ; if ( resourceCandidate != null ) { resource = parent + resourceCandidate ; } return resource ; }
Source:
public void canDoActionFailsForNoStorageDevice ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.Raid0 , null , null , java.util.Collections.EMPTY_LIST ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void canDoActionFailsForNoStorageDevice ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.EMPTY_LIST ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }
Source:
public void render ( com.google.gwt.cell.client.Cell.Context context , org.ovirt.engine.ui.uicommonweb.models.EntityModel object , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { com.google.gwt.cell.client.Cell < java.lang.Boolean > cell = getCell ( ) ; if ( cell instanceof org.ovirt.engine.ui.webadmin.widget.table.column.EntityModelCheckboxColumn.ClickableCheckboxCell ) { ( ( org.ovirt.engine.ui.webadmin.widget.table.column.EntityModelCheckboxColumn.ClickableCheckboxCell ) ( cell ) ) . renderEditable ( context , getValue ( object ) , canEdit ( object ) , sb ) ; } else { super . render ( context , object , sb ) ; } }

Target:
public void render ( com.google.gwt.cell.client.Cell.Context context , org.ovirt.engine.ui.uicommonweb.models.EntityModel object , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { com.google.gwt.cell.client.Cell < java.lang.Boolean > cell = getCell ( ) ; if ( cell instanceof org.ovirt.engine.ui.webadmin.widget.table.column.EntityModelCheckboxColumn.EnabledDisabledCheckboxCell ) { ( ( org.ovirt.engine.ui.webadmin.widget.table.column.EntityModelCheckboxColumn.EnabledDisabledCheckboxCell ) ( cell ) ) . renderEditable ( context , getValue ( object ) , canEdit ( object ) , sb ) ; } else { super . render ( context , object , sb ) ; } }
Source:
private void edit ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getSelectedItem ( ) ; if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.frontend.AsyncQuery getVmInitQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getVmInitQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { vmInitLoaded ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( result ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getTemplateById ( getVmInitQuery , template.getId ( ) ) ; }

Target:
private void edit ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getSelectedItem ( ) ; if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.templates.AsyncQuery getVmInitQuery = new org.ovirt.engine.ui.uicommonweb.models.templates.AsyncQuery ( ) ; getVmInitQuery.asyncCallback = new org.ovirt.engine.ui.frontend.AsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object result ) { vmInitLoaded ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( result ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getTemplateById ( getVmInitQuery , template.getId ( ) ) ; }
Source:
public void init ( ) { super . init ( ) ; getIsAutoAssign ( ) . setEntity ( true ) ; getCustomPropertySheet ( ) . setKeyValueMap ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getCustomPropertiesList ( ) . get ( vm.getVdsGroupCompatibilityVersion ( ) ) ) ; getCustomPropertySheet ( ) . deserialize ( vm.getCustomProperties ( ) ) ; loadHosts ( ) ; }

Target:
public void init ( ) { super . init ( ) ; getIsAutoAssign ( ) . setEntity ( true ) ; getCustomPropertySheet ( ) . setKeyValueMap ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getCustomPropertiesList ( ) . get ( vm.getCompatibilityVersion ( ) ) ) ; getCustomPropertySheet ( ) . deserialize ( vm.getCustomProperties ( ) ) ; loadHosts ( ) ; }
Source:
public static boolean validateBrickCount ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType selectedVolumeType , org.ovirt.engine.ui.uicommonweb.models.ListModel bricks , int replicaCount , int stripeCount ) { int brickCount = 0 ; if ( ( bricks.getItems ( ) ) != null ) { brickCount = ( ( java.util.List < ? > ) ( bricks.getItems ( ) ) ) . size ( ) ; } return org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickModel.validateBrickCount ( selectedVolumeType , brickCount , replicaCount , stripeCount ) ; }

Target:
public static boolean validateBrickCount ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType selectedVolumeType , org.ovirt.engine.ui.uicommonweb.models.ListModel bricks , int replicaCount , int stripeCount , boolean isCreateVolume ) { int brickCount = 0 ; if ( ( bricks.getItems ( ) ) != null ) { brickCount = ( ( java.util.List < ? > ) ( bricks.getItems ( ) ) ) . size ( ) ; } return org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickModel.validateBrickCount ( selectedVolumeType , brickCount , replicaCount , stripeCount , isCreateVolume ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS none = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; none.setName ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . unlimitedQoSTitle ( ) ) ; none.setId ( Guid.Empty ) ; networkQoSes.add ( 0 , none ) ; getNetworkQoS ( ) . setItems ( networkQoSes ) ; setSelectedNetworkQoSId ( selectedItemId ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; networkQoSes.add ( 0 , org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.getEmptyQos ( ) ) ; getNetworkQoS ( ) . setItems ( networkQoSes ) ; setSelectedNetworkQoSId ( defaultQosId ) ; }
Source:
private void updateCinderDiskSnapshot ( org.ovirt.engine.core.compat.Guid cinderDiskId , org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmSnapshotId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskFromSnapshot = org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getDiskImageDao ( ) . getDiskSnapshotForVmSnapshot ( cinderDiskId , snapshotId ) ; diskFromSnapshot.setActive ( true ) ; if ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( vmSnapshotId ) ) ) { diskFromSnapshot.setVmSnapshotId ( vmSnapshotId ) ; } org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getImageDao ( ) . update ( diskFromSnapshot.getImage ( ) ) ; }

Target:
private void updateCinderDiskSnapshot ( org.ovirt.engine.core.compat.Guid cinderDiskId , org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmSnapshotId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskFromSnapshot = diskImageDao.getDiskSnapshotForVmSnapshot ( cinderDiskId , snapshotId ) ; diskFromSnapshot.setActive ( true ) ; if ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( vmSnapshotId ) ) ) { diskFromSnapshot.setVmSnapshotId ( vmSnapshotId ) ; } org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getImageDao ( ) . update ( diskFromSnapshot.getImage ( ) ) ; }
Source:
private void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.IVdcQueryableCellTable < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel > ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; }

Target:
protected void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.IVdcQueryableCellTable < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel > ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; com.google.gwt.user.client.ui.ScrollPanel appPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; appPanel.add ( appTable ) ; subTabLayoutPanel.add ( appPanel , constants.importVmApplicationslSubTabLabel ( ) ) ; }
Source:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }

Target:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.String > aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.StringConverter ( ) ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateProvider , org.ovirt.engine.core.common.action.ProviderParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.update ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateProvider , org.ovirt.engine.core.common.action.ProviderParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.update ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }