auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.UserProfile profile = userProfileDao.getByUserId ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getUserId ( ) ) ; profile.setSshPublicKey ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getParameters ( ) . getUserProfile ( ) . getSshPublicKey ( ) ) ; profile.setUserPortalVmLoginAutomatically ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getParameters ( ) . getUserProfile ( ) . isUserPortalVmLoginAutomatically ( ) ) ; userProfileDao.update ( profile ) ; org.ovirt.engine.core.bll.UpdateUserProfileCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.UserProfile profile = org.ovirt.engine.core.bll.UpdateUserProfileCommand.getUserProfile ( ) ; profile.setSshPublicKeyId ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getParameters ( ) . getUserProfile ( ) . getSshPublicKeyId ( ) ) ; profile.setSshPublicKey ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getParameters ( ) . getUserProfile ( ) . getSshPublicKey ( ) ) ; profile.setUserPortalVmLoginAutomatically ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getParameters ( ) . getUserProfile ( ) . isUserPortalVmLoginAutomatically ( ) ) ; userProfileDao.update ( profile ) ; org.ovirt.engine.core.bll.UpdateUserProfileCommand.setSucceeded ( true ) ; }
Source:
private void initProfileParentList ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel < P , Q , R > model ) { model.getParentListModel ( ) . setItems ( java.util.Arrays.< R > asList ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileListModel.getEntity ( ) ) ) ; model.getParentListModel ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileListModel.getEntity ( ) ) ; model.getParentListModel ( ) . setIsChangable ( false ) ; }

Target:
private void initProfileParentList ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel < P , Q , R > model ) { model.getParentListModel ( ) . setItems ( java.util.Arrays.< R > asList ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileListModel.getEntity ( ) ) ) ; model.getParentListModel ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileListModel.getEntity ( ) ) ; model.getParentListModel ( ) . setIsChangeable ( false ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.TagsVmMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.TagsVmMap entity = new org.ovirt.engine.core.common.businessentities.TagsVmMap ( ) ; entity.settag_id ( getGuidDefaultEmpty ( rs , "tag_id" ) ) ; entity.setvm_id ( getGuidDefaultEmpty ( rs , "vm_id" ) ) ; entity.setDefaultDisplayType ( ( ( java.lang.Integer ) ( rs.getObject ( "DefaultDisplayType" ) ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.TagsVmPoolMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.TagsVmPoolMap entity = new org.ovirt.engine.core.common.businessentities.TagsVmPoolMap ( ) ; entity.settag_id ( getGuidDefaultEmpty ( rs , "tag_id" ) ) ; entity.setvm_pool_id ( getGuidDefaultEmpty ( rs , "vm_pool_id" ) ) ; return entity ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( created ) == null ? 0 : created.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( id , created ) ; }
Source:
public static void getNetworkList ( 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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 ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VmDevice createVMDevice ( org.ovirt.engine.core.compat.Guid vmID , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getImageId ( ) , vmID ) , VmDeviceType.DISK.getName ( ) , VmDeviceType.DISK.getName ( ) , "" , 1 , null , true , true , true , "" ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VmDevice createVMDevice ( org.ovirt.engine.core.compat.Guid vmID , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getImageId ( ) , vmID ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 1 , null , true , true , true , "" ) ; }
Source:
void addModelSearchStringChangeListener ( final org.ovirt.engine.ui.uicommonweb.models.SearchableListModel < ? > model ) { if ( model.supportsServerSideSorting ( ) ) { model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( com.google.gwt.user.client.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "SearchString" . equals ( args.propertyName ) ) { if ( ! ( model.isSearchValidForServerSideSorting ( ) ) ) { model.clearSortOptions ( ) ; clearColumnSort ( ) ; } } } } ) ; } }

Target:
void addModelSearchStringChangeListener ( final org.ovirt.engine.ui.uicommonweb.models.SearchableListModel < ? , ? > model ) { if ( model.supportsServerSideSorting ( ) ) { model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "SearchString" . equals ( args.propertyName ) ) { if ( ! ( model.isSearchValidForServerSideSorting ( ) ) ) { model.clearSortOptions ( ) ; clearColumnSort ( ) ; } } } } ) ; } }
Source:
public void onContextMenu ( com.google.gwt.event.dom.client.ContextMenuEvent event ) { event.preventDefault ( ) ; event.stopPropagation ( ) ; if ( hasActionButtons ( ) ) { int eventX = event.getNativeEvent ( ) . getClientX ( ) ; int eventY = event.getNativeEvent ( ) . getClientY ( ) ; updateContextMenu ( contextMenuBar , actionButtonList , contextPopupPanel ) ; contextPopupPanel.showAndFitToScreen ( eventX , eventY ) ; } }

