auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void Perform ( ) { if ( org.ovirt.engine.core.common.businessentities.VM.isStatusUpOrPaused ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . getStatus ( ) ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ChangeFloppy , new org.ovirt.engine.core.common.vdscommands.ChangeDiskVDSCommandParameters ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . getId ( ) , mCdImagePath ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.ChangeFloppyCommand.setSucceeded ( true ) ; } }

Target:
protected void Perform ( ) { if ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . isRunningOrPaused ( ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ChangeFloppy , new org.ovirt.engine.core.common.vdscommands.ChangeDiskVDSCommandParameters ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . getId ( ) , mCdImagePath ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.ChangeFloppyCommand.setSucceeded ( true ) ; } }
Source:
public static void GetDataCenterListByName ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void GetDataCenterList ( 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 ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void testHandleIoTune ( ) { org.mockito.Mockito.when ( storageQosDao.getQosByDiskProfileId ( diskImage.getDiskProfileId ( ) ) ) . thenReturn ( qos ) ; qos.setMaxThroughput ( 100 ) ; qos.setMaxIops ( 10000 ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.handleIoTune ( vmDevice , org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.loadStorageQos ( diskImage ) ) ; assertIoTune ( getIoTune ( vmDevice ) , ( 100L * ( org.ovirt.engine.core.vdsbroker.vdsbroker.IoTuneUtils.MB_TO_BYTES ) ) , 0 , 0 , 10000 , 0 , 0 ) ; }

Target:
public void testHandleIoTune ( ) { org.mockito.Mockito.when ( storageQosDao.getQosByDiskProfileId ( diskImage.getDiskProfileId ( ) ) ) . thenReturn ( qos ) ; qos.setMaxThroughput ( 100 ) ; qos.setMaxIops ( 10000 ) ; underTest.handleIoTune ( vmDevice , underTest.loadStorageQos ( diskImage ) ) ; assertIoTune ( getIoTune ( vmDevice ) , ( 100L * ( org.ovirt.engine.core.vdsbroker.vdsbroker.IoTuneUtils.MB_TO_BYTES ) ) , 0 , 0 , 10000 , 0 , 0 ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( ! ( java.lang.Boolean.TRUE.equals ( iface.getBonded ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } int slavesCount = getSlaveCount ( nics ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , ( "$NETWORK_BONDS_INVALID_SLAVE_COUNT_LIST " + slavesCount ) ) . when ( ( slavesCount < 2 ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( ! ( java.lang.Boolean.TRUE.equals ( iface.getBonded ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } int slavesCount = getSlaveCount ( nics ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_BONDS_INVALID_SLAVE_COUNT_LIST , iface.getName ( ) ) ) . when ( ( slavesCount < 2 ) ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.businessentities.permissions permission ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetPermissionById , org.ovirt.engine.core.common.queries.MultilevelAdministrationByPermissionIdParameters.class , new java.lang.String [ ] { "PermissionId" } , new java.lang.Object [ ] { entityId } , permission ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.businessentities.permissions permission ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetPermissionById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entityId } , permission ) ; } }
Source:
public static void GetAllAttachableDisks ( 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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) , aQuery ) ; }

Target:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public void recordLoggedInTime ( ) { if ( ( restApiSessionHardlimit ) > 0 ) { restApiLoginTimePlusHardLimit = new java.util.Date ( ) ; restApiLoginTimePlusHardLimit.setTime ( ( ( restApiLoginTimePlusHardLimit.getTime ( ) ) + ( ( ( restApiSessionHardlimit.longValue ( ) ) - 1 ) * ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.MIN_IN_MS ) ) ) ) ; } }

Target:
public void recordLoggedInTime ( ) { if ( ( restApiSessionHardlimit ) > 0 ) { restApiLoginTimePlusHardLimit = new java.util.Date ( ) ; restApiLoginTimePlusHardLimit.setTime ( ( ( restApiLoginTimePlusHardLimit.getTime ( ) ) + ( ( ( restApiSessionHardlimit.longValue ( ) ) - 1 ) * ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.MIN_IN_MS ) ) ) ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.network.host.LabelNicCommand.getBackend ( ) . runInternalAction ( VdcActionType.PersistentSetupNetworks , new org.ovirt.engine.core.bll.network.AddNetworksByLabelParametersBuilder ( ) . buildParameters ( getNic ( ) , getLabel ( ) , getClusterNetworksByLabel ( ) ) ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.network.host.LabelNicCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; } else { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.PersistentSetupNetworks , new org.ovirt.engine.core.bll.network.AddNetworksByLabelParametersBuilder ( org.ovirt.engine.core.bll.network.host.LabelNicCommand.getContext ( ) ) . buildParameters ( getNic ( ) , getLabel ( ) , getClusterNetworksByLabel ( ) ) , org.ovirt.engine.core.bll.network.host.LabelNicCommand.cloneContextAndDetachFromParent ( ) ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.network.host.LabelNicCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; } else { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getSnapshotDao ( ) . get ( getSnapshotId ( ) ) ; if ( snapshot != null ) { jobProperties.put ( VdcObjectType.Snapshot.name ( ) . toLowerCase ( ) , snapshot.getDescription ( ) ) ; } } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; if ( ( getSnapshot ( ) ) != null ) { jobProperties.put ( VdcObjectType.Snapshot.name ( ) . toLowerCase ( ) , snapshot.getDescription ( ) ) ; } } return jobProperties ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isOsSupportedForVirtIoScsi ( org.ovirt.engine.core.common.businessentities.VM vm ) { final java.util.List < java.lang.String > unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > getValue ( ConfigValues.VirtIoScsiUnsupportedOsList ) ; java.lang.String vmOs = org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) . get ( vm.getVmOsId ( ) ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( vmOs ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isReadOnlyPropertyCompatibleWithInterface ( ) { if ( ( java.lang.Boolean.TRUE.equals ( disk.getReadOnly ( ) ) ) && ( ( disk.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.IDE ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_IDE_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
protected org.ovirt.engine.core.dao.VmDao getVmDao ( ) { return vmDao ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmWithoutConfiguration ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid snapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = vmDao.get ( vmId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = vmNetworkInterfaceDao.getAllForVm ( vm.getId ( ) ) ; vm.setInterfaces ( interfaces ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = diskImageDao.getAllSnapshotsForVmSnapshot ( snapshotId ) ; vm.setImages ( new java.util.ArrayList ( disks ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage currDisk : disks ) { currDisk.setActive ( true ) ; } return vm ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isOsSupportedForVirtIoScsi ( org.ovirt.engine.core.common.businessentities.VM vm ) { final java.util.List < java.lang.String > unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > GetValue ( ConfigValues.VirtIoScsiUnsupportedOsList ) ; java.lang.String vmOs = org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) . get ( vm.getVmOsId ( ) ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( vmOs ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isDiskInterfaceSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm != null ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) , disk.getDiskInterface ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED , java.lang.String.format ( "$osName %s" , org.ovirt.engine.core.bll.validator.DiskValidator.getOsRepository ( ) . getOsName ( vm.getOs ( ) ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void acquireSession ( java.lang.String userNameWithDomain , java.lang.String password ) { com.google.gwt.http.client.RequestBuilder requestBuilder = createRequest ( ) ; requestBuilder.setUser ( userNameWithDomain ) ; requestBuilder.setPassword ( password ) ; sendRequest ( requestBuilder , new org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.RestApiCallback ( ) { @ java.lang.Override protected void processResponse ( com.google.gwt.http.client.Response response ) { java.lang.String sessionIdFromHeader = org.ovirt.engine.ui.common.utils.HttpUtils.getHeader ( response , org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_ID_HEADER ) ; if ( sessionIdFromHeader != null ) { setSessionId ( sessionIdFromHeader ) ; } reuseSession ( ) ; } } ) ; }

Target:
public void acquireSession ( java.lang.String engineAuthToken ) { sendRequest ( createRequest ( engineAuthToken ) , new org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.RestApiRequestCallback ( ) { @ java.lang.Override protected void processResponse ( com.google.gwt.http.client.Response response ) { java.lang.String sessionIdFromHeader = org.ovirt.engine.ui.common.utils.HttpUtils.getHeader ( response , org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_ID_HEADER ) ; if ( sessionIdFromHeader != null ) { setSessionId ( sessionIdFromHeader ) ; } reuseSession ( ) ; } } ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.GetStorageDomainsByStoragePoolIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.storage.GetStorageDomainsByStoragePoolIdQuery.getDbFacade ( ) . getStorageDomainDAO ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.storage.GetStorageDomainsByStoragePoolIdQuery.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.GetStorageDomainsByStoragePoolIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.GetStorageDomainsByStoragePoolIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.GetStorageDomainsByStoragePoolIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.storage.GetStorageDomainsByStoragePoolIdQuery.getDbFacade ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.storage.GetStorageDomainsByStoragePoolIdQuery.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.GetStorageDomainsByStoragePoolIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.GetStorageDomainsByStoragePoolIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public boolean isValid ( java.lang.String name , javax.validation.ConstraintValidatorContext context ) { return ( org.ovirt.engine.core.common.validation.NfsMountPointConstraint.LINUX_MOUNT_POINT_PATTERN.matcher ( name ) . matches ( ) ) && ( org.ovirt.engine.core.common.validation.NfsMountPointConstraint.ASCII_PATTERN.matcher ( name ) . matches ( ) ) ; }

Target:
public boolean isValid ( java.lang.String name , javax.validation.ConstraintValidatorContext context ) { return ( ( org.ovirt.engine.core.common.validation.NfsMountPointConstraint.LINUX_MOUNT_POINT_PATTERN.matcher ( name ) . matches ( ) ) && ( org.ovirt.engine.core.common.validation.NfsMountPointConstraint.ASCII_PATTERN.matcher ( name ) . matches ( ) ) ) && ( org.ovirt.engine.core.common.validation.NfsMountPointConstraint.NO_SPACE_PATTERN.matcher ( name ) . matches ( ) ) ; }
Source:
public void initCdImage ( ) { updateUserCdImage ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getModel ( ) . getDataCenter ( ) . getSelectedItem ( ) ) ) . getId ( ) ) ; }

Target:
public void vmTypeChanged ( org.ovirt.engine.core.common.businessentities.VmType vmType ) { super . vmTypeChanged ( vmType ) ; if ( getModel ( ) . getProvisioning ( ) . getIsAvailable ( ) ) { getModel ( ) . getProvisioning ( ) . setEntity ( ( vmType == ( org.ovirt.engine.core.common.businessentities.VmType.Server ) ) ) ; } }
Source:
private void loadPolicyUnits ( ) { java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > allPolicyUnits = getPolicyUnitDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : allPolicyUnits ) { if ( policyUnit.isInternal ( ) ) { policyUnits.put ( policyUnit.getId ( ) , org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.getPolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } else { policyUnits.put ( policyUnit.getId ( ) , new org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } } }

Target:
private void loadPolicyUnits ( ) { java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > allPolicyUnits = getPolicyUnitDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : allPolicyUnits ) { if ( policyUnit.isInternal ( ) ) { policyUnits.put ( policyUnit.getId ( ) , org.ovirt.engine.core.di.Injector.injectMembers ( org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.getPolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ) ; } else { policyUnits.put ( policyUnit.getId ( ) , new org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalBasicListModel userPortalBasicListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalBasicListModel ) ( model ) ) ; if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( vm != null ) { userPortalBasicListModel.UpdateDetails ( vm ) ; } } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalBasicListModel userPortalBasicListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalBasicListModel ) ( model ) ) ; if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( vm != null ) { userPortalBasicListModel.updateDetails ( vm ) ; } } }
Source:
private void initListeners ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { model.getAdvancedMode ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.common.widget.popup.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { swithAccordingToMode ( model ) ; } } ) ; }

Target:
private void initListeners ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { model.getAdvancedMode ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { storeAdvancedModeToLocalStorage ( model ) ; swithAccordingToMode ( model ) ; } } ) ; model.getAttachedToInstanceType ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { swithAttachToInstanceType ( model ) ; } } ) ; }
Source:
protected java.lang.String getTransferDescription ( ) { return java.lang.String.format ( "%s %s '%s' (id '%s')" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) . name ( ) , getImageType ( ) , getImageAlias ( ) , getImageIdNullSafe ( ) ) ; }

Target:
private java.lang.String getTransferDescription ( ) { return java.lang.String.format ( "%s %s '%s' (disk id: '%s', image id: '%s')" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) . name ( ) , getImageType ( ) , getImageAlias ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getDiskImage ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getDiskImage ( ) . getImageId ( ) ) ; }
Source:
public java.util.concurrent.Future < java.lang.Void > close ( ) { final java.util.concurrent.Callable < java.lang.Void > disconnectCallable = new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { disconnect ( org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.CLIENT_CLOSED ) ; return null ; } } ; return scheduleTask ( disconnectCallable ) ; }

Target:
private java.util.concurrent.Future < java.lang.Void > scheduleClose ( final java.lang.String message ) { final java.util.concurrent.Callable < java.lang.Void > disconnectCallable = new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { disconnect ( message ) ; return null ; } } ; return scheduleTask ( disconnectCallable ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getAdGroupDAO ( ) ) ; newAdGroup = new org.ovirt.engine.core.common.businessentities.ad_groups ( ) ; newAdGroup.setid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; newAdGroup.setdomain ( "domain" ) ; newAdGroup.setname ( "name" ) ; newAdGroup.setstatus ( AdRefStatus.Active ) ; existingAdGroup = dao.get ( new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getAdGroupDao ( ) ) ; newAdGroup = new org.ovirt.engine.core.common.businessentities.ad_groups ( ) ; newAdGroup.setid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; newAdGroup.setdomain ( "domain" ) ; newAdGroup.setname ( "name" ) ; newAdGroup.setstatus ( AdRefStatus.Active ) ; existingAdGroup = dao.get ( new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ) ; }
Source:
public void isUSBEnabledByDefault ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > items = new java.util.ArrayList < java.lang.Object > ( ) ; for ( java.lang.Object i : getSelectedItems ( ) ) { items.add ( ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( i ) ) . getId ( ) ) ; } return items.toArray ( new java.lang.Object [ ] { } ) ; } }

Target:
private void setResetEmulatedMachineCommand ( org.ovirt.engine.ui.uicommonweb.UICommand value ) { resetEmulatedMachineCommand = value ; }
Source:
public void testGetAllForVolumeGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > result = dao.getAllForVolumeGroup ( existingLUN.getvolume_group_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : result ) { org.junit.Assert.assertEquals ( existingLUN.getvolume_group_id ( ) , lun.getvolume_group_id ( ) ) ; } }

