auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ) ( returnValue ) ) ; allNetworks = networks ; initNetworkModels ( ) ; initDcNetworkParams ( ) ; queryInterfaces ( ) ; }

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 ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; this . allNics = allNics ; queryFreeBonds ( ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult networkNotUsedByVms ( java.lang.String networkName ) { if ( org.ovirt.engine.core.common.FeatureSupported.changeNetworkUsedByVmSupported ( host.getVdsGroupCompatibilityVersion ( ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.util.List < java.lang.String > vmNames = vmInterfaceManager.findActiveVmsUsingNetworks ( host.getId ( ) , java.util.Collections.singleton ( networkName ) ) ; return new org.ovirt.engine.core.common.utils.PluralMessages ( ) . getNetworkInUse ( vmNames , EngineMessage.VAR__ENTITIES__VM , EngineMessage.VAR__ENTITIES__VMS ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult networkNotUsedByVms ( java.lang.String networkName ) { if ( org.ovirt.engine.core.common.FeatureSupported.changeNetworkUsedByVmSupported ( host.getClusterCompatibilityVersion ( ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.util.List < java.lang.String > vmNames = vmInterfaceManager.findActiveVmsUsingNetworks ( host.getId ( ) , java.util.Collections.singleton ( networkName ) ) ; return new org.ovirt.engine.core.common.utils.PluralMessages ( ) . getNetworkInUse ( vmNames , EngineMessage.VAR__ENTITIES__VM , EngineMessage.VAR__ENTITIES__VMS ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > searchVDSsByDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data = genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVdsDao ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( cpuFlagsManagerHandler.findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getClusterCompatibilityVersion ( ) ) ) ; } return data ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > searchVDSsByDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data = genericSearch ( vdsDao , true ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( cpuFlagsManagerHandler.findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getClusterCompatibilityVersion ( ) ) ) ; } return data ; }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case UnknownTask : log.error ( java.lang.String.format ( "Trying to revert unknown task: %1$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; return ; } super . ProceedProxyReturnValue ( ) ; }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case UnknownTask : log.error ( java.lang.String.format ( "Trying to revert unknown task: %1$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; return ; } super . proceedProxyReturnValue ( ) ; }
Source:
public void testEnoughSpaceToMergeSnapshotsWithMultipleDiskAndDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; imagesDisks.addAll ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 ) ; org.junit.Assert.assertTrue ( "Validation should succeed. Free space minus threshold should be bigger then summarize all disks size for each domain" , cmd.isEnoughSpaceToMergeSnapshots ( ) ) ; }

Target:
public void testEnoughSpaceToMergeSnapshotsWithMultipleDiskAndDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; imagesDisks.addAll ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 ) ; org.junit.Assert.assertTrue ( "Validation should succeed. Free space minus threshold should be bigger then summarize all disks size for each domain" , cmd.validateStorageDomains ( ) ) ; }
Source:
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.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , 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 : "" ; } } ; 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:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; dataCenterGuideModel.isoStorageDomains = storageDomains ; dataCenterGuideModel.UpdateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; dataCenterGuideModel.isoStorageDomains = storageDomains ; dataCenterGuideModel.updateOptionsNonLocalFS ( ) ; }
Source:
public static boolean isAdminUser ( org.ovirt.engine.core.compat.Guid userId ) { java.util.List < org.ovirt.engine.core.common.businessentities.roles > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAllForAdElement ( userId ) ; for ( org.ovirt.engine.core.common.businessentities.roles r : userRoles ) { if ( ( r.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { if ( org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debugFormat ( "LoginAdminUser: User logged to admin using role {0}" , r.getname ( ) ) ; } return true ; } } return false ; }

Target:
public static boolean isAdminUser ( org.ovirt.engine.core.common.interfaces.IVdcUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.roles > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAllForUserAndGroups ( user.getUserId ( ) , user.getGroupIds ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.roles r : userRoles ) { if ( ( r.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { if ( org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debugFormat ( "LoginAdminUser: User logged to admin using role {0}" , r.getname ( ) ) ; } return true ; } } return false ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getStorageDevices ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > devices = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > ) ( returnValue ) ) ; java.util.Collections.sort ( devices , new org.ovirt.engine.ui.uicommonweb.Linq.StorageDeviceComparer ( ) ) ; setItems ( devices ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getStorageDevices ( new org.ovirt.engine.ui.uicommonweb.models.gluster.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > devices ) { java.util.Collections.sort ( devices , new org.ovirt.engine.ui.uicommonweb.Linq.StorageDeviceComparer ( ) ) ; setItems ( devices ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.CommandEntity buildCommandEntity ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid rootCommandId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.compat.CommandStatus status , boolean enableCallBack ) { org.ovirt.engine.core.common.businessentities.CommandEntity entity = new org.ovirt.engine.core.common.businessentities.CommandEntity ( ) ; entity.setId ( commandId ) ; entity.setRootCommandId ( rootCommandId ) ; entity.setCommandType ( actionType ) ; entity.setActionParameters ( params ) ; entity.setCommandStatus ( status ) ; return entity ; }

Target:
public void updateCallBackNotified ( org.ovirt.engine.core.compat.Guid commandId ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = get ( commandId ) ; if ( cmdEntity != null ) { cmdEntity.setCallBackNotified ( true ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . updateNotified ( commandId ) ; } }
Source:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getHostListByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( org.ovirt.engine.core.common.gluster.GlusterFeatureSupported.glusterSnapshot ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( getGlusterUtil ( ) . isGlusterSnapshotSupported ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getId ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED ) ; } return true ; }
Source:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) ) ; }

Target:
public void testValidModifiedBondsFailsWhenBondIsUnnamed ( ) throws java.lang.Exception { doTestValidModifiedBonds ( new org.ovirt.engine.core.common.businessentities.network.Bond ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { "Tag.TagName" , "Tag.ParentId" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_GUID } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { "Tag.TagName" , "Tag.ParentId" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_GUID } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) , 0 ) ; }
Source:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getstatus ( ) ) != ( runningVm.getstatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "VM {0} {1} moved from {2} --> {3}" , vmToUpdate.getvm_name ( ) , vmToUpdate.getId ( ) , vmToUpdate.getstatus ( ) . name ( ) , runningVm.getstatus ( ) . name ( ) ) ; } }