Target:
public void execute ( ) { if ( hasActionButtons ( ) ) { updateContextMenu ( contextMenuBar , actionButtonList , contextPopupPanel ) ; contextPopupPanel.showAndFitToScreen ( eventX , eventY ) ; } }
Source:
public void testGetDefaultQuotaForDCWithDefaultQuotaWithNoReuse ( ) throws java.lang.Exception { org.mockito.Mockito.when ( quotaDAO.getDefaultQuotaByStoragePoolId ( storagePoolUUID ) ) . thenReturn ( mockGeneralStorageQuota ( ) ) ; org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true , false ) . getFirst ( ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }

Target:
public void testGetDefaultQuotaToDCWithoutDefaultQuota ( ) throws java.lang.Exception { java.lang.String defaultQuotaName = quotaHelper.getDefaultQuotaName ( storagePool.getname ( ) ) ; org.mockito.Mockito.when ( quotaHelper.generateDefaultQuotaName ( storagePool ) ) . thenReturn ( defaultQuotaName ) ; org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }
Source:
public static void GetLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public static void GetDefaultSpmPriority ( 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.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_SERVER_LOCALE , t ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.StorageDomainStatic randomStorageDomainStatic ( ) { org.ovirt.engine.core.utils.RandomUtils random = org.ovirt.engine.core.utils.RandomUtils.instance ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sds = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; sds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; sds.setStorage ( random.nextString ( 10 ) ) ; sds.setStorageType ( random.nextEnum ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ) ; sds.setStorageName ( random.nextString ( 10 ) ) ; sds.setDescription ( random.nextString ( 10 ) ) ; return sds ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StorageDomainStatic randomStorageDomainStatic ( ) { org.ovirt.engine.core.utils.RandomUtils random = org.ovirt.engine.core.utils.RandomUtils.instance ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sds = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; sds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; sds.setStorage ( random.nextString ( 10 ) ) ; sds.setStorageType ( random.nextEnum ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ) ; sds.setStorageName ( random.nextString ( 10 ) ) ; sds.setDescription ( random.nextString ( 10 ) ) ; return sds ; }
Source:
public < P extends org.ovirt.engine.core.common.vdscommands.VDSParametersBase > org.ovirt.engine.core.common.vdscommands.VDSAsyncReturnValue runAsyncVdsCommand ( org.ovirt.engine.core.common.vdscommands.VDSCommandType commandType , P parameters ) { org.ovirt.engine.core.vdsbroker.VDSCommandBase < P > command = CreateCommand ( commandType , parameters ) ; if ( command != null ) { command.setAsync ( true ) ; command.execute ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = command.getVDSReturnValue ( ) ; if ( ! ( org.ovirt.engine.core.common.vdscommands.VDSAsyncReturnValue.class . isInstance ( value ) ) ) { throw new java.lang.IllegalStateException ( "Wrong return value type" ) ; } return ( ( org.ovirt.engine.core.common.vdscommands.VDSAsyncReturnValue ) ( value ) ) ; } return null ; }

Target:
public < P extends org.ovirt.engine.core.common.vdscommands.VDSParametersBase > org.ovirt.engine.core.common.vdscommands.VDSAsyncReturnValue runAsyncVdsCommand ( org.ovirt.engine.core.common.vdscommands.VDSCommandType commandType , P parameters ) { org.ovirt.engine.core.vdsbroker.VDSCommandBase < P > command = createCommand ( commandType , parameters ) ; if ( command != null ) { command.setAsync ( true ) ; command.execute ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = command.getVDSReturnValue ( ) ; if ( ! ( org.ovirt.engine.core.common.vdscommands.VDSAsyncReturnValue.class . isInstance ( value ) ) ) { throw new java.lang.IllegalStateException ( "Wrong return value type" ) ; } return ( ( org.ovirt.engine.core.common.vdscommands.VDSAsyncReturnValue ) ( value ) ) ; } return null ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static 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 static java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vdsId ) { return org.ovirt.engine.core.bll.ImagesHandler.cdPathWindowsToLinux ( windowsPath , ( ( java.lang.String ) ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.IsoPrefix , new org.ovirt.engine.core.common.vdscommands.VdsAndPoolIDVDSParametersBase ( vdsId , storagePoolId ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public static java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vdsId ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( windowsPath ) ) { return windowsPath ; } return org.ovirt.engine.core.bll.ImagesHandler.cdPathWindowsToLinux ( windowsPath , ( ( java.lang.String ) ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.IsoPrefix , new org.ovirt.engine.core.common.vdscommands.VdsAndPoolIDVDSParametersBase ( vdsId , storagePoolId ) ) . getReturnValue ( ) ) ) ) ; }
Source:
protected boolean validate ( ) { if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } return validate ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) , getVmNumaNodesForValidation ( ) ) ) ; }