Target:
public void testGetAllForVolumeGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > result = dao.getAllForVolumeGroup ( existingLUN.getVolumeGroupId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : result ) { org.junit.Assert.assertEquals ( existingLUN.getVolumeGroupId ( ) , lun.getVolumeGroupId ( ) ) ; } }
Source:
public void validateFailsWhenCreateAllSnapshotFromVmValidationFails ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; 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 validateCantLiveMigrateToBackupDomain ( ) { initStorageDomain ( srcStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setBackup ( true ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE ) ; }
Source:
public boolean validate ( ) { getPath ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getVfsType ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation ( ) } ) ; return ( getPath ( ) . getIsValid ( ) ) && ( getVfsType ( ) . getIsValid ( ) ) ; }

Target:
protected void prepareConnectionForEditing ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { getMountOptions ( ) . setEntity ( connection.getMountOptions ( ) ) ; getVfsType ( ) . setEntity ( connection.getVfsType ( ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.gluster.StorageDevice entity ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > convertedSize = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( entity.getSize ( ) , SizeUnit.MB ) ; return ( ( formatSize ( convertedSize.getSecond ( ) ) ) + " " ) + ( convertedSize.getFirst ( ) . toString ( ) ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.gluster.StorageDevice entity ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > convertedSize = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( entity.getSize ( ) , SizeUnit.MiB ) ; return org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.messages.sizeUnitString ( formatSize ( convertedSize.getSecond ( ) ) , convertedSize.getFirst ( ) ) ; }
Source:
void initListBoxEditors ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { storagePoolTypeEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Boolean > ( new org.ovirt.engine.ui.common.widget.renderer.BooleanRenderer ( constants.storageTypeLocal ( ) , constants.storageTypeShared ( ) ) ) ; versionEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.compat.Version > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.compat.Version > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.compat.Version object ) { return object.getValue ( ) ; } } ) ; quotaEnforceTypeEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer ( ) ) ; }