Target:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getstatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "VM {0} {1} moved from {2} --> {3}" , vmToUpdate.getVmName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getstatus ( ) . name ( ) ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getVmPoolId ( ) ) == null ) { switch ( vm.getvm_type ( ) ) { case Desktop : return getApplicationResources ( ) . desktopImage ( ) ; case Server : return getApplicationResources ( ) . serverImage ( ) ; default : return getApplicationResources ( ) . questionMarkImage ( ) ; } } else { return getApplicationResources ( ) . manyDesktopsImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getVmPoolId ( ) ) == null ) { switch ( vm.getVmType ( ) ) { case Desktop : return getApplicationResources ( ) . desktopImage ( ) ; case Server : return getApplicationResources ( ) . serverImage ( ) ; default : return getApplicationResources ( ) . questionMarkImage ( ) ; } } else { return getApplicationResources ( ) . manyDesktopsImage ( ) ; } }
Source:
protected void setUpGetEntityExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( false ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { true , false } , getUsers ( ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public javax.ws.rs.core.Response importCertificates ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.core.common.businessentities.Provider provider = org.ovirt.engine.api.restapi.resource.BackendExternalProviderHelper.getProvider ( this , id ) ; java.util.List < org.ovirt.engine.core.common.businessentities.CertificateInfo > entities = getBackendCollection ( org.ovirt.engine.core.common.businessentities.CertificateInfo.class , VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) ) ; if ( ( entities.size ( ) ) == 0 ) { return null ; } return null ; }