Target:
protected boolean validate ( ) { if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( validate ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaIndexDuplicates ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmNumaNodeList ( ) ) ) ) ) { return false ; } return validate ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) , getVmNumaNodesForValidation ( ) ) ) ; }
Source:
public void getUsbPolicyUsbTypeLegacy ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "legacy" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicyUsbTypeLegacy ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "legacy" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.ENABLED_LEGACY ) ; }
Source:
protected boolean checkCpuSockets ( ) { return org.ovirt.engine.core.bll.AddVmCommand.checkCpuSockets ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfSockets ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getCpuPerSocket ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getThreadsPerCpu ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) . toString ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getValidationMessages ( ) ) ; }

Target:
protected boolean checkCpuSockets ( ) { return org.ovirt.engine.core.bll.AddVmCommand.checkCpuSockets ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfSockets ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getCpuPerSocket ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getThreadsPerCpu ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) . toString ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
protected org.ovirt.engine.core.bll.FenceExecutor createExecutorForProxyCheck ( ) { return new org.ovirt.engine.core.bll.FenceExecutor ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getParameters ( ) . getAction ( ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.FenceValidator fenceValidator = new org.ovirt.engine.core.bll.validator.FenceValidator ( ) ; java.util.List < java.lang.String > messages = org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ; boolean canDo = ( ( fenceValidator.isHostExists ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) , messages ) ) && ( fenceValidator.isStartupTimeoutPassed ( messages ) ) ) && ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.isQuietTimeFromLastActionPassed ( ) ) ; if ( ! canDo ) { handleError ( ) ; } org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getReturnValue ( ) . setSucceeded ( canDo ) ; return canDo ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageByImageId ( parameters.getImageId ( ) ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageByImageId ( parameters.getImageId ( ) ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getCurrentUser ( ) ) ) ; }
Source:
private static void initOsIds ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds = new java.util.ArrayList < java.lang.Integer > ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.keySet ( ) ) ; java.util.Collections.sort ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds , new java.util.Comparator < java.lang.Integer > ( ) { @ java.lang.Override public int compare ( java.lang.Integer o1 , java.lang.Integer o2 ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o1 ) . compareTo ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o2 ) ) ; } } ) ; }

Target:
private void initOsIds ( ) { osIds = new java.util.ArrayList < java.lang.Integer > ( osNames.keySet ( ) ) ; java.util.Collections.sort ( osIds , new java.util.Comparator < java.lang.Integer > ( ) { @ java.lang.Override public int compare ( java.lang.Integer o1 , java.lang.Integer o2 ) { return osNames.get ( o1 ) . compareTo ( osNames.get ( o2 ) ) ; } } ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.ImageStatus map ( org.ovirt.engine.api.model.DiskStatus diskStatus ) { if ( diskStatus == null ) { return null ; } else { switch ( diskStatus ) { case ILLEGAL : return org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ; case LOCKED : return org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ; case OK : return org.ovirt.engine.core.common.businessentities.ImageStatus.OK ; default : return null ; } } }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.ImageStatus map ( org.ovirt.engine.api.model.DiskStatus diskStatus ) { if ( diskStatus == null ) { return null ; } else { switch ( diskStatus ) { case ILLEGAL : return org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL ; case LOCKED : return org.ovirt.engine.core.common.businessentities.storage.ImageStatus.LOCKED ; case OK : return org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ; default : return null ; } } }
Source:
public void canDoActionFailedShareableDiskOnGlusterDomain ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createShareableDisk ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storage = addNewStorageDomainToDisk ( disk , StorageType.GLUSTERFS ) ; parameters.setDiskInfo ( disk ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.mockito.Mockito.when ( storageDomainStaticDao.get ( storage.getId ( ) ) ) . thenReturn ( storage.getStorageStaticData ( ) ) ; initializeCommand ( parameters ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISKS_NOT_SUPPORTED_ON_GLUSTER_DOMAIN ) ; }

Target:
public void canDoActionFailedShareableDiskOnGlusterDomain ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createShareableDisk ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storage = addNewStorageDomainToDisk ( disk , StorageType.GLUSTERFS ) ; parameters.setDiskInfo ( disk ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.mockito.Mockito.when ( storageDomainStaticDao.get ( storage.getId ( ) ) ) . thenReturn ( storage.getStorageStaticData ( ) ) ; initializeCommand ( parameters ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISKS_NOT_SUPPORTED_ON_GLUSTER_DOMAIN ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.UsbPolicy forStringValue ( java.lang.String value ) { org.ovirt.engine.core.common.businessentities.UsbPolicy retVal = null ; if ( ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.oldEnabledValue ) ) || ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_LEGACY.name ( ) ) ) ) { retVal = org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_LEGACY ; } else if ( ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.oldDisabledValue ) ) || ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED.name ( ) ) ) ) { retVal = org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED ; } else if ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_NATIVE.name ( ) ) ) { retVal = org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_NATIVE ; } return retVal ; }