Target:
protected java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.MacPool macPool ) { return macPool.getName ( ) ; }
Source:
public void onBrowserEvent ( com.google.gwt.cell.client.Cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.String value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < java.lang.String > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; if ( ( ! ( "mouseover" . equals ( event.getType ( ) ) ) ) || ( "" . equals ( title ) ) ) { return ; } parent.setTitle ( title ) ; }

Target:
public void onBrowserEvent ( com.google.gwt.cell.client.Cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.String value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < java.lang.String > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; if ( ( ! ( BrowserEvents.MOUSEOVER.equals ( event.getType ( ) ) ) ) || ( "" . equals ( title ) ) ) { return ; } parent.setTitle ( title ) ; }
Source:
private static void assertFailsWithCanDoActionMessage ( org.ovirt.engine.core.bll.InstallVdsCommand < org.ovirt.engine.core.common.action.InstallVdsParameters > command , org.ovirt.engine.core.dal.VdcBllMessages message ) { org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( message.name ( ) ) ) ; }

Target:
private static void assertFailsWithCanDoActionMessage ( org.ovirt.engine.core.bll.InstallVdsCommand < org.ovirt.engine.core.common.action.InstallVdsParameters > command , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( message.name ( ) ) ) ; }
Source:
public void containBiggerThanDefaultNumberOfElements ( ) { java.util.List < java.lang.Object > items = createItems ( ) ; java.lang.String separator = "sep" ; int numOfElementsToShow = 8 ; java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME , items , separator , numOfElementsToShow ) ; org.junit.Assert.assertTrue ( validateReplacementElementCount ( replacements , separator , numOfElementsToShow ) ) ; }