Target:
public javax.ws.rs.core.Response importCertificates ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.core.common.businessentities.Provider provider = org.ovirt.engine.api.restapi.resource.BackendExternalProviderHelper.getProvider ( this , id ) ; java.util.List < org.ovirt.engine.core.common.businessentities.CertificateInfo > entities = getBackendCollection ( org.ovirt.engine.core.common.businessentities.CertificateInfo.class , VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) ) ; if ( ( entities.size ( ) ) == 0 ) { return null ; } return performAction ( VdcActionType.ImportProviderCertificate , new org.ovirt.engine.core.common.action.ImportProviderCertificateParameters ( provider , entities.get ( 0 ) . getPayload ( ) ) ) ; }
Source:
protected void unlockVm ( ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) , org.ovirt.engine.core.bll.VmCommand.getCompensationContext ( ) ) ; } } else { setLoggingForCommand ( ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing EndAction on Vm" ) ; } }

Target:
protected void unlockVm ( ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) , org.ovirt.engine.core.bll.VmCommand.getCompensationContext ( ) ) ; } } else { setLoggingForCommand ( ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing endAction on Vm" ) ; } }
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:
public void getConfigurationValueBoolean ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.queries.ConfigurationValues configVal ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( configVal , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { buttonDefinition.onClick ( null ) ; }

Target:
public com.google.gwt.event.dom.client.HasClickHandlers addShutdownButton ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model , org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( constants.shutdownVm ( ) , resources.stopIcon ( ) , resources.stopDisabledIcon ( ) , style.shutdownButtonAdditionalStyle ( ) ) ; button.setElementId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , "shutdownButton" ) ) ; addButtonToPanel ( button ) ; updateButton ( button , command ) ; return button ; }
Source:
private boolean shouldWaitForEndMethodsCompletion ( org.ovirt.engine.core.bll.CommandBase < ? > childCommand , org.ovirt.engine.core.bll.CommandBase < ? > parentCommand ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( childCommand.getCommandId ( ) ) ; boolean hasNotifiedCallback = ( cmdEntity.isCallbackEnabled ( ) ) && ( cmdEntity.isCallbackNotified ( ) ) ; if ( ( shouldCommandEndOnAsyncOpEnd ( childCommand ) ) && ( ! hasNotifiedCallback ) ) { logWaitingForChildCommand ( childCommand , parentCommand ) ; return true ; } return false ; }