Target:
public static org.ovirt.engine.core.common.businessentities.UsbPolicy forStringValue ( java.lang.String value ) { org.ovirt.engine.core.common.businessentities.UsbPolicy retVal = null ; if ( ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.PRE_3_1_ENABLED ) ) || ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_LEGACY.name ( ) ) ) ) { retVal = org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_LEGACY ; } else if ( ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.PRE_3_1_DISABLED ) ) || ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED.name ( ) ) ) ) { retVal = org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED ; } else if ( value.equalsIgnoreCase ( org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_NATIVE.name ( ) ) ) { retVal = org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_NATIVE ; } return retVal ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDelete ( java.lang.String snapshotName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotDelete ( snapshotName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDelete ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotDelete ( volumeName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void invalidStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; sd.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStorageDomain ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( sd ) ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void invalidStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; sd.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStorageDomain ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( sd ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
protected boolean isImageExist ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } return true ; }

Target:
protected boolean isSourceAndDestTheSame ( ) { if ( ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) && ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getSourceDomainId ( ) . equals ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; } return true ; }
Source:
public org.ovirt.engine.core.common.businessentities.VDS getUpServer ( org.ovirt.engine.core.compat.Guid clusterId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > servers = getVdsDao ( ) . getAllForVdsGroupWithStatus ( clusterId , VDSStatus.Up ) ; if ( ( servers == null ) || ( servers.isEmpty ( ) ) ) { return null ; } return org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( servers ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VDS getUpServer ( org.ovirt.engine.core.compat.Guid clusterId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > servers = getAllUpServers ( clusterId ) ; if ( ( servers == null ) || ( servers.isEmpty ( ) ) ) { return null ; } return org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( servers ) ; }
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.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; }
Source:
public void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( 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.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
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.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( 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.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.PoolModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.PoolModelBehaviorBase ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( array [ 1 ] ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; model.setClusters ( model , clusters , null ) ; behavior.initTemplate ( ) ; behavior.initCdImage ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , null ) ; initTemplate ( ) ; initCdImage ( ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.Empty ) ; }
Source:
public void setSelectedItem ( java.lang.Integer value ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . osNameExists ( value ) ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( dataCenterWithCluster == null ) ? null : dataCenterWithCluster.getCluster ( ) ; if ( cluster == null ) { return ; } super . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultOs ( cluster.getArchitecture ( ) ) ) ; } else { super . setSelectedItem ( value ) ; } }

Target:
public void setSelectedItem ( java.lang.Integer value ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . osNameExists ( value ) ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = ( dataCenterWithCluster == null ) ? null : dataCenterWithCluster.getCluster ( ) ; if ( cluster == null ) { return ; } super . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultOs ( cluster.getArchitecture ( ) ) ) ; } else { super . setSelectedItem ( value ) ; } }
Source:
private void logLowDiskSpaceOnHostDisks ( java.util.List < java.lang.String > disksWithLowSpace , final java.lang.Integer lowSpaceThreshold , org.ovirt.engine.core.common.AuditLogType logType ) { if ( ! ( disksWithLowSpace.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( _vds.getId ( ) ) ; logable.AddCustomValue ( "DiskSpace" , lowSpaceThreshold.toString ( ) ) ; logable.AddCustomValue ( "Disks" , org.apache.commons.lang.StringUtils.join ( disksWithLowSpace , ", " ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , logType ) ; } }

Target:
private void logLowDiskSpaceOnHostDisks ( java.util.List < java.lang.String > disksWithLowSpace , final java.lang.Integer lowSpaceThreshold , org.ovirt.engine.core.common.AuditLogType logType ) { if ( ! ( disksWithLowSpace.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( _vds.getId ( ) ) ; logable.AddCustomValue ( "DiskSpace" , lowSpaceThreshold.toString ( ) ) ; logable.AddCustomValue ( "Disks" , org.apache.commons.lang.StringUtils.join ( disksWithLowSpace , ", " ) ) ; auditLog ( logable , logType ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.addOrUpdateTaskInDB ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap = asyncTask.getEntitiesMap ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entry : entitiesMap.entrySet ( ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.getAsyncTaskDao ( ) . insertAsyncTaskEntity ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) . getTaskId ( ) , entry.getKey ( ) , entry.getValue ( ) ) ; } return null ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTaskEntity > buildAsyncTaskEntities ( org.ovirt.engine.core.compat.Guid taskId , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap ) { if ( entitiesMap == null ) { entitiesMap = java.util.Collections.emptyMap ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTaskEntity > results = new java.util.ArrayList ( entitiesMap.size ( ) ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entry : entitiesMap.entrySet ( ) ) { results.add ( new org.ovirt.engine.core.common.businessentities.AsyncTaskEntity ( taskId , entry.getValue ( ) , entry.getKey ( ) ) ) ; } return results ; }
Source:
public void testReadLatency ( ) { java.lang.String doubleValue = "2" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_read_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) ) ; org.junit.Assert.assertEquals ( vmDynamic.getDisks ( ) . get ( 0 ) . getReadLatency ( ) , new java.lang.Double ( "0.000000002" ) ) ; }

Target:
public void testReadLatency ( ) { java.lang.String doubleValue = "2" ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_read_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setMockForTesting ( diskData ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > disks = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmDiskStatistics ( xml ) ; org.junit.Assert.assertEquals ( new java.lang.Double ( "0.000000002" ) , disks.get ( 0 ) . getReadLatency ( ) ) ; }
Source:
public void testMissingSubField ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; vm.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "host.id" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "host.id" ) ; } }

Target:
public void testMissingSubField ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; vm.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "host.id" ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "host.id" ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNic ( org.ovirt.engine.core.bll.network.host.GetTlvsByHostNicIdQueryTest.ExpectedError expectedError ) { switch ( expectedError ) { case NIC_ID_NIC : return new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; case NIC_ID_NETWORK_INTERFACE : return null ; default : org.ovirt.engine.core.common.businessentities.network.Nic nic = new org.ovirt.engine.core.common.businessentities.network.Nic ( ) ; nic.setName ( org.ovirt.engine.core.bll.network.host.GetTlvsByHostNicIdQueryTest.NIC_NAME ) ; return nic ; } }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNic ( org.ovirt.engine.core.bll.network.host.GetTlvsByHostNicIdQueryTest.ExpectedError expectedError , org.ovirt.engine.core.compat.Guid vdsId ) { switch ( expectedError ) { case NIC_ID_NIC : org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsIface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; vdsIface.setVdsId ( vdsId ) ; return vdsIface ; case NIC_ID_NETWORK_INTERFACE : return null ; default : org.ovirt.engine.core.common.businessentities.network.Nic nic = new org.ovirt.engine.core.common.businessentities.network.Nic ( ) ; nic.setName ( org.ovirt.engine.core.bll.network.host.GetTlvsByHostNicIdQueryTest.NIC_NAME ) ; nic.setVdsId ( vdsId ) ; return nic ; } }
Source:
public boolean match ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic ) { return vnic.isPlugged ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = returnValue.getReturnValue ( ) ; boolean hasPluggedNics = nics.stream ( ) . anyMatch ( VmNetworkInterface :: isPlugged ) ; if ( ! hasPluggedNics ) { org.ovirt.engine.ui.uicommonweb.models.vms.BootSequenceModel bootSequenceModel = getBootSequence ( ) ; bootSequenceModel.getNetworkOption ( ) . setIsChangeable ( false ) ; bootSequenceModel.getNetworkOption ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . interfaceIsRequiredToBootFromNetwork ( ) ) ; } }