Target:
public void containBiggerThanDefaultNumberOfElements ( ) { java.util.List < java.lang.Object > items = createItems ( ) ; java.lang.String separator = "sep" ; int numOfElementsToShow = 8 ; java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME , items , separator , numOfElementsToShow ) ; org.junit.jupiter.api.Assertions.assertTrue ( validateReplacementElementCount ( replacements , separator , numOfElementsToShow ) ) ; }
Source:
public static boolean isOsTypeSupported ( int osId , org.ovirt.engine.core.common.businessentities.ArchitectureType architectureType , java.util.List < java.lang.String > reasons ) { boolean result = org.ovirt.engine.core.bll.validator.VmValidationUtils.isOsTypeSupported ( osId , architectureType ) ; if ( ! result ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_IS_NOT_SUPPORTED_BY_ARCHITECTURE_TYPE.toString ( ) ) ; } return result ; }

Target:
public static boolean isOsTypeSupported ( int osId , org.ovirt.engine.core.common.businessentities.ArchitectureType architectureType , java.util.List < java.lang.String > reasons ) { boolean result = org.ovirt.engine.core.bll.validator.VmValidationUtils.isOsTypeSupported ( osId , architectureType ) ; if ( ! result ) { reasons.add ( EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_IS_NOT_SUPPORTED_BY_ARCHITECTURE_TYPE.toString ( ) ) ; } return result ; }
Source:
private void editMacPool ( ) { org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel model = new org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel ( this , org.ovirt.engine.core.common.action.VdcActionType.UpdateMacPool ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . editSharedMacPoolTitle ( ) ) ; model.setHashName ( "edit_shared_mac_pool" ) ; model.setHelpTag ( HelpTag.edit_shared_mac_pool ) ; model.setEntity ( getSelectedItem ( ) ) ; setWindow ( model ) ; }