Target:
private boolean shouldWaitForEndMethodsCompletion ( org.ovirt.engine.core.bll.CommandBase < ? > childCommand , org.ovirt.engine.core.bll.CommandBase < ? > parentCommand ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = commandCoordinatorUtil.getCommandEntity ( childCommand.getCommandId ( ) ) ; boolean hasNotifiedCallback = ( cmdEntity.isCallbackEnabled ( ) ) && ( cmdEntity.isCallbackNotified ( ) ) ; if ( ( shouldCommandEndOnAsyncOpEnd ( childCommand ) ) && ( ! hasNotifiedCallback ) ) { logWaitingForChildCommand ( childCommand , parentCommand ) ; return true ; } return false ; }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.StopGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters ( upServer.getId ( ) , getGlusterVolumeName ( ) , getParameters ( ) . isForceAction ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { org.ovirt.engine.core.bll.utils.GlusterUtils.getInstance ( ) . updateVolumeStatus ( getParameters ( ) . getVolumeId ( ) , GlusterStatus.DOWN ) ; } else { handleVdsError ( AuditLogType.GLUSTER_VOLUME_STOP_FAILED , returnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.StopGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters ( upServer.getId ( ) , getGlusterVolumeName ( ) , getParameters ( ) . isForceAction ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { org.ovirt.engine.core.dao.gluster.GlusterDBUtils.getInstance ( ) . updateVolumeStatus ( getParameters ( ) . getVolumeId ( ) , GlusterStatus.DOWN ) ; } else { handleVdsError ( AuditLogType.GLUSTER_VOLUME_STOP_FAILED , returnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }
Source:
public static void GetHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , 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 synchronized org.ovirt.engine.api.model.RSDL getRSDL ( ) throws java.io.IOException , java.lang.ClassNotFoundException { if ( ( rsdl ) == null ) { rsdl = org.ovirt.engine.api.rsdl.RsdlManager.loadRsdl ( getCurrent ( ) . get ( org.ovirt.engine.core.common.mode.ApplicationMode.class ) , getUriInfo ( ) . getBaseUri ( ) . getPath ( ) ) ; } return rsdl ; }

Target:
public synchronized org.ovirt.engine.api.model.RSDL getRSDL ( ) throws java.io.IOException , java.lang.ClassNotFoundException { if ( ( rsdl ) == null ) { rsdl = org.ovirt.engine.api.rsdl.RsdlManager.loadRsdl ( getCurrent ( ) . getApplicationMode ( ) , getUriInfo ( ) . getBaseUri ( ) . getPath ( ) ) ; } return rsdl ; }
Source:
public void testRefreshUserSession ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER ) ; container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , true ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return null since the session wasn't refresh" , container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , false ) ) ; }

Target:
public void testRefreshUserSession ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER ) ; container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , true ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return null since the session wasn't refresh" , container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , false ) ) ; clearSession ( ) ; }
Source:
protected void sortStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > vmDisks ) { java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > comp = null ; for ( java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > comparator : getStorageDomainComparators ( vmDisks ) ) { comp = ( comp == null ) ? comparator : comp.thenComparing ( comparator ) ; } java.util.Collections.sort ( domainsInPool , comp ) ; }

Target:
protected void sortStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > vmDisks ) { java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > comp = getStorageDomainComparators ( vmDisks ) . stream ( ) . reduce ( java.util.Comparator :: thenComparing ) . orElse ( null ) ; java.util.Collections.sort ( domainsInPool , comp ) ; }
Source:
public void clearPoolTimers ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.info ( ( "clear domain error-timers for pool " + ( _storagePoolId ) ) ) ; for ( java.lang.String jobId : _timers.values ( ) ) { try { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( jobId ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.warn ( ( "failed deleting job " + jobId ) ) ; } } }

Target:
public void clearPoolTimers ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.info ( "clear domain error-timers for pool '{}'." , _storagePoolId ) ; for ( java.lang.String jobId : _timers.values ( ) ) { try { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( jobId ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.warn ( "failed deleting job '{}'." , jobId ) ; } } }
Source:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVmForFail ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }
Source:
private org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand < org.ovirt.engine.core.common.vdscommands.SetupNetworksVdsCommandParameters > createCommand ( org.ovirt.engine.core.common.vdscommands.SetupNetworksVdsCommandParameters parameters ) { final org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacade = org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class ) ; final org.ovirt.engine.core.dao.VdsStaticDAO vdsStaticDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsStaticDAO.class ) ; org.mockito.Mockito.when ( dbFacade.getVdsStaticDao ( ) ) . thenReturn ( vdsStaticDao ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand < org.ovirt.engine.core.common.vdscommands.SetupNetworksVdsCommandParameters > ( parameters ) { @ java.lang.Override protected org.ovirt.engine.core.vdsbroker.vdsbroker.IVdsServer initializeVdsBroker ( org.ovirt.engine.core.compat.Guid vdsId ) { return server ; } @ java.lang.Override protected org.ovirt.engine.core.dal.dbbroker.DbFacade getDbFacade ( ) { return dbFacade ; } } ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDS getVds ( ) { return host ; }
Source:
protected void onReset ( ) { if ( placeManager.isMainSectionBasicPlaceVisible ( ) ) { header.setGuideUrl ( basicGuideUrl ) ; } else { header.setGuideUrl ( extendedGuideUrl ) ; } }

Target:
protected void onReset ( ) { if ( placeManager.isMainSectionBasicPlaceVisible ( ) ) { header.setGuideUrl ( basicGuideUrl ) ; } else { header.setGuideUrl ( extendedGuideUrl ) ; } if ( userRole.isExtendedUser ( ) ) { getView ( ) . setHeaderPanelHeight ( org.ovirt.engine.ui.userportal.section.main.presenter.MainSectionPresenter.HEIGHT_FOR_EXTENDED_USER ) ; } else { getView ( ) . setHeaderPanelHeight ( org.ovirt.engine.ui.userportal.section.main.presenter.MainSectionPresenter.HEIGHT_FOR_REGULAR_USER ) ; } }
Source:
protected org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters buildDeleteMemoryImageParams ( java.util.List < org.ovirt.engine.core.compat.Guid > guids ) { boolean discardAfterDelete = storageDomainDao.get ( guids.get ( 0 ) ) . isDiscardAfterDelete ( ) ; return postDeleteActionHandler.fixParameters ( new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( guids.get ( 1 ) , guids.get ( 0 ) , guids.get ( 2 ) , isPostZero ( ) , discardAfterDelete , false ) ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters buildDeleteMemoryImageParams ( java.util.List < org.ovirt.engine.core.compat.Guid > guids ) { boolean discardAfterDelete = storageDomainDao.get ( guids.get ( 0 ) ) . getDiscardAfterDelete ( ) ; return postDeleteActionHandler.fixParameters ( new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( guids.get ( 1 ) , guids.get ( 0 ) , guids.get ( 2 ) , isPostZero ( ) , discardAfterDelete , false ) ) ; }
Source:
public java.util.Set < java.lang.String > computeSelecetedLabels ( ) { java.util.Set < java.lang.String > selectedLabels = new java.util.HashSet < > ( ) ; selectedLabels.clear ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > labelModel : getItems ( ) ) { selectedLabels.add ( labelModel.getSelectedItem ( ) ) ; } return selectedLabels ; }

Target:
public java.util.Set < java.lang.String > computeSelectedLabels ( ) { java.util.Set < java.lang.String > selectedLabels = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > labelModel : getItems ( ) ) { selectedLabels.add ( labelModel.getSelectedItem ( ) ) ; } return selectedLabels ; }
Source:
protected java.lang.String executePeerStatusCommand ( org.ovirt.engine.core.utils.ssh.SSHClient client ) { java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.utils.ssh.ConstraintByteArrayOutputStream ( 500 ) ; java.lang.String command = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.GlusterPeerStatusCommand ) ; try { client.executeCommand ( command , null , out , null ) ; return new java.lang.String ( out.toByteArray ( ) , "UTF-8" ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while executing command {0} on server {1}!" , command , client.getHost ( ) , e ) ; throw new java.lang.RuntimeException ( e ) ; } }

Target:
protected java.lang.String executePeerStatusCommand ( org.ovirt.engine.core.bll.utils.EngineSSHClient client ) { java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.utils.ssh.ConstraintByteArrayOutputStream ( 500 ) ; java.lang.String command = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.GlusterPeerStatusCommand ) ; try { client.executeCommand ( command , null , out , null ) ; return new java.lang.String ( out.toByteArray ( ) , "UTF-8" ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while executing command {0} on server {1}!" , command , client.getHost ( ) , e ) ; throw new java.lang.RuntimeException ( e ) ; } }
Source:
protected boolean isDataOperationsBySpm ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { return ! ( org.ovirt.engine.core.common.FeatureSupported.dataOperationsByHSM ( storagePool.getCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean isDataOperationsByHSM ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic targetSd ) { return ( ( org.ovirt.engine.core.common.FeatureSupported.dataOperationsByHSM ( org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) && ( ! ( targetSd.getStorageType ( ) . isLocal ( ) ) ) ) && ( targetSd.getStorageDomainType ( ) . isDataDomain ( ) ) ; }
Source:
protected void init ( ) { org.ovirt.engine.core.bll.UpdateClusterCommand.updateMigrateOnError ( ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { final java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > result = new java.util.ArrayList ( super . getPermissionCheckSubjects ( ) ) ; final org.ovirt.engine.core.compat.Guid macPoolId = getNewMacPoolId ( ) ; final boolean changingPoolDefinition = ( macPoolId != null ) && ( ! ( macPoolId.equals ( getOldMacPoolId ( ) ) ) ) ; if ( changingPoolDefinition ) { result.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( macPoolId , org.ovirt.engine.core.common.VdcObjectType.MacPool , org.ovirt.engine.core.common.businessentities.ActionGroup.CONFIGURE_MAC_POOL ) ) ; } return result ; }
Source:
public void testNetworkIpAddressWasSameAsHostnameAndChangedWhenIfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.STATIC_IP , null , null ) ; attachment.setNicName ( "nicName" ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , null ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = java.util.Collections.emptyMap ( ) ; org.junit.Assert.assertThat ( validator.networkIpAddressWasSameAsHostnameAndChanged ( nics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkIpAddressWasSameAsHostnameAndChangedWhenIfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.STATIC_IP , null , null ) ; attachment.setNicName ( "nicName" ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = java.util.Collections.emptyMap ( ) ; org.junit.Assert.assertThat ( validator.networkIpAddressWasSameAsHostnameAndChanged ( nics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void validateFailsWhenCreateAllSnapshotFromVmValidationFails ( ) { initStorageDomain ( srcStorageId ) ; initStorageDomain ( dstStorageId ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void validateFailsWhenCreateAllSnapshotFromVmValidationFails ( ) { initStorageDomain ( srcStorageId ) ; initStorageDomain ( dstStorageId ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( command.validate ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.network.Network net ) { return createVdsInterface ( ( ( ( iface.getName ( ) ) + "." ) + ( net.getvlan_id ( ) ) ) , false , null , null , NetworkBootProtocol.None , net.getName ( ) , net.getvlan_id ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.network.Network net ) { return createVdsInterface ( ( ( ( iface.getName ( ) ) + "." ) + ( net.getVlanId ( ) ) ) , false , null , null , NetworkBootProtocol.None , net.getName ( ) , net.getVlanId ( ) ) ; }
Source:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , 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 : "" ; } } ; 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 ) ; }

Target:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }