auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.ui.webadmin.widget.label.LabelWithToolTip createInterfaceLabel ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { boolean hasLabels = ( ( iface.getLabels ( ) ) != null ) && ( ! ( iface.getLabels ( ) . isEmpty ( ) ) ) ; org.ovirt.engine.ui.webadmin.widget.label.LabelWithToolTip interfaceNameWithLabel = new org.ovirt.engine.ui.webadmin.widget.label.LabelWithToolTip ( ( hasLabels ? org.ovirt.engine.ui.webadmin.widget.host.InterfaceLabelWithToolTip.templates.textImageLabels ( iface.getName ( ) , org.ovirt.engine.ui.webadmin.widget.host.InterfaceLabelWithToolTip.labelImage ) : com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( iface.getName ( ) ) ) ) ; interfaceNameWithLabel.setTitle ( createLabelToolTip ( iface.getLabels ( ) ) ) ; return interfaceNameWithLabel ; }

Target:
private org.ovirt.engine.ui.common.widget.label.LabelWithCustomToolTip createInterfaceLabel ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { boolean hasLabels = ( ( iface.getLabels ( ) ) != null ) && ( ! ( iface.getLabels ( ) . isEmpty ( ) ) ) ; org.ovirt.engine.ui.common.widget.label.LabelWithCustomToolTip interfaceNameWithLabel = new org.ovirt.engine.ui.common.widget.label.LabelWithCustomToolTip ( ( hasLabels ? org.ovirt.engine.ui.webadmin.widget.host.InterfaceLabelWithToolTip.templates.textImageLabels ( iface.getName ( ) , org.ovirt.engine.ui.webadmin.widget.host.InterfaceLabelWithToolTip.labelImage ) : com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( iface.getName ( ) ) ) ) ; interfaceNameWithLabel.setTitle ( createLabelToolTip ( iface.getLabels ( ) ) ) ; return interfaceNameWithLabel ; }
Source:
public static 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.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
private void PostInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.NGuid.Empty ) ) ) ) ; UpdateIsDisksAvailable ( ) ; }