Target:
private void editMacPool ( ) { org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel model = new org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel ( this , org.ovirt.engine.core.common.action.ActionType.UpdateMacPool ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . editSharedMacPoolTitle ( ) ) ; model.setHashName ( "edit_shared_mac_pool" ) ; model.setHelpTag ( HelpTag.edit_shared_mac_pool ) ; model.setEntity ( getSelectedItem ( ) ) ; setWindow ( model ) ; }
Source:
public void loadVmsFromVmware ( ) { clearProblem ( ) ; if ( ! ( validateVmwareConfiguration ( ) ) ) { return ; } loadVMsFromExternalProvider ( getUrl ( ) , getUsername ( ) . getEntity ( ) , getPassword ( ) . getEntity ( ) ) ; }

Target:
public void loadVmsFromVmware ( ) { clearProblem ( ) ; if ( ! ( validateVmwareConfiguration ( ) ) ) { return ; } org.ovirt.engine.core.compat.Guid proxyId = ( ( getProxyHosts ( ) . getSelectedItem ( ) ) != null ) ? getProxyHosts ( ) . getSelectedItem ( ) . getId ( ) : null ; loadVMsFromExternalProvider ( OriginType.VMWARE , getUrl ( ) , getUsername ( ) . getEntity ( ) , getPassword ( ) . getEntity ( ) , proxyId ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageType > getStoragePoolTypeList ( ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageType [ ] { org.ovirt.engine.core.common.businessentities.StorageType.NFS , org.ovirt.engine.core.common.businessentities.StorageType.ISCSI , org.ovirt.engine.core.common.businessentities.StorageType.FCP , org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS , org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS , org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS } ) ) ; }

Target:
private static void initDisplayTypes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.displayTypes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDisplayTypes ) , callback ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getBrick ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setVolumeId ( volumeId ) ; brick.setServerId ( serverId ) ; brick.setServerName ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.serverName ) ; brick.setBrickDirectory ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.BRICK_DIRECTORY ) ; brick.setStatus ( GlusterStatus.UP ) ; return brick ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getBrick ( org.ovirt.engine.core.compat.Guid volumeId , org.ovirt.engine.core.compat.Guid serverid , java.lang.String brickDir ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setVolumeId ( volumeId ) ; brick.setServerId ( serverid ) ; brick.setServerName ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.serverName ) ; brick.setBrickDirectory ( brickDir ) ; brick.setStatus ( GlusterStatus.UP ) ; return brick ; }
Source:
private void addSELinuxModes ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.core.common.businessentities.SELinuxMode [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_5 ) ) { version.setSelinuxModes ( new org.ovirt.engine.api.model.SELinuxModes ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.SELinuxMode mode : values ) { version.getSelinuxModes ( ) . getSELinuxModes ( ) . add ( mode.toString ( ) ) ; } } }

Target:
private void addSELinuxModes ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.SELinuxMode [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_5 ) ) { version.setSelinuxModes ( new org.ovirt.engine.api.model.SELinuxModes ( ) ) ; for ( org.ovirt.engine.api.model.SELinuxMode mode : values ) { version.getSelinuxModes ( ) . getSELinuxModes ( ) . add ( mode.value ( ) ) ; } } }
Source:
private void syncNetworkValues ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.DcNetworkParams dcNetParams = getSetupModel ( ) . getNetDcParams ( getName ( ) ) ; if ( dcNetParams != null ) { getEntity ( ) . setvlan_id ( dcNetParams.getVlanId ( ) ) ; getEntity ( ) . setMtu ( dcNetParams.getMtu ( ) ) ; getEntity ( ) . setVmNetwork ( dcNetParams.isVmNetwork ( ) ) ; } }