Target:
public void initCdImage ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( getModel ( ) . getDataCenterWithClustersList ( ) . getSelectedItem ( ) ) ) ; if ( ( dataCenterWithCluster == null ) || ( ( dataCenterWithCluster.getDataCenter ( ) ) == null ) ) { return ; } updateUserCdImage ( dataCenterWithCluster.getDataCenter ( ) . getId ( ) ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) ) ; addPermissions ( ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkDAO ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) ) ; addPermissions ( ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }
Source:
private boolean isItemSelectable ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel item , org.ovirt.engine.core.common.businessentities.StoragePool dataCenter , boolean isNoStorageAttached ) { if ( ( isLocalStorage ( item ) ) && ( ! ( isLocalDataCenter ( dataCenter ) ) ) ) { return false ; } if ( dataCenter.getId ( ) . equals ( StorageModel.UnassignedDataCenterId ) ) { return true ; } if ( isNoStorageAttached && ( ( ( item.getRole ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( item.getRole ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) ) { return true ; } return false ; }

Target:
private boolean isItemSelectable ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel item , org.ovirt.engine.core.common.businessentities.StoragePool dataCenter , boolean isNoStorageAttached ) { if ( ( isLocalStorage ( item ) ) && ( ! ( dataCenter.isLocal ( ) ) ) ) { return false ; } if ( dataCenter.getId ( ) . equals ( StorageModel.UnassignedDataCenterId ) ) { return true ; } if ( isNoStorageAttached && ( ( ( item.getRole ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( item.getRole ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) ) { return true ; } return false ; }
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
public java.lang.Object getConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , org.ovirt.engine.ui.frontend.IAsyncConverter converter ) { if ( converter == null ) { return null ; } org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > ( configValue , version ) ; return converter.Convert ( cachedConfigValuesPreConvert.get ( key ) , null ) ; }

Target:
public java.lang.Object getConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , org.ovirt.engine.ui.frontend.IAsyncConverter converter ) { if ( converter == null ) { return null ; } org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat ( configValue , version ) ; return converter.convert ( cachedConfigValuesPreConvert.get ( key ) , null ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.image_storage_domain_map ) ) { return false ; } org.ovirt.engine.core.common.businessentities.image_storage_domain_map other = ( ( org.ovirt.engine.core.common.businessentities.image_storage_domain_map ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( id , other.id ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( quotaId , other.quotaId ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.image_storage_domain_map ) ) { return false ; } org.ovirt.engine.core.common.businessentities.image_storage_domain_map other = ( ( org.ovirt.engine.core.common.businessentities.image_storage_domain_map ) ( obj ) ) ; return ( ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( id , other.id ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( quotaId , other.quotaId ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( diskProfileId , other.diskProfileId ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { addDiskAllocation ( object ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { boolean isAutoAssign = ( ( java.lang.Boolean ) ( object.getIsAutoAssign ( ) . getEntity ( ) ) ) ; defaultHostEditor.setEnabled ( ( ! isAutoAssign ) ) ; specificHost.setValue ( ( ! isAutoAssign ) ) ; }
Source:
public java.lang.String getUserName ( ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( mUserName ) ) && ( ( getCurrentUser ( ) ) != null ) ) { mUserName = getCurrentUser ( ) . getLoginName ( ) ; } return mUserName ; }

Target:
public java.lang.String getUserName ( ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( mUserName ) ) && ( ( getCurrentUser ( ) ) != null ) ) { mUserName = java.lang.String.format ( "%s[%s]" , getCurrentUser ( ) . getLoginName ( ) , getCurrentUser ( ) . getDomain ( ) ) ; } return mUserName ; }
Source:
public void getAAAProfilesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAAAProfilesEntriesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private static void convertAAAProfilesResult ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , final boolean passwordBasedOnly ) { 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 ) { java.util.List < java.lang.String > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; } } ; }

Target:
private static void convertAAAProfilesResult ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , final boolean passwordBasedOnly ) { 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 ) { java.util.List < java.lang.String > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; } } ; }
Source:
protected void runningFailed ( ) { try { decreasePendingVm ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.RunVmCommandBase.setCommandShouldBeLogged ( false ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmPoolOnStopVm ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }

Target:
protected void runningFailed ( ) { try { decreasePendingVm ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.RunVmCommandBase.setCommandShouldBeLogged ( false ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmOnDown ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }
Source:
public boolean equals ( java.lang.Object other ) { if ( other instanceof org.ovirt.engine.core.common.utils.customprop.ValidationError ) { org.ovirt.engine.core.common.utils.customprop.ValidationError otherError = ( ( org.ovirt.engine.core.common.utils.customprop.ValidationError ) ( other ) ) ; return ( keyName.equals ( otherError.getKeyName ( ) ) ) && ( ( reason ) == ( otherError.getReason ( ) ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.utils.customprop.ValidationError ) ) { return false ; } org.ovirt.engine.core.common.utils.customprop.ValidationError other = ( ( org.ovirt.engine.core.common.utils.customprop.ValidationError ) ( obj ) ) ; return ( java.util.Objects.equals ( keyName , other.keyName ) ) && ( ( reason ) == ( other.reason ) ) ; }
Source:
public void validateVmIsNotDown ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( diskValidator.isDiskPluggedToVmsThatAreNotDown ( org.mockito.ArgumentMatchers.anyBoolean ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }

Target:
public void validateVmIsNotDown ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( diskValidator.isDiskPluggedToAnyNonDownVm ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testTimeout ( ) throws java.lang.Throwable { org.ovirt.engine.core.uutils.ssh.SSHDialogTest.Sink sink = new org.ovirt.engine.core.uutils.ssh.SSHDialogTest.Sink ( new java.lang.String [ ] { "start" } , new java.lang.String [ ] { } ) ; sshDialog.setSoftTimeout ( ( 1 * 1000 ) ) ; sshDialog.connect ( ) ; sshDialog.authenticate ( ) ; sshDialog.executeCommand ( sink , "cat" , null ) ; sink.exception ( ) ; }

Target:
public void testWrongPassword ( ) throws java.lang.Exception { sshDialog.setKeyPair ( null ) ; sshDialog.setPassword ( "bad" ) ; sshDialog.connect ( ) ; org.junit.jupiter.api.Assertions.assertThrows ( javax.naming.AuthenticationException.class , sshDialog :: authenticate ) ; }
Source:
public void enoughSpaceAndPct ( ) { org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings = new org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings ( ) ; settings.diskSpaceFree = 6 ; settings.diskSpaceUsed = 4 ; settings.spaceThresholdGB = 5 ; settings.spaceThresholdPct = 10 ; org.ovirt.engine.core.common.businessentities.storage_domains domain = setupForSpaceTest ( settings ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.isWithinThresholds ( domain ) ) ; }

Target:
public void equalSpaceThreshold ( ) { org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings = new org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings ( ) ; settings.diskSpaceFree = 5 ; settings.diskSpaceUsed = 5 ; settings.spaceThresholdGB = 5 ; org.ovirt.engine.core.common.businessentities.storage_domains domain = setupForSpaceTest ( settings ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.isWithinThresholds ( domain ) ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times , boolean isDisplay , boolean isRequired ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( isDisplay , isRequired ) ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times , boolean isDisplay , boolean isRequired ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( isDisplay , isRequired ) ) ; } }
Source:
public static void GetAllProviders ( 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.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }

Target:
public static void getAllProviders ( 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.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }
Source:
protected boolean isInterfaceSupportedForPlugUnPlug ( org.ovirt.engine.core.common.businessentities.Disk disk ) { java.util.Set < java.lang.String > diskHotpluggableInterfaces = osRepository.getDiskHotpluggableInterfaces ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ; if ( ( org.springframework.util.CollectionUtils.isEmpty ( diskHotpluggableInterfaces ) ) || ( ! ( diskHotpluggableInterfaces.contains ( disk.getDiskInterface ( ) . toString ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } return true ; }

Target:
protected boolean isHotPlugDiskSnapshotSupported ( ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.hotPlugDiskSnapshot ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVds ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.HOT_PLUG_DISK_SNAPSHOT_IS_NOT_SUPPORTED ) ; } return true ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ( ( getVm ( ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( getVm ( ) . getCustomProperties ( ) ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getVm ( ) . getvds_group_id ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } return permissionList ; }

Target:
protected boolean updateVmInSpm ( ) { return org.ovirt.engine.core.bll.VmCommand.updateVmInSpm ( getVm ( ) . getStoragePoolId ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VM [ ] { getVm ( ) } ) ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" , "dataCenter.name|id" ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , entity ) ; if ( network.isSetProfileRequired ( ) ) { parameters.setVnicProfileRequired ( network.isProfileRequired ( ) ) ; } return performCreate ( VdcActionType.AddNetwork , parameters , new org.ovirt.engine.api.restapi.resource.BackendNetworksResource.AddedNetworkResolver ( ) ) ; }

Target:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks ; if ( isFiltered ( ) ) { networks = mapCollection ( getBackendCollection ( queryType , getQueryParameters ( ) , SearchType.Network ) ) ; } else { networks = mapCollection ( getBackendCollection ( SearchType.Network ) ) ; } for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }
Source:
public void validateEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateSourceDomainValid ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; initializeCommand ( disk , VmEntityType.VM ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SOURCE_STORAGE_DOMAIN_DOES_CONTAINS_THE_DISK ) ; }
Source:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.TRUE } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendVmResource.FORCE , java.lang.Boolean.TRUE.toString ( ) ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( ActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.TRUE } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendVmResource.FORCE , java.lang.Boolean.TRUE.toString ( ) ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ( vds.getcpu_cores ( ) ) != null ) && ( ( getVm ( ) . getnum_of_cpus ( ) ) > ( vds.getcpu_cores ( ) ) ) ) { sb.append ( "has less cores(" ) . append ( vds.getcpu_cores ( ) ) . append ( ") than " ) . append ( getVm ( ) . getnum_of_cpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { java.lang.Integer cores = org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( vds ) ; if ( ( cores != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > cores ) ) { sb.append ( "has less cores(" ) . append ( cores ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }
Source:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public void getClusterDesktopMemoryOverCommit ( 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void executeFenceVdsManuallyAction ( ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVdsId ( ) ) ; fenceVdsManuallyParams.setSessionId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getParameters ( ) . getSessionId ( ) ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.cloneContext ( ) . withoutCompensationContext ( ) . withLock ( new org.ovirt.engine.core.utils.lock.EngineLock ( getExclusiveLocks ( ) , null ) ) ) ; }

Target:
private void executeFenceVdsManuallyAction ( ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVdsId ( ) ) ; fenceVdsManuallyParams.setSessionId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getParameters ( ) . getSessionId ( ) ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getContext ( ) ) ; }
Source:
public void migrationSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . migrationSupportedForArch ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void migrationSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . migrationSupportedForArch ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void setMemoryPageSharing ( java.lang.Boolean value ) { if ( ( ( memoryPageSharing ) == null ) && ( value == null ) ) { return ; } if ( ( ( memoryPageSharing ) == null ) || ( ! ( memoryPageSharing.equals ( value ) ) ) ) { memoryPageSharing = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "MemoryPageSharing" ) ) ; } }

Target:
public void setPhysicalMemory ( java.lang.Integer value ) { if ( ( ( physicalMemory ) == null ) && ( value == null ) ) { return ; } if ( ( ( physicalMemory ) == null ) || ( ! ( physicalMemory.equals ( value ) ) ) ) { physicalMemory = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "PhysicalMemory" ) ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( getHost ( ) ) ; org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result = executor.checkAgentStatus ( org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getAgent ( ) ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getQueryReturnValue ( ) . setReturnValue ( result.getReturnValue ( ) ) ; } else { handleError ( result ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.pm.HostFenceActionExecutor executor = new org.ovirt.engine.core.bll.pm.HostFenceActionExecutor ( getHost ( ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.getFenceAgentStatus ( org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getAgent ( ) ) ; org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getQueryReturnValue ( ) . setSucceeded ( ( ( result.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS ) ) ) ; org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
public void starting ( org.junit.runner.Description description ) { java.lang.String seedProperty = java.lang.System.getProperty ( org.ovirt.engine.core.utils.RandomUtilsSeedingRule.RANDOM_SEED_PROPERTY ) ; java.lang.Long seed ; try { seed = java.lang.Long.parseLong ( seedProperty ) ; } catch ( java.lang.NumberFormatException e ) { org.ovirt.engine.core.utils.RandomUtilsSeedingRule.log.info ( "Property '{}' was not set, using System.currentTimeMillis() as a seed." , org.ovirt.engine.core.utils.RandomUtilsSeedingRule.RANDOM_SEED_PROPERTY ) ; seed = java.lang.System.currentTimeMillis ( ) ; } org.ovirt.engine.core.utils.RandomUtilsSeedingRule.log.info ( "Running test with random seed '{}'" , seed ) ; org.ovirt.engine.core.utils.RandomUtils.instance ( ) . setSeed ( seed ) ; }

Target:
public void beforeEach ( org.junit.jupiter.api.extension.ExtensionContext extensionContext ) { java.lang.String seedProperty = java.lang.System.getProperty ( org.ovirt.engine.core.utils.RandomUtilsSeedingExtension.RANDOM_SEED_PROPERTY ) ; java.lang.Long seed ; try { seed = java.lang.Long.parseLong ( seedProperty ) ; } catch ( java.lang.NumberFormatException e ) { org.ovirt.engine.core.utils.RandomUtilsSeedingExtension.log.info ( "Property '{}' was not set, using System.currentTimeMillis() as a seed." , org.ovirt.engine.core.utils.RandomUtilsSeedingExtension.RANDOM_SEED_PROPERTY ) ; seed = java.lang.System.currentTimeMillis ( ) ; } org.ovirt.engine.core.utils.RandomUtilsSeedingExtension.log.info ( "Running test with random seed '{}'" , seed ) ; org.ovirt.engine.core.utils.RandomUtils.instance ( ) . setSeed ( seed ) ; }
Source:
public void clusterChanged ( ) { org.mockito.Mockito.when ( oldHost.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( host.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( validator.clusterNotChanged ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.VDS_CANNOT_UPDATE_CLUSTER ) ) ; }

Target:
public void clusterChanged ( ) { org.mockito.Mockito.when ( oldHost.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( host.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( validator.clusterNotChanged ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_CANNOT_UPDATE_CLUSTER ) ) ; }
Source:
protected < T > T getConfigurationValue ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.ConfigurationValues config , final org.ovirt.engine.api.model.Version version ) { return getEntity ( clz , VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config , org.ovirt.engine.api.restapi.resource.BackendResource.asString ( version ) ) , config.toString ( ) ) ; }

Target:
protected < T > T getConfigurationValue ( org.ovirt.engine.core.common.queries.ConfigurationValues config , final org.ovirt.engine.api.model.Version version ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config , org.ovirt.engine.api.restapi.resource.BackendResource.asString ( version ) ) ) ; if ( result.getSucceeded ( ) ) { return ( ( T ) ( result.getReturnValue ( ) ) ) ; } return null ; }
Source:
public boolean isHibernating ( ) { return ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.SavingState ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PreparingForHibernate ) ) ; }

Target:
public boolean isRunning ( ) { return ( ( ( ( ( ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringUp ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingTo ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.WaitForLaunch ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.RebootInProgress ) ) ; }
Source:
public void edit ( final M model ) { if ( ( this . model ) != null ) { this . model.getItemsChangedEvent ( ) . removeListener ( itemsChangedListener ) ; } this . model = model ; model.getItemsChangedEvent ( ) . addListener ( itemsChangedListener ) ; setVisible ( model.getIsAvailable ( ) ) ; init ( model ) ; }

Target:
public void edit ( final M model ) { if ( ( this . model ) != null ) { this . model.getItemsChangedEvent ( ) . removeListener ( itemsChangedListener ) ; this . model.getPropertyChangedEvent ( ) . removeListener ( propertyChangedListener ) ; } this . model = model ; model.getItemsChangedEvent ( ) . addListener ( itemsChangedListener ) ; model.getPropertyChangedEvent ( ) . addListener ( propertyChangedListener ) ; enabled = model.getIsChangable ( ) ; setVisible ( model.getIsAvailable ( ) ) ; init ( model ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.SignStringQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; try { org.ovirt.engine.core.utils.crypt.TicketUtils ticketUtils = org.ovirt.engine.core.utils.crypt.TicketUtils.getInstanceForEngineStoreSigning ( ) ; java.lang.String ticket = ticketUtils.generateTicket ( org.ovirt.engine.core.bll.SignStringQuery.getParameters ( ) . getString ( ) ) ; org.ovirt.engine.core.bll.SignStringQuery.getQueryReturnValue ( ) . setReturnValue ( ticket ) ; org.ovirt.engine.core.bll.SignStringQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } catch ( java.lang.Exception e ) { log.error ( ( "Error when signing string: " + ( e.getMessage ( ) ) ) ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.SignStringQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; try { org.ovirt.engine.core.utils.crypt.TicketUtils ticketUtils = org.ovirt.engine.core.utils.crypt.TicketUtils.getInstanceForEngineStoreSigning ( ) ; java.lang.String ticket = ticketUtils.generateTicket ( org.ovirt.engine.core.bll.SignStringQuery.getParameters ( ) . getString ( ) ) ; org.ovirt.engine.core.bll.SignStringQuery.getQueryReturnValue ( ) . setReturnValue ( ticket ) ; org.ovirt.engine.core.bll.SignStringQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } catch ( java.lang.Exception e ) { log.error ( "Error when signing string: {}" , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } }
Source:
public void getClusterDesktopMemoryOverCommit ( 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
protected void executeCommand ( ) { try ( org.ovirt.engine.core.utils.lock.EngineLock monitoringLock = org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.acquireMonitorLock ( ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getVdsManager ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVdsId ( ) ) . refreshHost ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVds ( ) ) ; org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.setSucceeded ( true ) ; } org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.logMonitorLockReleased ( "Refresh host capabilities" ) ; }

Target:
protected void executeCommand ( ) { try ( org.ovirt.engine.core.utils.lock.EngineLock monitoringLock = org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.acquireMonitorLock ( ) ) { resourceManager.getVdsManager ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVdsId ( ) ) . refreshHost ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVds ( ) ) ; org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.setSucceeded ( true ) ; } org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.logMonitorLockReleased ( "Refresh host capabilities" ) ; }