Target:
private void syncNetworkValues ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.DcNetworkParams dcNetParams = getSetupModel ( ) . getNetDcParams ( getName ( ) ) ; if ( dcNetParams != null ) { getEntity ( ) . setVlanId ( dcNetParams.getVlanId ( ) ) ; getEntity ( ) . setMtu ( dcNetParams.getMtu ( ) ) ; getEntity ( ) . setVmNetwork ( dcNetParams.isVmNetwork ( ) ) ; } }
Source:
public void onResult ( java.lang.Boolean result ) { this . resultValue = result ; this . resultType = JsFunction.RESULT_TYPE_BOOLEAN ; }

Target:
public boolean invokeAsBoolean ( com.google.gwt.core.client.JsArray < ? > args , org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunction.ErrorHandler errorHandler ) { clearResultInformation ( ) ; return function.invoke ( args , JsFunction.RESULT_TYPE_BOOLEAN , ( java.lang.Boolean result ) -> { this . resultValue = result ; this . resultType = JsFunction.RESULT_TYPE_BOOLEAN ; } , errorHandler ) ; }
Source:
public void testGetClusterByClusterPolicyId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > result = dao.getClustersByClusterPolicyId ( FixturesTool.CLUSTER_POLICY_EVEN_DISTRIBUTION ) ; java.util.List < org.ovirt.engine.core.compat.Guid > clusterIdList = result.stream ( ) . map ( Cluster :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ; org.junit.Assert.assertTrue ( clusterIdList.contains ( FixturesTool.CLUSTER_RHEL6_ISCSI ) ) ; org.junit.Assert.assertTrue ( clusterIdList.contains ( FixturesTool.CLUSTER_NO_RUNNING_VMS ) ) ; org.junit.Assert.assertTrue ( clusterIdList.contains ( FixturesTool.CLUSTER_RHEL6_NFS ) ) ; }

Target:
public void testGetClusterByClusterPolicyId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > result = dao.getClustersByClusterPolicyId ( FixturesTool.CLUSTER_POLICY_EVEN_DISTRIBUTION ) ; java.util.List < org.ovirt.engine.core.compat.Guid > clusterIdList = result.stream ( ) . map ( Cluster :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( clusterIdList.contains ( FixturesTool.CLUSTER_RHEL6_ISCSI ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( clusterIdList.contains ( FixturesTool.CLUSTER_NO_RUNNING_VMS ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( clusterIdList.contains ( FixturesTool.CLUSTER_RHEL6_NFS ) ) ; }
Source:
private void initTemplateDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.TEMPLATE ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }

Target:
public void moveShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setShareable ( true ) ; initializeCommand ( diskImage , VmEntityType.VM ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_ATTACHMENT_NOT_EXISTS_ENTITY , networkAttachmentId.toString ( ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { java.lang.String targetNicName = attachment.getNicName ( ) ; boolean attachmentReferencesExistingNic = ( existingInterfacesMap.get ( attachment.getNicId ( ) , targetNicName ) ) != null ; if ( attachmentReferencesExistingNic ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentReferencesNewlyCreatedBond = ( targetNicName != null ) && ( ( bondsMap.get ( targetNicName ) ) != null ) ; if ( attachmentReferencesNewlyCreatedBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }